repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java | SnapToEllipseEdge.change | protected static double change( EllipseRotated_F64 a , EllipseRotated_F64 b ) {
double total = 0;
total += Math.abs(a.center.x - b.center.x);
total += Math.abs(a.center.y - b.center.y);
total += Math.abs(a.a - b.a);
total += Math.abs(a.b - b.b);
// only care about the change of angle when it is not a circ... | java | protected static double change( EllipseRotated_F64 a , EllipseRotated_F64 b ) {
double total = 0;
total += Math.abs(a.center.x - b.center.x);
total += Math.abs(a.center.y - b.center.y);
total += Math.abs(a.a - b.a);
total += Math.abs(a.b - b.b);
// only care about the change of angle when it is not a circ... | [
"protected",
"static",
"double",
"change",
"(",
"EllipseRotated_F64",
"a",
",",
"EllipseRotated_F64",
"b",
")",
"{",
"double",
"total",
"=",
"0",
";",
"total",
"+=",
"Math",
".",
"abs",
"(",
"a",
".",
"center",
".",
"x",
"-",
"b",
".",
"center",
".",
... | Computes a numerical value for the difference in parameters between the two ellipses | [
"Computes",
"a",
"numerical",
"value",
"for",
"the",
"difference",
"in",
"parameters",
"between",
"the",
"two",
"ellipses"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java#L116-L129 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java | FactoryVisualOdometry.monoPlaneInfinity | public static <T extends ImageGray<T>>
MonocularPlaneVisualOdometry<T> monoPlaneInfinity(int thresholdAdd,
int thresholdRetire,
double inlierPixelTol,
int ransacIterations,
PointTracker<T> tracker,
ImageType<T> imageType) {
//squared pixel... | java | public static <T extends ImageGray<T>>
MonocularPlaneVisualOdometry<T> monoPlaneInfinity(int thresholdAdd,
int thresholdRetire,
double inlierPixelTol,
int ransacIterations,
PointTracker<T> tracker,
ImageType<T> imageType) {
//squared pixel... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"MonocularPlaneVisualOdometry",
"<",
"T",
">",
"monoPlaneInfinity",
"(",
"int",
"thresholdAdd",
",",
"int",
"thresholdRetire",
",",
"double",
"inlierPixelTol",
",",
"int",
"ransacIterations"... | Monocular plane based visual odometry algorithm which uses both points on the plane and off plane for motion
estimation.
@see VisOdomMonoPlaneInfinity
@param thresholdAdd New points are spawned when the number of on plane inliers drops below this value.
@param thresholdRetire Tracks are dropped when they are not con... | [
"Monocular",
"plane",
"based",
"visual",
"odometry",
"algorithm",
"which",
"uses",
"both",
"points",
"on",
"the",
"plane",
"and",
"off",
"plane",
"for",
"motion",
"estimation",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java#L94-L118 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java | FactoryVisualOdometry.monoPlaneOverhead | public static <T extends ImageGray<T>>
MonocularPlaneVisualOdometry<T> monoPlaneOverhead(double cellSize,
double maxCellsPerPixel,
double mapHeightFraction ,
double inlierGroundTol,
int ransacIterations ,
int thresholdRetire ,
... | java | public static <T extends ImageGray<T>>
MonocularPlaneVisualOdometry<T> monoPlaneOverhead(double cellSize,
double maxCellsPerPixel,
double mapHeightFraction ,
double inlierGroundTol,
int ransacIterations ,
int thresholdRetire ,
... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"MonocularPlaneVisualOdometry",
"<",
"T",
">",
"monoPlaneOverhead",
"(",
"double",
"cellSize",
",",
"double",
"maxCellsPerPixel",
",",
"double",
"mapHeightFraction",
",",
"double",
"inlierGr... | Monocular plane based visual odometry algorithm which creates a synthetic overhead view and tracks image
features inside this synthetic view.
@see VisOdomMonoOverheadMotion2D
@param cellSize (Overhead) size of ground cells in overhead image in world units
@param maxCellsPerPixel (Overhead) Specifies the minimum resol... | [
"Monocular",
"plane",
"based",
"visual",
"odometry",
"algorithm",
"which",
"creates",
"a",
"synthetic",
"overhead",
"view",
"and",
"tracks",
"image",
"features",
"inside",
"this",
"synthetic",
"view",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java#L145-L170 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java | FactoryVisualOdometry.stereoDepth | public static <T extends ImageGray<T>>
StereoVisualOdometry<T> stereoDepth(double inlierPixelTol,
int thresholdAdd,
int thresholdRetire ,
int ransacIterations ,
int refineIterations ,
boolean doublePass ,
StereoDisparitySparse<T> sparseDisparity,
Po... | java | public static <T extends ImageGray<T>>
StereoVisualOdometry<T> stereoDepth(double inlierPixelTol,
int thresholdAdd,
int thresholdRetire ,
int ransacIterations ,
int refineIterations ,
boolean doublePass ,
StereoDisparitySparse<T> sparseDisparity,
Po... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"StereoVisualOdometry",
"<",
"T",
">",
"stereoDepth",
"(",
"double",
"inlierPixelTol",
",",
"int",
"thresholdAdd",
",",
"int",
"thresholdRetire",
",",
"int",
"ransacIterations",
",",
"in... | Stereo vision based visual odometry algorithm which runs a sparse feature tracker in the left camera and
estimates the range of tracks once when first detected using disparity between left and right cameras.
@see VisOdomPixelDepthPnP
@param thresholdAdd Add new tracks when less than this number are in the inlier set.... | [
"Stereo",
"vision",
"based",
"visual",
"odometry",
"algorithm",
"which",
"runs",
"a",
"sparse",
"feature",
"tracker",
"in",
"the",
"left",
"camera",
"and",
"estimates",
"the",
"range",
"of",
"tracks",
"once",
"when",
"first",
"detected",
"using",
"disparity",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java#L185-L222 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java | FactoryVisualOdometry.depthDepthPnP | public static <Vis extends ImageGray<Vis>, Depth extends ImageGray<Depth>>
DepthVisualOdometry<Vis,Depth> depthDepthPnP(double inlierPixelTol,
int thresholdAdd,
int thresholdRetire ,
int ransacIterations ,
int refineIterations ,
boolean doublePass ,
... | java | public static <Vis extends ImageGray<Vis>, Depth extends ImageGray<Depth>>
DepthVisualOdometry<Vis,Depth> depthDepthPnP(double inlierPixelTol,
int thresholdAdd,
int thresholdRetire ,
int ransacIterations ,
int refineIterations ,
boolean doublePass ,
... | [
"public",
"static",
"<",
"Vis",
"extends",
"ImageGray",
"<",
"Vis",
">",
",",
"Depth",
"extends",
"ImageGray",
"<",
"Depth",
">",
">",
"DepthVisualOdometry",
"<",
"Vis",
",",
"Depth",
">",
"depthDepthPnP",
"(",
"double",
"inlierPixelTol",
",",
"int",
"thresh... | Depth sensor based visual odometry algorithm which runs a sparse feature tracker in the visual camera and
estimates the range of tracks once when first detected using the depth sensor.
@see VisOdomPixelDepthPnP
@param thresholdAdd Add new tracks when less than this number are in the inlier set. Tracker dependent. Se... | [
"Depth",
"sensor",
"based",
"visual",
"odometry",
"algorithm",
"which",
"runs",
"a",
"sparse",
"feature",
"tracker",
"in",
"the",
"visual",
"camera",
"and",
"estimates",
"the",
"range",
"of",
"tracks",
"once",
"when",
"first",
"detected",
"using",
"the",
"dept... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java#L238-L275 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java | FactoryVisualOdometry.stereoDualTrackerPnP | public static <T extends ImageGray<T>, Desc extends TupleDesc>
StereoVisualOdometry<T> stereoDualTrackerPnP(int thresholdAdd, int thresholdRetire,
double inlierPixelTol,
double epipolarPixelTol,
int ransacIterations,
int refineIterations,
PointTracker<T>... | java | public static <T extends ImageGray<T>, Desc extends TupleDesc>
StereoVisualOdometry<T> stereoDualTrackerPnP(int thresholdAdd, int thresholdRetire,
double inlierPixelTol,
double epipolarPixelTol,
int ransacIterations,
int refineIterations,
PointTracker<T>... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"Desc",
"extends",
"TupleDesc",
">",
"StereoVisualOdometry",
"<",
"T",
">",
"stereoDualTrackerPnP",
"(",
"int",
"thresholdAdd",
",",
"int",
"thresholdRetire",
",",
"double",
"inlierPixelTo... | Creates a stereo visual odometry algorithm that independently tracks features in left and right camera.
@see VisOdomDualTrackPnP
@param thresholdAdd When the number of inliers is below this number new features are detected
@param thresholdRetire When a feature has not been in the inlier list for this many ticks it is... | [
"Creates",
"a",
"stereo",
"visual",
"odometry",
"algorithm",
"that",
"independently",
"tracks",
"features",
"in",
"left",
"and",
"right",
"camera",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryVisualOdometry.java#L293-L340 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.computeCameraControl | public static void computeCameraControl(double beta[],
List<Point3D_F64> nullPts[],
FastQueue<Point3D_F64> cameraPts ,
int numControl )
{
cameraPts.reset();
for( int i = 0; i < numControl; i++ ) {
cameraPts.grow().set(0,0,0);
}
for( int i = 0; i < numControl; i++ ) {
dou... | java | public static void computeCameraControl(double beta[],
List<Point3D_F64> nullPts[],
FastQueue<Point3D_F64> cameraPts ,
int numControl )
{
cameraPts.reset();
for( int i = 0; i < numControl; i++ ) {
cameraPts.grow().set(0,0,0);
}
for( int i = 0; i < numControl; i++ ) {
dou... | [
"public",
"static",
"void",
"computeCameraControl",
"(",
"double",
"beta",
"[",
"]",
",",
"List",
"<",
"Point3D_F64",
">",
"nullPts",
"[",
"]",
",",
"FastQueue",
"<",
"Point3D_F64",
">",
"cameraPts",
",",
"int",
"numControl",
")",
"{",
"cameraPts",
".",
"r... | Computes the camera control points as weighted sum of null points.
@param beta Beta values which describe the weights of null points
@param nullPts Null points that the camera point is a weighted sum of
@param cameraPts The output | [
"Computes",
"the",
"camera",
"control",
"points",
"as",
"weighted",
"sum",
"of",
"null",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L41-L63 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix6x3 | public static void constraintMatrix6x3( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x3 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x3.data[index++] = L_6x10.get(i,0);
L_6x3.data[index++] = L_6x10.get(i,1);
L_6x3.data[index++] = L_6x10.get(i,4);
}
} | java | public static void constraintMatrix6x3( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x3 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x3.data[index++] = L_6x10.get(i,0);
L_6x3.data[index++] = L_6x10.get(i,1);
L_6x3.data[index++] = L_6x10.get(i,4);
}
} | [
"public",
"static",
"void",
"constraintMatrix6x3",
"(",
"DMatrixRMaj",
"L_6x10",
",",
"DMatrixRMaj",
"L_6x3",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"6",
";",
"i",
"++",
")",
"{",
"L_6x3",
".",
"da... | Extracts the linear constraint matrix for case 2 from the full 6x10 constraint matrix. | [
"Extracts",
"the",
"linear",
"constraint",
"matrix",
"for",
"case",
"2",
"from",
"the",
"full",
"6x10",
"constraint",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L82-L90 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix6x6 | public static void constraintMatrix6x6( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x6 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x6.data[index++] = L_6x10.get(i,0);
L_6x6.data[index++] = L_6x10.get(i,1);
L_6x6.data[index++] = L_6x10.get(i,2);
L_6x6.data[index++] = L_6x10.get(i,4);
L_6x6.data[inde... | java | public static void constraintMatrix6x6( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x6 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x6.data[index++] = L_6x10.get(i,0);
L_6x6.data[index++] = L_6x10.get(i,1);
L_6x6.data[index++] = L_6x10.get(i,2);
L_6x6.data[index++] = L_6x10.get(i,4);
L_6x6.data[inde... | [
"public",
"static",
"void",
"constraintMatrix6x6",
"(",
"DMatrixRMaj",
"L_6x10",
",",
"DMatrixRMaj",
"L_6x6",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"6",
";",
"i",
"++",
")",
"{",
"L_6x6",
".",
"da... | Extracts the linear constraint matrix for case 3 from the full 6x10 constraint matrix. | [
"Extracts",
"the",
"linear",
"constraint",
"matrix",
"for",
"case",
"3",
"from",
"the",
"full",
"6x10",
"constraint",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L95-L106 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix3x3 | public static void constraintMatrix3x3( DMatrixRMaj L_3x6 ,
DMatrixRMaj L_6x3 ) {
int index = 0;
for( int i = 0; i < 3; i++ ) {
L_6x3.data[index++] = L_3x6.get(i,0);
L_6x3.data[index++] = L_3x6.get(i,1);
L_6x3.data[index++] = L_3x6.get(i,3);
}
} | java | public static void constraintMatrix3x3( DMatrixRMaj L_3x6 ,
DMatrixRMaj L_6x3 ) {
int index = 0;
for( int i = 0; i < 3; i++ ) {
L_6x3.data[index++] = L_3x6.get(i,0);
L_6x3.data[index++] = L_3x6.get(i,1);
L_6x3.data[index++] = L_3x6.get(i,3);
}
} | [
"public",
"static",
"void",
"constraintMatrix3x3",
"(",
"DMatrixRMaj",
"L_3x6",
",",
"DMatrixRMaj",
"L_6x3",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"L_6x3",
".",
"dat... | Extracts the linear constraint matrix for planar case 2 from the full 4x6 constraint matrix. | [
"Extracts",
"the",
"linear",
"constraint",
"matrix",
"for",
"planar",
"case",
"2",
"from",
"the",
"full",
"4x6",
"constraint",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L194-L203 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix3x6 | public static void constraintMatrix3x6( DMatrixRMaj L , DMatrixRMaj y ,
FastQueue<Point3D_F64> controlWorldPts ,
List<Point3D_F64> nullPts[] ) {
int row = 0;
for( int i = 0; i < 3; i++ ) {
Point3D_F64 ci = controlWorldPts.get(i);
Point3D_F64 vai = nullPts[0].get(i);
Point3D_F64 vbi = ... | java | public static void constraintMatrix3x6( DMatrixRMaj L , DMatrixRMaj y ,
FastQueue<Point3D_F64> controlWorldPts ,
List<Point3D_F64> nullPts[] ) {
int row = 0;
for( int i = 0; i < 3; i++ ) {
Point3D_F64 ci = controlWorldPts.get(i);
Point3D_F64 vai = nullPts[0].get(i);
Point3D_F64 vbi = ... | [
"public",
"static",
"void",
"constraintMatrix3x6",
"(",
"DMatrixRMaj",
"L",
",",
"DMatrixRMaj",
"y",
",",
"FastQueue",
"<",
"Point3D_F64",
">",
"controlWorldPts",
",",
"List",
"<",
"Point3D_F64",
">",
"nullPts",
"[",
"]",
")",
"{",
"int",
"row",
"=",
"0",
... | Linear constraint matrix for case 4 in the planar case
@param L Constraint matrix
@param y Vector containing distance between world control points
@param controlWorldPts List of world control points
@param nullPts Null points | [
"Linear",
"constraint",
"matrix",
"for",
"case",
"4",
"in",
"the",
"planar",
"case"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L213-L259 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.jacobian_Control4 | public static void jacobian_Control4( DMatrixRMaj L_full ,
double beta[] , DMatrixRMaj A )
{
int indexA = 0;
double b0 = beta[0]; double b1 = beta[1]; double b2 = beta[2]; double b3 = beta[3];
final double ld[] = L_full.data;
for( int i = 0; i < 6; i++ ) {
int li = L_full.numCols*i;
A.data... | java | public static void jacobian_Control4( DMatrixRMaj L_full ,
double beta[] , DMatrixRMaj A )
{
int indexA = 0;
double b0 = beta[0]; double b1 = beta[1]; double b2 = beta[2]; double b3 = beta[3];
final double ld[] = L_full.data;
for( int i = 0; i < 6; i++ ) {
int li = L_full.numCols*i;
A.data... | [
"public",
"static",
"void",
"jacobian_Control4",
"(",
"DMatrixRMaj",
"L_full",
",",
"double",
"beta",
"[",
"]",
",",
"DMatrixRMaj",
"A",
")",
"{",
"int",
"indexA",
"=",
"0",
";",
"double",
"b0",
"=",
"beta",
"[",
"0",
"]",
";",
"double",
"b1",
"=",
"... | Computes the Jacobian given 4 control points. | [
"Computes",
"the",
"Jacobian",
"given",
"4",
"control",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L316-L332 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.jacobian_Control3 | public static void jacobian_Control3( DMatrixRMaj L_full ,
double beta[] , DMatrixRMaj A)
{
int indexA = 0;
double b0 = beta[0]; double b1 = beta[1]; double b2 = beta[2];
final double ld[] = L_full.data;
for( int i = 0; i < 3; i++ ) {
int li = L_full.numCols*i;
A.data[indexA++] = 2*ld[li+... | java | public static void jacobian_Control3( DMatrixRMaj L_full ,
double beta[] , DMatrixRMaj A)
{
int indexA = 0;
double b0 = beta[0]; double b1 = beta[1]; double b2 = beta[2];
final double ld[] = L_full.data;
for( int i = 0; i < 3; i++ ) {
int li = L_full.numCols*i;
A.data[indexA++] = 2*ld[li+... | [
"public",
"static",
"void",
"jacobian_Control3",
"(",
"DMatrixRMaj",
"L_full",
",",
"double",
"beta",
"[",
"]",
",",
"DMatrixRMaj",
"A",
")",
"{",
"int",
"indexA",
"=",
"0",
";",
"double",
"b0",
"=",
"beta",
"[",
"0",
"]",
";",
"double",
"b1",
"=",
"... | Computes the Jacobian given 3 control points. | [
"Computes",
"the",
"Jacobian",
"given",
"3",
"control",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L337-L352 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseOpticalFlowBlockPyramid.java | DenseOpticalFlowBlockPyramid.process | public void process( ImagePyramid<T> pyramidPrev , ImagePyramid<T> pyramidCurr ) {
InputSanityCheck.checkSameShape(pyramidPrev, pyramidCurr);
int numLayers = pyramidPrev.getNumLayers();
for( int i = numLayers-1; i >= 0; i-- ) {
T prev = pyramidPrev.getLayer(i);
T curr = pyramidCurr.getLayer(i);
flow... | java | public void process( ImagePyramid<T> pyramidPrev , ImagePyramid<T> pyramidCurr ) {
InputSanityCheck.checkSameShape(pyramidPrev, pyramidCurr);
int numLayers = pyramidPrev.getNumLayers();
for( int i = numLayers-1; i >= 0; i-- ) {
T prev = pyramidPrev.getLayer(i);
T curr = pyramidCurr.getLayer(i);
flow... | [
"public",
"void",
"process",
"(",
"ImagePyramid",
"<",
"T",
">",
"pyramidPrev",
",",
"ImagePyramid",
"<",
"T",
">",
"pyramidCurr",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"pyramidPrev",
",",
"pyramidCurr",
")",
";",
"int",
"numLayers",
"=",
... | Computes the optical flow form 'prev' to 'curr' and stores the output into output
@param pyramidPrev Previous image
@param pyramidCurr Current image | [
"Computes",
"the",
"optical",
"flow",
"form",
"prev",
"to",
"curr",
"and",
"stores",
"the",
"output",
"into",
"output"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseOpticalFlowBlockPyramid.java#L103-L179 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java | EquirectangularDistortBase_F64.setDirection | public void setDirection(double yaw, double pitch, double roll ) {
ConvertRotation3D_F64.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R);
} | java | public void setDirection(double yaw, double pitch, double roll ) {
ConvertRotation3D_F64.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R);
} | [
"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 | [
"Specifies",
"the",
"rotation",
"offset",
"from",
"the",
"canonical",
"location",
"using",
"yaw",
"and",
"pitch",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java#L69-L71 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java | EquirectangularDistortBase_F64.declareVectors | protected void declareVectors( int width , int height ) {
this.outWidth = width;
if( vectors.length < width*height ) {
Point3D_F64[] tmp = new Point3D_F64[width*height];
System.arraycopy(vectors,0,tmp,0,vectors.length);
for (int i = vectors.length; i < tmp.length; i++) {
tmp[i] = new Point3D_F64();
... | java | protected void declareVectors( int width , int height ) {
this.outWidth = width;
if( vectors.length < width*height ) {
Point3D_F64[] tmp = new Point3D_F64[width*height];
System.arraycopy(vectors,0,tmp,0,vectors.length);
for (int i = vectors.length; i < tmp.length; i++) {
tmp[i] = new Point3D_F64();
... | [
"protected",
"void",
"declareVectors",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"this",
".",
"outWidth",
"=",
"width",
";",
"if",
"(",
"vectors",
".",
"length",
"<",
"width",
"*",
"height",
")",
"{",
"Point3D_F64",
"[",
"]",
"tmp",
"=",
"... | Declares storage for precomputed pointing vectors to output image
@param width output image width
@param height output image height | [
"Declares",
"storage",
"for",
"precomputed",
"pointing",
"vectors",
"to",
"output",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java#L87-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyScale | public void polyScale(GrowQueue_I8 input , int scale , GrowQueue_I8 output) {
output.resize(input.size);
for (int i = 0; i < input.size; i++) {
output.data[i] = (byte)multiply(input.data[i]&0xFF, scale);
}
} | java | public void polyScale(GrowQueue_I8 input , int scale , GrowQueue_I8 output) {
output.resize(input.size);
for (int i = 0; i < input.size; i++) {
output.data[i] = (byte)multiply(input.data[i]&0xFF, scale);
}
} | [
"public",
"void",
"polyScale",
"(",
"GrowQueue_I8",
"input",
",",
"int",
"scale",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"input",
".",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"input",
".",
... | Scales the polynomial.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param input Input polynomial.
@param scale scale
@param output Output polynomial. | [
"Scales",
"the",
"polynomial",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L129-L136 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyAdd | public void polyAdd(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0,polyA.size-polyB.s... | java | public void polyAdd(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0,polyA.size-polyB.s... | [
"public",
"void",
"polyAdd",
"(",
"GrowQueue_I8",
"polyA",
",",
"GrowQueue_I8",
"polyB",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"Math",
".",
"max",
"(",
"polyA",
".",
"size",
",",
"polyB",
".",
"size",
")",
")",
";",
"//... | Adds two polynomials together. output = polyA + polyB
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param polyA (Input) First polynomial
@param polyB (Input) Second polynomial
@param output (Output) Results of addition | [
"Adds",
"two",
"polynomials",
"together",
".",
"output",
"=",
"polyA",
"+",
"polyB"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L147-L164 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyAdd_S | public void polyAdd_S(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
int M = Math.min(polyA.size, polyB.size);
for (int i = M; i < polyA.size; i++) {
output.data[i] = polyA.data[i];
}
for (int i = M; i < polyB.size; i++) {
output.data[i... | java | public void polyAdd_S(GrowQueue_I8 polyA , GrowQueue_I8 polyB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
int M = Math.min(polyA.size, polyB.size);
for (int i = M; i < polyA.size; i++) {
output.data[i] = polyA.data[i];
}
for (int i = M; i < polyB.size; i++) {
output.data[i... | [
"public",
"void",
"polyAdd_S",
"(",
"GrowQueue_I8",
"polyA",
",",
"GrowQueue_I8",
"polyB",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"Math",
".",
"max",
"(",
"polyA",
".",
"size",
",",
"polyB",
".",
"size",
")",
")",
";",
"... | Adds two polynomials together.
<p>Coefficients for smallest powers are first, e.g. 2*x**3 + 8*x**2+1 = [1,0,2,8]</p>
@param polyA (Input) First polynomial
@param polyB (Input) Second polynomial
@param output (Output) Results of addition | [
"Adds",
"two",
"polynomials",
"together",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L175-L189 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyAddScaleB | public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0... | java | public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0... | [
"public",
"void",
"polyAddScaleB",
"(",
"GrowQueue_I8",
"polyA",
",",
"GrowQueue_I8",
"polyB",
",",
"int",
"scaleB",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"Math",
".",
"max",
"(",
"polyA",
".",
"size",
",",
"polyB",
".",
... | Adds two polynomials together while scaling the second.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param polyA (Input) First polynomial
@param polyB (Input) Second polynomial
@param scaleB (Input) Scale factor applied to polyB
@param output (Output) Results of addition | [
"Adds",
"two",
"polynomials",
"together",
"while",
"scaling",
"the",
"second",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L201-L218 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyEval | public int polyEval(GrowQueue_I8 input , int x ) {
int y = input.data[0]&0xFF;
for (int i = 1; i < input.size; i++) {
y = multiply(y,x) ^ (input.data[i]&0xFF);
}
return y;
} | java | public int polyEval(GrowQueue_I8 input , int x ) {
int y = input.data[0]&0xFF;
for (int i = 1; i < input.size; i++) {
y = multiply(y,x) ^ (input.data[i]&0xFF);
}
return y;
} | [
"public",
"int",
"polyEval",
"(",
"GrowQueue_I8",
"input",
",",
"int",
"x",
")",
"{",
"int",
"y",
"=",
"input",
".",
"data",
"[",
"0",
"]",
"&",
"0xFF",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"input",
".",
"size",
";",
"i",
"++... | Evaluate the polynomial using Horner's method. Avoids explicit calculating the powers of x.
<p>01x**4 + 0fx**3 + 36x**2 + 78x + 40 = (((01 x + 0f) x + 36) x + 78) x + 40</p>
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param input Polynomial being evaluated
@param x Value of... | [
"Evaluate",
"the",
"polynomial",
"using",
"Horner",
"s",
"method",
".",
"Avoids",
"explicit",
"calculating",
"the",
"powers",
"of",
"x",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L295-L303 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyEvalContinue | public int polyEvalContinue( int previousOutput, GrowQueue_I8 part , int x ) {
int y = previousOutput;
for (int i = 0; i < part.size; i++) {
y = multiply(y,x) ^ (part.data[i]&0xFF);
}
return y;
} | java | public int polyEvalContinue( int previousOutput, GrowQueue_I8 part , int x ) {
int y = previousOutput;
for (int i = 0; i < part.size; i++) {
y = multiply(y,x) ^ (part.data[i]&0xFF);
}
return y;
} | [
"public",
"int",
"polyEvalContinue",
"(",
"int",
"previousOutput",
",",
"GrowQueue_I8",
"part",
",",
"int",
"x",
")",
"{",
"int",
"y",
"=",
"previousOutput",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"part",
".",
"size",
";",
"i",
"++",
... | Continue evaluating a polynomial which has been broken up into multiple arrays.
@param previousOutput Output from the evaluation of the prior part of the polynomial
@param part Additional segment of the polynomial
@param x Point it's being evaluated at
@return results | [
"Continue",
"evaluating",
"a",
"polynomial",
"which",
"has",
"been",
"broken",
"up",
"into",
"multiple",
"arrays",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L335-L342 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyDivide | public void polyDivide(GrowQueue_I8 dividend , GrowQueue_I8 divisor ,
GrowQueue_I8 quotient, GrowQueue_I8 remainder ) {
// handle special case
if( divisor.size > dividend.size ) {
remainder.setTo(dividend);
quotient.resize(0);
return;
} else {
remainder.resize(divisor.size-1);
quotient.se... | java | public void polyDivide(GrowQueue_I8 dividend , GrowQueue_I8 divisor ,
GrowQueue_I8 quotient, GrowQueue_I8 remainder ) {
// handle special case
if( divisor.size > dividend.size ) {
remainder.setTo(dividend);
quotient.resize(0);
return;
} else {
remainder.resize(divisor.size-1);
quotient.se... | [
"public",
"void",
"polyDivide",
"(",
"GrowQueue_I8",
"dividend",
",",
"GrowQueue_I8",
"divisor",
",",
"GrowQueue_I8",
"quotient",
",",
"GrowQueue_I8",
"remainder",
")",
"{",
"// handle special case",
"if",
"(",
"divisor",
".",
"size",
">",
"dividend",
".",
"size",... | Performs polynomial division using a synthetic division algorithm.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param dividend (Input) Polynomial dividend
@param divisor (Input) Polynomial divisor
@param quotient (Output) Division's quotient
@param remainder (Output) Divisions... | [
"Performs",
"polynomial",
"division",
"using",
"a",
"synthetic",
"division",
"algorithm",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L354-L388 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/ConfigQrCode.java | ConfigQrCode.fast | public static ConfigQrCode fast() {
// A global threshold is faster than any local algorithm
// plus it will generate a simpler set of internal contours speeding up that process
ConfigQrCode config = new ConfigQrCode();
config.threshold = ConfigThreshold.global(ThresholdType.GLOBAL_OTSU);
return config;
} | java | public static ConfigQrCode fast() {
// A global threshold is faster than any local algorithm
// plus it will generate a simpler set of internal contours speeding up that process
ConfigQrCode config = new ConfigQrCode();
config.threshold = ConfigThreshold.global(ThresholdType.GLOBAL_OTSU);
return config;
} | [
"public",
"static",
"ConfigQrCode",
"fast",
"(",
")",
"{",
"// A global threshold is faster than any local algorithm",
"// plus it will generate a simpler set of internal contours speeding up that process",
"ConfigQrCode",
"config",
"=",
"new",
"ConfigQrCode",
"(",
")",
";",
"confi... | Default configuration for a QR Code detector which is optimized for speed | [
"Default",
"configuration",
"for",
"a",
"QR",
"Code",
"detector",
"which",
"is",
"optimized",
"for",
"speed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/ConfigQrCode.java#L96-L102 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/feature/AssociationScorePanel.java | AssociationScorePanel.drawDistribution | private void drawDistribution( Graphics2D g2 , List<Point2D_F64> candidates ,
int offX, int offY , double scale) {
findStatistics();
// draw all the features, adjusting their size based on the first score
g2.setColor(Color.RED);
g2.setStroke(new BasicStroke(3));
double normalizer;
if( scorer.getSco... | java | private void drawDistribution( Graphics2D g2 , List<Point2D_F64> candidates ,
int offX, int offY , double scale) {
findStatistics();
// draw all the features, adjusting their size based on the first score
g2.setColor(Color.RED);
g2.setStroke(new BasicStroke(3));
double normalizer;
if( scorer.getSco... | [
"private",
"void",
"drawDistribution",
"(",
"Graphics2D",
"g2",
",",
"List",
"<",
"Point2D_F64",
">",
"candidates",
",",
"int",
"offX",
",",
"int",
"offY",
",",
"double",
"scale",
")",
"{",
"findStatistics",
"(",
")",
";",
"// draw all the features, adjusting th... | Visualizes score distribution. Larger circles mean its closer to the best
fit score. | [
"Visualizes",
"score",
"distribution",
".",
"Larger",
"circles",
"mean",
"its",
"closer",
"to",
"the",
"best",
"fit",
"score",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/AssociationScorePanel.java#L138-L178 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.process | public void process(List<ChessboardCorner> corners ) {
this.corners = corners;
// reset internal data structures
vertexes.reset();
edges.reset();
clusters.reset();
// Create a vertex for each corner
for (int idx = 0; idx < corners.size(); idx++) {
Vertex v = vertexes.grow();
v.reset();
v.index ... | java | public void process(List<ChessboardCorner> corners ) {
this.corners = corners;
// reset internal data structures
vertexes.reset();
edges.reset();
clusters.reset();
// Create a vertex for each corner
for (int idx = 0; idx < corners.size(); idx++) {
Vertex v = vertexes.grow();
v.reset();
v.index ... | [
"public",
"void",
"process",
"(",
"List",
"<",
"ChessboardCorner",
">",
"corners",
")",
"{",
"this",
".",
"corners",
"=",
"corners",
";",
"// reset internal data structures",
"vertexes",
".",
"reset",
"(",
")",
";",
"edges",
".",
"reset",
"(",
")",
";",
"c... | Processes corners and finds clusters of chessboard patterns
@param corners Detected chessboard patterns. Not modified. | [
"Processes",
"corners",
"and",
"finds",
"clusters",
"of",
"chessboard",
"patterns"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L137-L208 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.printDualGraph | public void printDualGraph() {
System.out.println("============= Dual");
int l = BoofMiscOps.numDigits(vertexes.size);
String format = "%"+l+"d";
for( Vertex n : vertexes.toList() ) {
ChessboardCorner c = corners.get(n.index);
System.out.printf("["+format+"] {%3.0f, %3.0f} -> 90[ ",n.index,c.x,c.y);
... | java | public void printDualGraph() {
System.out.println("============= Dual");
int l = BoofMiscOps.numDigits(vertexes.size);
String format = "%"+l+"d";
for( Vertex n : vertexes.toList() ) {
ChessboardCorner c = corners.get(n.index);
System.out.printf("["+format+"] {%3.0f, %3.0f} -> 90[ ",n.index,c.x,c.y);
... | [
"public",
"void",
"printDualGraph",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"============= Dual\"",
")",
";",
"int",
"l",
"=",
"BoofMiscOps",
".",
"numDigits",
"(",
"vertexes",
".",
"size",
")",
";",
"String",
"format",
"=",
"\"%\"",
... | Prints the graph. Used for debugging the code. | [
"Prints",
"the",
"graph",
".",
"Used",
"for",
"debugging",
"the",
"code",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L213-L233 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.findVertexNeighbors | void findVertexNeighbors(Vertex target , List<ChessboardCorner> corners ) {
// if( target.index == 18 ) {
// System.out.println("Vertex Neighbors "+target.index);
// }
ChessboardCorner targetCorner = corners.get(target.index);
// distance is Euclidean squared
double maxDist = Double.MAX_VALUE==maxNeighborDi... | java | void findVertexNeighbors(Vertex target , List<ChessboardCorner> corners ) {
// if( target.index == 18 ) {
// System.out.println("Vertex Neighbors "+target.index);
// }
ChessboardCorner targetCorner = corners.get(target.index);
// distance is Euclidean squared
double maxDist = Double.MAX_VALUE==maxNeighborDi... | [
"void",
"findVertexNeighbors",
"(",
"Vertex",
"target",
",",
"List",
"<",
"ChessboardCorner",
">",
"corners",
")",
"{",
"//\t\tif( target.index == 18 ) {",
"//\t\t\tSystem.out.println(\"Vertex Neighbors \"+target.index);",
"//\t\t}",
"ChessboardCorner",
"targetCorner",
"=",
"co... | Use nearest neighbor search to find closest corners. Split those into two groups, parallel and
perpendicular. | [
"Use",
"nearest",
"neighbor",
"search",
"to",
"find",
"closest",
"corners",
".",
"Split",
"those",
"into",
"two",
"groups",
"parallel",
"and",
"perpendicular",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L255-L326 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.handleAmbiguousVertexes | void handleAmbiguousVertexes(List<ChessboardCorner> corners) {
List<Vertex> candidates = new ArrayList<>();
for (int idx = 0; idx < vertexes.size(); idx++) {
Vertex target = vertexes.get(idx);
// median distance was previously found based on the closer neighbors. In an actual chessboard
// there are solid... | java | void handleAmbiguousVertexes(List<ChessboardCorner> corners) {
List<Vertex> candidates = new ArrayList<>();
for (int idx = 0; idx < vertexes.size(); idx++) {
Vertex target = vertexes.get(idx);
// median distance was previously found based on the closer neighbors. In an actual chessboard
// there are solid... | [
"void",
"handleAmbiguousVertexes",
"(",
"List",
"<",
"ChessboardCorner",
">",
"corners",
")",
"{",
"List",
"<",
"Vertex",
">",
"candidates",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"idx",
"=",
"0",
";",
"idx",
"<",
"vertexes",
... | Identify ambiguous vertexes which are too close to each other. Select the corner with the highest intensity
score and remove the rest | [
"Identify",
"ambiguous",
"vertexes",
"which",
"are",
"too",
"close",
"to",
"each",
"other",
".",
"Select",
"the",
"corner",
"with",
"the",
"highest",
"intensity",
"score",
"and",
"remove",
"the",
"rest"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L332-L376 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.disconnectInvalidVertices | void disconnectInvalidVertices() {
// add elements with 1 or 2 edges
openVertexes.clear();
for (int idxVert = 0; idxVert < vertexes.size; idxVert++) {
Vertex n = vertexes.get(idxVert);
if( n.connections.size() == 1 || n.connections.size()==2) {
openVertexes.add(n);
}
}
// continue until there ar... | java | void disconnectInvalidVertices() {
// add elements with 1 or 2 edges
openVertexes.clear();
for (int idxVert = 0; idxVert < vertexes.size; idxVert++) {
Vertex n = vertexes.get(idxVert);
if( n.connections.size() == 1 || n.connections.size()==2) {
openVertexes.add(n);
}
}
// continue until there ar... | [
"void",
"disconnectInvalidVertices",
"(",
")",
"{",
"// add elements with 1 or 2 edges",
"openVertexes",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"idxVert",
"=",
"0",
";",
"idxVert",
"<",
"vertexes",
".",
"size",
";",
"idxVert",
"++",
")",
"{",
"Verte... | Disconnect the edges from invalid vertices. Invalid ones have only one edge or two edges which do
not connect to a common vertex, i.e. they are point 180 degrees away from each other. | [
"Disconnect",
"the",
"edges",
"from",
"invalid",
"vertices",
".",
"Invalid",
"ones",
"have",
"only",
"one",
"edge",
"or",
"two",
"edges",
"which",
"do",
"not",
"connect",
"to",
"a",
"common",
"vertex",
"i",
".",
"e",
".",
"they",
"are",
"point",
"180",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L382-L433 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.removeReferences | void removeReferences( Vertex remove , EdgeType type ) {
EdgeSet removeSet = remove.getEdgeSet(type);
for (int i = removeSet.size()-1; i >= 0; i--) {
Vertex v = removeSet.get(i).dst;
EdgeSet setV = v.getEdgeSet(type);
// remove the connection from v to 'remove'. Be careful since the connection isn't always... | java | void removeReferences( Vertex remove , EdgeType type ) {
EdgeSet removeSet = remove.getEdgeSet(type);
for (int i = removeSet.size()-1; i >= 0; i--) {
Vertex v = removeSet.get(i).dst;
EdgeSet setV = v.getEdgeSet(type);
// remove the connection from v to 'remove'. Be careful since the connection isn't always... | [
"void",
"removeReferences",
"(",
"Vertex",
"remove",
",",
"EdgeType",
"type",
")",
"{",
"EdgeSet",
"removeSet",
"=",
"remove",
".",
"getEdgeSet",
"(",
"type",
")",
";",
"for",
"(",
"int",
"i",
"=",
"removeSet",
".",
"size",
"(",
")",
"-",
"1",
";",
"... | Go through all the vertexes that 'remove' is connected to and remove that link. if it is
in the connected list swap it with 'replaceWith'. | [
"Go",
"through",
"all",
"the",
"vertexes",
"that",
"remove",
"is",
"connected",
"to",
"and",
"remove",
"that",
"link",
".",
"if",
"it",
"is",
"in",
"the",
"connected",
"list",
"swap",
"it",
"with",
"replaceWith",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L439-L451 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.selectConnections | void selectConnections( Vertex target ) {
// There needs to be at least two corners
if( target.perpendicular.size() <= 1 )
return;
// if( target.index == 16 ) {
// System.out.println("ASDSAD");
// }
// System.out.println("======= Connecting "+target.index);
double bestError = Double.MAX_VALUE;
List<Ed... | java | void selectConnections( Vertex target ) {
// There needs to be at least two corners
if( target.perpendicular.size() <= 1 )
return;
// if( target.index == 16 ) {
// System.out.println("ASDSAD");
// }
// System.out.println("======= Connecting "+target.index);
double bestError = Double.MAX_VALUE;
List<Ed... | [
"void",
"selectConnections",
"(",
"Vertex",
"target",
")",
"{",
"// There needs to be at least two corners",
"if",
"(",
"target",
".",
"perpendicular",
".",
"size",
"(",
")",
"<=",
"1",
")",
"return",
";",
"//\t\tif( target.index == 16 ) {",
"//\t\t\tSystem.out.println(... | Select the best 2,3, or 4 perpendicular vertexes to connect to. These are the output grid connections. | [
"Select",
"the",
"best",
"2",
"3",
"or",
"4",
"perpendicular",
"vertexes",
"to",
"connect",
"to",
".",
"These",
"are",
"the",
"output",
"grid",
"connections",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L456-L515 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.findNext | boolean findNext( int firstIdx , EdgeSet splitterSet , EdgeSet candidateSet ,
double parallel,
SearchResults results ) {
Edge e0 = candidateSet.get(firstIdx);
results.index = -1;
results.error = Double.MAX_VALUE;
boolean checkParallel = !Double.isNaN(parallel);
for (int i = 0; i < candidateSet... | java | boolean findNext( int firstIdx , EdgeSet splitterSet , EdgeSet candidateSet ,
double parallel,
SearchResults results ) {
Edge e0 = candidateSet.get(firstIdx);
results.index = -1;
results.error = Double.MAX_VALUE;
boolean checkParallel = !Double.isNaN(parallel);
for (int i = 0; i < candidateSet... | [
"boolean",
"findNext",
"(",
"int",
"firstIdx",
",",
"EdgeSet",
"splitterSet",
",",
"EdgeSet",
"candidateSet",
",",
"double",
"parallel",
",",
"SearchResults",
"results",
")",
"{",
"Edge",
"e0",
"=",
"candidateSet",
".",
"get",
"(",
"firstIdx",
")",
";",
"res... | Greedily select the next edge that will belong to the final graph.
@param firstIdx Index of the edge CW of the one being considered
@param splitterSet Set of edges that the splitter can belong to
@param candidateSet Set of edges that the next edge can belong to
@param parallel if NaN this is the angle the edge should ... | [
"Greedily",
"select",
"the",
"next",
"edge",
"that",
"will",
"belong",
"to",
"the",
"final",
"graph",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L527-L598 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.findSplitter | boolean findSplitter(double ccw0 , double ccw1 ,
EdgeSet master , EdgeSet other1 , EdgeSet other2 ,
TupleI32 output ) {
double bestDistance = Double.MAX_VALUE;
for (int i = 0; i < master.size(); i++) {
// select the splitter
Edge me = master.get(i);
// TODO decide if this is helpful or not... | java | boolean findSplitter(double ccw0 , double ccw1 ,
EdgeSet master , EdgeSet other1 , EdgeSet other2 ,
TupleI32 output ) {
double bestDistance = Double.MAX_VALUE;
for (int i = 0; i < master.size(); i++) {
// select the splitter
Edge me = master.get(i);
// TODO decide if this is helpful or not... | [
"boolean",
"findSplitter",
"(",
"double",
"ccw0",
",",
"double",
"ccw1",
",",
"EdgeSet",
"master",
",",
"EdgeSet",
"other1",
",",
"EdgeSet",
"other2",
",",
"TupleI32",
"output",
")",
"{",
"double",
"bestDistance",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",... | Splitter is a vertex that has an angle between two edges being considered.
@param ccw0 angle of edge 0
@param ccw1 angle of edge 1
@param master Set of edges that contains all potential spitters
@param other1 set of perpendicular edges to vertex ccw0
@param other2 set of perpendicular edges to vertex ccw1
@param outpu... | [
"Splitter",
"is",
"a",
"vertex",
"that",
"has",
"an",
"angle",
"between",
"two",
"edges",
"being",
"considered",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L611-L665 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.repairVertexes | private void repairVertexes() {
// System.out.println("######## Repair");
for (int idxV = 0; idxV < dirtyVertexes.size(); idxV++) {
final Vertex v = dirtyVertexes.get(idxV);
// System.out.println(" dirty="+v.index);
bestSolution.clear();
for (int idxE = 0; idxE < v.perpendicular.size(); idxE++) {
/... | java | private void repairVertexes() {
// System.out.println("######## Repair");
for (int idxV = 0; idxV < dirtyVertexes.size(); idxV++) {
final Vertex v = dirtyVertexes.get(idxV);
// System.out.println(" dirty="+v.index);
bestSolution.clear();
for (int idxE = 0; idxE < v.perpendicular.size(); idxE++) {
/... | [
"private",
"void",
"repairVertexes",
"(",
")",
"{",
"//\t\tSystem.out.println(\"######## Repair\");",
"for",
"(",
"int",
"idxV",
"=",
"0",
";",
"idxV",
"<",
"dirtyVertexes",
".",
"size",
"(",
")",
";",
"idxV",
"++",
")",
"{",
"final",
"Vertex",
"v",
"=",
"... | Given the current graph, attempt to replace edges from vertexes which lost them in an apparent bad decision.
This is a very simple algorithm and gives up if the graph around the current node is less than perfect.
1) Can only connect to vertexes which lost edges
2) Can't modify an existing edge
3) Parallel lines must b... | [
"Given",
"the",
"current",
"graph",
"attempt",
"to",
"replace",
"edges",
"from",
"vertexes",
"which",
"lost",
"them",
"in",
"an",
"apparent",
"bad",
"decision",
".",
"This",
"is",
"a",
"very",
"simple",
"algorithm",
"and",
"gives",
"up",
"if",
"the",
"grap... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L677-L765 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.convertToOutput | private void convertToOutput(List<ChessboardCorner> corners) {
c2n.resize(corners.size());
n2c.resize(vertexes.size());
open.reset();
n2c.fill(-1);
c2n.fill(-1);
for (int seedIdx = 0; seedIdx < vertexes.size; seedIdx++) {
Vertex seedN = vertexes.get(seedIdx);
if( seedN.marked)
continue;
Chess... | java | private void convertToOutput(List<ChessboardCorner> corners) {
c2n.resize(corners.size());
n2c.resize(vertexes.size());
open.reset();
n2c.fill(-1);
c2n.fill(-1);
for (int seedIdx = 0; seedIdx < vertexes.size; seedIdx++) {
Vertex seedN = vertexes.get(seedIdx);
if( seedN.marked)
continue;
Chess... | [
"private",
"void",
"convertToOutput",
"(",
"List",
"<",
"ChessboardCorner",
">",
"corners",
")",
"{",
"c2n",
".",
"resize",
"(",
"corners",
".",
"size",
"(",
")",
")",
";",
"n2c",
".",
"resize",
"(",
"vertexes",
".",
"size",
"(",
")",
")",
";",
"open... | Converts the internal graphs into unordered chessboard grids. | [
"Converts",
"the",
"internal",
"graphs",
"into",
"unordered",
"chessboard",
"grids",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L771-L815 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java | ChessboardCornerClusterFinder.growCluster | private void growCluster(List<ChessboardCorner> corners, int seedIdx, ChessboardCornerGraph graph) {
// open contains corner list indexes
open.add(seedIdx);
while( open.size > 0 ) {
int cornerIdx = open.pop();
Vertex v = vertexes.get(cornerIdx);
// make sure it hasn't already been processed
if( v.mar... | java | private void growCluster(List<ChessboardCorner> corners, int seedIdx, ChessboardCornerGraph graph) {
// open contains corner list indexes
open.add(seedIdx);
while( open.size > 0 ) {
int cornerIdx = open.pop();
Vertex v = vertexes.get(cornerIdx);
// make sure it hasn't already been processed
if( v.mar... | [
"private",
"void",
"growCluster",
"(",
"List",
"<",
"ChessboardCorner",
">",
"corners",
",",
"int",
"seedIdx",
",",
"ChessboardCornerGraph",
"graph",
")",
"{",
"// open contains corner list indexes",
"open",
".",
"add",
"(",
"seedIdx",
")",
";",
"while",
"(",
"o... | Given the initial seed, add all connected nodes to the output cluster while keeping track of how to
convert one node index into another one, between the two graphs | [
"Given",
"the",
"initial",
"seed",
"add",
"all",
"connected",
"nodes",
"to",
"the",
"output",
"cluster",
"while",
"keeping",
"track",
"of",
"how",
"to",
"convert",
"one",
"node",
"index",
"into",
"another",
"one",
"between",
"the",
"two",
"graphs"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterFinder.java#L821-L847 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/BaseIntegralEdge.java | BaseIntegralEdge.setTransform | public void setTransform( PixelTransform<Point2D_F32> undistToDist ) {
if( undistToDist != null ) {
InterpolatePixelS<T> interpolate = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
integralImage = new GImageGrayDistorted<>(undistToDist, interpolate);
} else {
integralImage = FactoryG... | java | public void setTransform( PixelTransform<Point2D_F32> undistToDist ) {
if( undistToDist != null ) {
InterpolatePixelS<T> interpolate = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
integralImage = new GImageGrayDistorted<>(undistToDist, interpolate);
} else {
integralImage = FactoryG... | [
"public",
"void",
"setTransform",
"(",
"PixelTransform",
"<",
"Point2D_F32",
">",
"undistToDist",
")",
"{",
"if",
"(",
"undistToDist",
"!=",
"null",
")",
"{",
"InterpolatePixelS",
"<",
"T",
">",
"interpolate",
"=",
"FactoryInterpolation",
".",
"bilinearPixelS",
... | Used to specify a transform that is applied to pixel coordinates to bring them back into original input
image coordinates. For example if the input image has lens distortion but the edge were found
in undistorted coordinates this code needs to know how to go from undistorted back into distorted
image coordinates in or... | [
"Used",
"to",
"specify",
"a",
"transform",
"that",
"is",
"applied",
"to",
"pixel",
"coordinates",
"to",
"bring",
"them",
"back",
"into",
"original",
"input",
"image",
"coordinates",
".",
"For",
"example",
"if",
"the",
"input",
"image",
"has",
"lens",
"distor... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/BaseIntegralEdge.java#L58-L65 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java | EnforceTrifocalGeometry.process | public void process( Point3D_F64 e2 , Point3D_F64 e3 , DMatrixRMaj A ) {
// construct the linear system that the solution which solves the unknown square
// matrices in the camera matrices
constructE(e2, e3);
// Computes U, which is used to map the 18 unknowns onto the 27 trifocal unknowns
svdU.decompose(E);... | java | public void process( Point3D_F64 e2 , Point3D_F64 e3 , DMatrixRMaj A ) {
// construct the linear system that the solution which solves the unknown square
// matrices in the camera matrices
constructE(e2, e3);
// Computes U, which is used to map the 18 unknowns onto the 27 trifocal unknowns
svdU.decompose(E);... | [
"public",
"void",
"process",
"(",
"Point3D_F64",
"e2",
",",
"Point3D_F64",
"e3",
",",
"DMatrixRMaj",
"A",
")",
"{",
"// construct the linear system that the solution which solves the unknown square",
"// matrices in the camera matrices",
"constructE",
"(",
"e2",
",",
"e3",
... | Computes a trifocal tensor which minimizes the algebraic error given the
two epipoles and the linear constraint matrix. The epipoles are from a previously
computed trifocal tensor.
@param e2 Epipole of first image in the second image
@param e3 Epipole of first image in the third image
@param A Linear constraint matri... | [
"Computes",
"a",
"trifocal",
"tensor",
"which",
"minimizes",
"the",
"algebraic",
"error",
"given",
"the",
"two",
"epipoles",
"and",
"the",
"linear",
"constraint",
"matrix",
".",
"The",
"epipoles",
"are",
"from",
"a",
"previously",
"computed",
"trifocal",
"tensor... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java#L85-L117 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java | EnforceTrifocalGeometry.constructE | protected void constructE( Point3D_F64 e2 , Point3D_F64 e3 ) {
E.zero();
for( int i = 0; i < 3; i++ ) {
for( int j = 0; j < 3; j++ ) {
for( int k = 0; k < 3; k++ ) {
// which element in the trifocal tensor is being manipulated
int row = 9*i + 3*j + k;
// which unknowns are being multiplied by... | java | protected void constructE( Point3D_F64 e2 , Point3D_F64 e3 ) {
E.zero();
for( int i = 0; i < 3; i++ ) {
for( int j = 0; j < 3; j++ ) {
for( int k = 0; k < 3; k++ ) {
// which element in the trifocal tensor is being manipulated
int row = 9*i + 3*j + k;
// which unknowns are being multiplied by... | [
"protected",
"void",
"constructE",
"(",
"Point3D_F64",
"e2",
",",
"Point3D_F64",
"e3",
")",
"{",
"E",
".",
"zero",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0"... | The matrix E is a linear system for computing the trifocal tensor. The columns
are the unknown square matrices from view 2 and 3. The right most column in
both projection matrices are the provided epipoles, whose values are inserted into E | [
"The",
"matrix",
"E",
"is",
"a",
"linear",
"system",
"for",
"computing",
"the",
"trifocal",
"tensor",
".",
"The",
"columns",
"are",
"the",
"unknown",
"square",
"matrices",
"from",
"view",
"2",
"and",
"3",
".",
"The",
"right",
"most",
"column",
"in",
"bot... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/EnforceTrifocalGeometry.java#L140-L157 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/struct/geo/TrifocalTensor.java | TrifocalTensor.copy | public TrifocalTensor copy() {
TrifocalTensor ret = new TrifocalTensor();
ret.T1.set(T1);
ret.T2.set(T2);
ret.T3.set(T3);
return ret;
} | java | public TrifocalTensor copy() {
TrifocalTensor ret = new TrifocalTensor();
ret.T1.set(T1);
ret.T2.set(T2);
ret.T3.set(T3);
return ret;
} | [
"public",
"TrifocalTensor",
"copy",
"(",
")",
"{",
"TrifocalTensor",
"ret",
"=",
"new",
"TrifocalTensor",
"(",
")",
";",
"ret",
".",
"T1",
".",
"set",
"(",
"T1",
")",
";",
"ret",
".",
"T2",
".",
"set",
"(",
"T2",
")",
";",
"ret",
".",
"T3",
".",
... | Returns a new copy of the TrifocalTensor
@return Copy of the trifocal tensor | [
"Returns",
"a",
"new",
"copy",
"of",
"the",
"TrifocalTensor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/geo/TrifocalTensor.java#L101-L107 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparitySparseScoreSadRect.java | DisparitySparseScoreSadRect.setImages | public void setImages( Input left , Input right ) {
InputSanityCheck.checkSameShape(left, right);
this.left = left;
this.right = right;
} | java | public void setImages( Input left , Input right ) {
InputSanityCheck.checkSameShape(left, right);
this.left = left;
this.right = right;
} | [
"public",
"void",
"setImages",
"(",
"Input",
"left",
",",
"Input",
"right",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"left",
",",
"right",
")",
";",
"this",
".",
"left",
"=",
"left",
";",
"this",
".",
"right",
"=",
"right",
";",
"}"
] | Specify inputs for left and right camera images.
@param left Rectified left camera image.
@param right Rectified right camera image. | [
"Specify",
"inputs",
"for",
"left",
"and",
"right",
"camera",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparitySparseScoreSadRect.java#L72-L77 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.getImageType | protected <T extends ImageBase> ImageType<T> getImageType( int which ) {
synchronized ( inputStreams ) {
return inputStreams.get(which).imageType;
}
} | java | protected <T extends ImageBase> ImageType<T> getImageType( int which ) {
synchronized ( inputStreams ) {
return inputStreams.get(which).imageType;
}
} | [
"protected",
"<",
"T",
"extends",
"ImageBase",
">",
"ImageType",
"<",
"T",
">",
"getImageType",
"(",
"int",
"which",
")",
"{",
"synchronized",
"(",
"inputStreams",
")",
"{",
"return",
"inputStreams",
".",
"get",
"(",
"which",
")",
".",
"imageType",
";",
... | Get input input type for a stream safely | [
"Get",
"input",
"input",
"type",
"for",
"a",
"stream",
"safely"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L150-L154 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.updateRecentItems | private void updateRecentItems() {
if( menuRecent == null )
return;
menuRecent.removeAll();
List<String> recentFiles = BoofSwingUtil.getListOfRecentFiles(this);
for( String filePath : recentFiles ) {
final File f = new File(filePath);
JMenuItem recentItem = new JMenuItem(f.getName());
recentItem.add... | java | private void updateRecentItems() {
if( menuRecent == null )
return;
menuRecent.removeAll();
List<String> recentFiles = BoofSwingUtil.getListOfRecentFiles(this);
for( String filePath : recentFiles ) {
final File f = new File(filePath);
JMenuItem recentItem = new JMenuItem(f.getName());
recentItem.add... | [
"private",
"void",
"updateRecentItems",
"(",
")",
"{",
"if",
"(",
"menuRecent",
"==",
"null",
")",
"return",
";",
"menuRecent",
".",
"removeAll",
"(",
")",
";",
"List",
"<",
"String",
">",
"recentFiles",
"=",
"BoofSwingUtil",
".",
"getListOfRecentFiles",
"("... | Updates the list in recent menu | [
"Updates",
"the",
"list",
"in",
"recent",
"menu"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L230-L246 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openExample | public void openExample( Object o ) {
if (o instanceof PathLabel) {
PathLabel p = (PathLabel)o;
if( p.path.length == 1 )
openFile(new File(p.path[0]));
else {
// openFile(new File(p.path[0]));
openImageSet(p.path);
}
} else if (o instanceof String) {
openFile(new File((String) o));
} els... | java | public void openExample( Object o ) {
if (o instanceof PathLabel) {
PathLabel p = (PathLabel)o;
if( p.path.length == 1 )
openFile(new File(p.path[0]));
else {
// openFile(new File(p.path[0]));
openImageSet(p.path);
}
} else if (o instanceof String) {
openFile(new File((String) o));
} els... | [
"public",
"void",
"openExample",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"PathLabel",
")",
"{",
"PathLabel",
"p",
"=",
"(",
"PathLabel",
")",
"o",
";",
"if",
"(",
"p",
".",
"path",
".",
"length",
"==",
"1",
")",
"openFile",
"(",... | Function that is invoked when an example has been selected | [
"Function",
"that",
"is",
"invoked",
"when",
"an",
"example",
"has",
"been",
"selected"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L251-L265 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.stopAllInputProcessing | public void stopAllInputProcessing() {
ProcessThread threadProcess;
synchronized (inputStreams) {
threadProcess = this.threadProcess;
if( threadProcess != null ) {
if( threadProcess.running ) {
threadProcess.requestStop = true;
} else {
threadProcess = this.threadProcess = null;
}
}
... | java | public void stopAllInputProcessing() {
ProcessThread threadProcess;
synchronized (inputStreams) {
threadProcess = this.threadProcess;
if( threadProcess != null ) {
if( threadProcess.running ) {
threadProcess.requestStop = true;
} else {
threadProcess = this.threadProcess = null;
}
}
... | [
"public",
"void",
"stopAllInputProcessing",
"(",
")",
"{",
"ProcessThread",
"threadProcess",
";",
"synchronized",
"(",
"inputStreams",
")",
"{",
"threadProcess",
"=",
"this",
".",
"threadProcess",
";",
"if",
"(",
"threadProcess",
"!=",
"null",
")",
"{",
"if",
... | Blocks until it kills all input streams from running | [
"Blocks",
"until",
"it",
"kills",
"all",
"input",
"streams",
"from",
"running"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L270-L304 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openFile | public void openFile(File file) {
final String path = massageFilePath(file);
if( path == null )
return;
inputFilePath = path;
// update recent items menu
BoofSwingUtil.invokeNowOrLater(() -> {
BoofSwingUtil.addToRecentFiles(DemonstrationBase.this,path);
updateRecentItems();
});
BufferedImage bu... | java | public void openFile(File file) {
final String path = massageFilePath(file);
if( path == null )
return;
inputFilePath = path;
// update recent items menu
BoofSwingUtil.invokeNowOrLater(() -> {
BoofSwingUtil.addToRecentFiles(DemonstrationBase.this,path);
updateRecentItems();
});
BufferedImage bu... | [
"public",
"void",
"openFile",
"(",
"File",
"file",
")",
"{",
"final",
"String",
"path",
"=",
"massageFilePath",
"(",
"file",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"return",
";",
"inputFilePath",
"=",
"path",
";",
"// update recent items menu",
"B... | Opens a file. First it will attempt to open it as an image. If that fails it will try opening it as a
video. If all else fails tell the user it has failed. If a streaming source was running before it will
be stopped. | [
"Opens",
"a",
"file",
".",
"First",
"it",
"will",
"attempt",
"to",
"open",
"it",
"as",
"an",
"image",
".",
"If",
"that",
"fails",
"it",
"will",
"try",
"opening",
"it",
"as",
"a",
"video",
".",
"If",
"all",
"else",
"fails",
"tell",
"the",
"user",
"i... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L346-L365 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openImageSet | public void openImageSet(String ...files ) {
synchronized (lockStartingProcess) {
if( startingProcess ) {
System.out.println("Ignoring open image set request. Detected spamming");
return;
}
startingProcess = true;
}
stopAllInputProcessing();
synchronized (inputStreams) {
inputMethod = Inp... | java | public void openImageSet(String ...files ) {
synchronized (lockStartingProcess) {
if( startingProcess ) {
System.out.println("Ignoring open image set request. Detected spamming");
return;
}
startingProcess = true;
}
stopAllInputProcessing();
synchronized (inputStreams) {
inputMethod = Inp... | [
"public",
"void",
"openImageSet",
"(",
"String",
"...",
"files",
")",
"{",
"synchronized",
"(",
"lockStartingProcess",
")",
"{",
"if",
"(",
"startingProcess",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Ignoring open image set request. Detected spamming... | Opens a set of images
@param files | [
"Opens",
"a",
"set",
"of",
"images"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L404-L424 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openNextFile | public void openNextFile() {
if( inputFilePath == null || inputMethod != InputMethod.IMAGE )
return;
String path;
try {
// need to remove annoying %20 from the path is there is whitespace
path = URLDecoder.decode(inputFilePath, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace(... | java | public void openNextFile() {
if( inputFilePath == null || inputMethod != InputMethod.IMAGE )
return;
String path;
try {
// need to remove annoying %20 from the path is there is whitespace
path = URLDecoder.decode(inputFilePath, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace(... | [
"public",
"void",
"openNextFile",
"(",
")",
"{",
"if",
"(",
"inputFilePath",
"==",
"null",
"||",
"inputMethod",
"!=",
"InputMethod",
".",
"IMAGE",
")",
"return",
";",
"String",
"path",
";",
"try",
"{",
"// need to remove annoying %20 from the path is there is whites... | Opens the next file in the directory by lexicographical order. | [
"Opens",
"the",
"next",
"file",
"in",
"the",
"directory",
"by",
"lexicographical",
"order",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L429-L474 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openVideo | protected void openVideo(boolean reopen , String ...filePaths) {
synchronized (lockStartingProcess) {
if( startingProcess ) {
System.out.println("Ignoring video request. Detected spamming");
return;
}
startingProcess = true;
}
synchronized (inputStreams) {
if (inputStreams.size() != filePath... | java | protected void openVideo(boolean reopen , String ...filePaths) {
synchronized (lockStartingProcess) {
if( startingProcess ) {
System.out.println("Ignoring video request. Detected spamming");
return;
}
startingProcess = true;
}
synchronized (inputStreams) {
if (inputStreams.size() != filePath... | [
"protected",
"void",
"openVideo",
"(",
"boolean",
"reopen",
",",
"String",
"...",
"filePaths",
")",
"{",
"synchronized",
"(",
"lockStartingProcess",
")",
"{",
"if",
"(",
"startingProcess",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Ignoring video ... | Before invoking this function make sure waitingToOpenImage is false AND that the previous input has been stopped | [
"Before",
"invoking",
"this",
"function",
"make",
"sure",
"waitingToOpenImage",
"is",
"false",
"AND",
"that",
"the",
"previous",
"input",
"has",
"been",
"stopped"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L479-L541 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.display | public void display(String appName ) {
waitUntilInputSizeIsKnown();
this.appName = appName;
window = ShowImages.showWindow(this,appName,true);
window.setJMenuBar(menuBar);
} | java | public void display(String appName ) {
waitUntilInputSizeIsKnown();
this.appName = appName;
window = ShowImages.showWindow(this,appName,true);
window.setJMenuBar(menuBar);
} | [
"public",
"void",
"display",
"(",
"String",
"appName",
")",
"{",
"waitUntilInputSizeIsKnown",
"(",
")",
";",
"this",
".",
"appName",
"=",
"appName",
";",
"window",
"=",
"ShowImages",
".",
"showWindow",
"(",
"this",
",",
"appName",
",",
"true",
")",
";",
... | Opens a window with this application inside of it
@param appName Name of the application | [
"Opens",
"a",
"window",
"with",
"this",
"application",
"inside",
"of",
"it"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L658-L663 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.openFileMenuBar | protected void openFileMenuBar() {
List<BoofSwingUtil.FileTypes> types = new ArrayList<>();
if( allowImages )
types.add(BoofSwingUtil.FileTypes.IMAGES);
if( allowVideos )
types.add(BoofSwingUtil.FileTypes.VIDEOS);
BoofSwingUtil.FileTypes array[] = types.toArray(new BoofSwingUtil.FileTypes[0]);
File fil... | java | protected void openFileMenuBar() {
List<BoofSwingUtil.FileTypes> types = new ArrayList<>();
if( allowImages )
types.add(BoofSwingUtil.FileTypes.IMAGES);
if( allowVideos )
types.add(BoofSwingUtil.FileTypes.VIDEOS);
BoofSwingUtil.FileTypes array[] = types.toArray(new BoofSwingUtil.FileTypes[0]);
File fil... | [
"protected",
"void",
"openFileMenuBar",
"(",
")",
"{",
"List",
"<",
"BoofSwingUtil",
".",
"FileTypes",
">",
"types",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"allowImages",
")",
"types",
".",
"add",
"(",
"BoofSwingUtil",
".",
"FileTypes",
... | Open file in the menu bar was invoked by the user | [
"Open",
"file",
"in",
"the",
"menu",
"bar",
"was",
"invoked",
"by",
"the",
"user"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L693-L705 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java | DemonstrationBase.reprocessInput | public void reprocessInput() {
if ( inputMethod == InputMethod.VIDEO ) {
openVideo(true,inputFilePath);
} else if( inputMethod == InputMethod.IMAGE ) {
BufferedImage buff = inputStreams.get(0).getBufferedImage();
openImage(true,new File(inputFilePath).getName(),buff);// TODO still does a pointless image co... | java | public void reprocessInput() {
if ( inputMethod == InputMethod.VIDEO ) {
openVideo(true,inputFilePath);
} else if( inputMethod == InputMethod.IMAGE ) {
BufferedImage buff = inputStreams.get(0).getBufferedImage();
openImage(true,new File(inputFilePath).getName(),buff);// TODO still does a pointless image co... | [
"public",
"void",
"reprocessInput",
"(",
")",
"{",
"if",
"(",
"inputMethod",
"==",
"InputMethod",
".",
"VIDEO",
")",
"{",
"openVideo",
"(",
"true",
",",
"inputFilePath",
")",
";",
"}",
"else",
"if",
"(",
"inputMethod",
"==",
"InputMethod",
".",
"IMAGE",
... | If just a single image was processed it will process it again. If it's a stream
there is no need to reprocess, the next image will be handled soon enough. | [
"If",
"just",
"a",
"single",
"image",
"was",
"processed",
"it",
"will",
"process",
"it",
"again",
".",
"If",
"it",
"s",
"a",
"stream",
"there",
"is",
"no",
"need",
"to",
"reprocess",
"the",
"next",
"image",
"will",
"be",
"handled",
"soon",
"enough",
".... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/gui/DemonstrationBase.java#L880-L889 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/GeneralFeatureDetector.java | GeneralFeatureDetector.process | public void process(I image, D derivX, D derivY, D derivXX, D derivYY, D derivXY) {
intensity.process(image, derivX, derivY, derivXX, derivYY, derivXY);
GrayF32 intensityImage = intensity.getIntensity();
int numSelectMin = -1;
int numSelectMax = -1;
if( maxFeatures > 0 ) {
if( intensity.localMinimums() )
... | java | public void process(I image, D derivX, D derivY, D derivXX, D derivYY, D derivXY) {
intensity.process(image, derivX, derivY, derivXX, derivYY, derivXY);
GrayF32 intensityImage = intensity.getIntensity();
int numSelectMin = -1;
int numSelectMax = -1;
if( maxFeatures > 0 ) {
if( intensity.localMinimums() )
... | [
"public",
"void",
"process",
"(",
"I",
"image",
",",
"D",
"derivX",
",",
"D",
"derivY",
",",
"D",
"derivXX",
",",
"D",
"derivYY",
",",
"D",
"derivXY",
")",
"{",
"intensity",
".",
"process",
"(",
"image",
",",
"derivX",
",",
"derivY",
",",
"derivXX",
... | Computes point features from image gradients.
@param image Original image.
@param derivX image derivative in along the x-axis. Only needed if {@link #getRequiresGradient()} is true.
@param derivY image derivative in along the y-axis. Only needed if {@link #getRequiresGradient()} is true.
@param derivXX Second deri... | [
"Computes",
"point",
"features",
"from",
"image",
"gradients",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/GeneralFeatureDetector.java#L107-L149 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java | FactoryDescribeRegionPoint.surfColorStable | public static <T extends ImageBase<T>, II extends ImageGray<II>>
DescribeRegionPoint<T,BrightFeature> surfColorStable(ConfigSurfDescribe.Stability config, ImageType<T> imageType) {
Class bandType = imageType.getImageClass();
Class<II> integralType = GIntegralImageOps.getIntegralType(bandType);
DescribePointSur... | java | public static <T extends ImageBase<T>, II extends ImageGray<II>>
DescribeRegionPoint<T,BrightFeature> surfColorStable(ConfigSurfDescribe.Stability config, ImageType<T> imageType) {
Class bandType = imageType.getImageClass();
Class<II> integralType = GIntegralImageOps.getIntegralType(bandType);
DescribePointSur... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
",",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"DescribeRegionPoint",
"<",
"T",
",",
"BrightFeature",
">",
"surfColorStable",
"(",
"ConfigSurfDescribe",
".",
"Stability",
"config",
... | Color variant of the SURF descriptor which has been designed for stability.
@see DescribePointSurfPlanar
@param config SURF configuration. Pass in null for default options.
@param imageType Type of input image.
@return SURF color description extractor | [
"Color",
"variant",
"of",
"the",
"SURF",
"descriptor",
"which",
"has",
"been",
"designed",
"for",
"stability",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java#L127-L142 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java | FactoryDescribeRegionPoint.pixel | @SuppressWarnings({"unchecked"})
public static <T extends ImageGray<T>, D extends TupleDesc>
DescribeRegionPoint<T,D> pixel( int regionWidth , int regionHeight , Class<T> imageType ) {
return new WrapDescribePixelRegion(
FactoryDescribePointAlgs.pixelRegion(regionWidth,regionHeight,imageType),imageType);
} | java | @SuppressWarnings({"unchecked"})
public static <T extends ImageGray<T>, D extends TupleDesc>
DescribeRegionPoint<T,D> pixel( int regionWidth , int regionHeight , Class<T> imageType ) {
return new WrapDescribePixelRegion(
FactoryDescribePointAlgs.pixelRegion(regionWidth,regionHeight,imageType),imageType);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"TupleDesc",
">",
"DescribeRegionPoint",
"<",
"T",
",",
"D",
">",
"pixel",
"(",
"int",
"regionWidth",
... | Creates a region descriptor based on pixel intensity values alone. A classic and fast to compute
descriptor, but much less stable than more modern ones.
@see boofcv.alg.feature.describe.DescribePointPixelRegion
@param regionWidth How wide the pixel region is.
@param regionHeight How tall the pixel region is.
@param ... | [
"Creates",
"a",
"region",
"descriptor",
"based",
"on",
"pixel",
"intensity",
"values",
"alone",
".",
"A",
"classic",
"and",
"fast",
"to",
"compute",
"descriptor",
"but",
"much",
"less",
"stable",
"than",
"more",
"modern",
"ones",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java#L215-L220 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java | FactoryDescribeRegionPoint.pixelNCC | @SuppressWarnings({"unchecked"})
public static <T extends ImageGray<T>>
DescribeRegionPoint<T,NccFeature> pixelNCC( int regionWidth , int regionHeight , Class<T> imageType ) {
return new WrapDescribePixelRegionNCC(
FactoryDescribePointAlgs.pixelRegionNCC(regionWidth,regionHeight,imageType),imageType);
} | java | @SuppressWarnings({"unchecked"})
public static <T extends ImageGray<T>>
DescribeRegionPoint<T,NccFeature> pixelNCC( int regionWidth , int regionHeight , Class<T> imageType ) {
return new WrapDescribePixelRegionNCC(
FactoryDescribePointAlgs.pixelRegionNCC(regionWidth,regionHeight,imageType),imageType);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"DescribeRegionPoint",
"<",
"T",
",",
"NccFeature",
">",
"pixelNCC",
"(",
"int",
"regionWidth",
",",
"int",
"regionHeight"... | Creates a region descriptor based on normalized pixel intensity values alone. This descriptor
is designed to be light invariance, but is still less stable than more modern ones.
@see boofcv.alg.feature.describe.DescribePointPixelRegionNCC
@param regionWidth How wide the pixel region is.
@param regionHeight How tall ... | [
"Creates",
"a",
"region",
"descriptor",
"based",
"on",
"normalized",
"pixel",
"intensity",
"values",
"alone",
".",
"This",
"descriptor",
"is",
"designed",
"to",
"be",
"light",
"invariance",
"but",
"is",
"still",
"less",
"stable",
"than",
"more",
"modern",
"one... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribeRegionPoint.java#L233-L238 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java | CalibrationIO.save | public static <T extends CameraPinhole> void save(T parameters , Writer outputWriter ) {
PrintWriter out = new PrintWriter(outputWriter);
Yaml yaml = createYmlObject();
Map<String, Object> data = new HashMap<>();
if( parameters instanceof CameraPinholeBrown) {
out.println("# Pinhole camera model with radi... | java | public static <T extends CameraPinhole> void save(T parameters , Writer outputWriter ) {
PrintWriter out = new PrintWriter(outputWriter);
Yaml yaml = createYmlObject();
Map<String, Object> data = new HashMap<>();
if( parameters instanceof CameraPinholeBrown) {
out.println("# Pinhole camera model with radi... | [
"public",
"static",
"<",
"T",
"extends",
"CameraPinhole",
">",
"void",
"save",
"(",
"T",
"parameters",
",",
"Writer",
"outputWriter",
")",
"{",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"outputWriter",
")",
";",
"Yaml",
"yaml",
"=",
"createYmlObj... | Saves intrinsic camera model to disk
@param parameters Camera parameters
@param outputWriter Path to where it should be saved | [
"Saves",
"intrinsic",
"camera",
"model",
"to",
"disk"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java#L56-L89 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java | CalibrationIO.save | public static void save(StereoParameters parameters , Writer outputWriter ) {
Map<String, Object> map = new HashMap<>();
map.put("model",MODEL_STEREO);
map.put(VERSION,0);
map.put("left",putModelRadial(parameters.left,null));
map.put("right",putModelRadial(parameters.right,null));
map.put("rightToLeft",put... | java | public static void save(StereoParameters parameters , Writer outputWriter ) {
Map<String, Object> map = new HashMap<>();
map.put("model",MODEL_STEREO);
map.put(VERSION,0);
map.put("left",putModelRadial(parameters.left,null));
map.put("right",putModelRadial(parameters.right,null));
map.put("rightToLeft",put... | [
"public",
"static",
"void",
"save",
"(",
"StereoParameters",
"parameters",
",",
"Writer",
"outputWriter",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"model\"",
",",
"... | Saves stereo camera model to disk
@param parameters Camera parameters
@param outputWriter Stream to save the parameters to | [
"Saves",
"stereo",
"camera",
"model",
"to",
"disk"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java#L115-L129 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java | CalibrationIO.load | public static <T> T load(Reader reader ) {
Yaml yaml = createYmlObject();
Map<String,Object> data = (Map<String, Object>) yaml.load(reader);
try {
reader.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
return load(data);
} | java | public static <T> T load(Reader reader ) {
Yaml yaml = createYmlObject();
Map<String,Object> data = (Map<String, Object>) yaml.load(reader);
try {
reader.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
return load(data);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"load",
"(",
"Reader",
"reader",
")",
"{",
"Yaml",
"yaml",
"=",
"createYmlObject",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"... | Loads intrinsic parameters from disk
@param reader Reader
@return Camera model | [
"Loads",
"intrinsic",
"parameters",
"from",
"disk"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/calibration/CalibrationIO.java#L238-L250 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java | CalibrationPlanarGridZhang99.process | public boolean process( List<CalibrationObservation> observations ) {
// compute initial parameter estimates using linear algebra
if( !linearEstimate(observations) )
return false;
status("Non-linear refinement");
// perform non-linear optimization to improve results
if( !performBundleAdjustment())
ret... | java | public boolean process( List<CalibrationObservation> observations ) {
// compute initial parameter estimates using linear algebra
if( !linearEstimate(observations) )
return false;
status("Non-linear refinement");
// perform non-linear optimization to improve results
if( !performBundleAdjustment())
ret... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"CalibrationObservation",
">",
"observations",
")",
"{",
"// compute initial parameter estimates using linear algebra",
"if",
"(",
"!",
"linearEstimate",
"(",
"observations",
")",
")",
"return",
"false",
";",
"status",
... | Processes observed calibration point coordinates and computes camera intrinsic and extrinsic
parameters.
@param observations Set of observed grid locations in pixel coordinates.
@return true if successful and false if it failed | [
"Processes",
"observed",
"calibration",
"point",
"coordinates",
"and",
"computes",
"camera",
"intrinsic",
"and",
"extrinsic",
"parameters",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java#L122-L134 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java | CalibrationPlanarGridZhang99.linearEstimate | protected boolean linearEstimate(List<CalibrationObservation> observations )
{
status("Estimating Homographies");
List<DMatrixRMaj> homographies = new ArrayList<>();
List<Se3_F64> motions = new ArrayList<>();
for( CalibrationObservation obs : observations ) {
if( !computeHomography.computeHomography(obs) ... | java | protected boolean linearEstimate(List<CalibrationObservation> observations )
{
status("Estimating Homographies");
List<DMatrixRMaj> homographies = new ArrayList<>();
List<Se3_F64> motions = new ArrayList<>();
for( CalibrationObservation obs : observations ) {
if( !computeHomography.computeHomography(obs) ... | [
"protected",
"boolean",
"linearEstimate",
"(",
"List",
"<",
"CalibrationObservation",
">",
"observations",
")",
"{",
"status",
"(",
"\"Estimating Homographies\"",
")",
";",
"List",
"<",
"DMatrixRMaj",
">",
"homographies",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Find an initial estimate for calibration parameters using linear techniques. | [
"Find",
"an",
"initial",
"estimate",
"for",
"calibration",
"parameters",
"using",
"linear",
"techniques",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java#L139-L171 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java | CalibrationPlanarGridZhang99.performBundleAdjustment | public boolean performBundleAdjustment()
{
// Configure the sparse Levenberg-Marquardt solver
ConfigLevenbergMarquardt configLM = new ConfigLevenbergMarquardt();
configLM.hessianScaling = false;
ConfigBundleAdjustment configSBA = new ConfigBundleAdjustment();
configSBA.configOptimizer = configLM;
BundleA... | java | public boolean performBundleAdjustment()
{
// Configure the sparse Levenberg-Marquardt solver
ConfigLevenbergMarquardt configLM = new ConfigLevenbergMarquardt();
configLM.hessianScaling = false;
ConfigBundleAdjustment configSBA = new ConfigBundleAdjustment();
configSBA.configOptimizer = configLM;
BundleA... | [
"public",
"boolean",
"performBundleAdjustment",
"(",
")",
"{",
"// Configure the sparse Levenberg-Marquardt solver",
"ConfigLevenbergMarquardt",
"configLM",
"=",
"new",
"ConfigLevenbergMarquardt",
"(",
")",
";",
"configLM",
".",
"hessianScaling",
"=",
"false",
";",
"ConfigB... | Use non-linear optimization to improve the parameter estimates | [
"Use",
"non",
"-",
"linear",
"optimization",
"to",
"improve",
"the",
"parameter",
"estimates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java#L183-L206 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java | CalibrationPlanarGridZhang99.applyDistortion | public static void applyDistortion(Point2D_F64 normPt, double[] radial, double t1 , double t2 )
{
final double x = normPt.x;
final double y = normPt.y;
double a = 0;
double r2 = x*x + y*y;
double r2i = r2;
for( int i = 0; i < radial.length; i++ ) {
a += radial[i]*r2i;
r2i *= r2;
}
normPt.x = x ... | java | public static void applyDistortion(Point2D_F64 normPt, double[] radial, double t1 , double t2 )
{
final double x = normPt.x;
final double y = normPt.y;
double a = 0;
double r2 = x*x + y*y;
double r2i = r2;
for( int i = 0; i < radial.length; i++ ) {
a += radial[i]*r2i;
r2i *= r2;
}
normPt.x = x ... | [
"public",
"static",
"void",
"applyDistortion",
"(",
"Point2D_F64",
"normPt",
",",
"double",
"[",
"]",
"radial",
",",
"double",
"t1",
",",
"double",
"t2",
")",
"{",
"final",
"double",
"x",
"=",
"normPt",
".",
"x",
";",
"final",
"double",
"y",
"=",
"norm... | Applies radial and tangential distortion to the normalized image coordinate.
@param normPt point in normalized image coordinates
@param radial radial distortion parameters
@param t1 tangential parameter
@param t2 tangential parameter | [
"Applies",
"radial",
"and",
"tangential",
"distortion",
"to",
"the",
"normalized",
"image",
"coordinate",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/CalibrationPlanarGridZhang99.java#L303-L318 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/DistanceSe3SymmetricSq.java | DistanceSe3SymmetricSq.computeDistance | @Override
public double computeDistance(AssociatedPair obs) {
// triangulate the point in 3D space
triangulate.triangulate(obs.p1,obs.p2,keyToCurr,p);
if( p.z < 0 )
return Double.MAX_VALUE;
// compute observational error in each view
double error = errorCam1.errorSq(obs.p1.x,obs.p1.y,p.x/p.z,p.y/p.z);
... | java | @Override
public double computeDistance(AssociatedPair obs) {
// triangulate the point in 3D space
triangulate.triangulate(obs.p1,obs.p2,keyToCurr,p);
if( p.z < 0 )
return Double.MAX_VALUE;
// compute observational error in each view
double error = errorCam1.errorSq(obs.p1.x,obs.p1.y,p.x/p.z,p.y/p.z);
... | [
"@",
"Override",
"public",
"double",
"computeDistance",
"(",
"AssociatedPair",
"obs",
")",
"{",
"// triangulate the point in 3D space",
"triangulate",
".",
"triangulate",
"(",
"obs",
".",
"p1",
",",
"obs",
".",
"p2",
",",
"keyToCurr",
",",
"p",
")",
";",
"if",... | Computes the error given the motion model
@param obs Observation in normalized pixel coordinates
@return observation error | [
"Computes",
"the",
"error",
"given",
"the",
"motion",
"model"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/DistanceSe3SymmetricSq.java#L93-L112 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java | GImageDerivativeOps.getDerivativeType | public static <I extends ImageGray<I>, D extends ImageGray<D>>
Class<D> getDerivativeType( Class<I> imageType ) {
if( imageType == GrayF32.class ) {
return (Class<D>) GrayF32.class;
} else if( imageType == GrayU8.class ) {
return (Class<D>) GrayS16.class;
} else if( imageType == GrayU16.class ) {
retur... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
Class<D> getDerivativeType( Class<I> imageType ) {
if( imageType == GrayF32.class ) {
return (Class<D>) GrayF32.class;
} else if( imageType == GrayU8.class ) {
return (Class<D>) GrayS16.class;
} else if( imageType == GrayU16.class ) {
retur... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"Class",
"<",
"D",
">",
"getDerivativeType",
"(",
"Class",
"<",
"I",
">",
"imageType",
")",
"{",
"if",
"(",
"imageType",
"==",
... | Returns the type of image the derivative should be for the specified input type.
@param imageType Input image type.
@return Appropriate output image type. | [
"Returns",
"the",
"type",
"of",
"image",
"the",
"derivative",
"should",
"be",
"for",
"the",
"specified",
"input",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java#L57-L68 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java | GImageDerivativeOps.hessian | public static <I extends ImageGray<I>, D extends ImageGray<D>>
void hessian( DerivativeType type , I input , D derivXX , D derivYY , D derivXY , BorderType borderType ) {
ImageBorder<I> border = BorderType.SKIP == borderType ? null : FactoryImageBorder.wrap(borderType, input);
switch( type ) {
case SOBEL:
... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
void hessian( DerivativeType type , I input , D derivXX , D derivYY , D derivXY , BorderType borderType ) {
ImageBorder<I> border = BorderType.SKIP == borderType ? null : FactoryImageBorder.wrap(borderType, input);
switch( type ) {
case SOBEL:
... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"hessian",
"(",
"DerivativeType",
"type",
",",
"I",
"input",
",",
"D",
"derivXX",
",",
"D",
"derivYY",
",",
"D",
"deriv... | Computes the hessian from the original input image. Only Sobel and Three supported.
@param type Type of gradient to compute
@param input Input image
@param derivXX Output. Derivative XX
@param derivYY Output. Derivative YY
@param derivXY Output. Derivative XY
@param borderType How it should handle borders. null == ... | [
"Computes",
"the",
"hessian",
"from",
"the",
"original",
"input",
"image",
".",
"Only",
"Sobel",
"and",
"Three",
"supported",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java#L181-L209 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java | GImageDerivativeOps.hessian | public static <D extends ImageGray<D>>
void hessian( DerivativeType type , D derivX , D derivY , D derivXX , D derivYY , D derivXY , BorderType borderType ) {
ImageBorder<D> border = BorderType.SKIP == borderType ? null : FactoryImageBorder.wrap(borderType, derivX);
switch( type ) {
case PREWITT:
if( deriv... | java | public static <D extends ImageGray<D>>
void hessian( DerivativeType type , D derivX , D derivY , D derivXX , D derivYY , D derivXY , BorderType borderType ) {
ImageBorder<D> border = BorderType.SKIP == borderType ? null : FactoryImageBorder.wrap(borderType, derivX);
switch( type ) {
case PREWITT:
if( deriv... | [
"public",
"static",
"<",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"hessian",
"(",
"DerivativeType",
"type",
",",
"D",
"derivX",
",",
"D",
"derivY",
",",
"D",
"derivXX",
",",
"D",
"derivYY",
",",
"D",
"derivXY",
",",
"BorderType",
"borde... | Computes the hessian from the gradient. Only Prewitt, Sobel and Three supported.
@param type Type of gradient to compute
@param derivX Input derivative X
@param derivY Input derivative Y
@param derivXX Output. Derivative XX
@param derivYY Output. Derivative YY
@param derivXY Output. Derivative XY
@param borderType H... | [
"Computes",
"the",
"hessian",
"from",
"the",
"gradient",
".",
"Only",
"Prewitt",
"Sobel",
"and",
"Three",
"supported",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java#L222-L260 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java | GImageDerivativeOps.lookupKernelX | public static KernelBase lookupKernelX( DerivativeType type , boolean isInteger) {
switch( type ) {
case PREWITT:
return GradientPrewitt.getKernelX(isInteger);
case SOBEL:
return GradientSobel.getKernelX(isInteger);
case THREE:
return GradientThree.getKernelX(isInteger);
case TWO_0:
ret... | java | public static KernelBase lookupKernelX( DerivativeType type , boolean isInteger) {
switch( type ) {
case PREWITT:
return GradientPrewitt.getKernelX(isInteger);
case SOBEL:
return GradientSobel.getKernelX(isInteger);
case THREE:
return GradientThree.getKernelX(isInteger);
case TWO_0:
ret... | [
"public",
"static",
"KernelBase",
"lookupKernelX",
"(",
"DerivativeType",
"type",
",",
"boolean",
"isInteger",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"PREWITT",
":",
"return",
"GradientPrewitt",
".",
"getKernelX",
"(",
"isInteger",
")",
";",
"case"... | Returns the kernel for finding the X derivative.
@param type Type of gradient
@param isInteger integer or floating point kernels
@return The kernel. Can be 1D or 2D | [
"Returns",
"the",
"kernel",
"for",
"finding",
"the",
"X",
"derivative",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GImageDerivativeOps.java#L268-L287 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/KeyPointsCircleHexagonalGrid.java | KeyPointsCircleHexagonalGrid.computeEllipseCenters | boolean computeEllipseCenters() {
keypoints.reset();
for (int tangentIdx = 0; tangentIdx < tangents.size(); tangentIdx++) {
// System.out.println("tangent id "+tangentIdx);
Tangents t = tangents.get(tangentIdx);
Point2D_F64 center = keypoints.grow();
center.set(0,0);
double totalWeight = 0;
for (... | java | boolean computeEllipseCenters() {
keypoints.reset();
for (int tangentIdx = 0; tangentIdx < tangents.size(); tangentIdx++) {
// System.out.println("tangent id "+tangentIdx);
Tangents t = tangents.get(tangentIdx);
Point2D_F64 center = keypoints.grow();
center.set(0,0);
double totalWeight = 0;
for (... | [
"boolean",
"computeEllipseCenters",
"(",
")",
"{",
"keypoints",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"tangentIdx",
"=",
"0",
";",
"tangentIdx",
"<",
"tangents",
".",
"size",
"(",
")",
";",
"tangentIdx",
"++",
")",
"{",
"//\t\t\tSystem.out.printl... | Finds the intersection of all the tangent lines with each other the computes the average of those points.
That location is where the center is set to. Each intersection of lines is weighted by the acute angle.
lines which are 90 degrees to each other are less sensitive to noise | [
"Finds",
"the",
"intersection",
"of",
"all",
"the",
"tangent",
"lines",
"with",
"each",
"other",
"the",
"computes",
"the",
"average",
"of",
"those",
"points",
".",
"That",
"location",
"is",
"where",
"the",
"center",
"is",
"set",
"to",
".",
"Each",
"interse... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/KeyPointsCircleHexagonalGrid.java#L190-L237 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.getBand | public T getBand(int band) {
if (band >= bands.length || band < 0)
throw new IllegalArgumentException("The specified band is out of bounds: "+band);
return bands[band];
} | java | public T getBand(int band) {
if (band >= bands.length || band < 0)
throw new IllegalArgumentException("The specified band is out of bounds: "+band);
return bands[band];
} | [
"public",
"T",
"getBand",
"(",
"int",
"band",
")",
"{",
"if",
"(",
"band",
">=",
"bands",
".",
"length",
"||",
"band",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The specified band is out of bounds: \"",
"+",
"band",
")",
";",
"return... | Returns a band in the multi-band image.
@param band Which band should be returned.
@return Image band | [
"Returns",
"a",
"band",
"in",
"the",
"multi",
"-",
"band",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L132-L137 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.setTo | @Override
public void setTo( Planar<T> orig) {
if (orig.width != width || orig.height != height)
reshape(orig.width,orig.height);
if( orig.getBandType() != getBandType() )
throw new IllegalArgumentException("The band type must be the same");
int N = orig.getNumBands();
if( N != getNumBands() ) {
setN... | java | @Override
public void setTo( Planar<T> orig) {
if (orig.width != width || orig.height != height)
reshape(orig.width,orig.height);
if( orig.getBandType() != getBandType() )
throw new IllegalArgumentException("The band type must be the same");
int N = orig.getNumBands();
if( N != getNumBands() ) {
setN... | [
"@",
"Override",
"public",
"void",
"setTo",
"(",
"Planar",
"<",
"T",
">",
"orig",
")",
"{",
"if",
"(",
"orig",
".",
"width",
"!=",
"width",
"||",
"orig",
".",
"height",
"!=",
"height",
")",
"reshape",
"(",
"orig",
".",
"width",
",",
"orig",
".",
... | Sets the values of each pixel equal to the pixels in the specified matrix.
Automatically resized to match the input image.
@param orig The original image whose value is to be copied into this one | [
"Sets",
"the",
"values",
"of",
"each",
"pixel",
"equal",
"to",
"the",
"pixels",
"in",
"the",
"specified",
"matrix",
".",
"Automatically",
"resized",
"to",
"match",
"the",
"input",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L181-L196 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.createNew | @Override
public Planar<T> createNew(int imgWidth, int imgHeight) {
return new Planar<>(type, imgWidth, imgHeight, bands.length);
} | java | @Override
public Planar<T> createNew(int imgWidth, int imgHeight) {
return new Planar<>(type, imgWidth, imgHeight, bands.length);
} | [
"@",
"Override",
"public",
"Planar",
"<",
"T",
">",
"createNew",
"(",
"int",
"imgWidth",
",",
"int",
"imgHeight",
")",
"{",
"return",
"new",
"Planar",
"<>",
"(",
"type",
",",
"imgWidth",
",",
"imgHeight",
",",
"bands",
".",
"length",
")",
";",
"}"
] | Creates a new image of the same type and number of bands
@param imgWidth image width
@param imgHeight image height
@return new image | [
"Creates",
"a",
"new",
"image",
"of",
"the",
"same",
"type",
"and",
"number",
"of",
"bands"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L255-L258 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.reorderBands | public void reorderBands( int ...order ) {
T[] bands = (T[]) Array.newInstance(type, order.length);
for (int i = 0; i < order.length; i++) {
bands[i] = this.bands[order[i]];
}
this.bands = bands;
} | java | public void reorderBands( int ...order ) {
T[] bands = (T[]) Array.newInstance(type, order.length);
for (int i = 0; i < order.length; i++) {
bands[i] = this.bands[order[i]];
}
this.bands = bands;
} | [
"public",
"void",
"reorderBands",
"(",
"int",
"...",
"order",
")",
"{",
"T",
"[",
"]",
"bands",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
"type",
",",
"order",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Changes the bands order
@param order The new band order | [
"Changes",
"the",
"bands",
"order"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L284-L291 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.setNumberOfBands | @Override
public void setNumberOfBands( int numberOfBands ) {
if( numberOfBands == this.bands.length )
return;
T[] bands = (T[]) Array.newInstance(type, numberOfBands);
int N = Math.min(numberOfBands, this.bands.length );
for (int i = 0; i < N; i++) {
bands[i] = this.bands[i];
}
for (int i = N; i < ... | java | @Override
public void setNumberOfBands( int numberOfBands ) {
if( numberOfBands == this.bands.length )
return;
T[] bands = (T[]) Array.newInstance(type, numberOfBands);
int N = Math.min(numberOfBands, this.bands.length );
for (int i = 0; i < N; i++) {
bands[i] = this.bands[i];
}
for (int i = N; i < ... | [
"@",
"Override",
"public",
"void",
"setNumberOfBands",
"(",
"int",
"numberOfBands",
")",
"{",
"if",
"(",
"numberOfBands",
"==",
"this",
".",
"bands",
".",
"length",
")",
"return",
";",
"T",
"[",
"]",
"bands",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".... | Changes the number of bands in the image. A new array is declared and individual bands are recycled
if possible
@param numberOfBands New number of bands in the image. | [
"Changes",
"the",
"number",
"of",
"bands",
"in",
"the",
"image",
".",
"A",
"new",
"array",
"is",
"declared",
"and",
"individual",
"bands",
"are",
"recycled",
"if",
"possible"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L298-L312 | train |
lessthanoptimal/BoofCV | main/boofcv-learning/src/main/java/boofcv/struct/learning/Confusion.java | Confusion.computeAccuracy | public double computeAccuracy() {
double totalCorrect = 0;
double totalIncorrect = 0;
for (int i = 0; i < actualCounts.length; i++) {
for (int j = 0; j < actualCounts.length; j++) {
if( i == j ) {
totalCorrect += matrix.get(i,j);
} else {
totalIncorrect += matrix.get(i,j);
}
}
}
... | java | public double computeAccuracy() {
double totalCorrect = 0;
double totalIncorrect = 0;
for (int i = 0; i < actualCounts.length; i++) {
for (int j = 0; j < actualCounts.length; j++) {
if( i == j ) {
totalCorrect += matrix.get(i,j);
} else {
totalIncorrect += matrix.get(i,j);
}
}
}
... | [
"public",
"double",
"computeAccuracy",
"(",
")",
"{",
"double",
"totalCorrect",
"=",
"0",
";",
"double",
"totalIncorrect",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"actualCounts",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",... | Computes accuracy from the confusion matrix. This is the sum of the fraction correct divide by total number
of types. The number of each sample for each type is not taken in account.
@return overall accuracy | [
"Computes",
"accuracy",
"from",
"the",
"confusion",
"matrix",
".",
"This",
"is",
"the",
"sum",
"of",
"the",
"fraction",
"correct",
"divide",
"by",
"total",
"number",
"of",
"types",
".",
"The",
"number",
"of",
"each",
"sample",
"for",
"each",
"type",
"is",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-learning/src/main/java/boofcv/struct/learning/Confusion.java#L48-L63 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java | CalibrateMonoPlanar.addImage | public void addImage( CalibrationObservation observation ) {
if( imageWidth == 0 ) {
this.imageWidth = observation.getWidth();
this.imageHeight = observation.getHeight();
} else if( observation.getWidth() != this.imageWidth || observation.getHeight() != this.imageHeight) {
throw new IllegalArgumentExceptio... | java | public void addImage( CalibrationObservation observation ) {
if( imageWidth == 0 ) {
this.imageWidth = observation.getWidth();
this.imageHeight = observation.getHeight();
} else if( observation.getWidth() != this.imageWidth || observation.getHeight() != this.imageHeight) {
throw new IllegalArgumentExceptio... | [
"public",
"void",
"addImage",
"(",
"CalibrationObservation",
"observation",
")",
"{",
"if",
"(",
"imageWidth",
"==",
"0",
")",
"{",
"this",
".",
"imageWidth",
"=",
"observation",
".",
"getWidth",
"(",
")",
";",
"this",
".",
"imageHeight",
"=",
"observation",... | Adds the observations from a calibration target detector
@param observation Detected calibration points | [
"Adds",
"the",
"observations",
"from",
"a",
"calibration",
"target",
"detector"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java#L139-L147 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java | CalibrateMonoPlanar.process | public <T extends CameraModel>T process() {
if( zhang99 == null )
throw new IllegalArgumentException("Please call configure first.");
zhang99.setVerbose(verbose,0);
if( !zhang99.process(observations) ) {
throw new RuntimeException("Zhang99 algorithm failed!");
}
structure = zhang99.getStructure();
e... | java | public <T extends CameraModel>T process() {
if( zhang99 == null )
throw new IllegalArgumentException("Please call configure first.");
zhang99.setVerbose(verbose,0);
if( !zhang99.process(observations) ) {
throw new RuntimeException("Zhang99 algorithm failed!");
}
structure = zhang99.getStructure();
e... | [
"public",
"<",
"T",
"extends",
"CameraModel",
">",
"T",
"process",
"(",
")",
"{",
"if",
"(",
"zhang99",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Please call configure first.\"",
")",
";",
"zhang99",
".",
"setVerbose",
"(",
"verbos... | After calibration points have been found this invokes the Zhang99 algorithm to
estimate calibration parameters. Error statistics are also computed. | [
"After",
"calibration",
"points",
"have",
"been",
"found",
"this",
"invokes",
"the",
"Zhang99",
"algorithm",
"to",
"estimate",
"calibration",
"parameters",
".",
"Error",
"statistics",
"are",
"also",
"computed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java#L160-L177 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java | CalibrateMonoPlanar.printErrors | public static void printErrors( List<ImageResults> results ) {
double totalError = 0;
for( int i = 0; i < results.size(); i++ ) {
ImageResults r = results.get(i);
totalError += r.meanError;
System.out.printf("image %3d Euclidean ( mean = %7.1e max = %7.1e ) bias ( X = %8.1e Y %8.1e )\n",i,r.meanError,r.ma... | java | public static void printErrors( List<ImageResults> results ) {
double totalError = 0;
for( int i = 0; i < results.size(); i++ ) {
ImageResults r = results.get(i);
totalError += r.meanError;
System.out.printf("image %3d Euclidean ( mean = %7.1e max = %7.1e ) bias ( X = %8.1e Y %8.1e )\n",i,r.meanError,r.ma... | [
"public",
"static",
"void",
"printErrors",
"(",
"List",
"<",
"ImageResults",
">",
"results",
")",
"{",
"double",
"totalError",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"results",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
... | Prints out error information to standard out | [
"Prints",
"out",
"error",
"information",
"to",
"standard",
"out"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/abst/geo/calibration/CalibrateMonoPlanar.java#L189-L198 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java | ConfusionMatrixPanel.renderLabels | private void renderLabels(Graphics2D g2, double fontSize) {
int numCategories = confusion.getNumRows();
int longestLabel = 0;
if(renderLabels) {
for (int i = 0; i < numCategories; i++) {
longestLabel = Math.max(longestLabel,labels.get(i).length());
}
}
Font fontLabel = new Font("monospaced", Font.... | java | private void renderLabels(Graphics2D g2, double fontSize) {
int numCategories = confusion.getNumRows();
int longestLabel = 0;
if(renderLabels) {
for (int i = 0; i < numCategories; i++) {
longestLabel = Math.max(longestLabel,labels.get(i).length());
}
}
Font fontLabel = new Font("monospaced", Font.... | [
"private",
"void",
"renderLabels",
"(",
"Graphics2D",
"g2",
",",
"double",
"fontSize",
")",
"{",
"int",
"numCategories",
"=",
"confusion",
".",
"getNumRows",
"(",
")",
";",
"int",
"longestLabel",
"=",
"0",
";",
"if",
"(",
"renderLabels",
")",
"{",
"for",
... | Renders the names on each category to the side of the confusion matrix | [
"Renders",
"the",
"names",
"on",
"each",
"category",
"to",
"the",
"side",
"of",
"the",
"confusion",
"matrix"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java#L200-L236 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java | ConfusionMatrixPanel.renderMatrix | private void renderMatrix(Graphics2D g2, double fontSize) {
int numCategories = confusion.getNumRows();
Font fontNumber = new Font("Serif", Font.BOLD, (int)(0.6*fontSize + 0.5));
g2.setFont(fontNumber);
FontMetrics metrics = g2.getFontMetrics(fontNumber);
for (int i = 0; i < numCategories; i++) {
int y0 =... | java | private void renderMatrix(Graphics2D g2, double fontSize) {
int numCategories = confusion.getNumRows();
Font fontNumber = new Font("Serif", Font.BOLD, (int)(0.6*fontSize + 0.5));
g2.setFont(fontNumber);
FontMetrics metrics = g2.getFontMetrics(fontNumber);
for (int i = 0; i < numCategories; i++) {
int y0 =... | [
"private",
"void",
"renderMatrix",
"(",
"Graphics2D",
"g2",
",",
"double",
"fontSize",
")",
"{",
"int",
"numCategories",
"=",
"confusion",
".",
"getNumRows",
"(",
")",
";",
"Font",
"fontNumber",
"=",
"new",
"Font",
"(",
"\"Serif\"",
",",
"Font",
".",
"BOLD... | Renders the confusion matrix and visualizes the value in each cell with a color and optionally a color. | [
"Renders",
"the",
"confusion",
"matrix",
"and",
"visualizes",
"the",
"value",
"in",
"each",
"cell",
"with",
"a",
"color",
"and",
"optionally",
"a",
"color",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java#L241-L290 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java | ConfusionMatrixPanel.whatIsAtPoint | public LocationInfo whatIsAtPoint( int pixelX , int pixelY , LocationInfo output ) {
if( output == null )
output = new LocationInfo();
int numCategories = confusion.getNumRows();
synchronized ( this ) {
if( pixelX >= gridWidth ) {
output.insideMatrix = false;
output.col = output.row = pixelY*numCa... | java | public LocationInfo whatIsAtPoint( int pixelX , int pixelY , LocationInfo output ) {
if( output == null )
output = new LocationInfo();
int numCategories = confusion.getNumRows();
synchronized ( this ) {
if( pixelX >= gridWidth ) {
output.insideMatrix = false;
output.col = output.row = pixelY*numCa... | [
"public",
"LocationInfo",
"whatIsAtPoint",
"(",
"int",
"pixelX",
",",
"int",
"pixelY",
",",
"LocationInfo",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"LocationInfo",
"(",
")",
";",
"int",
"numCategories",
"=",
"confu... | Use to sample the panel to see what is being displayed at the location clicked. All coordinates
are in panel coordinates.
@param pixelX x-axis in panel coordinates
@param pixelY y-axis in panel coordinates
@param output (Optional) storage for output.
@return Information on what is at the specified location | [
"Use",
"to",
"sample",
"the",
"panel",
"to",
"see",
"what",
"is",
"being",
"displayed",
"at",
"the",
"location",
"clicked",
".",
"All",
"coordinates",
"are",
"in",
"panel",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java#L301-L319 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.configure | public void configure( int widthStitch, int heightStitch , IT worldToInit ) {
this.worldToInit = (IT)worldToCurr.createInstance();
if( worldToInit != null )
this.worldToInit.set(worldToInit);
this.widthStitch = widthStitch;
this.heightStitch = heightStitch;
} | java | public void configure( int widthStitch, int heightStitch , IT worldToInit ) {
this.worldToInit = (IT)worldToCurr.createInstance();
if( worldToInit != null )
this.worldToInit.set(worldToInit);
this.widthStitch = widthStitch;
this.heightStitch = heightStitch;
} | [
"public",
"void",
"configure",
"(",
"int",
"widthStitch",
",",
"int",
"heightStitch",
",",
"IT",
"worldToInit",
")",
"{",
"this",
".",
"worldToInit",
"=",
"(",
"IT",
")",
"worldToCurr",
".",
"createInstance",
"(",
")",
";",
"if",
"(",
"worldToInit",
"!=",
... | Specifies size of stitch image and the location of the initial coordinate system.
@param widthStitch Width of the image being stitched into
@param heightStitch Height of the image being stitched into
@param worldToInit (Option) Used to change the location of the initial frame in stitched image.
null means no transform... | [
"Specifies",
"size",
"of",
"stitch",
"image",
"and",
"the",
"location",
"of",
"the",
"initial",
"coordinate",
"system",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L120-L126 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.reset | public void reset() {
if( stitchedImage != null )
GImageMiscOps.fill(stitchedImage, 0);
motion.reset();
worldToCurr.reset();
first = true;
} | java | public void reset() {
if( stitchedImage != null )
GImageMiscOps.fill(stitchedImage, 0);
motion.reset();
worldToCurr.reset();
first = true;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"stitchedImage",
"!=",
"null",
")",
"GImageMiscOps",
".",
"fill",
"(",
"stitchedImage",
",",
"0",
")",
";",
"motion",
".",
"reset",
"(",
")",
";",
"worldToCurr",
".",
"reset",
"(",
")",
";",
"first... | Throws away current results and starts over again | [
"Throws",
"away",
"current",
"results",
"and",
"starts",
"over",
"again"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L155-L161 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.checkLargeMotion | private boolean checkLargeMotion( int width , int height ) {
if( first ) {
getImageCorners(width,height,corners);
previousArea = computeArea(corners);
first = false;
} else {
getImageCorners(width,height,corners);
double area = computeArea(corners);
double change = Math.max(area/previousArea,pre... | java | private boolean checkLargeMotion( int width , int height ) {
if( first ) {
getImageCorners(width,height,corners);
previousArea = computeArea(corners);
first = false;
} else {
getImageCorners(width,height,corners);
double area = computeArea(corners);
double change = Math.max(area/previousArea,pre... | [
"private",
"boolean",
"checkLargeMotion",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"first",
")",
"{",
"getImageCorners",
"(",
"width",
",",
"height",
",",
"corners",
")",
";",
"previousArea",
"=",
"computeArea",
"(",
"corners",
")",
... | Looks for sudden large changes in corner location to detect motion estimation faults.
@param width image width
@param height image height
@return true for fault | [
"Looks",
"for",
"sudden",
"large",
"changes",
"in",
"corner",
"location",
"to",
"detect",
"motion",
"estimation",
"faults",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L169-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.update | private void update(I image) {
computeCurrToInit_PixelTran();
// only process a cropped portion to speed up processing
RectangleLength2D_I32 box = DistortImageOps.boundBox(image.width, image.height,
stitchedImage.width, stitchedImage.height,work, tranCurrToWorld);
int x0 = box.x0;
int y0 = box.y0;
int... | java | private void update(I image) {
computeCurrToInit_PixelTran();
// only process a cropped portion to speed up processing
RectangleLength2D_I32 box = DistortImageOps.boundBox(image.width, image.height,
stitchedImage.width, stitchedImage.height,work, tranCurrToWorld);
int x0 = box.x0;
int y0 = box.y0;
int... | [
"private",
"void",
"update",
"(",
"I",
"image",
")",
"{",
"computeCurrToInit_PixelTran",
"(",
")",
";",
"// only process a cropped portion to speed up processing",
"RectangleLength2D_I32",
"box",
"=",
"DistortImageOps",
".",
"boundBox",
"(",
"image",
".",
"width",
",",
... | Adds the latest image into the stitched image
@param image | [
"Adds",
"the",
"latest",
"image",
"into",
"the",
"stitched",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L200-L214 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.resizeStitchImage | public void resizeStitchImage( int widthStitch, int heightStitch , IT newToOldStitch ) {
// copy the old image into the new one
workImage.reshape(widthStitch,heightStitch);
GImageMiscOps.fill(workImage, 0);
if( newToOldStitch != null ) {
PixelTransform<Point2D_F32> newToOld = converter.convertPixel(newToOld... | java | public void resizeStitchImage( int widthStitch, int heightStitch , IT newToOldStitch ) {
// copy the old image into the new one
workImage.reshape(widthStitch,heightStitch);
GImageMiscOps.fill(workImage, 0);
if( newToOldStitch != null ) {
PixelTransform<Point2D_F32> newToOld = converter.convertPixel(newToOld... | [
"public",
"void",
"resizeStitchImage",
"(",
"int",
"widthStitch",
",",
"int",
"heightStitch",
",",
"IT",
"newToOldStitch",
")",
"{",
"// copy the old image into the new one",
"workImage",
".",
"reshape",
"(",
"widthStitch",
",",
"heightStitch",
")",
";",
"GImageMiscOp... | Resizes the stitch image. If no transform is provided then the old stitch region is simply
places on top of the new one and copied. Pixels which do not exist in the old image are filled with zero.
@param widthStitch The new width of the stitch image.
@param heightStitch The new height of the stitch image.
@param new... | [
"Resizes",
"the",
"stitch",
"image",
".",
"If",
"no",
"transform",
"is",
"provided",
"then",
"the",
"old",
"stitch",
"region",
"is",
"simply",
"places",
"on",
"top",
"of",
"the",
"new",
"one",
"and",
"copied",
".",
"Pixels",
"which",
"do",
"not",
"exist"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L264-L292 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.getImageCorners | public Corners getImageCorners( int width , int height , Corners corners ) {
if( corners == null )
corners = new Corners();
int w = width;
int h = height;
tranCurrToWorld.compute(0,0,work); corners.p0.set(work.x, work.y);
tranCurrToWorld.compute(w,0,work); corners.p1.set(work.x, work.y);
tranCurrTo... | java | public Corners getImageCorners( int width , int height , Corners corners ) {
if( corners == null )
corners = new Corners();
int w = width;
int h = height;
tranCurrToWorld.compute(0,0,work); corners.p0.set(work.x, work.y);
tranCurrToWorld.compute(w,0,work); corners.p1.set(work.x, work.y);
tranCurrTo... | [
"public",
"Corners",
"getImageCorners",
"(",
"int",
"width",
",",
"int",
"height",
",",
"Corners",
"corners",
")",
"{",
"if",
"(",
"corners",
"==",
"null",
")",
"corners",
"=",
"new",
"Corners",
"(",
")",
";",
"int",
"w",
"=",
"width",
";",
"int",
"h... | Returns the location of the input image's corners inside the stitch image.
@return image corners | [
"Returns",
"the",
"location",
"of",
"the",
"input",
"image",
"s",
"corners",
"inside",
"the",
"stitch",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L299-L313 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalAlgebraicPoint7.java | TrifocalAlgebraicPoint7.minimizeWithGeometricConstraints | private void minimizeWithGeometricConstraints() {
extractEpipoles.setTensor(solutionN);
extractEpipoles.extractEpipoles(e2,e3);
// encode the parameters being optimized
param[0] = e2.x; param[1] = e2.y; param[2] = e2.z;
param[3] = e3.x; param[4] = e3.y; param[5] = e3.z;
// adjust the error function for th... | java | private void minimizeWithGeometricConstraints() {
extractEpipoles.setTensor(solutionN);
extractEpipoles.extractEpipoles(e2,e3);
// encode the parameters being optimized
param[0] = e2.x; param[1] = e2.y; param[2] = e2.z;
param[3] = e3.x; param[4] = e3.y; param[5] = e3.z;
// adjust the error function for th... | [
"private",
"void",
"minimizeWithGeometricConstraints",
"(",
")",
"{",
"extractEpipoles",
".",
"setTensor",
"(",
"solutionN",
")",
";",
"extractEpipoles",
".",
"extractEpipoles",
"(",
"e2",
",",
"e3",
")",
";",
"// encode the parameters being optimized",
"param",
"[",
... | Minimize the algebraic error using LM. The two epipoles are the parameters being optimized. | [
"Minimize",
"the",
"algebraic",
"error",
"using",
"LM",
".",
"The",
"two",
"epipoles",
"are",
"the",
"parameters",
"being",
"optimized",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalAlgebraicPoint7.java#L103-L127 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PositiveDepthConstraintCheck.java | PositiveDepthConstraintCheck.checkConstraint | public boolean checkConstraint( Point2D_F64 viewA , Point2D_F64 viewB , Se3_F64 fromAtoB ) {
triangulate.triangulate(viewA,viewB,fromAtoB,P);
if( P.z > 0 ) {
SePointOps_F64.transform(fromAtoB,P,P);
return P.z > 0;
}
return false;
} | java | public boolean checkConstraint( Point2D_F64 viewA , Point2D_F64 viewB , Se3_F64 fromAtoB ) {
triangulate.triangulate(viewA,viewB,fromAtoB,P);
if( P.z > 0 ) {
SePointOps_F64.transform(fromAtoB,P,P);
return P.z > 0;
}
return false;
} | [
"public",
"boolean",
"checkConstraint",
"(",
"Point2D_F64",
"viewA",
",",
"Point2D_F64",
"viewB",
",",
"Se3_F64",
"fromAtoB",
")",
"{",
"triangulate",
".",
"triangulate",
"(",
"viewA",
",",
"viewB",
",",
"fromAtoB",
",",
"P",
")",
";",
"if",
"(",
"P",
".",... | Checks to see if a single point meets the constraint.
@param viewA View of the 3D point from the first camera. Calibrated coordinates.
@param viewB View of the 3D point from the second camera. Calibrated coordinates.
@param fromAtoB Transform from the B to A camera frame.
@return If the triangulated point appears in... | [
"Checks",
"to",
"see",
"if",
"a",
"single",
"point",
"meets",
"the",
"constraint",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PositiveDepthConstraintCheck.java#L67-L76 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java | FactoryMotion2D.createMotion2D | public static <I extends ImageBase<I>, IT extends InvertibleTransform>
ImageMotion2D<I,IT> createMotion2D( int ransacIterations , double inlierThreshold,int outlierPrune,
int absoluteMinimumTracks, double respawnTrackFraction,
double respawnCoverageFraction,
boolean refineEstimate ,
... | java | public static <I extends ImageBase<I>, IT extends InvertibleTransform>
ImageMotion2D<I,IT> createMotion2D( int ransacIterations , double inlierThreshold,int outlierPrune,
int absoluteMinimumTracks, double respawnTrackFraction,
double respawnCoverageFraction,
boolean refineEstimate ,
... | [
"public",
"static",
"<",
"I",
"extends",
"ImageBase",
"<",
"I",
">",
",",
"IT",
"extends",
"InvertibleTransform",
">",
"ImageMotion2D",
"<",
"I",
",",
"IT",
">",
"createMotion2D",
"(",
"int",
"ransacIterations",
",",
"double",
"inlierThreshold",
",",
"int",
... | Estimates the 2D motion of an image using different models.
@param ransacIterations Number of RANSAC iterations
@param inlierThreshold Threshold which defines an inlier.
@param outlierPrune If a feature is an outlier for this many turns in a row it is dropped. Try 2
@param absoluteMinimumTracks New features will be re... | [
"Estimates",
"the",
"2D",
"motion",
"of",
"an",
"image",
"using",
"different",
"models",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java#L73-L121 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java | FactoryMotion2D.createVideoStitch | @SuppressWarnings("unchecked")
public static <I extends ImageBase<I>, IT extends InvertibleTransform>
StitchingFromMotion2D<I, IT>
createVideoStitch( double maxJumpFraction , ImageMotion2D<I,IT> motion2D , ImageType<I> imageType ) {
StitchingTransform<IT> transform;
if( motion2D.getTransformType() == Affine2D_F... | java | @SuppressWarnings("unchecked")
public static <I extends ImageBase<I>, IT extends InvertibleTransform>
StitchingFromMotion2D<I, IT>
createVideoStitch( double maxJumpFraction , ImageMotion2D<I,IT> motion2D , ImageType<I> imageType ) {
StitchingTransform<IT> transform;
if( motion2D.getTransformType() == Affine2D_F... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"I",
"extends",
"ImageBase",
"<",
"I",
">",
",",
"IT",
"extends",
"InvertibleTransform",
">",
"StitchingFromMotion2D",
"<",
"I",
",",
"IT",
">",
"createVideoStitch",
"(",
"double",
"m... | Estimates the image motion then combines images together. Typically used for mosaics and stabilization.
@param maxJumpFraction If the area changes by this much between two consecuative frames then the transform
is reset.
@param motion2D Estimates the image motion.
@param imageType Type of image processed
@param <I> I... | [
"Estimates",
"the",
"image",
"motion",
"then",
"combines",
"images",
"together",
".",
"Typically",
"used",
"for",
"mosaics",
"and",
"stabilization",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java#L134-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java | ImageStatistics.min | public static int min( GrayS32 input ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.min(input.data, input.startIndex, input.height, input.width , input.stride);
} else {
return ImplImageStatistics.min(input.data, input.startIndex, input.height, input.width , input.stride);
}
} | java | public static int min( GrayS32 input ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.min(input.data, input.startIndex, input.height, input.width , input.stride);
} else {
return ImplImageStatistics.min(input.data, input.startIndex, input.height, input.width , input.stride);
}
} | [
"public",
"static",
"int",
"min",
"(",
"GrayS32",
"input",
")",
"{",
"if",
"(",
"BoofConcurrency",
".",
"USE_CONCURRENT",
")",
"{",
"return",
"ImplImageStatistics_MT",
".",
"min",
"(",
"input",
".",
"data",
",",
"input",
".",
"startIndex",
",",
"input",
".... | Returns the minimum element value.
@param input Input image. Not modified.
@return Minimum pixel value. | [
"Returns",
"the",
"minimum",
"element",
"value",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java#L971-L977 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java | ImageStatistics.maxAbs | public static float maxAbs( InterleavedF32 input ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.maxAbs(input.data, input.startIndex, input.height, input.width*input.numBands , input.stride);
} else {
return ImplImageStatistics.maxAbs(input.data, input.startIndex, input.height, input.... | java | public static float maxAbs( InterleavedF32 input ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.maxAbs(input.data, input.startIndex, input.height, input.width*input.numBands , input.stride);
} else {
return ImplImageStatistics.maxAbs(input.data, input.startIndex, input.height, input.... | [
"public",
"static",
"float",
"maxAbs",
"(",
"InterleavedF32",
"input",
")",
"{",
"if",
"(",
"BoofConcurrency",
".",
"USE_CONCURRENT",
")",
"{",
"return",
"ImplImageStatistics_MT",
".",
"maxAbs",
"(",
"input",
".",
"data",
",",
"input",
".",
"startIndex",
",",
... | Returns the maximum element value.
@param input Input image. Not modified.
@return Maximum pixel value. | [
"Returns",
"the",
"maximum",
"element",
"value",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageStatistics.java#L1503-L1509 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.connectToNeighbors | private void connectToNeighbors(int x, int y ) {
List<LineSegment2D_F32> lines = grid.get(x,y);
Iterator<LineSegment2D_F32> iter = lines.iterator();
while( iter.hasNext() )
{
LineSegment2D_F32 l = iter.next();
boolean connected = false;
if( connectTry(l,x+1,y) )
connected = true;
if( !connecte... | java | private void connectToNeighbors(int x, int y ) {
List<LineSegment2D_F32> lines = grid.get(x,y);
Iterator<LineSegment2D_F32> iter = lines.iterator();
while( iter.hasNext() )
{
LineSegment2D_F32 l = iter.next();
boolean connected = false;
if( connectTry(l,x+1,y) )
connected = true;
if( !connecte... | [
"private",
"void",
"connectToNeighbors",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"List",
"<",
"LineSegment2D_F32",
">",
"lines",
"=",
"grid",
".",
"get",
"(",
"x",
",",
"y",
")",
";",
"Iterator",
"<",
"LineSegment2D_F32",
">",
"iter",
"=",
"lines",... | Connect lines in the target region to lines in neighboring regions. Regions are selected such that
no two regions are compared against each other more than once.
@param x target region grid x-coordinate
@param y target region grid y-coordinate | [
"Connect",
"lines",
"in",
"the",
"target",
"region",
"to",
"lines",
"in",
"neighboring",
"regions",
".",
"Regions",
"are",
"selected",
"such",
"that",
"no",
"two",
"regions",
"are",
"compared",
"against",
"each",
"other",
"more",
"than",
"once",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L113-L136 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.connectTry | private boolean connectTry( LineSegment2D_F32 target , int x , int y ) {
if( !grid.isInBounds(x,y) )
return false;
List<LineSegment2D_F32> lines = grid.get(x,y);
int index = findBestCompatible(target,lines,0);
if( index == -1 )
return false;
LineSegment2D_F32 b = lines.remove(index);
// join the ... | java | private boolean connectTry( LineSegment2D_F32 target , int x , int y ) {
if( !grid.isInBounds(x,y) )
return false;
List<LineSegment2D_F32> lines = grid.get(x,y);
int index = findBestCompatible(target,lines,0);
if( index == -1 )
return false;
LineSegment2D_F32 b = lines.remove(index);
// join the ... | [
"private",
"boolean",
"connectTry",
"(",
"LineSegment2D_F32",
"target",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"!",
"grid",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"return",
"false",
";",
"List",
"<",
"LineSegment2D_F32",
">",
... | See if there is a line that matches in this adjacent region.
@param target Line being connected.
@param x x-coordinate of adjacent region.
@param y y-coordinate of adjacent region.
@return true if a connection was made. | [
"See",
"if",
"there",
"is",
"a",
"line",
"that",
"matches",
"in",
"this",
"adjacent",
"region",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L146-L171 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.connectInSameElement | private void connectInSameElement(List<LineSegment2D_F32> lines ) {
for( int i = 0; i < lines.size(); i++ ) {
LineSegment2D_F32 a = lines.get(i);
int index = findBestCompatible(a,lines,i+1);
if( index == -1 )
continue;
// remove the line from the index which it is being connected to
LineSegment2D... | java | private void connectInSameElement(List<LineSegment2D_F32> lines ) {
for( int i = 0; i < lines.size(); i++ ) {
LineSegment2D_F32 a = lines.get(i);
int index = findBestCompatible(a,lines,i+1);
if( index == -1 )
continue;
// remove the line from the index which it is being connected to
LineSegment2D... | [
"private",
"void",
"connectInSameElement",
"(",
"List",
"<",
"LineSegment2D_F32",
">",
"lines",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"lines",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"LineSegment2D_F32",
"a",
"=",
"lines... | Search for lines in the same region for it to be connected to.
@param lines All the lines in the region. | [
"Search",
"for",
"lines",
"in",
"the",
"same",
"region",
"for",
"it",
"to",
"be",
"connected",
"to",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L178-L196 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.findBestCompatible | private int findBestCompatible( LineSegment2D_F32 target ,
List<LineSegment2D_F32> candidates ,
int start )
{
int bestIndex = -1;
double bestDistance = Double.MAX_VALUE;
int bestFarthest = 0;
float targetAngle = UtilAngle.atanSafe(target.slopeY(),target.slopeX());
float cos = (float)Math.c... | java | private int findBestCompatible( LineSegment2D_F32 target ,
List<LineSegment2D_F32> candidates ,
int start )
{
int bestIndex = -1;
double bestDistance = Double.MAX_VALUE;
int bestFarthest = 0;
float targetAngle = UtilAngle.atanSafe(target.slopeY(),target.slopeX());
float cos = (float)Math.c... | [
"private",
"int",
"findBestCompatible",
"(",
"LineSegment2D_F32",
"target",
",",
"List",
"<",
"LineSegment2D_F32",
">",
"candidates",
",",
"int",
"start",
")",
"{",
"int",
"bestIndex",
"=",
"-",
"1",
";",
"double",
"bestDistance",
"=",
"Double",
".",
"MAX_VALU... | Searches for a line in the list which the target is compatible with and can
be connected to.
@param target Line being connected to.
@param candidates List of candidate lines.
@param start First index in the candidate list it should start searching at.
@return Index of the candidate it can connect to. -1 if there is n... | [
"Searches",
"for",
"a",
"line",
"in",
"the",
"list",
"which",
"the",
"target",
"is",
"compatible",
"with",
"and",
"can",
"be",
"connected",
"to",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L207-L263 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.closestFarthestPoints | private void closestFarthestPoints(LineSegment2D_F32 a, LineSegment2D_F32 b)
{
dist[0] = a.a.distance2(b.a);
dist[1] = a.a.distance2(b.b);
dist[2] = a.b.distance2(b.a);
dist[3] = a.b.distance2(b.b);
// find the two points which are closest together and save which ones those are
// for future reference
f... | java | private void closestFarthestPoints(LineSegment2D_F32 a, LineSegment2D_F32 b)
{
dist[0] = a.a.distance2(b.a);
dist[1] = a.a.distance2(b.b);
dist[2] = a.b.distance2(b.a);
dist[3] = a.b.distance2(b.b);
// find the two points which are closest together and save which ones those are
// for future reference
f... | [
"private",
"void",
"closestFarthestPoints",
"(",
"LineSegment2D_F32",
"a",
",",
"LineSegment2D_F32",
"b",
")",
"{",
"dist",
"[",
"0",
"]",
"=",
"a",
".",
"a",
".",
"distance2",
"(",
"b",
".",
"a",
")",
";",
"dist",
"[",
"1",
"]",
"=",
"a",
".",
"a"... | Finds the points on each line which are closest and farthest away from each other. | [
"Finds",
"the",
"points",
"on",
"each",
"line",
"which",
"are",
"closest",
"and",
"farthest",
"away",
"from",
"each",
"other",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L268-L291 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java | CalibrationFiducialDetector.selectBoundaryCorners | protected void selectBoundaryCorners() {
List<Point2D_F64> layout = detector.getLayout();
Polygon2D_F64 hull = new Polygon2D_F64();
UtilPolygons2D_F64.convexHull(layout,hull);
UtilPolygons2D_F64.removeAlmostParallel(hull,0.02);
boundaryIndexes = new int[hull.size()];
for (int i = 0; i < hull.size(); i++) ... | java | protected void selectBoundaryCorners() {
List<Point2D_F64> layout = detector.getLayout();
Polygon2D_F64 hull = new Polygon2D_F64();
UtilPolygons2D_F64.convexHull(layout,hull);
UtilPolygons2D_F64.removeAlmostParallel(hull,0.02);
boundaryIndexes = new int[hull.size()];
for (int i = 0; i < hull.size(); i++) ... | [
"protected",
"void",
"selectBoundaryCorners",
"(",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"layout",
"=",
"detector",
".",
"getLayout",
"(",
")",
";",
"Polygon2D_F64",
"hull",
"=",
"new",
"Polygon2D_F64",
"(",
")",
";",
"UtilPolygons2D_F64",
".",
"convexHul... | Selects points which will be the corners in the boundary. Finds the convex hull. | [
"Selects",
"points",
"which",
"will",
"be",
"the",
"corners",
"in",
"the",
"boundary",
".",
"Finds",
"the",
"convex",
"hull",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java#L203-L225 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.