android如何测摄像头和被拍摄物体之间的距离??

Android 码拜 9年前 (2015-04-24) 2228次浏览 0个评论
 

试了下传说中的近距离感应器,但好像只有0.0和5.0两个值,而且感应的是屏幕那一侧。我需要的是检测摄像头和被拍摄物体之间的距离。各位大神能否指点一下思路????

android如何测摄像头和被拍摄物体之间的距离??
…先通过了解距离和对焦过程之间的关系 写个Rom改下对焦函数?
= =
android如何测摄像头和被拍摄物体之间的距离??
我只知道通过人的双眼和方位传感器 可以估算距离…
android如何测摄像头和被拍摄物体之间的距离??
引用 1 楼  的回复:

…先通过了解距离和对焦过程之间的关系 写个Rom改下对焦函数?
= =

恩 您提醒的思路很对!google搜遍了 这方便的资料很少啊!几乎没有。唉 难道要一点一点看google的api

android如何测摄像头和被拍摄物体之间的距离??
貌似 现在手机上都没有红外了! 有红外的话还能自己控制发送接收自己算出个距离!
android如何测摄像头和被拍摄物体之间的距离??
http://pastebin.com/w3vDGZ2F
查了一圈,很多国外的程序猿也在研究这个,也没个所以然来。
目前唯一的线索就是焦距到底是多少!
google的api也找到了,public void getFocusDistances (float[] output)

Since: API Level 9
Gets the distances from the camera to where an object appears to be in focus. The object is sharpest at the optimal focus distance. The depth of field is the far focus distance minus near focus distance.

Focus distances may change after calling autoFocus(AutoFocusCallback), cancelAutoFocus(), or startPreview(). Applications can call getParameters() and this method anytime to get the latest focus distances. If the focus mode is FOCUS_MODE_CONTINUOUS_VIDEO, focus distances may change from time to time.

This method is intended to estimate the distance between the camera and the subject. After autofocus, the subject distance may be within near and far focus distance. However, the precision depends on the camera hardware, autofocus algorithm, the focus area, and the scene. The error can be large and it should be only used as a reference.

Far focus distance >= optimal focus distance >= near focus distance. If the focus distance is infinity, the value will be Float.POSITIVE_INFINITY.

Parameters
output focus distances in meters. output must be a float array with three elements. Near focus distance, optimal focus distance, and far focus distance will be filled in the array.
See Also
FOCUS_DISTANCE_NEAR_INDEX
FOCUS_DISTANCE_OPTIMAL_INDEX
FOCUS_DISTANCE_FAR_INDEX
得到的数据一直是infinite,奶奶的真坑爹!  看来是测不出了

android如何测摄像头和被拍摄物体之间的距离??
20分
哥们是准备做物体3D姿态估计吧  如果是的话OpenCV里面有http://www.opencv.org.cn/index.php/Cv%E7%85%A7%E7%9B%B8%E6%9C%BA%E5%AE%9A%E6%A0%87%E5%92%8C%E4%B8%89%E7%BB%B4%E9%87%8D%E5%BB%BA#POSIT
android如何测摄像头和被拍摄物体之间的距离??
引用 6 楼  的回复:

哥们是准备做物体3D姿态估计吧 如果是的话OpenCV里面有http://www.opencv.org.cn/index.php/Cv%E7%85%A7%E7%9B%B8%E6%9C%BA%E5%AE%9A%E6%A0%87%E5%92%8C%E4%B8%89%E7%BB%B4%E9%87%8D%E5%BB%BA#POSIT

好的 谢谢哥们啦! 我项目需要确定被拍摄物体在空间中的位置,要求多次拍摄被拍摄物体在空间中位置尽量保持不练,平面(x,y)里采用这种屏幕上画关键点,关键点与物体的关键点重合实现。还需要一个z分量,就是距离。

android如何测摄像头和被拍摄物体之间的距离??
楼主有用贴  顶一下···
android如何测摄像头和被拍摄物体之间的距离??
顶lz一下 想问问楼主一年了  解决了没有?小弟想请教请教楼主
android如何测摄像头和被拍摄物体之间的距离??
唉,我也在做这个,一点头绪都没有。。。顶一个!

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明android如何测摄像头和被拍摄物体之间的距离??
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!