find multiple objects and their number in an image

1 回表示 (過去 30 日間)
Liliana Malik
Liliana Malik 2018 年 3 月 12 日
コメント済み: Image Analyst 2018 年 3 月 13 日
I am working on a project that classifies beans in an image how can i do that and how can i tell the number of beans of each type.
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 3 月 12 日
編集済み: KALYAN ACHARJYA 2018 年 3 月 12 日
When you classify it based on image segmentation (Apply various variable thresholding techniques) and count the number of objects within an image.
[label_Image, numberofObject]=bwlabel(segmented_binaryImage);
Liliana Malik
Liliana Malik 2018 年 3 月 12 日
this is a sample image it's not exactly what i'm going to do cause the exact number of beans for some types is uncountable in this image, the image i'm going to work with will have less beans

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2018 年 3 月 12 日
See my image segmentation tutorial in my File Exchange.
  1 件のコメント
Image Analyst
Image Analyst 2018 年 3 月 13 日
Create a feature vector for each pixel that includes the mean hue, saturation, and value in a window around the pixel plus the standard deviation of the values in the window. Use rgb2hsv() and conv2() and stdfilt().
hsvImage = rgb2hsv(rgbImage);
hImage = hsvImage(:, :, 1);
sImage = hsvImage(:, :, 2);
vImage = hsvImage(:, :, 3);
windowsSize = 21; % Some odd number.
kernel = ones(windowSize, windowSize)/windowSize^2;
localMeanH = conv2(hImage, kernel, 'same');
localMeanS = conv2(sImage, kernel, 'same');
localMeanV = conv2(vImage, kernel, 'same');
% Now use stdfilt
localSDH = stdfilt(hImage, ..... etc.
I'm sure you can figure out what to do next.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRecognition, Object Detection, and Semantic Segmentation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by