Page 1 of 1

measure positions

Posted: 2013-05-31T01:56:28-07:00
by Voodoo
Hello,
first: english is not my native language, so I try to keep my posts short and precise. What may not allways succeed :-)
Ok,
Iwould like to measure positions with IM.
Background: I must verify the positions of several textblocks printed on documents.
The images of the documents will come by scanner or (better)camera.
So it would be helpfull to find f.e. left and upper borders of such blocks. If possible metric.
The blocks must be printed within a tolerance of about 1mm up/down - /left/right and there should be a warning when the block is outside of this tolerance.
So I only need to find the positions, everything else I may realize with PERL.

Many thanks in advance for any help
Voodoo

Re: measure positions

Posted: 2013-05-31T08:04:24-07:00
by snibgo
Can you supply a sample image?

If the text is close to black, and the paper is close to white, you could use "compare" to find the location of the top-left black pixel.

Re: measure positions

Posted: 2013-06-03T00:08:05-07:00
by Voodoo
Hello snibgo,
thanks for your answer.
Yes, it is a "normal" letter. Means black text on white paper.
So now I'll have a look at the "compare" command and try to find out how it may help me.

Re: measure positions

Posted: 2013-06-03T00:22:03-07:00
by fmw42
see for example

http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
http://www.imagemagick.org/Usage/compare/#statistics
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076 (but now add -subimage-search)


results will be indicated in pixel coordinates only (not metric or english) along with the metric value (match score)