我在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