MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / distort

Method distort

src/libfreenect2.cpp:146–155  ·  view source on GitHub ↗

x,y: undistorted, normalized coordinates xd,yd: distorted, normalized coordinates

Source from the content-addressed store, hash-verified

144 //x,y: undistorted, normalized coordinates
145 //xd,yd: distorted, normalized coordinates
146 void distort(double x, double y, double &xd, double &yd) const
147 {
148 double x2 = x * x;
149 double y2 = y * y;
150 double r2 = x2 + y2;
151 double xy = x * y;
152 double kr = ((k3 * r2 + k2) * r2 + k1) * r2 + 1.0;
153 xd = x*kr + p2*(r2 + 2*x2) + 2*p1*xy;
154 yd = y*kr + p1*(r2 + 2*y2) + 2*p2*xy;
155 }
156
157 //The inverse of distort() using Newton's method
158 //Return true if converged correctly

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected