新的针孔相机内参矩阵适用于裁剪后的图像。

huangapple go评论86阅读模式
英文:

New Pinhole Camera Intinsics Matrix for the Cropped Image

问题

我给出以下示例来说明我的问题:假设我有一个遵循针孔相机模型的相机内参矩阵,其内参矩阵具有以下结构:

ori_intrinsics = [[fx, 0, cx],
                  [0, fy, cy],
                  [0, 0, 1]]

我还知道它可以生成大小为[ori_width, ori_height]的图像。然后,我在图像位置[ori_left, ori_top, ori_right, ori_bottom]进行裁剪。现在我有了一张新的图像。那么我的问题是:现在我有一个类似的相机(相同的针孔相机),它将生成与之前进行裁剪操作时相同的新图像,那么这个相机的内参是什么?

英文:

I give the following example to illustrate my question: suppose I have a camera intrinsics matrix that follows the pin-hole camera model, and its intrinsics matrix has the following structure:

 ori_intrinsics= [[fx, 0,  cx,],
                  [0,  fy, cy],
                   [0, 0, 1]]

I also know the image it can generate of size [ori_width, ori_height]. Then now I crop the image in the image position [ori_left, ori_top, ori_right, ori_bottom]. Now I have a new image. Then my question is as follows: image now I have a similar camera(the same pin-hole camera) and it will generate the same new image without any cropping operation as I did before. What will be the camera intrinsics for this camera?

答案1

得分: 1

裁剪图像不会影响焦距,因此fxfy不会改变。唯一会改变的是cxcy,需要根据从左上角裁剪的量进行调整。

如果你通过L, T进行裁剪,则:

  • c_newx = cx - L
  • c_newy = cy - T
英文:

Cropping an image does not affect focal length, so no change to fx, fy. The only thing that will change is cx and cy, and this needs to be adjusted based on how much you have cropped from top-left.

If you crop by L, T, then:

  • c_newx = cx - L and
  • c_newy = cy - T

huangapple
  • 本文由 发表于 2023年8月8日 22:38:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76860614.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定