Page 1 of 1

Hit-and-miss transform

Posted: 2007-08-17T08:56:39-07:00
by aquila
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

Re: Hit-and-miss transform

Posted: 2007-08-18T18:14:17-07:00
by anthony
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.

Re: Hit-and-miss transform

Posted: 2007-08-19T10:56:46-07:00
by aquila
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

Re: Hit-and-miss transform

Posted: 2007-08-19T22:12:55-07:00
by anthony
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.