Page 1 of 1

computing the area of an objec

Posted: September 9th, 2010, 10:05 am
by tomczak
I know PWP wasn't designed to do quantitative microscopy on it, but I wonder if anyone have an idea how to do this: having a picture of an object that is different in colour and/or brightness from the background, how do calculate the number of pixels that belong to the object?

This is useful in science where one needs to calculate an area of an irregular object. Given the scan/picture of a flat object, which also includes an object of a known area, one can calculate the number of pixels 'covered' by the object in question and then by the object of a known area and calculated the area of the former.

It's easy to isolate the pixels of the object either by masking or several other techniques, then increase the contrast so that e.g. the background is black and the object white, but how how to count the white pixels?

Re: computing the area of an objec

Posted: September 9th, 2010, 10:29 am
by couman
The mask tool reports the number of pixels in the mask and the area as a percentage of the image size.

Re: computing the area of an objec

Posted: September 9th, 2010, 10:38 am
by couman
Posted too quickly

You can also calculate (using a little trigonometry) absolute object dimensions using the FOV and focus distance reported in the detailed detailed EXIF metadata. [KUSO gives the most detailed EXIF readout that I've found.] Absolute dimensions may or may not be useful depending on what you are trying to accomplish.

Re: computing the area of an objec

Posted: September 9th, 2010, 10:49 am
by tomczak
Thanks a lot, Bob,

When the 'Area' button in the mask took is pressed, it it indeed calculates the area of the mask in pixels (weighing their contributions by relative brightness). Who would have thought...

Cheers!