How to know the real size of a bubble in an image , the distance of camera is 10 cm from the bubble, and how to convert it from pixel to micron unit. I know the size of
the bubble in the attachment but in pixel without real distance of camera.
if possible help. thanx

 Réponse acceptée

Bjorn Gustavsson
Bjorn Gustavsson le 29 Fév 2020

1 vote

In order to determine this you need at least one additional piece of information. The camera converts light from incidence angles, to image position (u,v) (this is only stating the rather obvious). Typically cameras with small fields-of-view have a rather simple mapping:
where u0, v0 are the horizontal and vertical image coordinate of the optical axis (you can at least initially assume that is the centre of your image), f is the focal length of your lens, and θ and ϕ are the polar angle to the optical axis and the azimuthal angle around it. To determine the size of the bubble you need to know the focal length f in useful units. If you know the field-of-view of your camera you can determine this:
where is the edge-to-edge field-of-view and S is the image size. (90-deg field-of-view gives you a focal length that is half the image size.
Since you know the distance to the bubble the rest is geometry.
A simpler way would be to include a ruler with well-calibrated scale-marks in the images.
HTH

3 commentaires

Ayman Saleh
Ayman Saleh le 1 Mar 2020
thanks a lot dear Bjorn.
Well if you know the field of view, you can skip all that math and just make a spatial calibration factor
mmPerPixel = fieldOfView / pixelsAcross;
where you simply compute the millimeters (or whatever) per pixel by dividing the field of view horizontally by the number of pixel columns in the image. This is essentially the "ruler" method Bjorn mentioned.
To get distances (like diameters):
distanceInMm = distanceInPixels * mmPerPixel;
To get areas in square mm:
areaInMm = areaInPixels * mmPerPixel ^ 2;
See my attached spatial calibration demo.
Ayman Saleh
Ayman Saleh le 1 Mar 2020
thank you very much dear Image Analyst I really appreciate it,

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Support Package for USB Webcams dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by