简体   繁体   English

openCV Python相机校准-作物和投资回报率

[英]openCV Python camera calibration - crop and ROI

I am using OpenCV-Python to correct lense distortion on pictures. 我正在使用OpenCV-Python纠正图片上的镜头失真。 I use the script given in this tutorial . 我使用本教程中给出的脚本。

If I apply the script on the picture provided by the author of the script, its working. 如果我将脚本应用到脚本作者提供的图片上,它将起作用。

However, if I use my own picture, I can either get a ROI = (0,0,0,0) or a ROI such that the crop is not good. 但是,如果使用自己的照片,则可以得到ROI =(0,0,0,0)或ROI,从而导致收成不好。

I don't understand why. 我不明白为什么。 I don't know what to do :./ 我不知道该怎么办 :。/

  • Is there a specific way to take picture of the chessboard? 有没有具体的方法来拍摄棋盘上的图片?
    • chessboard should be close/far from the camera? 棋盘应该离相机很近/远吗?
    • I should take several pictures? 我应该拍几张照片吗?
    • the camera should not move? 相机不应该移动?
  • Should I define the size of my chessboard square somewhere? 我应该在某处定义棋盘方块的大小吗?

Thank you in advance for your answer. 预先感谢您的答复。

M. M.

Ok, finally it works now, and I'll answer my own question ^^ 好的,现在终于可以使用了,我会回答我自己的问题^^

  • Is there a specific way to take picture of the chessboard? 有没有具体的方法来拍摄棋盘上的图片?

    • chessboard should be close/far from the camera? 棋盘应该离相机很近/远吗?

      --> The chessboard should be close to the picture edges. ->棋盘应靠近图片边缘。

    • I should take several pictures? 我应该拍几张照片吗?

      --> At least 10 if not 20 ->如果不是20,至少10

    • the camera should not move? 相机不应该移动?

      --> It could move ->可能会移动

  • Should I define the size of my chessboard square somewhere? 我应该在某处定义棋盘方块的大小吗?

    --> Apparently not, but it is better if the chessboard is not a square (eg 9x9 little square, it is better to have a 4x8 chessboard). ->显然不是,但是如果棋board不是正方形就更好(例如9x9小正方形,最好有4x8棋is)。

    --> Still, I don't know the answer of this question ->不过,我不知道这个问题的答案

Remarkable things I noticed: 我注意到的值得注意的事情:

  • The pictures should have same orientation (landscape) 图片应具有相同的方向(横向)
  • The cropped picture does not have necessarily the same dimension than the original one 裁剪后的图片不一定与原始图片具有相同的尺寸

Thank you myself :D 谢谢你自己:D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM