GeometryMath_F32.mult(K_inv, temp0, out);
@Override public void compute(float x, float y, Point2D_F32 out) { out.set(x,y); GeometryMath_F32.mult(K_inv, out, out); } }
/** * Input is in pinhole camera pixel coordinates. Output is in equirectangular coordinates * * @param x Pixel x-coordinate in rendered pinhole camera * @param y Pixel y-coordinate in rendered pinhole camera */ @Override public void compute(int x, int y) { // grab precomputed normalized image coordinate at canonical location Point3D_F32 v = vectors[y*outWidth+x]; // move to requested orientation GeometryMath_F32.mult(R,v,n); // TODO make faster by not using an array based matrix // compute pixel coordinate tools.normToEquiFV(n.x,n.y,n.z,out); distX = out.x; distY = out.y; }
/** * Removes radial distortion * * @param x Distorted x-coordinate pixel * @param y Distorted y-coordinate pixel * @param out Undistorted normalized coordinate. */ @Override public void compute(float x, float y, Point2D_F32 out) { out.x = x; out.y = y; // initial estimate of undistorted point GeometryMath_F32.mult(K_inv, out, out); removeRadial(out.x, out.y, params.radial, params.t1, params.t2, out, tol ); } }
/** * Input is in pinhole camera pixel coordinates. Output is in equirectangular coordinates * * @param x Pixel x-coordinate in rendered pinhole camera * @param y Pixel y-coordinate in rendered pinhole camera */ @Override public void compute(int x, int y) { // grab precomputed normalized image coordinate at canonical location Point3D_F32 v = vectors[y*outWidth+x]; // move to requested orientation GeometryMath_F32.mult(R,v,n); // TODO make faster by not using an array based matrix // compute pixel coordinate tools.normToEquiFV(n.x,n.y,n.z,out); distX = out.x; distY = out.y; }
GeometryMath_F32.mult(K_inv, p2, p2);
GeometryMath_F32.mult(K_inv, p2, p2);
public static Point2D_F32 renderPixel( Se3_F32 worldToCamera , FMatrixRMaj K , Point3D_F32 X ) { Point3D_F32 X_cam = new Point3D_F32(); SePointOps_F32.transform(worldToCamera, X, X_cam); // see if it's behind the camera if( X_cam.z <= 0 ) return null; Point2D_F32 norm = new Point2D_F32(X_cam.x/X_cam.z,X_cam.y/X_cam.z); if( K == null ) return norm; // convert into pixel coordinates return GeometryMath_F32.mult(K, norm, norm); }
/** * Apply the transformation * * @param x x-coordinate of point in pixels. Synthetic narrow FOV camera * @param y y-coordinate of point in pixels. Synthetic narrow FOV camera * @param out Pixel location of point in wide FOV camera. */ @Override public void compute(float x, float y, Point2D_F32 out) { narrowToNorm.compute(x,y, norm); // Convert from 2D homogenous to 3D unit.set( norm.x , norm.y , 1.0f); // Rotate then make it a unit vector GeometryMath_F32.mult(rotateWideToNarrow,unit,unit); float n = unit.norm(); unit.x /= n; unit.y /= n; unit.z /= n; unitToWide.compute(unit.x,unit.y,unit.z,out); }
/** * Apply the transformation * * @param x x-coordinate of point in pixels. Synthetic narrow FOV camera * @param y y-coordinate of point in pixels. Synthetic narrow FOV camera * @param out Pixel location of point in wide FOV camera. */ @Override public void compute(float x, float y, Point2D_F32 out) { narrowToNorm.compute(x,y, norm); // Convert from 2D homogenous to 3D unit.set( norm.x , norm.y , 1.0f); // Rotate then make it a unit vector GeometryMath_F32.mult(rotateWideToNarrow,unit,unit); float n = unit.norm(); unit.x /= n; unit.y /= n; unit.z /= n; unitToWide.compute(unit.x,unit.y,unit.z,out); }