Hi every one , I need help about:

2 views (last 30 days)
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

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 29 Feb 2020
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 Comments
Image Analyst
Image Analyst on 1 Mar 2020
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 on 1 Mar 2020
thank you very much dear Image Analyst I really appreciate it,

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Support Package for IP Cameras in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!