computing the area of an objec

Moderator: jsachs

Post Reply
tomczak
Posts: 1379
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

computing the area of an objec

Post 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?
Maciej Tomczak
Phototramp.com
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: computing the area of an objec

Post by couman »

The mask tool reports the number of pixels in the mask and the area as a percentage of the image size.
Bob Coutant
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: computing the area of an objec

Post 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.
Bob Coutant
tomczak
Posts: 1379
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: computing the area of an objec

Post 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!
Maciej Tomczak
Phototramp.com
Post Reply