Number of pixels in an area

spitabc Posted messages 6 Status Membre -  
FMrVinci Posted messages 31 Status Membre -
Hello,
Is it possible to know the pixel count in a specific area of an image? (My goal is to calculate the area of an irregular zone, of course)
If it is possible, with which software (Photoshop?) and how?
Thank you in advance
Configuration: Windows XP Internet Explorer 6.0

1 réponse

FMrVinci Posted messages 31 Status Membre 4
 
Hi, Spitabc. For your problem, overlay geometric primitives where the problem is relevant and add their areas...
Most of the time, it's better to use primitives (polygons) rather than a direct method to find the exact number of pixels; otherwise, you'll have to do integral calculus...

You use polygons that you cut into triangles, then you calculate the area of each triangle, which is half the product of the length of its base and its height. Then, you concatenate all the areas found and use pixels as the unit if you've defined the area beforehand.

At worst, if you really want the exact number, you could program a tool that would "procedurally" count the pixels up to a horizontal limit line by line; that would be an intuitive approach without integral calculus.

Good luck ;)
0