Object extraction from image

29 ビュー (過去 30 日間)
Sawera Zahra
Sawera Zahra 2021 年 1 月 4 日
編集済み: KALYAN ACHARJYA 2021 年 1 月 4 日
Hi, I need to extract rice grains from (rice.png) . I just need guidance for algorithm . Which algorithm or technique should I use?

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 1 月 4 日
編集済み: KALYAN ACHARJYA 2021 年 1 月 4 日
Simplest Case:
Assuming you are considering MATLAB internal image rice.png image. The image is quite clear, you may use directly thresholding to get the desired result.
bwImage=imbinarize(grayImage,.46);
%..............................^ adjust the threshold value as per requirement
bwImage=bwareaopen(bwImage,10); %Remove small objects from binary image
grayImage(~bwImage)=255; % Make all non segmented part as whilte pixels
imshow(grayImage)
In this particular image, this direct approach works better than othsu Method( To get the Global image threshold). Please do other sort of morphological operation, like smothing or other segmentation approach to get more better result.
Best Case: If you are at beginner level, request to refer to the image segmentation chapter in the Gonzalez Digital Image Processing Book
:)
Kalyan

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by