You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this great project. I have a question. I have successfully undistorted my RGB images into ideal pinhole intrinsics with command line colmap image_undistorter. But my masks keep the original size. How can I undistort my masks?
Thank you so much for your help.
Reacted by Saswat Subhajyoti, Simon Niedermayr and laserpanda
Just don't let Colmap to resize/crop images in images files.
How?
Use two parameters
--max_image_size xxxx yyyy
(where xxxx is width and yyyy height that you want to keep)
and
--min_scale x
(x defaul in Colmap 3.8 is 0.2, set it around 0.96 to 1.04. Experiment with it)
Check if Colmap do images in size that you want and you can keep masks.
Export data from COLMAP using File\Export model as text menu.
Replace in exported images.txt file all .jpg occurrences with .jpg.png.
Run this command: COLMAP.bat image_undistorter --image_path "<original masks folder>" --input_path "<exported text data folder>" --output_path "<new folder with results>" --output_type COLMAP
I am working on adding an optional mask_path to image_undistorter (COLMAP output) and pycolmap.undistort_images. The masks will use the same output camera/crop/resolution as their images, with nearest-neighbor sampling and PNG output under masks/. I plan to keep the existing image mask naming convention, validate masks for selected images, and cover distortion, downscaling, and already-undistorted images with regression tests.
Activity
jaco001 commentedon Jan 25, 2024
Just don't let Colmap to resize/crop images in images files.
How?
Use two parameters
--max_image_size xxxx yyyy
(where xxxx is width and yyyy height that you want to keep)
and
--min_scale x
(x defaul in Colmap 3.8 is 0.2, set it around 0.96 to 1.04. Experiment with it)
Check if Colmap do images in size that you want and you can keep masks.
saswat0 commentedon Oct 5, 2024
@ckrsls Were you able to find a workaround?
xiety commentedon Oct 18, 2026
I use this workaround:
File\Export model as textmenu.images.txtfile all.jpgoccurrences with.jpg.png.COLMAP.bat image_undistorter --image_path "<original masks folder>" --input_path "<exported text data folder>" --output_path "<new folder with results>" --output_type COLMAPcola1917 commentedon Oct 27, 2026
I am working on adding an optional mask_path to image_undistorter (COLMAP output) and pycolmap.undistort_images. The masks will use the same output camera/crop/resolution as their images, with nearest-neighbor sampling and PNG output under masks/. I plan to keep the existing image mask naming convention, validate masks for selected images, and cover distortion, downscaling, and already-undistorted images with regression tests.
laserpanda commentedon Nov 2, 2026
sorry to open up this again.
how about using the alpha from png as mask and also write the undistorted alpha into the undistorted images?