圆形的低对比度分割

时间:2014-03-07 17:23:32

标签: image-processing matlab grayscale image-segmentation

我在Matlab中遇到了一些问题,在这张图片中有圆圈的分割。对比度差异非常小,图像本身非常嘈杂。我对图像进行了一些处理并增加了对比度差异,但我仍然不知道下一步该怎么做。

我找到了this paper,但我不知道如何使用DCT进行背景重建。我做了以前的步骤。

调整前的图片:

Image before adjustment

调整后的图像(使用imfindcircles从整个图形切割内圆):

Image after adjustment

每个轮辐由3个圆圈组成,共有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

总结

我需要计算图像上可见的圆圈数。

2 个答案:

答案 0 :(得分:0)

如果您有一些用户种子输入可用(即使不可用,您可以使用Hough圆圈播种)您可能需要考虑活动轮廓:

  

Kass,Michael,Andrew Witkin和Demetri Terzopoulos。 “Snakes:活动轮廓模型。”国际计算机视觉杂志1.4(1988):321-331。

答案 1 :(得分:0)

使用Image Processing Toolbox中的imfindcircles。您还可以尝试activecontour功能。有关这些内容的详细信息,请参阅帮助文档。