measure positions

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
Voodoo
Posts: 2
Joined: 2013-05-31T01:37:06-07:00
Authentication code: 6789

measure positions

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: measure positions

Post 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.
snibgo's IM pages: im.snibgo.com
Voodoo
Posts: 2
Joined: 2013-05-31T01:37:06-07:00
Authentication code: 6789

Re: measure positions

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

Re: measure positions

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