Colmap Text export - pinhole option

RC’s COLMAP text export currently writes each image as FULL_OPENCV with trailing zero distortion parameters in cameras.txt, even when images are undistorted. This causes compatibility issues with tools like Brush and can crash COLMAP GUI without a project .ini. A quick workaround is to replace FULL_OPENCV with PINHOLE and remove the extra zeros in cameras.txt. A suggested improvement is for RC to offer a “PINHOLE” export option and deduplicate identical cameras, producing clean, ready-to-use COLMAP datasets without manual edits.

Hi, this is not exactly true. The export depends also on the used Prior lens distortion settings. If this is set as No lens distortion for undistorted images, then the exported Cameras.txt shows camera model as Simple_Pinhole.

Hi, yeah sorry I don’t think I was very clear in my explanation. There is an option to export the undistorted images with colmap format, however, the cameras.txt doesn’t use the pinhole option, it just uses a distortion flag, but offers no correction. I think it should be a pinhole flag instead. There are a couple of programs that cannot handle the empty and extra intrinsics in the file, and are unnecessary anyway, because the instructions should be simple pinhole, not a zero correction.

As you can see on the attached images, there is the SIMPLE_PINHOLE option for camera model in the exported cameras.txt file. And it is the same format as there. The params are empty for used and exported undistorted images. Should it be different or do you want just PINHOLE? Should be there also a 0 as a parameter according to you?

Sorry, I didn’t mean to confuse the subject further by mentioning simple pinhole as well as pinhole.

What I’m finding …

On export of colmap format and on attempt to import into Brush for Gaussian splatting, Brush says something about too many camera parameters. If I open the cameras.txt file, delete all the zeros and change all camera flags to “pinhole”, then everything imports and works fine.

I’m just wondering why when exporting undistorted images from RC, why it doesn’t just select the pinhole flag instead of setting it as a distorted camera, but with zero corrections? Seems that isn’t correct, but this is beyond my knowledge, so sorry if this is just none sense!!

PINHOLE/SIMPLE_PINHOLE is used if your images are undistorted a priori. When not, the other formats are used. To use the images as undistorted (when they are) you need to use the settings mentioned above (Prior: Fixed, Camera model: No lens distortion). Then the exported COLMAP has the wanted camera model.

Ok, thanks for the clarification.

So, rather than RC setting the colmap transforms to pinhole (when selecting the undistorted image export) the cameras.txt will say radial with zero lens corrections? Is that right?

When the images are undistorted a priori and applying that as a setting for the images, then the exported file has pinhole camera model directly. Otherwise as you wrote (which is following the COLMAP’s specification page).

Ok, thanks for the patience to explain. Cheers.

Hi again, having had a chat with the dev for “Brush” Gaussian splatting software on why there is a problem here, and then confirming this with AI, it appears reality capture isn’t exporting the correct number of intrinsics here. This is the response from AI….

Looking at your COLMAP camera CSV format, I can see the issue. You have only 6 parameters listed instead of 12.

For the FULL_OPENCV camera model in COLMAP, you need 12 distortion parameters:

  • fx, fy, cx, cy (4 intrinsic parameters - which you have)
  • k1, k2, p1, p2, k3, k4, k5, k6 (8 distortion coefficients - which you’re missing 2 of)

Your current line shows:

109 FULL_OPENCV 2962 1941 1032.446808510638 1032.446808510638 1481 970.5000000000001 0 0 0 0 0 0

Breaking this down:

  • Camera ID: 109
  • Model: FULL_OPENCV
  • Width: 2962
  • Height: 1941
  • fx: 1032.446808510638
  • fy: 1032.446808510638
  • cx: 1481
  • cy: 970.5000000000001
  • k1-k6: 0 0 0 0 0 0 (only 6 distortion parameters)

You’re missing p1 and p2 (the tangential distortion coefficients).

The correct format should be:

109 FULL_OPENCV 2962 1941 1032.446808510638 1032.446808510638 1481 970.5000000000001 0 0 0 0 0 0 0 0

The parameter order should be: fx fy cx cy k1 k2 p1 p2 k3 k4 k5 k6

Hi @PLAN8.EARTH

We are aware of this issue and it will be solved in the next release.

Just to correct you we are missing k5 and k6 parameters in the file.

Thank you for your notification!

1 Like

Ahh OK, glad we got to the bottom of this and thanks for your patience.