Login  Register

Re: Area and pixel count in Photoshop vs ImageJ

Posted by Michael Schmid on Jun 09, 2015; 1:52pm
URL: http://imagej.273.s1.nabble.com/Area-and-pixel-count-in-Photoshop-vs-ImageJ-tp5013084p5013091.html

Hi Andrew,

hmm, I don't know where the numbers 5720 or 5640 come from.  With Photoshop CS5, if I create a circular selection with a diameter of 100 pixels (as indicated by the 'Info' panel), the 'Histogram' panel says 7860 pixels.

In ImageJ, a circular selection with a diameter of 100 pixels has 7860 pixels, exactly the same.  In general, one should not expect perfect agreement; as Gabriel already wrote, there may be slightly different conventions on how a circle is delimited.

As Wayne wrote already a few days ago [1], this number is also very close to what you get from an analytic calculation, (r^2*Pi = 7853.98 with r=50). The difference is due to the fact that ImageJ can treat pixels only as inside or outside, not partially inside or partially outside, which would be required for an exact calculation.


Michael

[1] https://list.nih.gov/cgi-bin/wa.exe?A2=ind1506&L=IMAGEJ&F=&S=&P=37730
________________________________________________________________
On Jun 9, 2015, at 01:04, Andrew Sanchez wrote:

> Here are results between Photoshop and ImageJ:
>
> In Photoshop, the measurement log shows that the Area of a 100x100 circle
> is 5720.  In my histogram, it reads "Pixels: 5640 pixels."  The measurement
> scale is set to 1 pixel = 1 pixel.
>
> My project involves counting the number of green pixels in an image and
> dividing that number by the total number of pixels in the ROI, in order to
> get the percentage of vegetation.  The number shown in the histogram of
> Photoshop next to Pixels is the value I've been using as the total number
> of pixels.  Since starting to look into ImageJ, I'm worried that this
> method is not accurate.
>
> In ImageJ, I removed the scale and get the correct area of 7860.
>
> I am hoping to switch over from using Photoshop to ImageJ, but I need to
> first understand why the numbers I get in Photoshop are so different.
>
> --
> Thank you,
> Andrew Sanchez
> Lab Assistant
> Center for Ecosystem Science
> Northern Arizona University

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html