Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- % k
- aw
- acwac
- means clustering to classify objects in 2 different groups.
- %k means clustering is the quikest way to figure out the number of rice
- %grains and number of peas in the image, based on the area of individual
- %however this method is not giving accurate result, it counts one rice
- grain extra!
- [grain_count] = kmeans(stats2.Area,2);
- for i =1:length(grain_count)
- if grain_count(i)==1
- rice_count_2(i)= rice_area(i);
- else grain_count(i)==2
- peas_count(i) = rice_area(i);
- end
- end
- max_rice_area = max(rice_count_2);
- ricegrains = find([stats2.Area] < max_rice_area);
- %}
Advertisement
RAW Paste Data
Copied
Advertisement