我在matlab中的圖像分割中掙扎。我的目標是從ct掃描圖像中提取肝臟。 。肝臟的Matlab圖像分割
function [] = Code4(image_file)
image = imread(image_file);
[height, width, planes] = size(image);
rgb = reshape(image, height, width * planes);
r = image(:, :, 1);
g = image(:, :, 2);
b = image(:, :, 3);
% since r,g & b are of equeal values, we will be considering only r.
mask=r>120 & r<140 ; % range of color component for liver
labels = bwlabel(mask);
id = labels(111, 200);
% get the mask containing only the desired object
liver = (labels == id);
imagesc(liver);
colorbar;
end
我的問題是,當我改變形象,肝段的RGB值可能會有所不同。 這裏是其他樣品圖像
對於此圖像每種顏色成分的rgb值從160到190不等(r,g & b)。請幫我解決問題。
請幫忙。
你不能段按值的CT圖像。它有噪音和CT值會改變。你需要使用一些更好的semiqueation技術,例如水平集 –
@AnderBiguri你能否提供一些細節? –
我會嘗試在圖像的第一個衍生物中找到輪廓,然後通過形態學操作將其放大以確保沒有間隙,然後用填充填充它填充 – Spektre