# Morphological reconstruction

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:

Eroding it gives

Reconstruction yields those characters that left something after erosion

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

edit retag close merge delete

( 2014-06-18 07:17:53 -0500 )edit

Yes, that is the operation I was looking for.

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

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

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

Sort by ยป oldest newest most voted

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


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();
}
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.

more

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

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

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

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

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

more

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

( 2014-06-19 07:57:43 -0500 )edit

Official site

GitHub

Wiki

Documentation

## Stats

Seen: 6,247 times

Last updated: Sep 30 '16