How to do erosion on a 3D image?

asked 2017-12-04 11:38:49 -0500

M.R. gravatar image

I have a 2d image Mat matr, and I do an erosion as follows:

 Mat erosion_dst;
 // Apply the erosion operation
 int erosion_type;
 int errosion_size = 0;
 erosion_type = MORPH_ELLIPSE;
 Mat element = getStructuringElement( erosion_type,
                                      Size( 2*erosion_size + 1, 2*erosion_size+1 ),
                                      Point( erosion_size, erosion_size ) );
 erode(matr, erosion_dst, element);

How can I do the same thing but for a 3D image? How would the code change?

edit retag flag offensive close merge delete

Comments

I am also interested in knowing if there's a 3D version of erode?

sjhalayka gravatar imagesjhalayka ( 2017-12-04 18:47:24 -0500 )edit