Ask Your Question

Morphological reconstruction

asked 2014-06-18 01:26:36 -0500

Goosebumps gravatar image

updated 2016-09-30 12:07:27 -0500

Eduardo gravatar image

Does anybody know how to do morphological reconstruction using OpenCV (or emgu). Of course I can find the algorithm and implement it from scratch, but I was hoping this is not neccessary.

Some background. In matlab there is the imreconstruct operation. See: matlab imreconstruct example

It can do the following. The source image:

image description

Eroding it gives

image description

Reconstruction yields those characters that left something after erosion

image description

Credits for the images go to Steve Eddins (as in the link above)

edit retag flag offensive close merge delete


Can you please explain your problem clearly? Are you asking about this?

Balaji R gravatar imageBalaji R ( 2014-06-18 07:17:53 -0500 )edit

Yes, that is the operation I was looking for.

Goosebumps gravatar imageGoosebumps ( 2014-06-19 07:54:48 -0500 )edit

Edit the url to link to the article instead of the image.

Eduardo gravatar imageEduardo ( 2016-09-30 12:20:58 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2014-07-02 10:14:37 -0500

Goosebumps gravatar image

If found that the morphological reconstructions are not that hard to implement if you read the following document: Morphological Image Processing

This one is also nice because it has some example images of what to expect Morphology

The clue is that the reconstructions' main ingredients are geodesic erosion and dilation. These are basically masked erosion and dilation by using a min operator. Code snippet:

Image<Gray, byte> m = image.Dilate(size, shape); // normal dilation
Image<Gray, byte> geoDilate = m.Min(mask); // masking operation

Same for erosion but using a max operator. Now dilation by reconstruction is keep on geodesically dilating until the image doesn't change anymore.

Image<Gray, byte> m0;
Image<Gray, byte> m1 = image;
    m0 = m1.Clone();
    m1 = m0.GeoDilate(mask, size, shape);
while (!m1.Equals(m0));
Image<Gray, byte> DilateRec = m1;

Finally, opening by reconstruction is first erode the image. The eroded image is then dilated with the original image as mask:

Image<Gray, byte> m = image.Erode(size, shape);
Image<Gray, byte> openRec = m.DilateRec(image, size, shape);

Closing by reconstruction is the other way around.

edit flag offensive delete link more

Comments it's easy but some Morphology method is hard to work

wuling gravatar imagewuling ( 2014-07-02 10:57:45 -0500 )edit

Yes, but it is ever so much fun ;) BTW this is Emgu

Goosebumps gravatar imageGoosebumps ( 2014-07-03 02:59:20 -0500 )edit

answered 2014-06-18 11:25:45 -0500

wuling gravatar image

updated 2014-06-18 11:44:31 -0500

HI maybe you should find link text ,r link text or link textto find want you want

edit flag offensive delete link more


Nice links. This library seems to be capable of doing the reconstruction. However, I was hoping to stay within Emgu (C# opencv).

Goosebumps gravatar imageGoosebumps ( 2014-06-19 07:57:43 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2014-06-18 01:26:36 -0500

Seen: 6,247 times

Last updated: Sep 30 '16