我有一个图像,我想在其中平滑它的边缘。在获得更准确的分割方面存在一些挑战。然而,我通过调整以下建议得到了一个解决方案:我可以做些什么来提高我的图像质量?.
我使用的代码如下:
%# Read in image
Img = imread('image_name.png');
%# Apply filter
h = fspecial('average');
Img = imfilter(Img, h);
%# Segment image
Img = rgb2gray(Img);
thresh = multithresh(Img, 2);
Iseg = imquantize(Img, thresh);
figure, imshow(Iseg,[]), title('Segmented Image');
%# separate channels
blackPixels = (Iseg == 1);
grayPixels = (Iseg == 2);
whitePixels = (Iseg == 3);
%# grow white channel
whitePixels_dilated = imdilate(whitePixels, strel('disk', 4, 4));
%# Add all channels
Iseg(whitePixels | whitePixels_dilated) = 3;
figure, imshow(Iseg,[]);
我现在的挑战是平滑实体(whitePixels)的边缘或所有对象的边缘。我不知道该怎么做。我尝试过过滤,但这只会去除小点。非常感谢任何帮助、想法或建议或建议。谢谢你。