Page 1 of 1

'Measure' distance to find missing object

Posted: 2012-05-23T10:44:02-07:00
by myspacee
Hello,
have a problem with my job production.

sometime my system missing an object:
Image

in left side of posted image, you can see that miss something....

Now i'm earching a solution, to detect when my system fail, and allert user.
I think to 'measure' distance from upper border and first point not 'blank' [white] :
Image

if this value is higher than given value, error occours.

Any help, or idea to solve this ?

thank you for any help,
m.

Re: 'Measure' distance to find missing object

Posted: 2012-05-23T12:13:00-07:00
by fmw42
Split the image into left and right halves and use -white-threshold to make sure that the white is pure white. For each side average the image down to one column (see -scale). Then convert to txt format and search the text results until you do not get a white value. Note the y coordinate.

see
http://www.imagemagick.org/script/comma ... 3d9l4#crop
http://www.imagemagick.org/Usage/crop/#crop
http://www.imagemagick.org/script/comma ... -threshold
http://www.imagemagick.org/Usage/files/#txt