V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
LeCent
V2EX  ›  Python

如何根据固定物体(如 A4 纸、大纸箱)在画面中的大小与实际大小的关系来自动获取(ip)camera 的高度?

  •  
  •   LeCent · 2018-03-26 14:40:53 +08:00 · 1939 次点击
    这是一个创建于 2195 天前的主题,其中的信息可能已经有所发展或是发生改变。

    opencv

    6 条回复    2018-03-29 10:23:52 +08:00
    robot777
        1
    robot777  
       2018-03-26 14:47:56 +08:00
    可以搜摄像机标定,最简单是建立一个 y=ax+b 的模型。不过我不知道你这样一个纸盒常量够不够,以前都是拿摄像机高度作为常量的。
    zhjits
        2
    zhjits  
       2018-03-26 14:48:44 +08:00
    LeCent
        3
    LeCent  
    OP
       2018-03-26 15:03:54 +08:00
    @robot777 #1 這個是圖像矯正?
    robot777
        4
    robot777  
       2018-03-26 15:18:49 +08:00
    你不需要校正,校正是对于镜头畸变的,你可以选择把纸盒放在镜头中心比较正的位置,这样用简单模型误差也不会很大。需要摄像头焦距什么的一些参数。
    ruoyu0088
        5
    ruoyu0088  
       2018-03-26 16:09:56 +08:00
    首先用 https://docs.opencv.org/3.3.1/dc/dbb/tutorial_py_calibration.html 中介绍的方法照相机的 camera matrix, distortion coefficients 参数。

    然后用 https://docs.opencv.org/3.3.1/d7/d53/tutorial_py_pose.html 中介绍的 solvePnP 函数计算出旋转和偏移向量。
    LeCent
        6
    LeCent  
    OP
       2018-03-29 10:23:52 +08:00
    @ruoyu0088 #5 能问一下具体怎么操作吗?(参数是怎么获得的?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2446 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 66ms · UTC 15:49 · PVG 23:49 · LAX 08:49 · JFK 11:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.