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.
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
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.
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.
I want to calculate the distance between the camera and the recognized object.For this I tried a lot of methods, I tried to find the angle between the object and the camera using accelerometer and ...
While searching for a way to detect screen to face distance on Android I found only one open source project but it lacked some explanation and was quite old and complicated. So I did it myself.
A small image measurement tool to measure length and angle from image plans by clicking on certain points. There are several measurement tool softwares like ImageJ but are not suitable for my requirement very well. For my kite making it is important to have a fast pixel to certain unit mapping...
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