@Override public int computeResiduals(AssociatedPair p, double[] residuals, int index) { GeometryMath_F64.mult(H, p.p1, temp); residuals[index++] = temp.x-p.p2.x; residuals[index++] = temp.y-p.p2.y; return index; }
/** * Specifies the rotation offset from the canonical location using yaw and pitch. * @param yaw Radian from -pi to pi * @param pitch Radian from -pi/2 to pi/2 * @param roll Radian from -pi to pi */ public void setDirection(float yaw, float pitch, float roll ) { ConvertRotation3D_F32.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R); }
/** * Specifies the rotation offset from the canonical location using yaw and pitch. * @param yaw Radian from -pi to pi * @param pitch Radian from -pi/2 to pi/2 * @param roll Radian from -pi to pi */ public void setDirection(double yaw, double pitch, double roll ) { ConvertRotation3D_F64.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R); }
public double getFeatureRadius() { double r = UtilPoint2D_I32.distance(target,current); if( r < 1 ) return 1; return r; }
/** * U=[a,b,hat(a)*b] */ private void setU( DMatrixRMaj U, Vector3D_F64 a , Vector3D_F64 b ) { setColumn(U, 0, a); setColumn(U, 1, b); GeometryMath_F64.cross(a, b, tempV); setColumn(U, 2, tempV); }
@Override public double computeResidual(AssociatedPair observation) { GeometryMath_F64.multTran(F,observation.p2,temp); return temp.x*observation.p1.x + temp.y*observation.p1.y + temp.z; } }
/** * <p> * Applies the epipolar relationship constraint to an essential or fundamental matrix:<br> * 0 = p2<sup>T</sup>*F*p1<br> * Input points are in normalized image coordinates for an essential matrix and pixels for * fundamental. * </p> * * @param F 3x3 essential or fundamental matrix. * @param p1 Point in view 1. * @param p2 Point in view 2. * @return Constraint value. */ public static double constraint( DMatrixRMaj F , Point2D_F64 p1, Point2D_F64 p2 ) { return GeometryMath_F64.innerProd(p2,F,p1); }
/** * Converts equirectangular into normalized pointing vector * * @param x pixel coordinate in equirectangular image * @param y pixel coordinate in equirectangular image * @param norm Normalized pointing vector */ public void equiToNorm(float x , float y , Point3D_F32 norm ) { equiToLatLon(x,y, temp); ConvertCoordinates3D_F32.latlonToUnitVector(temp.lat,temp.lon, norm); }
@Override public void setModel(LinePolar2D_F32 lineParam) { UtilLine2D_F32.convert(lineParam,line); theta = lineParam.angle; }
@Override public boolean initialize(T image, Quadrilateral_F64 location) { UtilPolygons2D_F64.bounding(location, rect); int width = (int)(rect.p1.x - rect.p0.x); int height = (int)(rect.p1.y - rect.p0.y); tracker.initialize(image,(int)rect.p0.x,(int)rect.p0.y,width,height); return true; }
@Override public double computeResidual(AssociatedPair observation) { double bottom = 0; GeometryMath_F64.mult(F, observation.p1, temp); bottom += temp.x*temp.x + temp.y*temp.y; GeometryMath_F64.multTran(F, observation.p2, temp); bottom += temp.x*temp.x + temp.y*temp.y; if( bottom == 0) { return Double.MAX_VALUE; } else { GeometryMath_F64.multTran(F,observation.p2,temp); return (temp.x*observation.p1.x + temp.y*observation.p1.y + temp.z)/bottom; } } }
@Override public int computeResiduals(AssociatedPair p, double[] residuals, int index) { GeometryMath_F64.mult(H, p.p1, temp); residuals[index++] = temp.x-p.p2.x; residuals[index++] = temp.y-p.p2.y; return index; }
/** * Specifies the rotation offset from the canonical location using yaw and pitch. * @param yaw Radian from -pi to pi * @param pitch Radian from -pi/2 to pi/2 * @param roll Radian from -pi to pi */ public void setDirection(double yaw, double pitch, double roll ) { ConvertRotation3D_F64.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R); }
/** * Specifies the rotation offset from the canonical location using yaw and pitch. * @param yaw Radian from -pi to pi * @param pitch Radian from -pi/2 to pi/2 * @param roll Radian from -pi to pi */ public void setDirection(float yaw, float pitch, float roll ) { ConvertRotation3D_F32.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R); }
public double getFeatureRadius() { double r = UtilPoint2D_I32.distance(target,current); if( r < 1 ) return 1; return r; }
@Override public double computeResidual(AssociatedPair observation) { GeometryMath_F64.multTran(F,observation.p2,temp); return temp.x*observation.p1.x + temp.y*observation.p1.y + temp.z; } }
/** * <p> * Applies the epipolar relationship constraint to an essential or fundamental matrix:<br> * 0 = p2<sup>T</sup>*F*p1<br> * Input points are in normalized image coordinates for an essential matrix and pixels for * fundamental. * </p> * * @param F 3x3 essential or fundamental matrix. * @param p1 Point in view 1. * @param p2 Point in view 2. * @return Constraint value. */ public static double constraint( DenseMatrix64F F , Point2D_F64 p1, Point2D_F64 p2 ) { return GeometryMath_F64.innerProd(p2,F,p1); }
@Override public double computeResidual(AssociatedPair observation) { double bottom = 0; GeometryMath_F64.mult(K2E, observation.p1, temp); bottom += temp.x*temp.x + temp.y*temp.y; GeometryMath_F64.multTran(EK1, observation.p2, temp); bottom += temp.x*temp.x + temp.y*temp.y; if( bottom == 0) { return Double.MAX_VALUE; } else { GeometryMath_F64.multTran(E,observation.p2,temp); return (temp.x*observation.p1.x + temp.y*observation.p1.y + temp.z)/bottom; } } }
@Override public void compute(double x, double y, Point2D_F64 out) { out.set(x,y); GeometryMath_F64.mult(K_inv, out, out); } }