Hi
I was wondering if it is possible to do a hit-and-miss transform with a custom kernel in ImageMagick.
http://homepages.inf.ed.ac.uk/rbf/HIPR2/hitmiss.htm
I looked at the convolve operation, but I am not sure that cut's it, since I cannot specify
"don't care" fields in the kernel.
Any suggestions?
Best regards,
Christian
Hit-and-miss transform
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Hit-and-miss transform
Convolution just adds up the weighted elements. As such anything '0' is basically don't care.
However the algorithms the hit'n'miss arrays are looking for are not weighted averages but equality tests. That is defined elements must match the given color value.
I am not certian what this is known as but it isn't standard convolution. I believe however that some of the more generalized 'Automata' program may work better as this does do handling of image patterns such as this. (Google for it)
Just one final point IM does not save images in memory as a binary bitmap. All color values are numbers from 0 to 2^Q-1 where Q is the 'Q' or quality level that was compiled into IM.
However the algorithms the hit'n'miss arrays are looking for are not weighted averages but equality tests. That is defined elements must match the given color value.
I am not certian what this is known as but it isn't standard convolution. I believe however that some of the more generalized 'Automata' program may work better as this does do handling of image patterns such as this. (Google for it)
Just one final point IM does not save images in memory as a binary bitmap. All color values are numbers from 0 to 2^Q-1 where Q is the 'Q' or quality level that was compiled into IM.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Hit-and-miss transform
Thanks for the reply..
I guess I'll have to do this with something else than IM.
It shouldn't be to hard implement.
Best regards,
Christian
I guess I'll have to do this with something else than IM.
It shouldn't be to hard implement.
Best regards,
Christian
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Hit-and-miss transform
No it shouldn't but the convolution area has not been looked into beyond implementing the basic routines. It probably won't be looked at for some time either.
I myself already have far to much to look at. IM really could use some more people trying to improve the core functions.
I myself already have far to much to look at. IM really could use some more people trying to improve the core functions.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/