First time here? Check out the FAQ!

Ask Your Question
2

Morphological reconstruction

asked Jun 18 '14

Goosebumps gravatar image

updated Sep 30 '16

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)

Preview: (hide)

Comments

Can you please explain your problem clearly? Are you asking about this?http://www.mathworks.in/company/newsletters/articles/morphological-reconstruction.html

Balaji R gravatar imageBalaji R (Jun 18 '14)edit

Yes, that is the operation I was looking for.

Goosebumps gravatar imageGoosebumps (Jun 19 '14)edit

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

Eduardo gravatar imageEduardo (Sep 30 '16)edit

2 answers

Sort by » oldest newest most voted
3

answered Jul 2 '14

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;
do
{
    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.

Preview: (hide)

Comments

yes....so it's easy but some Morphology method is hard to work

wuling gravatar imagewuling (Jul 2 '14)edit

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

Goosebumps gravatar imageGoosebumps (Jul 3 '14)edit
1

answered Jun 18 '14

wuling gravatar image

updated Jun 18 '14

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

Preview: (hide)

Comments

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 (Jun 19 '14)edit

Question Tools

2 followers

Stats

Asked: Jun 18 '14

Seen: 9,898 times

Last updated: Sep 30 '16