finding number of pixels inside each circle
Ältere Kommentare anzeigen
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
3 Kommentare
Mohammad Abouali
am 21 Jan. 2015
What's it with counting points in circle? Past few weeks this question has been asked several times by different people! I think we can well say that this question is trending on MATHWORKS :D
Image Analyst
am 21 Jan. 2015
What is a "pixel distribution ratio"?
Dhandapani.S
am 21 Jan. 2015
Bearbeitet: Image Analyst
am 26 Jan. 2015
Akzeptierte Antwort
Weitere Antworten (1)
Thorsten
am 21 Jan. 2015
A well-known "approximation" is :-)
N = round(radius^2*pi)
You could also create a circle and count the pixels:
radius = 100;
x = [-radius: radius];
[X, Y] = meshgrid(x, x);
R = sqrt(X.^2 + Y.^2);
N = numel(find(R<=radius));
Both values are almost the same.
2 Kommentare
Dhandapani.S
am 21 Jan. 2015
Thorsten
am 26 Jan. 2015
You can just use any other value for the radius, like
radius = 50;
and then compute the N to count the pixels in the circle of radius 50. Or what else do you need?
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!