Page 1 of 1

Help Me Find the Edge of This

Posted: 2013-05-07T00:56:24-07:00
by dotmoe
Hey,
I have been tinkering with this for a while. I tried Alpha - trim - fuzz - but I cant get it so that its crops out everything except the two boxes.
Image
Can you please help me?

I am on Windows.

Re: Help Me Find the Edge of This

Posted: 2013-05-07T22:15:04-07:00
by anthony
That is very hard.

as the two boxes are touching, it become especially hard.
The real question is how variable is the input images. Do the boxes move around, do they overlap, and so on.

Best idea is first try and clean up the umage using Morphology Erode or Smooth to remove any 'thin lines'
http://www.imagemagick.org/Usage/morphology/#channel
then examine that image to find the edges of the two boxes. Once you have the information you can then apply it crop the original image.

Another technique is to scale the image (using ignore aspect flag '!' ) down to one row of pixels. This will average all the columns and from that you can segment where one box ends and another begins. A graph (profile) of that single row of images can help in figuring out thresholds and noise limits.

When you have horizontal placements, repeat vertically (scale all rows to a single column) to find the box row limits.