opening by reconstruction results

2 ビュー (過去 30 日間)
Sukuchha
Sukuchha 2013 年 11 月 4 日
コメント済み: Satadru Mukherjee 2020 年 7 月 14 日
I know the algorithm how it works. For illustration process i want to visualise output of opening by reconstruction in each iteration. in matlab the function just gives the final result obtained after stability is reached.
looking at the fucntion itself with edit imreconstruct, it calls a mex function for processing and there is no way to get individual output from imreconstruct.

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 4 日
No. You'd have to write that code yourself.
  4 件のコメント
Image Analyst
Image Analyst 2013 年 11 月 4 日
I'd start by searching the internet for a full description or pseudocode for doing morphological reconstruction.
Satadru Mukherjee
Satadru Mukherjee 2020 年 7 月 14 日
Check this , hope you will enjoy it , Happy Coding :-)
clc
clear all
close all
warning off
x=double(~imbinarize(rgb2gray(imread('GG.JPG'))));
x=imfill(x,'holes');
k=input('How many points you want to enter?');
imshow(x);
[a b]=size(x);
h_k=zeros(a,b);
temp=0;
while temp<k
gk=zeros(a,b);
[m n]=ginput(1);
m=round(m);
n=round(n);
gk(n,m)=1;
h_k=h_k+gk;
temp=temp+1;
end
imshow(h_k);
se=ones(3);
previous=h_k;
current=(imdilate(previous,se) & x);
output=zeros(a,b,3);
figure;
pause(3);
while ~isequal(previous,current)
previous=current;
current=(imdilate(previous,se) & x);
output(:,:,2)=current;
subplot(1,2,1);
imshow(x);
subplot(1,2,2);
imshow(output);
pause(0.2);
end
close all
imshow(current);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by