how to measure real height and width of object and distance of object from camera using android

i have refered many of the links i'm not getting  how to do ,i need get the real height ,width and distance of object from camera like how face detection 'll work ,lf i put mark on object on image while taking picture i need to get all the values on the screen of camera of android phone
 

please let me know how i can do this exactly
shruti AAsked:
Who is Participating?
 
David Johnson, CD, MVPOwnerCommented:
The Simple answer is that you can't.  You need a depth sensing camera to get distance.   A ruler/tape measure that is at the same depth as the object to be measured for size will give you the size of the object.
1
 
Jackie ManCommented:
I have tried many apps which claim to be able to do what you want, but no apps can do measurements accurately which can be accepted.

Theoretically, it is possible if  you are taking a photo vertically above the object (and you know the vertical distance between your Android phone and the object) but there are many different cameras in different Android phones and no app developers will be able to develop an app which can work for different Android phones.

If an app developer design such app just for you, will you pay? I guess not.
1
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
To get the height and width you would need to have a known distance, the focal length of the lens and the size of the image in pixels (the size of the sensor).

https://www.scantips.com/lights/subjectdistance.html

If you are creating an app to do the math, you would need to extract all of the information from the device to create the calculation. It is not going to be easy, but it can be done if you can get your users to take a picture from either a) a preset distance or b) input the distance in your app.  

It will be in interesting puzzle for you to complete and as you can see, the ground work is there for you to work out the final app.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
David Johnson, CD, MVPOwnerCommented:
another complication will be the zoom factor of the camera,
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If this is an app you are building, you can get the information about the camera https://developer.android.com/guide/topics/media/camera.html. David brings up a good point as there are lens add-ons you can buy. You would want your app to alert users to avoid adding the clip on lenses.
0
 
shruti AAuthor Commented:
thanks to all of you for your more precious suggestions and responses .I ll try to do :)
1
 
David Johnson, CD, MVPOwnerCommented:
enough information to confirm an answer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.