# finding number of pixels inside each circle

37 views (last 30 days)
Dhandapani.S on 21 Jan 2015
Commented: Dhandapani.S on 1 Feb 2015
i am drawing circles of different radius on a jpg image. how to find the number of pixels in each circle. i have to compare the pixel distribution ratio in each circle
Dhandapani.S on 21 Jan 2015
say, for inner most circle, there may be 20% of the total pixels of the jpeg image. the next immediate outer circle may contain 40 % of the total jpeg image pixels. this is a kind of segmentation i think. please give me a solution. thank you in advance.

Image Analyst on 26 Jan 2015
I'm pretty sure I gave you the answer in your other question: http://www.mathworks.com/matlabcentral/answers/169093#comment_261946 How is this any different than that?
Dhandapani.S on 1 Feb 2015
dear image analyst, you have made the work with concentric circles and i got good results. i am trying with triangles, rectangles and spheres.but cannot accomplish. iget the error with bwboundaries. since bwboundaries is 2d i cannot make it up to sphere. please help me in rectangle and triangle.

Thorsten on 21 Jan 2015
A well-known "approximation" is :-)
You could also create a circle and count the pixels:
[X, Y] = meshgrid(x, x);
R = sqrt(X.^2 + Y.^2);
Both values are almost the same.
##### 2 CommentsShowHide 1 older comment
Thorsten on 26 Jan 2015
You can just use any other value for the radius, like