Skip to content

Apply 7 camera distortion parameters to an image.

Notifications You must be signed in to change notification settings

rosslovas/warp7p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

warp7p

Simple utility to apply 7 parameter distortion (k1, k2, p1, p2, k3, cx, cy) to an image as per the equations here. Made for the sake of learning and to demonstrate the effects of the individual parameters for a university project on camera calibration. Uses nearest neighbour interpolation.

Requires that lodepng.h and lodepng.cpp from LodePNG (for PNG input/output) and nanoflann.hpp from nanoflann (for fast approximate nearest neighbour interpolation with a KD-tree) are present in the source directory, alongside main.cpp.

Usage: warp7p <input.png> <k1> <k2> <p1> <p2> <k3> <cx> <cy>

Example: warp7p test.png -0.4 0 -0.05 0.1 0 0.5 0.5
Where test.png is:
test.png
Produces the resulting out.png:
out.png

The effects of individual parameters:

k1 (positive)
k1.png
k1 (negative)
k1n.png
k2
k2.png
k3
k3.png
p1
p1.png
p2
p2.png

License: GPLv2

About

Apply 7 camera distortion parameters to an image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published