'Measure' distance to find missing object

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

'Measure' distance to find missing object

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 'Measure' distance to find missing object

Post 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
Post Reply