Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

校正后的图片部分像素不见 #9

Open
Suarez0124 opened this issue Jun 8, 2022 · 0 comments
Open

校正后的图片部分像素不见 #9

Suarez0124 opened this issue Jun 8, 2022 · 0 comments

Comments

@Suarez0124
Copy link

def _get_camera_mat_dst(self, camera_mat):
    camera_mat_dst = camera_mat.copy()
    camera_mat_dst[0][0] *= args.FOCAL_SCALE
    camera_mat_dst[1][1] *= args.FOCAL_SCALE
    camera_mat_dst[0][2] = args.FRAME_WIDTH / 2 * args.SIZE_SCALE
    camera_mat_dst[1][2] = args.FRAME_HEIGHT / 2 * args.SIZE_SCALE
    return camera_mat_dst

请问这部分为什么改变焦距与光轴获得新的内参矩阵,我没调用这个函数,直接用原内参,就少了部分像素。
然后我新加了cv2.getOptimalNewCameraMatrix这个获取新的内参矩阵,设置α值
newCameraMatrix, roi = cv2.getOptimalNewCameraMatrix(camera_mat,
dist_coeff,
(int(args.width), int(args.height)),
0.13)
这个函数与博主的函数是同一个原理吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant