DIPlib / diplib

Quantitative Image Analysis in C++, MATLAB and Python
https://diplib.org
Apache License 2.0
228 stars 50 forks source link

How to SetPixelSize #116

Closed 8188 closed 2 years ago

8188 commented 2 years ago

I am a newbie at Image Analysis. May I ask this silly question? I want to use MeseasurementTool to measure the lengths or something, but I don't know how to determine the Pixel Size of an image. Another question. Because the objects in the images maybe different in distance. How the algorithm effective?

crisluengo commented 2 years ago

The measurement assumes the pixel size is constant. This is the case in 2D and 3D microscopy, in CAT and MRI scans, and many other imaging modalities. But it is often not the case in photography. To properly measure things in a photograph (the 2D image formed by projecting a 3D scene through a pinhole or lens), you need to determine the distance of the camera to each object (or object part) imaged, thereby partially reconstructing the 3D scene that was photographed.

The pixel size for an image is determined by properly calibrating the instrument. This can be as simple as taking an image of a ruler.

8188 commented 2 years ago

Got it. Thank you crisluengo.