Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Strange result morphological filtering with opening and closing

Hi guys, i try to filter binarized image using closing and opening operation in morphological filtering. But, why the image completely damage ?

image description

as an information, i use 3 x 3 disk structuring element

Strange result morphological filtering with opening and closing

Hi guys, i try to filter binarized image using closing and opening operation in morphological filtering. But, why the image completely damage ?

image descriptioninitial image

after filtering

as an information, i use 3 x 3 disk structuring element

here is my opencv code :

Mat k = getStructuringElement(MORPH_ELLIPSE,Size(3,3));

morphologyEx( thresholdImg, openingImg, 3, k );
morphologyEx( openingImg, finalMorph, 2, k );

Strange result morphological filtering with opening and closing

Hi guys, i try to filter binarized image using closing and opening operation in morphological filtering. But, why the image completely damage ?? (note: i have tried to invert the image). Is my kernel / structure element wrong ? Thanks.

initial image

after filteringinvert the image :

invert image

Result

filtered image

as an information, i use 3 x 3 disk structuring element

Mat k = getStructuringElement(MORPH_ELLIPSE,Size(3,3));

here is my opencv code :

Mat k = getStructuringElement(MORPH_ELLIPSE,Size(3,3));

morphologyEx( thresholdImg, openingImg, 3, k );
morphologyEx( openingImg, finalMorph, 2, k );