Requires Image Processing Toolbox for rgb2hsv() and Signal Processing Toolbox for findpeaks().
Question
I try lot of algo and matlab code to count the object in olympic logo i should get 5 object but my count only one how i should count an binary image of olympic logo and get 5 object need code
Expert Answer
John Williams
PhD Expert
Answered Nov 20, 2025
try this :
% Convert the image from rgb into hsv color space: hsvImage = rgb2hsv(rgbImage); % Extract the hue image h = hsvImage(:,:,1); % Get the histogram counts = histcounts(h, 1000); % Find peaks in the histogram [peaks, indexes] = findpeaks(counts); % count the number of peaks numberOfHues = length(peaks)
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →