Hi John:
Thanks for the line detect mask, I couldn't figure it out.
I did end up with the same thing for the 4way 3x3 as you have below,
but I'm using the following for (what I thought was) 8 way 3x3 with good success:
3 3
255 128 255
128 255 128
255 128 255
Now that I have that answered, see the next email for a question about how to
Command line a rotation of arbitrary degrees.
---------
I have found an interesting page on morphological thinning at http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm
There, it describes thinning being accomplished with the two 3x3 masks:
000
1
111
And
00
110
1
Which are each applied then rotated successively 90, 180 and 270 degrees.
I interpreted (for VIPS) to be:
000 000 000
128 255 128
255 255 255
And
128 000 000
255 255 000
128 255 128
But that didn't seem to work out for me. Any suggestions?
If this can be solved, perhaps it can be added to the nip2 package to do automatic thinning.
Thanks
Doug
-----Original Message-----
From: VIPS/ip [mailto:[log in to unmask]] On Behalf Of John Cupitt
Sent: Sunday, September 15, 2013 5:04 AM
To: [log in to unmask]
Subject: Re: default mask NIP2 uses for "IM_LINDETECT" ? Similarly the mask(s) for im_dilate 8 and im_dilate 4
Hi Doug,
For a 4-way dilate/erode you need:
3 3
128 255 128
255 255 255
128 255 128
ie. search for a cross shape and don't care about the corners. For 8-way, make the corners 255 as well.
The nip2 menu item Filter / Convolution / Line Detect uses the mask:
3 3
1 1 1
-2 -2 -2
1 1 1
Is that the one you mean? You can check the source by clicking Toolkits / Edit, then clicking on Filter, then Filter_conv_item.
John
|