Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

how to perform closing by reconstruction followed by opening by reconstruction

Asked by Sukuchha on 9 Feb 2012
Latest activity Edited by John Kelly on 22 Aug 2014

In image processing demo(watershed segmentation) following codes were used for opening by reconstruction follwed by closing by reconstruction

Ie = imerode(I, se);
Iobr = imreconstruct(Ie, I);
figure, imshow(Iobr), title('Opening-by-reconstruction (Iobr)')
Iobrd = imdilate(Iobr, se);
Iobrcbr = imreconstruct(imcomplement(Iobrd), imcomplement(Iobr));
Iobrcbr = imcomplement(Iobrcbr);
figure, imshow(Iobrcbr), title('Opening-closing by reconstruction (Iobrcbr)')

For closing by reconstruction followed by opening by reconstruction can i follow the same sequence but interchanging imerode and imdilate positioning in above code ? ;

0 Comments

Sukuchha

Products

No products are associated with this question.

1 Answer

Answer by Jeff EA on 9 Feb 2012
Edited by John Kelly on 22 Aug 2014
Accepted answer

No, you cannot. Notice the multiple imcomplement calls after the imdilate step. These are necessary in the closing by reconstruction to make the mask and marker image fit the required inputs of imreconstruct. These imcomplement calls are not necessary for the opening by reconstruction.

In order to reverse the operations, you would need to take lines 4 through 6 in the code you pasted, and put them above lines 1 through 3, AND rename the variables accordingly.

1 Comment

Sukuchha on 10 Feb 2012

Thanks Jeff for your input! the link you provided helped me a lot !

Jeff EA

Contact us