Counting objects in an binary image of olympic logo

3 Ansichten (letzte 30 Tage)
louna akkad
louna akkad am 21 Jun. 2015
Bearbeitet: Image Analyst am 27 Dez. 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

Akzeptierte Antwort

Image Analyst
Image Analyst am 21 Jun. 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 Kommentare
louna akkad
louna akkad am 21 Jun. 2015
Bearbeitet: louna akkad am 21 Jun. 2015
did not work it give me numberOfHues =1 i want to give 5 objects
Image Analyst
Image Analyst am 21 Jun. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (3)

louna akkad
louna akkad am 21 Jun. 2015
sorry for that
i have this image
im searching for algorithm matlab code or matlab function to count objects in this image the function should tell me that there is 5 objects thank you

Image Analyst
Image Analyst am 21 Jun. 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 Kommentare
louna akkad
louna akkad am 22 Jun. 2015
i have the question to find algorithm that can count intersecting and overlapping objects in the binary image
*olympic logo image was example and he could give me image with intersecting squirrels and the algorithm should count the object
i tried function like normxcorr2 ,bwboundaries but didnot work the doctor said i should find function can say if there are intersecting Objects in the image
Image Analyst
Image Analyst am 22 Jun. 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.

Melden Sie sich an, um zu kommentieren.


Rahul punk
Rahul punk am 27 Dez. 2018
Bearbeitet: Image Analyst am 27 Dez. 2018
Hi.
  1. Please verify the image size is like 640*480.
  2. Then count pixel number of all black circle pixels in the whole image is 307200
  3. Then find the number of pixels in a single circle.
  4. 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.

Community Treasure Hunt

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

Start Hunting!

Translated by