我在Matlab中有一些問題,用圓圈在這個圖像中分割。對比度差異真的很小,圖像本身真的很嘈雜。我對圖像做了一些處理,增加了對比度的差異,但我仍然不知道下一步該怎麼做。圓圈的低對比度分割
我發現this paper,但我不知道如何使用DCT背景重建進行。我做了前面的步驟。調整前
圖片:
每個輻條包括3圈和有:調整(在innercircle從使用imfindcircles整個圖形切割)後
圖片共10個輻條,共計30個圈。
我試過到目前爲止:
clc
clear
im = imread('f8.jpg');
im = mat2gray(im);
im = 1 - im;
s = size(im);
%contrast enhancement method suggested in paper
for x = 1:s(1);
for y=1:s(2);
a = max(im(x, :))/mean(im(x, :));
a;
b = max(im(:, y))/mean(im(:, y));
b;
ab = (a+b)/2;
im(x, y) = im(x, y) * ab;
im(x, y);
end
end
imshow(im);
%bluring
h = fspecial('average', [2,2]);
im= filter2(h, im);
%find circles
[c, r] = imfindcircles(im, [35 50], 'Sensitivity', 0.92, 'Edge', 0.01);
% figure(1)
% imshow(im)
% hold on
% viscircles(c, r, 'EdgeColor', 'b');
% hold off
% making mask that cuts out the inenr circles
mask = bsxfun(@plus, ((1:256) - c(1,1)).^2, (transpose(1:256) - c(1,2)).^2) < r(1)^2;
mask = im2double(mask);
mask_al
for x=1:256
for y=1:256
if mask(x, y) == 1;
mask(x, y) = im(x, y);
end
end
end
綜上所述:
我需要算多少圈都在圖像上可見。
我的代碼是在這裏-http://paste.org/71029 – jasheq