Refrax: flat-port refraction removal

Warps an underwater image taken through a flat-port housing into a refraction-free pinhole image, so it can be used directly by tools such as COLMAP. Every pixel is traced through the air–glass–water interfaces onto a scene plane at depth z0, and the resulting map is inverted.

Code · Image-Space Refraction Correction for Underwater 3D Reconstruction: Warping Flat-Port Views into Pinhole Perspective

Loading Python in your browser… the first visit takes about 30 s.

Fills in the camera, housing and depth below; choosing a sample selects its camera.

Camera (in-air calibration)

Uploads of a different size are handled by rescaling these intrinsics.

Housing (lengths in metres)
Correction

Or use your own image

Underwater image
No image
Corrected
Validity mask
new_calibration.yaml
 

A checkerboard (10×10 squares of 10 cm) at depth z0, seen through the housing with the calibration on the left, then corrected.