morphology

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
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

morphology

Post by VanGog »

I read article
http://www.imagemagick.org/Usage/morphology/

and a I am stucked at this two examples. I don't understand the commands:

Code: Select all

convert man.gif   -morphology Hit-and-Miss '2x1:1,0'  hmt_right.gif
What doed mean "2x1:1,0"

and in the second command:

Code: Select all

convert man.gif   -morphology Hit-and-Miss '3x1:1,-,0'  hmt_right2.gif
"3x1:1,-,0"

Can you break it down to explain every individual character of this argument?

And is possible to use Mophology to compare letters in Images?
For Example:
http://www.virtualtripping.com/wp-conte ... aduz-2.jpg
On the image is Town "Sevelen" and I would want do some operation with it.
For example to check if the Sevelen is on the Photo or Get position of the red dot, which is placed just before the Sevelen title. Or possibly to convert the text from the image... But I think it would not be simple... Am I write? I would need whole alphabet to convert it ...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: morphology

Post by fmw42 »

VanGog wrote:I read article
http://www.imagemagick.org/Usage/morphology/

and a I am stucked at this two examples. I don't understand the commands:

Code: Select all

convert man.gif   -morphology Hit-and-Miss '2x1:1,0'  hmt_right.gif
What doed mean "2x1:1,0"
it means the kernel/shape will be 2pixels wide x 1pixel high and the values will be 1 and 0. The colon : is a separator between the shape size and its values.
VanGog wrote:and in the second command:

Code: Select all

convert man.gif   -morphology Hit-and-Miss '3x1:1,-,0'  hmt_right2.gif
"3x1:1,-,0"

Can you break it down to explain every individual character of this argument?
This shape/kernel will be 3pixels wide x 1pixel high and have values 1, - and 0. the - means do not care whether 1 or 0, that is just skip it.
VanGog wrote:And is possible to use Mophology to compare letters in Images?
For Example:
http://www.virtualtripping.com/wp-conte ... aduz-2.jpg
On the image is Town "Sevelen" and I would want do some operation with it.
For example to check if the Sevelen is on the Photo or Get position of the red dot, which is placed just before the Sevelen title. Or possibly to convert the text from the image... But I think it would not be simple... Am I write? I would need whole alphabet to convert it ...
I don't think so. I would use compare between the full image and a small image of the letters. see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: morphology

Post by VanGog »

Thank you!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: morphology

Post by anthony »

This is explained in the section closer to the top of the same page, just after the 'basic morphology kernel built-ins'.

User Defined Kernels
http://www.imagemagick.org/Usage/morphology/#user

This section also gives you a deeper understanding of the kernel values.

Note that while most morphology operators only deal with three values in the kernel, 1, 0, and '-' for don't care (actually a floating point NaN (Not a Number)) others like Distance, and Convolution use full floating point values.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply