Android Question camera: possible to measure width of the rectangle object ?

peacemaker

Expert
Licensed User
Longtime User
HI, All

Is it possible in B4A? I guess, maybe with help of OpenCV.
I only understand that if camera's sensor width is W mm and photo width is WP pixels, and ObjectWpixels is got from the photo - we can calculate the Wobj in millimeters.

It needs to get camera's sensor dimension.
 
Last edited:
Solution
how he did it
I see in the interface "px2unit" variable = 1.0, so it's clear how. But question is how to measure.
I have released initially the method #2: firstly to measure the etalon, secondly the object. The object width = etalon_real_width * Zoom_object / Zoom_etalon
1727450466536.png

ppgirl

Member
Licensed User
Longtime User
I have a preliminary idea. You can put the object on an A4 paper. OpenCV takes a picture and recognizes the reference of the A4 paper rectangular size and calculates the object size.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
My investigations about the measuring dimension by a camera are:


1) AR - works not at any smartphone, the tolerance is very variable, the closer to object - the worse. Not available in B4A now.

2) calculations via camera's properties (angles of view to the object) - the distance to the object must be known. Not available easy and automated.

3) calculations via the etalon size reference (like your A4 paper sheet) - etalon and the measuring object must be together in the camera. Manual operator's work.

4)
1727426824335.png
Ruler on the screen in an app
 
Upvote 0

zed

Active Member
Licensed User
Did you see this?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Have you seen this?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
how he did it
I see in the interface "px2unit" variable = 1.0, so it's clear how. But question is how to measure.
I have released initially the method #2: firstly to measure the etalon, secondly the object. The object width = etalon_real_width * Zoom_object / Zoom_etalon
1727450466536.png
 
Upvote 0
Solution
Top