【发布时间】:2014-07-20 14:01:46
【问题描述】:
我是 MATLAB 的新生并使用 MATLAB 和神经网络开发“大米质量识别”应用程序。对于我的指导,我更喜欢这个 Research Paper
此应用程序包含 5 个阶段
- 图像采集
- 图像预处理
- 图像分割和识别感兴趣区域
- 特征提取
- 培训和测试
我现在处于第三阶段,已经为此应用程序开发了初始步骤
第 1 步:从计算机浏览图像并显示它
% Get the orginal image & show , Figure 1
[fileName, pathName] = uigetfile('*.jpg;*.tif;*.png;*.gif','Select the Picture file');
I = fullfile(pathName, fileName);
I = imread(I);
imshow(I)
第 2 步:背景减法
% selected rice image Background subtraction , Figure 2
% Use Morphological Opening to Estimate the Background
background = imopen(I,strel('disk',7));
I2 = I - background;
figure, imshow(I2);
第 3 步:
% get the Black and white Image , Figure 3
% output image BW replaces all pixels in the input image with luminance greater than 0.17 level
BW = im2bw(I2,0.17);
figure, imshow(BW)
第 4 步:
% Remove small objects fewer than 30 pixels from binary image
pure = bwareaopen(BW,30);
figure, imshow(pure)
第 5 步:标记
% Label Black and white & Image bounding box around each object
L=bwlabel(pure,8);
bb=regionprops(L,'BoundingBox');
我从 2 天开始就坚持第 6 步。第 6 步是使用带标签的二值图像从原始图像中裁剪多个对象
确切的输出应该如下图所示,
如果我能得到这个,我可以轻松计算原始图像中每个对象的形态特征和颜色特征,以用于阶段 4。
形态特征
1.Area for each Object
2.scale of X, Y axis for each object in above picture
3.using X, Y axis I can Calculate Aspect Ratio
颜色特征
1. Red Mean
2. Green Mean
3. Blue Mean
您能否解释一下使用标记二进制图像从原始图像中裁剪多个对象的方法,即第 6 步。
【问题讨论】:
标签: matlab image-processing neural-network