Counting objects in an binary image of olympic logo
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
louna akkad
el 21 de Jun. de 2015
Editada: Image Analyst
el 27 de Dic. de 2018
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
0 comentarios
Respuesta aceptada
Image Analyst
el 21 de Jun. de 2015
Try this (untested):
% 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)
Requires Image Processing Toolbox for rgb2hsv() and Signal Processing Toolbox for findpeaks().
2 comentarios
Image Analyst
el 21 de Jun. de 2015
louna, read this, then upload your image. Until then I can't help you because you've not given me anything to help you.
Más respuestas (3)
Image Analyst
el 21 de Jun. de 2015
That is not the Olympic logo - where are the colors? You didn't say that you had a binary image . In that image there are 10 white objects and one black object.
If you want to find circles, I suggest you use imfindcircle(). See Brett Shoelson's circle finder app: http://www.mathworks.com/matlabcentral/fileexchange/34365-circle-finder
6 comentarios
Image Analyst
el 22 de Jun. de 2015
There is no such function. normxcorr2() finds a pattern in an image. There are others that can find objects that are rotated or scaled, such as this one using Hu's moments https://www.youtube.com/watch?v=Nc06tlZAv_Q
But unless you simplify the problem there is no general solution to do what you ask. Let's say I have a silhouette of a big coin. Underneath it are smaller coins. But they are not seen in the silhouette since the coin on top is much bigger. Can you detect how many small coins there are, and where they are? No, you cannot. Let's say you have a dash and the letter I such that the dash overlaps the bottom of the I to form an L shape. Can you detect that? What makes you think it's two bars and not an L shape? Like I said initially any blob could be the superposition of other blobs.
Rahul punk
el 27 de Dic. de 2018
Editada: Image Analyst
el 27 de Dic. de 2018
Hi.
- Please verify the image size is like 640*480.
- Then count pixel number of all black circle pixels in the whole image is 307200
- Then find the number of pixels in a single circle.
- After finding number of pixels in a single circle, then divide whole image value by the count in a single olympic circle pixel area to get the number of rings.
Easy
Thank you!
This is last and final solutions to find overlapping image analysis.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!