Recognising/classify segmented objects in RGB image

2 ビュー (過去 30 日間)
Teshan Rezel
Teshan Rezel 2020 年 2 月 7 日
コメント済み: Teshan Rezel 2020 年 2 月 11 日
Hi all,
After successfully thresholding an image using Otsu's method, is there a way to pass the thresholded objects only with a view to classify the objects within?
Thanks
otsu.jpg

採用された回答

Ajay Pattassery
Ajay Pattassery 2020 年 2 月 10 日
Hello,
The following sample code will extract the segment of image that you could use for classification.
Here I assumed you wanted to threshold an RGB image and you are using grey scale intensity of the RGB image for Otsu’s thresholding.
colorImage= imread('peppers.png');
grayVersion = rgb2gray(colorImage);
thresholded = imbinarize(grayVersion); %Does thresholding by using Otsu’s method.
thresholded(:,:,2) = thresholded;
thresholded(:,:,3) = thresholded(:,:,1);
colorImage(thresholded == 0) = 0; %Extract the color image with the threshold region alone
  1 件のコメント
Teshan Rezel
Teshan Rezel 2020 年 2 月 11 日
this is perfect, thnak you!

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

その他の回答 (0 件)

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by