Morphological Filtering On OpenCV
Hi guys, i want to ask about this statement :
3 x 3 disk morphological filtering
Does it mean the radius is 9 ? or the size = 2 * 3 - 1 ?
Thank you.
no, the radius is (size-1)/2 .
here is the 3x3 disk kernel, as you can see, it's pretty much the same as the MORPH_CROSS one, because it's so small:
Mat k = getStructuringElement(MORPH_ELLIPSE,Size(3,3));
cerr << k << endl;
[ 0, 1, 0;
1, 1, 1;
0, 1, 0]
ofc., it gets more "disk-like" with larger size (like 11):
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0;
0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0;
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0;
0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0;
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
please also see MORPH flags and tutorials
Asked: 2017-05-13 10:32:24 -0600
Seen: 251 times
Last updated: May 15 '17