2016-05-16 43 views
-1

我正在與MATLAB中的肺癌檢測工作。我想分割肺部CT掃描的二值圖像以獲取感興趣的區域。如何分離二進制圖像中黑色的白色區域

在圖片中,您可以看到黑色區域內的白色區域。黑色物體表示肺部,黑色物體內部的白色區域表示肺部受癌症影響的部分。我想從圖像中獲取白色區域。我只想得到黑色背景中只有白色區域的輸出。我怎樣才能做到這一點?

input image

回答

0

你還沒有定的代碼,所以我還沒有回答代碼。

你可以

  • 使用morpholocical關閉動作擺脫該空白區域連接到周圍
  • 然後尋找每個黑色區域白洞(公開渠道,例如做一個blob分析僅在(屏蔽)區域/閾值操作,其是黑色)

或者,可以

  • 找輪廓的凸起缺陷,如描述here(這是一個Python版本,但類似的功能應該是大約在MATLAB)
+0

感謝您的信息....它已經幫助我尋求解決方案... – Shilpauser6294007

+0

由於你還是新來的Stackoverflow,也許你想讀一些提示什麼時候回答有幫助:http:// stackoverflow .COM /幫助/某人答案除了在現實生活中,「評論」中的「謝謝」不會被鼓勵,以保持關注內容的言論,但您可以對許多答案進行投票並接受答案。 – tfv

1

怎麼是這樣的:

% Read in image and convert to BW 
BW = im2bw(imread('http://i.stack.imgur.com/pxpOz.jpg')); 

% Invert so that the lung appears white white 
BW = ~BW; 

% Create a structuring element. Tune the '2' depending on the size of the gap 
se = strel('disk',2); 

% Perform mophological closing 
closeBW = imclose(BW,se); 

% Fill the holes 
lungBW = imfill(closeBW,'holes'); 

% subtract the lung image from the closed image 
cancerBW = (lungBW - closeBW); 

% Display the results 
figure; imshow(cancerBW); 

Click here for the output

+0

非常感謝....你的代碼對我很有幫助.... – Shilpauser6294007

相關問題