Recognising/classify segmented objects in RGB image
조회 수: 2(최근 30일)
표시 이전 댓글
Teshan Rezel 2020년 2월 7일
댓글: Teshan Rezel 2020년 2월 11일
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?
댓글 수: 0
Ajay Pattassery 2020년 2월 10일
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.
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
Find more on Image Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!