我想在matlab中寫一個簡單的二進制重建算法。到目前爲止,我知道這個算法是'開放'後使用長大後連接到開放的原始圖像的件。我還發現,它可以去除與大對象不相交的小區域,而不會扭曲大對象的小特徵。二進制重構算法
這是僞代碼:
1. J = I o Z; %open input image with some structre element
2. T = J;
3. J = J Z(k) % Dilate J with Z(k). this is my first problems. if Z in first line is structure element, then what is Z(k)?
4. J = I AND J % my second problem. how to AND these two on matlab.
5. if J ~= T go to 2.
6. else stop and J is the reconstructed image.
假設我們有這樣的圖像作爲輸入:
重建圖像看起來像:
上述上面提到的代碼,到目前爲止我寫道:
img = imread ('Input.jpg');
img = im2bw(img, 0.8);
J = bwmorph(img,'open');
T = J;
J = bwmorph(J, 'dilate');
我的問題是如何在matlab中正確結束這個。 我的第二個問題是,如果我要使用'imdilate'而不是'bwmorph',應該是我提到的示例中的結構元素?
在此先感謝。
上傳圖片到web服務(http://tinypic.com/),並張貼鏈接到圖片。 – Shai
請更具體地說明你正在嘗試做什麼。請不要發送給我們閱讀論文 - 只需提供您正在嘗試的內容的簡要說明以及爲什麼您在這方面遇到問題。 – Shai
我用(http://imgur.com)仍然有錯誤。這是我第一次做的:  – Zahra