Fraction of a pixel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Fraction of a pixel

Rodrigo Gonçalves-4
I am not an image analysis expert and have a (probably very ignorant) question.

I thought that a pixel was the minimum unit of an image of display. Maybe I am wrong starting with this?  But then I open eg. a 8-bit grayscale image and take any length measurement (having setting no scale, only pixels by default) and I see that the line measures lengths of, say, 192.34

If the pixel is the minimum unit, shouldn't it be any length measurement only integers of pixels? I wonder what does it mean a measurement of 0.34 pixels? How is it calculated? What is the explanation?

On the other hand, when I draw a rectangular selection, the length of the sides of the rectangle are integer always.

Thanks and sorry if this is a silly question..

________________________

Rodrigo J. Gonçalves

________________________

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fraction of a pixel

Volker Baecker
Hello,
you are basically right about the pixel. The situation can be as complex
as you want if you look at this topic in detail.
If you measure areas you will always get integer results. However it is
different for length measurements. Imagine a square with side length 1.
Then the diagonal has the length c=sqrt(1² + 1²) = sqrt(2). The distance
between a pixel and his right or left or upper or lower neighbour is 1
but the distance between a pixel and the upper-right neighbour is
sqrt(2) which is approximately 1.4142. So if you measure the length of a
horizontal or vertical line-segment you get integer values. If you
measure the length of a segmented line selection that has only 90°
angles you will always get integers.  If you measure arbitrary line
selections you can get non integer results.

Volker

On 07/08/12 12:13, Rodrigo Gonçalves wrote:

> I am not an image analysis expert and have a (probably very ignorant) question.
>
> I thought that a pixel was the minimum unit of an image of display. Maybe I am wrong starting with this?  But then I open eg. a 8-bit grayscale image and take any length measurement (having setting no scale, only pixels by default) and I see that the line measures lengths of, say, 192.34
>
> If the pixel is the minimum unit, shouldn't it be any length measurement only integers of pixels? I wonder what does it mean a measurement of 0.34 pixels? How is it calculated? What is the explanation?
>
> On the other hand, when I draw a rectangular selection, the length of the sides of the rectangle are integer always.
>
> Thanks and sorry if this is a silly question..
>
> ________________________
>
> Rodrigo J. Gonçalves
>
> ________________________
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fraction of a pixel

Michael Schmid
In reply to this post by Rodrigo Gonçalves-4
Hi Rodrigo,

in ImageJ you can have lines with sub-pixel accuracy of the starting and end points.  This is a very handy feature in several cases, such as line profiles and lines used as overlay (for drawing, annotations, ...).  Also for measuring distances, if you zoom in, your eye will often locate edges or centers of small objects with better accuracy than 1 pixel.

When programming a plugin (not just using the tool to draw it), you can have sub-pixel accuracy also for the other selection types.

Michael
________________________________________________________________
On Aug 7, 2012, at 12:13, Rodrigo Gonçalves wrote:

> I am not an image analysis expert and have a (probably very ignorant) question.
>
> I thought that a pixel was the minimum unit of an image of display. Maybe I am wrong starting with this?  But then I open eg. a 8-bit grayscale image and take any length measurement (having setting no scale, only pixels by default) and I see that the line measures lengths of, say, 192.34
>
> If the pixel is the minimum unit, shouldn't it be any length measurement only integers of pixels? I wonder what does it mean a measurement of 0.34 pixels? How is it calculated? What is the explanation?
>
> On the other hand, when I draw a rectangular selection, the length of the sides of the rectangle are integer always.
>
> Thanks and sorry if this is a silly question..
>
> ________________________
>
> Rodrigo J. Gonçalves
>
> ________________________

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fraction of a pixel

David M Gauntt
In reply to this post by Rodrigo Gonçalves-4
This is not a silly question at all!

There are two situations in which ImageJ will report a non-integer length
of a line (with no scale setting):

1) As Volker Baecker said, if the line is not exactly vertical or
horizontal, then it is the diagonal of a rectangle.  Even if the rectangle
has integer height and width, its diagonal can have non-integral length.

2) If the zoom setting is not 100%, the reported length of a horizontal or
vertical line can be non-integral. This is because the length of the line
is constrained to have an integral number of screen pixels, but the
reported length is the length in image pixels, which is screen pixels
divided by the zoom setting.  For example, if the zoom setting is 50% and
the line length is 100 screen pixels, the reported length will be 200.  If
you move the mouse one pixel on the screen so the line length is now 101
screen pixels, the reported length is 202.

On the other hand, if the zoom setting is 200% and the line length is 100
screen pixels, the reported length is 50.  If you move the mouse one
screen pixel so the line length is 101 screen pixels, the reported length
changes to 50.5.

--
David M. Gauntt, Ph.D.
Associate Professor,
Division of Medical Physics and Engineering
UAB Department of Radiology

mailto:[hidden email]
205-975-3777







On 8/7/12 6:53 AM, "IMAGEJ automatic digest system"
<[hidden email]> wrote:

>Date:    Tue, 7 Aug 2012 03:13:57 -0700
>From:    Rodrigo Gonçalves <[hidden email]>
>Subject: Fraction of a pixel
>
>I am not an image analysis expert and have a (probably very ignorant)
>question.
>
>I thought that a pixel was the minimum unit of an image of display. Maybe
>I am wrong starting with this?  But then I open eg. a 8-bit grayscale
>image and take any length measurement (having setting no scale, only
>pixels by default) and I see that the line measures lengths of, say,
>192.34
>
>If the pixel is the minimum unit, shouldn't it be any length measurement
>only integers of pixels? I wonder what does it mean a measurement of 0.34
>pixels? How is it calculated? What is the explanation?
>
>On the other hand, when I draw a rectangular selection, the length of the
>sides of the rectangle are integer always.
>
>Thanks and sorry if this is a silly question..
>
>________________________
>
>Rodrigo J. Gonçalves
>
>________________________
>
>--
>ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

ImageJ on OS X 10.8

Muresan, Virgil
Hello,

I have tried twice to install the latest version of ImageJ on my newest MacBook Pro, which runs OS X, Mountain Lion.  When I tried to start the application after downloading, each time I got the message that the application is damaged.  Did I do anything wrong, or does ImageJ not run on Mountain Lion (OS X 10.8)?

Thank you for your help,

Virgil

Virgil Muresan, Ph.D.
Associate Professor
UMDNJ - New Jersey Medical School
Department of Pharmacology and Physiology
185 South Orange Avenue, MSB, I-683
Newark, New Jersey 07103-2714
Tel: 973-972-2392
FAX: 973-972-7950
E-mail: [hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ on OS X 10.8

Michael Schell-2
I have the same computer and OS.  ImageJ  and ImageJ64 both launch fine for me.  Check you security and privacy preferences to ensure you allow apps from anywhere to launch (not just App Store).

Michael


On 8 Aug 2012, at 2:22 pm, Muresan, Virgil wrote:

> Hello,
>
> I have tried twice to install the latest version of ImageJ on my newest MacBook Pro, which runs OS X, Mountain Lion.  When I tried to start the application after downloading, each time I got the message that the application is damaged.  Did I do anything wrong, or does ImageJ not run on Mountain Lion (OS X 10.8)?
>
> Thank you for your help,
>
> Virgil
>
> Virgil Muresan, Ph.D.
> Associate Professor
> UMDNJ - New Jersey Medical School
> Department of Pharmacology and Physiology
> 185 South Orange Avenue, MSB, I-683
> Newark, New Jersey 07103-2714
> Tel: 973-972-2392
> FAX: 973-972-7950
> E-mail: [hidden email]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fraction of a pixel

Rodrigo Gonçalves-4
In reply to this post by David M Gauntt
Thanks for all your answers, my little enigma is solved now :)
Cheers,

________________________

Rodrigo J. Gonçalves

________________________

--- El mié, 8/8/12, David M Gauntt <[hidden email]> escribió:

De: David M Gauntt <[hidden email]>
Asunto: Re: Fraction of a pixel
A: [hidden email]
Fecha: miércoles, 8 de agosto de 2012, 03:16 pm

This is not a silly question at all!

There are two situations in which ImageJ will report a non-integer length
of a line (with no scale setting):

1) As Volker Baecker said, if the line is not exactly vertical or
horizontal, then it is the diagonal of a rectangle.  Even if the rectangle
has integer height and width, its diagonal can have non-integral length.

2) If the zoom setting is not 100%, the reported length of a horizontal or
vertical line can be non-integral. This is because the length of the line
is constrained to have an integral number of screen pixels, but the
reported length is the length in image pixels, which is screen pixels
divided by the zoom setting.  For example, if the zoom setting is 50% and
the line length is 100 screen pixels, the reported length will be 200.  If
you move the mouse one pixel on the screen so the line length is now 101
screen pixels, the reported length is 202.

On the other hand, if the zoom setting is 200% and the line length is 100
screen pixels, the reported length is 50.  If you move the mouse one
screen pixel so the line length is 101 screen pixels, the reported length
changes to 50.5.

--
David M. Gauntt, Ph.D.
Associate Professor,
Division of Medical Physics and Engineering
UAB Department of Radiology

mailto:[hidden email]
205-975-3777







On 8/7/12 6:53 AM, "IMAGEJ automatic digest system"
<[hidden email]> wrote:

>Date:    Tue, 7 Aug 2012 03:13:57 -0700
>From:    Rodrigo Gonçalves <[hidden email]>
>Subject: Fraction of a pixel
>
>I am not an image analysis expert and have a (probably very ignorant)
>question.
>
>I thought that a pixel was the minimum unit of an image of display. Maybe
>I am wrong starting with this?  But then I open eg. a 8-bit grayscale
>image and take any length measurement (having setting no scale, only
>pixels by default) and I see that the line measures lengths of, say,
>192.34
>
>If the pixel is the minimum unit, shouldn't it be any length measurement
>only integers of pixels? I wonder what does it mean a measurement of 0.34
>pixels? How is it calculated? What is the explanation?
>
>On the other hand, when I draw a rectangular selection, the length of the
>sides of the rectangle are integer always.
>
>Thanks and sorry if this is a silly question..
>
>________________________
>
>Rodrigo J. Gonçalves
>
>________________________
>
>--
>ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>

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

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