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

the size of image shrinks #1100

Open
derrick-xwp opened this issue Jan 24, 2021 · 6 comments
Open

the size of image shrinks #1100

derrick-xwp opened this issue Jan 24, 2021 · 6 comments

Comments

@derrick-xwp
Copy link

hi,

I use colmap to reconstruct,
the size of input image is (376, 541)
But the size of image in the output of colmap is (355, 512)
Do you why does this happen?

Thanks

@tsattler
Copy link
Contributor

Is this the image size after dense reconstruction, i.e., the size of the undistorted images?

@derrick-xwp
Copy link
Author

derrick-xwp commented Jan 25, 2021 via email

@tsattler
Copy link
Contributor

As part of the dense reconstruction process, Colmap removes radial (and potentially tangential) distortion from the images. The size of the undistorted images (and the depth maps since they are computed using the undistorted images) typically differs from the size of the original images.

@ahojnnes
Copy link
Contributor

The size of images can change in the image undistortion stage before dense reconstruction. This is because COLMAP automatically crops unobserved regions in the undistorted images, which can occur if you use a camera model which models non-linear distortion (radial/tangential, etc.).

@tom-bu
Copy link

tom-bu commented Apr 13, 2021

The undistortion seems to cut out the majority of each image, leaving only a small part for dense reconstruction. Is that because there's strong radial distortion in my camera? Is there a work around? Is there no way for it to create an undistorted image that is similar to the original image, rather than removing parts of the image that have some distortion?

@hummat
Copy link

hummat commented Apr 27, 2022

Hi @tom-bu you could have a look at OpenCVs getOptimalNewCameraMatrix with alpha=1 to obtain a new camera matrix which preserves pixels.

For reference:

  1. https://stackoverflow.com/questions/39432322/what-does-the-getoptimalnewcameramatrix-do-in-opencv
  2. https://docs.opencv.org/3.3.0/dc/dbb/tutorial_py_calibration.html (under "Undistortion")

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

5 participants