【发布时间】:2012-10-11 00:34:05
【问题描述】:
我想得到一张只有葡萄和三个圆圈(红、绿、蓝)的图像。 [我需要去除所有的污迹]。 我该如何改进我的代码?
这是我的代码:
RGB = imread('img_3235.jpg');
GRAY = rgb2gray(RGB);
threshold = graythresh(GRAY);
originalImage = im2bw(GRAY, threshold);
originalImage = bwareaopen(originalImage,250);
imshow(originalImage);
CC = bwconncomp(originalImage); %Ibw is my binary image
stats = regionprops(CC,'pixellist');
这是我的图片 (img_3235.jpg)。
这是我的代码的结果:
【问题讨论】:
标签: matlab image-processing computer-vision