0

I have a floor layout (fairly simple, white background, black content) and a template of a chair on the floor. I know all orientations I need to look for (simple up, down, left, right) but I do not know the scale of the floor template coming in.

I have it working with AForge where, when copying a chair from the layout so I know the exact scale, I can find all chairs on the floor. That is giving me exactly what I want (I just need the center x,y of the chair). Going forward I would like to automate this. I won't know the exact scale of the floor plan being uploaded

I played with the Emgu.CV examples to try and find it (SURFFeature example project) but using just the chair as the template did not work. It doesn't seem to find any observedDescriptors (it is null), I assume because the chair on its own isn't too complex. I tried a more complex template (chair+desk, though it wouldn't work normally because the chair relative to desk isn't consistent). The results didn't seem useful, it pointed to a few random places on the floor plan but didn't seem quite right.

Any ideas on ways to determine the scale?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Doug
  • 73
  • 1
  • 4
  • Whoops, sorry about that! I have an idea on getting scale - since AForge has a nice (and fast) shape detector I could have our other team add some special shape to the AutoCAD file with a chair in it. I would know the normal size bounding box for the shape and the size of the chair in that, and then I could scale the chair based on the % change of the bounding box on the outside object. My question then would be what is an easy to find shape for AForge that is unique enough to not be confused with something in a floor plan... my initial thought is a star-ish shape (four points). Thoughts? – Doug Feb 05 '13 at 14:39

2 Answers2

1

By using the wrong scale, readings are not accurate. This may cause a package weight to be misprinted on a cereal box that is made floor scale instead of a balance scale. This is because the percision on these scales is different to accommodate a business's diverse needs. And, by using different calabrations, this can cause a difference in the weight between an identical product when measured on a floor scale and than a counting scale.

Darvin788
  • 11
  • 1
0

Alright, I was able to get this working. What I ended up doing is drawing a square inside a circle and placing the object I want inside the square

Then I use: Blob[] blobs = blobCounter.GetObjectsInformation( ); to get all blobs on the page.

Loop through the blobs and look for all circles and squares, add them to a list of each

 if (shapeChecker.IsCircle(edgePoints, out center, out radius))
 {
     circs.Add(b);
 }
 else if (corners.Count == 3)
    tris.Add(b);
 else if (corners.Count == 4)
    boxes.Add(b);

Loop through each circle, and for each circle all squares, and look for two with approximately the same center point.

To get the object inside I copy a crop of the image from inside the square (add a few to x,y, remove a few from width, height). This gives me the white space and object within the square

I then use an autocrop (from here, though modified because I didn't need to rotate/greyscale) to cut away the white space and am left with just the image I want!

  • sorry I don't have example images in this - I don't have enough rep to post them yet
Community
  • 1
  • 1
Doug
  • 73
  • 1
  • 4