Well don’t I feel a prat!??

So err… I guess I’ve learnt a lot writing this crap on my own, and I am at least comfortable in the knowledge that when my routines DO work they are faster but I just found this:

MagickMorphologyImage

MagickMorphologyImage() applies a user supplied kernel to the image according to the given mophology method.

The format of the MagickMorphologyImage method is:

MagickBooleanType MagickMorphologyImage(MagickWand *wand,
MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
ChannelType channel,MorphologyMethod method,const ssize_t iterations,
KernelInfo *kernel)

Shite. That’s everything right there. Corner detection in theory but definitely thinning, my routine for excessive thinning is called starving. :), and thickening. I’m pretty sure I can also use it to do RIP stuff. So new workflow could be something like:

SigmaContrast(via. UpdatePixelViewIterator)->MagickAdaptiveThresholdImage->MagickQuantizeImage->MagickEvaluateImage(Negatise)->MagickMorphologyImage(RIP)->MagickEvaluateImage(Negatise)->MagickMorphologyImage(Thinning/Starving)->MagickMorphologyImage(CornerDetect)

Hmm… First things first, replace my code with theirs to see what the detectable differences are.

This entry was posted in Miscellany. Bookmark the permalink.