Skip to content

ImageProcessing-ElectronicPublications/warp7p

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

GitHub release (latest by date) GitHub Release Date GitHub repo size GitHub all releases GitHub

warp7p

Description

Simple utility to apply 7+1 parameter distortion (k1, k2, p1, p2, k3, cx, cy, mc) 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

  • lodepng.h and lodepng.cpp from LodePNG (for PNG input/output)
  • 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> <output.png> [k1=0.0] [k2=0.0] [p1=0.0] [p2=0.0] [k3=0.0] [cx=0.5] [cy=0.5] [mc=1.0]

Example

warp7p test.png testout.png -0.4 0 -0.05 0.1 0 0.5 0.5 2.0

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 99.9%
  • Makefile 0.1%