Hi,i am dealing with a project in which i have to detect the defected Rice grains from a sample of rice.I want to do segmentation to seprate the defected rice grains and then find the ratio of defect in the sample.kindly help me.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
Image Analyst
am 24 Dez. 2017
Which ones are defective?
What I'd do is to first take a "blank shot" of just the white background, then divide that out to remove any dependencies of the non-uniform background illumination and shading. See attached background correction demo.
Then I'd threshold to find the rice grains.
binaryImage = grayImage < someThreshold;
You might want to call bwareafilt() or bwareopen() to get rid of small noise pixels
binaryImage = bwareaopen(binaryImage, 30);
Then I'd get the mean intensity of each grain.
props = regionprops(binaryImage, 'MeanIntensity');
Histogram the mean intensities to see their distribution
allIntensities = [props.MeanIntensity];
histogram(allIntensities);
grid on;
xlabel('Mean Intensity');
ylabel('Count');
Presumably you can determine defective grains based on their mean intensity. Give that code a try and come back if you need any more help.
10 Kommentare
Ankit Rathore
am 9 Feb. 2022
Have you got the answer zeeshan Ahmed. I need your help and i am wirking in a similar project. Please let me know how can i reach you.
Image Analyst
am 9 Feb. 2022
@Ankit Rathore, yes, he did. He accepted this code as the Answer: https://www.mathworks.com/matlabcentral/answers/374388-hi-i-am-dealing-with-a-project-in-which-i-have-to-detect-the-defected-rice-grains-from-a-sample-of-r#comment_519087
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Red finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!