id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
50,600 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java | DenseFlowPyramidBase.imageNormalization | protected static<T extends ImageGray<T>>
void imageNormalization(T image1, T image2, GrayF32 normalized1, GrayF32 normalized2 )
{
// find the max and min of both images
float max1 = (float)GImageStatistics.max(image1);
float max2 = (float)GImageStatistics.max(image2);
float min1 = (float)GImageStatistics.min(... | java | protected static<T extends ImageGray<T>>
void imageNormalization(T image1, T image2, GrayF32 normalized1, GrayF32 normalized2 )
{
// find the max and min of both images
float max1 = (float)GImageStatistics.max(image1);
float max2 = (float)GImageStatistics.max(image2);
float min1 = (float)GImageStatistics.min(... | [
"protected",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"imageNormalization",
"(",
"T",
"image1",
",",
"T",
"image2",
",",
"GrayF32",
"normalized1",
",",
"GrayF32",
"normalized2",
")",
"{",
"// find the max and min of both images",
"... | Function to normalize the images between 0 and 255. | [
"Function",
"to",
"normalize",
"the",
"images",
"between",
"0",
"and",
"255",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java#L152-L184 |
50,601 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java | HomographyInducedStereo3Pts.process | public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) {
// Fill rows of M with observations from image 1
fillM(p1.p1,p2.p1,p3.p1);
// Compute 'b' vector
b.x = computeB(p1.p2);
b.y = computeB(p2.p2);
b.z = computeB(p3.p2);
// A_inv_b = inv(A)*b
if( !solver.setA(M) )
return... | java | public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) {
// Fill rows of M with observations from image 1
fillM(p1.p1,p2.p1,p3.p1);
// Compute 'b' vector
b.x = computeB(p1.p2);
b.y = computeB(p2.p2);
b.z = computeB(p3.p2);
// A_inv_b = inv(A)*b
if( !solver.setA(M) )
return... | [
"public",
"boolean",
"process",
"(",
"AssociatedPair",
"p1",
",",
"AssociatedPair",
"p2",
",",
"AssociatedPair",
"p3",
")",
"{",
"// Fill rows of M with observations from image 1",
"fillM",
"(",
"p1",
".",
"p1",
",",
"p2",
".",
"p1",
",",
"p3",
".",
"p1",
")",... | Estimates the homography from view 1 to view 2 induced by a plane from 3 point associations.
Each pair must pass the epipolar constraint. This can fail if the points are colinear.
@param p1 Associated point observation
@param p2 Associated point observation
@param p3 Associated point observation
@return True if succe... | [
"Estimates",
"the",
"homography",
"from",
"view",
"1",
"to",
"view",
"2",
"induced",
"by",
"a",
"plane",
"from",
"3",
"point",
"associations",
".",
"Each",
"pair",
"must",
"pass",
"the",
"epipolar",
"constraint",
".",
"This",
"can",
"fail",
"if",
"the",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java#L104-L128 |
50,602 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java | HomographyInducedStereo3Pts.fillM | private void fillM( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) {
M.data[0] = x1.x; M.data[1] = x1.y; M.data[2] = 1;
M.data[3] = x2.x; M.data[4] = x2.y; M.data[5] = 1;
M.data[6] = x3.x; M.data[7] = x3.y; M.data[8] = 1;
} | java | private void fillM( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) {
M.data[0] = x1.x; M.data[1] = x1.y; M.data[2] = 1;
M.data[3] = x2.x; M.data[4] = x2.y; M.data[5] = 1;
M.data[6] = x3.x; M.data[7] = x3.y; M.data[8] = 1;
} | [
"private",
"void",
"fillM",
"(",
"Point2D_F64",
"x1",
",",
"Point2D_F64",
"x2",
",",
"Point2D_F64",
"x3",
")",
"{",
"M",
".",
"data",
"[",
"0",
"]",
"=",
"x1",
".",
"x",
";",
"M",
".",
"data",
"[",
"1",
"]",
"=",
"x1",
".",
"y",
";",
"M",
"."... | Fill rows of M with observations from image 1 | [
"Fill",
"rows",
"of",
"M",
"with",
"observations",
"from",
"image",
"1"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java#L133-L137 |
50,603 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java | DecomposeAbsoluteDualQuadratic.decompose | public boolean decompose( DMatrix4x4 Q ) {
// scale Q so that Q(3,3) = 1 to provide a uniform scaling
CommonOps_DDF4.scale(1.0/Q.a33,Q);
// TODO consider using eigen decomposition like it was suggested
// Directly extract from the definition of Q
// Q = [w -w*p;-p'*w p'*w*p]
// w = k*k'
k.a11 = Q.a11;k... | java | public boolean decompose( DMatrix4x4 Q ) {
// scale Q so that Q(3,3) = 1 to provide a uniform scaling
CommonOps_DDF4.scale(1.0/Q.a33,Q);
// TODO consider using eigen decomposition like it was suggested
// Directly extract from the definition of Q
// Q = [w -w*p;-p'*w p'*w*p]
// w = k*k'
k.a11 = Q.a11;k... | [
"public",
"boolean",
"decompose",
"(",
"DMatrix4x4",
"Q",
")",
"{",
"// scale Q so that Q(3,3) = 1 to provide a uniform scaling",
"CommonOps_DDF4",
".",
"scale",
"(",
"1.0",
"/",
"Q",
".",
"a33",
",",
"Q",
")",
";",
"// TODO consider using eigen decomposition like it was ... | Decomposes the passed in absolute quadratic
@param Q Absolute quadratic
@return true if successful or false if it failed | [
"Decomposes",
"the",
"passed",
"in",
"absolute",
"quadratic"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L54-L92 |
50,604 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java | DecomposeAbsoluteDualQuadratic.recomputeQ | public void recomputeQ( DMatrix4x4 Q ) {
CommonOps_DDF3.multTransB(k,k,w);
Q.a11 = w.a11;Q.a12 = w.a12;Q.a13 = w.a13;
Q.a21 = w.a21;Q.a22 = w.a22;Q.a23 = w.a23;
Q.a31 = w.a31;Q.a32 = w.a32;Q.a33 = w.a33;
CommonOps_DDF3.mult(w,p,t);
CommonOps_DDF3.scale(-1,t);
Q.a14 = t.a1;Q.a24 = t.a2;Q.a34 = t.a3;
Q... | java | public void recomputeQ( DMatrix4x4 Q ) {
CommonOps_DDF3.multTransB(k,k,w);
Q.a11 = w.a11;Q.a12 = w.a12;Q.a13 = w.a13;
Q.a21 = w.a21;Q.a22 = w.a22;Q.a23 = w.a23;
Q.a31 = w.a31;Q.a32 = w.a32;Q.a33 = w.a33;
CommonOps_DDF3.mult(w,p,t);
CommonOps_DDF3.scale(-1,t);
Q.a14 = t.a1;Q.a24 = t.a2;Q.a34 = t.a3;
Q... | [
"public",
"void",
"recomputeQ",
"(",
"DMatrix4x4",
"Q",
")",
"{",
"CommonOps_DDF3",
".",
"multTransB",
"(",
"k",
",",
"k",
",",
"w",
")",
";",
"Q",
".",
"a11",
"=",
"w",
".",
"a11",
";",
"Q",
".",
"a12",
"=",
"w",
".",
"a12",
";",
"Q",
".",
"... | Recomputes Q from w and p.
@param Q Storage for the recomputed Q | [
"Recomputes",
"Q",
"from",
"w",
"and",
"p",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L99-L113 |
50,605 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java | DecomposeAbsoluteDualQuadratic.computeRectifyingHomography | public boolean computeRectifyingHomography( DMatrixRMaj H ) {
H.reshape(4,4);
// insert the results into H
// H = [K 0;-p'*K 1 ]
H.zero();
for (int i = 0; i < 3; i++) {
for (int j = i; j < 3; j++) {
H.set(i,j,k.get(i,j));
}
}
// p and k have different scales, fix that
H.set(3,0, -(p.a1*k.a11 ... | java | public boolean computeRectifyingHomography( DMatrixRMaj H ) {
H.reshape(4,4);
// insert the results into H
// H = [K 0;-p'*K 1 ]
H.zero();
for (int i = 0; i < 3; i++) {
for (int j = i; j < 3; j++) {
H.set(i,j,k.get(i,j));
}
}
// p and k have different scales, fix that
H.set(3,0, -(p.a1*k.a11 ... | [
"public",
"boolean",
"computeRectifyingHomography",
"(",
"DMatrixRMaj",
"H",
")",
"{",
"H",
".",
"reshape",
"(",
"4",
",",
"4",
")",
";",
"// insert the results into H",
"// H = [K 0;-p'*K 1 ]",
"H",
".",
"zero",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Computes the rectifying homography from the decomposed Q
H = [K 0; -p'*K 1] see Pg 460 | [
"Computes",
"the",
"rectifying",
"homography",
"from",
"the",
"decomposed",
"Q"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L120-L138 |
50,606 | lessthanoptimal/BoofCV | integration/boofcv-WebcamCapture/examples/boofcv/examples/ExampleWebcamObjectTracking.java | ExampleWebcamObjectTracking.process | public void process() {
Webcam webcam = UtilWebcamCapture.openDefault(desiredWidth,desiredHeight);
// adjust the window size and let the GUI know it has changed
Dimension actualSize = webcam.getViewSize();
setPreferredSize(actualSize);
setMinimumSize(actualSize);
window.setMinimumSize(actualSize);
window... | java | public void process() {
Webcam webcam = UtilWebcamCapture.openDefault(desiredWidth,desiredHeight);
// adjust the window size and let the GUI know it has changed
Dimension actualSize = webcam.getViewSize();
setPreferredSize(actualSize);
setMinimumSize(actualSize);
window.setMinimumSize(actualSize);
window... | [
"public",
"void",
"process",
"(",
")",
"{",
"Webcam",
"webcam",
"=",
"UtilWebcamCapture",
".",
"openDefault",
"(",
"desiredWidth",
",",
"desiredHeight",
")",
";",
"// adjust the window size and let the GUI know it has changed",
"Dimension",
"actualSize",
"=",
"webcam",
... | Invoke to start the main processing loop. | [
"Invoke",
"to",
"start",
"the",
"main",
"processing",
"loop",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-WebcamCapture/examples/boofcv/examples/ExampleWebcamObjectTracking.java#L92-L144 |
50,607 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java | ExampleFeatureSurf.easy | public static void easy( GrayF32 image ) {
// create the detector and descriptors
DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe.
surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class);
// specify the image to process
surf.detect(image);
System.out.p... | java | public static void easy( GrayF32 image ) {
// create the detector and descriptors
DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe.
surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class);
// specify the image to process
surf.detect(image);
System.out.p... | [
"public",
"static",
"void",
"easy",
"(",
"GrayF32",
"image",
")",
"{",
"// create the detector and descriptors",
"DetectDescribePoint",
"<",
"GrayF32",
",",
"BrightFeature",
">",
"surf",
"=",
"FactoryDetectDescribe",
".",
"surfStable",
"(",
"new",
"ConfigFastHessian",
... | Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility
and slightly increases memory and computational requirements.
@param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too | [
"Use",
"generalized",
"interfaces",
"for",
"working",
"with",
"SURF",
".",
"This",
"removes",
"much",
"of",
"the",
"drudgery",
"but",
"also",
"reduces",
"flexibility",
"and",
"slightly",
"increases",
"memory",
"and",
"computational",
"requirements",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L59-L69 |
50,608 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java | ExampleFeatureSurf.harder | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor =
FactoryFeatureExtractor.nonmax(new ConfigExtract(2... | java | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor =
FactoryFeatureExtractor.nonmax(new ConfigExtract(2... | [
"public",
"static",
"<",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"void",
"harder",
"(",
"GrayF32",
"image",
")",
"{",
"// SURF works off of integral images",
"Class",
"<",
"II",
">",
"integralType",
"=",
"GIntegralImageOps",
".",
"getIntegralType",
"(... | Configured exactly the same as the easy example above, but require a lot more code and a more in depth
understanding of how SURF works and is configured. Instead of TupleDesc_F64, SurfFeature are computed in
this case. They are almost the same as TupleDesc_F64, but contain the Laplacian's sign which can be used
to sp... | [
"Configured",
"exactly",
"the",
"same",
"as",
"the",
"easy",
"example",
"above",
"but",
"require",
"a",
"lot",
"more",
"code",
"and",
"a",
"more",
"in",
"depth",
"understanding",
"of",
"how",
"SURF",
"works",
"and",
"is",
"configured",
".",
"Instead",
"of"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L79-L124 |
50,609 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java | BackgroundModelMoving.updateBackground | public void updateBackground(MotionModel homeToCurrent, T frame) {
worldToHome.concat(homeToCurrent, worldToCurrent);
worldToCurrent.invert(currentToWorld);
// find the distorted polygon of the current image in the "home" background reference frame
transform.setModel(currentToWorld);
transform.compute(0, 0, ... | java | public void updateBackground(MotionModel homeToCurrent, T frame) {
worldToHome.concat(homeToCurrent, worldToCurrent);
worldToCurrent.invert(currentToWorld);
// find the distorted polygon of the current image in the "home" background reference frame
transform.setModel(currentToWorld);
transform.compute(0, 0, ... | [
"public",
"void",
"updateBackground",
"(",
"MotionModel",
"homeToCurrent",
",",
"T",
"frame",
")",
"{",
"worldToHome",
".",
"concat",
"(",
"homeToCurrent",
",",
"worldToCurrent",
")",
";",
"worldToCurrent",
".",
"invert",
"(",
"currentToWorld",
")",
";",
"// fin... | Updates the background with new image information.
@param homeToCurrent Transform from home image to the current image
@param frame The current image in the sequence | [
"Updates",
"the",
"background",
"with",
"new",
"image",
"information",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java#L115-L150 |
50,610 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java | BackgroundModelMoving.segment | public void segment( MotionModel homeToCurrent , T frame , GrayU8 segmented ) {
InputSanityCheck.checkSameShape(frame,segmented);
worldToHome.concat(homeToCurrent, worldToCurrent);
worldToCurrent.invert(currentToWorld);
_segment(currentToWorld,frame,segmented);
} | java | public void segment( MotionModel homeToCurrent , T frame , GrayU8 segmented ) {
InputSanityCheck.checkSameShape(frame,segmented);
worldToHome.concat(homeToCurrent, worldToCurrent);
worldToCurrent.invert(currentToWorld);
_segment(currentToWorld,frame,segmented);
} | [
"public",
"void",
"segment",
"(",
"MotionModel",
"homeToCurrent",
",",
"T",
"frame",
",",
"GrayU8",
"segmented",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"frame",
",",
"segmented",
")",
";",
"worldToHome",
".",
"concat",
"(",
"homeToCurrent",
... | Invoke to use the background image to segment the current frame into background and foreground pixels
@param homeToCurrent Transform from home image to the current image
@param frame current image
@param segmented Segmented image. 0 = background, 1 = foreground/moving | [
"Invoke",
"to",
"use",
"the",
"background",
"image",
"to",
"segment",
"the",
"current",
"frame",
"into",
"background",
"and",
"foreground",
"pixels"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java#L165-L172 |
50,611 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/AdjustPolygonForThresholdBias.java | AdjustPolygonForThresholdBias.process | public void process( Polygon2D_F64 polygon, boolean clockwise) {
int N = polygon.size();
segments.resize(N);
// Apply the adjustment independently to each side
for (int i = N - 1, j = 0; j < N; i = j, j++) {
int ii,jj;
if( clockwise ) {
ii = i; jj = j;
} else {
ii = j; jj = i;
}
Point2... | java | public void process( Polygon2D_F64 polygon, boolean clockwise) {
int N = polygon.size();
segments.resize(N);
// Apply the adjustment independently to each side
for (int i = N - 1, j = 0; j < N; i = j, j++) {
int ii,jj;
if( clockwise ) {
ii = i; jj = j;
} else {
ii = j; jj = i;
}
Point2... | [
"public",
"void",
"process",
"(",
"Polygon2D_F64",
"polygon",
",",
"boolean",
"clockwise",
")",
"{",
"int",
"N",
"=",
"polygon",
".",
"size",
"(",
")",
";",
"segments",
".",
"resize",
"(",
"N",
")",
";",
"// Apply the adjustment independently to each side",
"f... | Processes and adjusts the polygon. If after adjustment a corner needs to be removed because two sides are
parallel then the size of the polygon can be changed.
@param polygon The polygon that is to be adjusted. Modified.
@param clockwise Is the polygon in a lockwise orientation? | [
"Processes",
"and",
"adjusts",
"the",
"polygon",
".",
"If",
"after",
"adjustment",
"a",
"corner",
"needs",
"to",
"be",
"removed",
"because",
"two",
"sides",
"are",
"parallel",
"then",
"the",
"size",
"of",
"the",
"polygon",
"can",
"be",
"changed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/AdjustPolygonForThresholdBias.java#L51-L111 |
50,612 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java | DetectCircleGrid.closestCorner4 | static int closestCorner4(Grid g ) {
double bestDistance = g.get(0,0).center.normSq();
int bestIdx = 0;
double d = g.get(0,g.columns-1).center.normSq();
if( d < bestDistance ) {
bestDistance = d;
bestIdx = 3;
}
d = g.get(g.rows-1,g.columns-1).center.normSq();
if( d < bestDistance ) {
bestDistanc... | java | static int closestCorner4(Grid g ) {
double bestDistance = g.get(0,0).center.normSq();
int bestIdx = 0;
double d = g.get(0,g.columns-1).center.normSq();
if( d < bestDistance ) {
bestDistance = d;
bestIdx = 3;
}
d = g.get(g.rows-1,g.columns-1).center.normSq();
if( d < bestDistance ) {
bestDistanc... | [
"static",
"int",
"closestCorner4",
"(",
"Grid",
"g",
")",
"{",
"double",
"bestDistance",
"=",
"g",
".",
"get",
"(",
"0",
",",
"0",
")",
".",
"center",
".",
"normSq",
"(",
")",
";",
"int",
"bestIdx",
"=",
"0",
";",
"double",
"d",
"=",
"g",
".",
... | Number of CCW rotations to put selected corner into the canonical location. Only works
when there are 4 possible solutions
@param g The grid
@return number of rotations | [
"Number",
"of",
"CCW",
"rotations",
"to",
"put",
"selected",
"corner",
"into",
"the",
"canonical",
"location",
".",
"Only",
"works",
"when",
"there",
"are",
"4",
"possible",
"solutions"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L159-L179 |
50,613 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java | DetectCircleGrid.rotateGridCCW | void rotateGridCCW( Grid g ) {
work.clear();
for (int i = 0; i < g.rows * g.columns; i++) {
work.add(null);
}
for (int row = 0; row < g.rows; row++) {
for (int col = 0; col < g.columns; col++) {
work.set(col*g.rows + row, g.get(g.rows - row - 1,col));
}
}
g.ellipses.clear();
g.ellipses.add... | java | void rotateGridCCW( Grid g ) {
work.clear();
for (int i = 0; i < g.rows * g.columns; i++) {
work.add(null);
}
for (int row = 0; row < g.rows; row++) {
for (int col = 0; col < g.columns; col++) {
work.set(col*g.rows + row, g.get(g.rows - row - 1,col));
}
}
g.ellipses.clear();
g.ellipses.add... | [
"void",
"rotateGridCCW",
"(",
"Grid",
"g",
")",
"{",
"work",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"g",
".",
"rows",
"*",
"g",
".",
"columns",
";",
"i",
"++",
")",
"{",
"work",
".",
"add",
"(",
"null"... | performs a counter-clockwise rotation | [
"performs",
"a",
"counter",
"-",
"clockwise",
"rotation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L184-L202 |
50,614 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java | DetectCircleGrid.reverse | void reverse( Grid g ) {
work.clear();
int N = g.rows*g.columns;
for (int i = 0; i < N; i++) {
work.add( g.ellipses.get(N-i-1));
}
g.ellipses.clear();
g.ellipses.addAll(work);
} | java | void reverse( Grid g ) {
work.clear();
int N = g.rows*g.columns;
for (int i = 0; i < N; i++) {
work.add( g.ellipses.get(N-i-1));
}
g.ellipses.clear();
g.ellipses.addAll(work);
} | [
"void",
"reverse",
"(",
"Grid",
"g",
")",
"{",
"work",
".",
"clear",
"(",
")",
";",
"int",
"N",
"=",
"g",
".",
"rows",
"*",
"g",
".",
"columns",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"work",
... | Reverse the order of elements inside the grid | [
"Reverse",
"the",
"order",
"of",
"elements",
"inside",
"the",
"grid"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L207-L216 |
50,615 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java | DetectCircleGrid.pruneIncorrectShape | static void pruneIncorrectShape(FastQueue<Grid> grids , int numRows, int numCols ) {
// prune clusters which can't be a member calibration target
for (int i = grids.size()-1; i >= 0; i--) {
Grid g = grids.get(i);
if ((g.rows != numRows || g.columns != numCols) && (g.rows != numCols || g.columns != numRows)) {... | java | static void pruneIncorrectShape(FastQueue<Grid> grids , int numRows, int numCols ) {
// prune clusters which can't be a member calibration target
for (int i = grids.size()-1; i >= 0; i--) {
Grid g = grids.get(i);
if ((g.rows != numRows || g.columns != numCols) && (g.rows != numCols || g.columns != numRows)) {... | [
"static",
"void",
"pruneIncorrectShape",
"(",
"FastQueue",
"<",
"Grid",
">",
"grids",
",",
"int",
"numRows",
",",
"int",
"numCols",
")",
"{",
"// prune clusters which can't be a member calibration target",
"for",
"(",
"int",
"i",
"=",
"grids",
".",
"size",
"(",
... | Remove grids which cannot possible match the expected shape | [
"Remove",
"grids",
"which",
"cannot",
"possible",
"match",
"the",
"expected",
"shape"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L247-L255 |
50,616 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java | DetectCircleGrid.pruneIncorrectSize | static void pruneIncorrectSize(List<List<EllipsesIntoClusters.Node>> clusters, int N) {
// prune clusters which can't be a member calibration target
for (int i = clusters.size()-1; i >= 0; i--) {
if( clusters.get(i).size() != N ) {
clusters.remove(i);
}
}
} | java | static void pruneIncorrectSize(List<List<EllipsesIntoClusters.Node>> clusters, int N) {
// prune clusters which can't be a member calibration target
for (int i = clusters.size()-1; i >= 0; i--) {
if( clusters.get(i).size() != N ) {
clusters.remove(i);
}
}
} | [
"static",
"void",
"pruneIncorrectSize",
"(",
"List",
"<",
"List",
"<",
"EllipsesIntoClusters",
".",
"Node",
">",
">",
"clusters",
",",
"int",
"N",
")",
"{",
"// prune clusters which can't be a member calibration target",
"for",
"(",
"int",
"i",
"=",
"clusters",
".... | Prune clusters which do not have the expected number of elements | [
"Prune",
"clusters",
"which",
"do",
"not",
"have",
"the",
"expected",
"number",
"of",
"elements"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L260-L267 |
50,617 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java | DetectChessboardSquarePoints.process | public boolean process( T input , GrayU8 binary ) {
double maxCornerDistancePixels = maxCornerDistance.computeI(Math.min(input.width,input.height));
s2c.setMaxCornerDistance(maxCornerDistancePixels);
configureContourDetector(input);
boundPolygon.vertexes.reset();
detectorSquare.process(input, binary);
de... | java | public boolean process( T input , GrayU8 binary ) {
double maxCornerDistancePixels = maxCornerDistance.computeI(Math.min(input.width,input.height));
s2c.setMaxCornerDistance(maxCornerDistancePixels);
configureContourDetector(input);
boundPolygon.vertexes.reset();
detectorSquare.process(input, binary);
de... | [
"public",
"boolean",
"process",
"(",
"T",
"input",
",",
"GrayU8",
"binary",
")",
"{",
"double",
"maxCornerDistancePixels",
"=",
"maxCornerDistance",
".",
"computeI",
"(",
"Math",
".",
"min",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
")"... | Detects chessboard in the binary image. Square corners must be disconnected.
Returns true if a chessboard was found, false otherwise.
@param input Original input image.
@param binary Binary image of chessboard
@return True if successful. | [
"Detects",
"chessboard",
"in",
"the",
"binary",
"image",
".",
"Square",
"corners",
"must",
"be",
"disconnected",
".",
"Returns",
"true",
"if",
"a",
"chessboard",
"was",
"found",
"false",
"otherwise",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L110-L157 |
50,618 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java | DetectChessboardSquarePoints.adjustBeforeOptimize | public void adjustBeforeOptimize(Polygon2D_F64 polygon, GrowQueue_B touchesBorder, boolean clockwise) {
int N = polygon.size();
work.vertexes.resize(N);
for (int i = 0; i < N; i++) {
work.get(i).set(0, 0);
}
for (int i = N - 1, j = 0; j < N; i = j, j++) {
int ii,jj,kk,mm;
if( clockwise ) {
mm = ... | java | public void adjustBeforeOptimize(Polygon2D_F64 polygon, GrowQueue_B touchesBorder, boolean clockwise) {
int N = polygon.size();
work.vertexes.resize(N);
for (int i = 0; i < N; i++) {
work.get(i).set(0, 0);
}
for (int i = N - 1, j = 0; j < N; i = j, j++) {
int ii,jj,kk,mm;
if( clockwise ) {
mm = ... | [
"public",
"void",
"adjustBeforeOptimize",
"(",
"Polygon2D_F64",
"polygon",
",",
"GrowQueue_B",
"touchesBorder",
",",
"boolean",
"clockwise",
")",
"{",
"int",
"N",
"=",
"polygon",
".",
"size",
"(",
")",
";",
"work",
".",
"vertexes",
".",
"resize",
"(",
"N",
... | The polygon detected from the contour is too small because the binary image was eroded. This expand the size
of the polygon so that it fits the image edge better | [
"The",
"polygon",
"detected",
"from",
"the",
"contour",
"is",
"too",
"small",
"because",
"the",
"binary",
"image",
"was",
"eroded",
".",
"This",
"expand",
"the",
"size",
"of",
"the",
"polygon",
"so",
"that",
"it",
"fits",
"the",
"image",
"edge",
"better"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L176-L240 |
50,619 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java | DetectChessboardSquarePoints.computeCalibrationPoints | boolean computeCalibrationPoints(SquareGrid grid) {
calibrationPoints.reset();
for (int row = 0; row < grid.rows-1; row++) {
int offset = row%2;
for (int col = offset; col < grid.columns; col += 2) {
SquareNode a = grid.get(row,col);
if( col > 0 ) {
SquareNode b = grid.get(row+1,col-1);
if... | java | boolean computeCalibrationPoints(SquareGrid grid) {
calibrationPoints.reset();
for (int row = 0; row < grid.rows-1; row++) {
int offset = row%2;
for (int col = offset; col < grid.columns; col += 2) {
SquareNode a = grid.get(row,col);
if( col > 0 ) {
SquareNode b = grid.get(row+1,col-1);
if... | [
"boolean",
"computeCalibrationPoints",
"(",
"SquareGrid",
"grid",
")",
"{",
"calibrationPoints",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"grid",
".",
"rows",
"-",
"1",
";",
"row",
"++",
")",
"{",
"int",
"offs... | Find inner corner points across the grid. Start from the "top" row and work its way down. Corners
are found by finding the average point between two adjacent corners on adjacent squares. | [
"Find",
"inner",
"corner",
"points",
"across",
"the",
"grid",
".",
"Start",
"from",
"the",
"top",
"row",
"and",
"work",
"its",
"way",
"down",
".",
"Corners",
"are",
"found",
"by",
"finding",
"the",
"average",
"point",
"between",
"two",
"adjacent",
"corners... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L327-L350 |
50,620 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/blur/impl/ImplMedianSortNaive.java | ImplMedianSortNaive.process | public static void process(GrayI input, GrayI output, int radius , int[] storage ) {
int w = 2*radius+1;
if( storage == null ) {
storage = new int[ w*w ];
} else if( storage.length < w*w ) {
throw new IllegalArgumentException("'storage' must be at least of length "+(w*w));
}
for( int y = 0; y < input.... | java | public static void process(GrayI input, GrayI output, int radius , int[] storage ) {
int w = 2*radius+1;
if( storage == null ) {
storage = new int[ w*w ];
} else if( storage.length < w*w ) {
throw new IllegalArgumentException("'storage' must be at least of length "+(w*w));
}
for( int y = 0; y < input.... | [
"public",
"static",
"void",
"process",
"(",
"GrayI",
"input",
",",
"GrayI",
"output",
",",
"int",
"radius",
",",
"int",
"[",
"]",
"storage",
")",
"{",
"int",
"w",
"=",
"2",
"*",
"radius",
"+",
"1",
";",
"if",
"(",
"storage",
"==",
"null",
")",
"{... | Performs a median filter.
@param input Raw input image.
@param output Filtered image.
@param radius Size of the filter's region.
@param storage Array used for storage. If null a new array is declared internally. | [
"Performs",
"a",
"median",
"filter",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/blur/impl/ImplMedianSortNaive.java#L49-L87 |
50,621 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.dda_ST_BRIEF | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> dda_ST_BRIEF(int maxAssociationError,
ConfigGeneralDetector configExtract,
Class<I> imageType, Class<D> derivType)
{
if( derivType == null )
derivType = GImageDerivativeOps.getDerivativeType(imageType);
Descri... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> dda_ST_BRIEF(int maxAssociationError,
ConfigGeneralDetector configExtract,
Class<I> imageType, Class<D> derivType)
{
if( derivType == null )
derivType = GImageDerivativeOps.getDerivativeType(imageType);
Descri... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"PointTracker",
"<",
"I",
">",
"dda_ST_BRIEF",
"(",
"int",
"maxAssociationError",
",",
"ConfigGeneralDetector",
"configExtract",
",",
"... | Creates a tracker which detects Shi-Tomasi corner features and describes them with BRIEF.
@see ShiTomasiCornerIntensity
@see DescribePointBrief
@see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint
@param maxAssociationError Maximum allowed association error. Try 200.
@param configExtract Configuration for ... | [
"Creates",
"a",
"tracker",
"which",
"detects",
"Shi",
"-",
"Tomasi",
"corner",
"features",
"and",
"describes",
"them",
"with",
"BRIEF",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L229-L252 |
50,622 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.dda_FAST_BRIEF | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> dda_FAST_BRIEF(ConfigFastCorner configFast,
ConfigGeneralDetector configExtract,
int maxAssociationError,
Class<I> imageType )
{
DescribePointBrief<I> brief = FactoryDescribePointAlgs.brief(FactoryBriefDe... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> dda_FAST_BRIEF(ConfigFastCorner configFast,
ConfigGeneralDetector configExtract,
int maxAssociationError,
Class<I> imageType )
{
DescribePointBrief<I> brief = FactoryDescribePointAlgs.brief(FactoryBriefDe... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"PointTracker",
"<",
"I",
">",
"dda_FAST_BRIEF",
"(",
"ConfigFastCorner",
"configFast",
",",
"ConfigGeneralDetector",
"configExtract",
",... | Creates a tracker which detects FAST corner features and describes them with BRIEF.
@see FastCornerDetector
@see DescribePointBrief
@see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint
@param configFast Configuration for FAST detector
@param configExtract Configuration for extracting features
@param maxAsso... | [
"Creates",
"a",
"tracker",
"which",
"detects",
"FAST",
"corner",
"features",
"and",
"describes",
"them",
"with",
"BRIEF",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L266-L288 |
50,623 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.dda | public static <I extends ImageGray<I>, Desc extends TupleDesc>
DetectDescribeAssociate<I,Desc> dda(InterestPointDetector<I> detector,
OrientationImage<I> orientation ,
DescribeRegionPoint<I, Desc> describe,
AssociateDescription2D<Desc> associate ,
ConfigTrackerDda config ) {
... | java | public static <I extends ImageGray<I>, Desc extends TupleDesc>
DetectDescribeAssociate<I,Desc> dda(InterestPointDetector<I> detector,
OrientationImage<I> orientation ,
DescribeRegionPoint<I, Desc> describe,
AssociateDescription2D<Desc> associate ,
ConfigTrackerDda config ) {
... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"Desc",
"extends",
"TupleDesc",
">",
"DetectDescribeAssociate",
"<",
"I",
",",
"Desc",
">",
"dda",
"(",
"InterestPointDetector",
"<",
"I",
">",
"detector",
",",
"OrientationImage",
"<"... | Creates a tracker which uses the detect, describe, associate architecture.
@param detector Interest point detector.
@param orientation Optional orientation estimation algorithm. Can be null.
@param describe Region description.
@param associate Description association.
@param config Configuration
@param <I> Type of inp... | [
"Creates",
"a",
"tracker",
"which",
"uses",
"the",
"detect",
"describe",
"associate",
"architecture",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L339-L356 |
50,624 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.combined_FH_SURF_KLT | public static <I extends ImageGray<I>>
PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig ,
int reactivateThreshold ,
ConfigFastHessian configDetector ,
ConfigSurfDescribe.Stability configDescribe ,
ConfigSlidingIntegral configOrientation ,
Class<I> i... | java | public static <I extends ImageGray<I>>
PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig ,
int reactivateThreshold ,
ConfigFastHessian configDetector ,
ConfigSurfDescribe.Stability configDescribe ,
ConfigSlidingIntegral configOrientation ,
Class<I> i... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
">",
"PointTracker",
"<",
"I",
">",
"combined_FH_SURF_KLT",
"(",
"PkltConfig",
"kltConfig",
",",
"int",
"reactivateThreshold",
",",
"ConfigFastHessian",
"configDetector",
",",
"ConfigSurfDescribe",... | Creates a tracker which detects Fast-Hessian features, describes them with SURF, nominally tracks them using KLT.
@see DescribePointSurf
@see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint
@param kltConfig Configuration for KLT tracker
@param reactivateThreshold Tracks are reactivated after this many have ... | [
"Creates",
"a",
"tracker",
"which",
"detects",
"Fast",
"-",
"Hessian",
"features",
"describes",
"them",
"with",
"SURF",
"nominally",
"tracks",
"them",
"using",
"KLT",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L387-L404 |
50,625 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.createShiTomasi | public static <I extends ImageGray<I>, D extends ImageGray<D>>
GeneralFeatureDetector<I, D> createShiTomasi(ConfigGeneralDetector config ,
Class<D> derivType)
{
GradientCornerIntensity<D> cornerIntensity = FactoryIntensityPointAlg.shiTomasi(1, false, derivType);
return FactoryDetectPoint.createGener... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
GeneralFeatureDetector<I, D> createShiTomasi(ConfigGeneralDetector config ,
Class<D> derivType)
{
GradientCornerIntensity<D> cornerIntensity = FactoryIntensityPointAlg.shiTomasi(1, false, derivType);
return FactoryDetectPoint.createGener... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"GeneralFeatureDetector",
"<",
"I",
",",
"D",
">",
"createShiTomasi",
"(",
"ConfigGeneralDetector",
"config",
",",
"Class",
"<",
"D",... | Creates a Shi-Tomasi corner detector specifically designed for SFM. Smaller feature radius work better.
Variable detectRadius to control the number of features. When larger features are used weighting should
be set to true, but because this is so small, it is set to false | [
"Creates",
"a",
"Shi",
"-",
"Tomasi",
"corner",
"detector",
"specifically",
"designed",
"for",
"SFM",
".",
"Smaller",
"feature",
"radius",
"work",
"better",
".",
"Variable",
"detectRadius",
"to",
"control",
"the",
"number",
"of",
"features",
".",
"When",
"larg... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L534-L541 |
50,626 | lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/CameraCalibration.java | CameraCalibration.handleWebcam | public void handleWebcam() {
final Webcam webcam = openSelectedCamera();
if( desiredWidth > 0 && desiredHeight > 0 )
UtilWebcamCapture.adjustResolution(webcam, desiredWidth, desiredHeight);
webcam.open();
// close the webcam gracefully on exit
Runtime.getRuntime().addShutdownHook(new Thread(){public void... | java | public void handleWebcam() {
final Webcam webcam = openSelectedCamera();
if( desiredWidth > 0 && desiredHeight > 0 )
UtilWebcamCapture.adjustResolution(webcam, desiredWidth, desiredHeight);
webcam.open();
// close the webcam gracefully on exit
Runtime.getRuntime().addShutdownHook(new Thread(){public void... | [
"public",
"void",
"handleWebcam",
"(",
")",
"{",
"final",
"Webcam",
"webcam",
"=",
"openSelectedCamera",
"(",
")",
";",
"if",
"(",
"desiredWidth",
">",
"0",
"&&",
"desiredHeight",
">",
"0",
")",
"UtilWebcamCapture",
".",
"adjustResolution",
"(",
"webcam",
",... | Captures calibration data live using a webcam and a GUI to assist the user | [
"Captures",
"calibration",
"data",
"live",
"using",
"a",
"webcam",
"and",
"a",
"GUI",
"to",
"assist",
"the",
"user"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/CameraCalibration.java#L535-L581 |
50,627 | lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java | ImageSelectorAndSaver.setTemplate | public void setTemplate(GrayF32 image, List<Point2D_F64> sides) {
if( sides.size() != 4 )
throw new IllegalArgumentException("Expected 4 sidesCollision");
removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3));
templateOriginal.setTo(removePerspective.getOutput());
// blur the ... | java | public void setTemplate(GrayF32 image, List<Point2D_F64> sides) {
if( sides.size() != 4 )
throw new IllegalArgumentException("Expected 4 sidesCollision");
removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3));
templateOriginal.setTo(removePerspective.getOutput());
// blur the ... | [
"public",
"void",
"setTemplate",
"(",
"GrayF32",
"image",
",",
"List",
"<",
"Point2D_F64",
">",
"sides",
")",
"{",
"if",
"(",
"sides",
".",
"size",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expected 4 sidesCollision\"",
")... | Creates a template of the fiducial and this is then used to determine how blurred the image is | [
"Creates",
"a",
"template",
"of",
"the",
"fiducial",
"and",
"this",
"is",
"then",
"used",
"to",
"determine",
"how",
"blurred",
"the",
"image",
"is"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L82-L110 |
50,628 | lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java | ImageSelectorAndSaver.process | public synchronized void process(GrayF32 image, List<Point2D_F64> sides) {
if( sides.size() != 4 )
throw new IllegalArgumentException("Expected 4 sidesCollision");
updateScore(image,sides);
if( currentScore < bestScore ) {
bestScore = currentScore;
if( bestImage == null ) {
bestImage = new Buffered... | java | public synchronized void process(GrayF32 image, List<Point2D_F64> sides) {
if( sides.size() != 4 )
throw new IllegalArgumentException("Expected 4 sidesCollision");
updateScore(image,sides);
if( currentScore < bestScore ) {
bestScore = currentScore;
if( bestImage == null ) {
bestImage = new Buffered... | [
"public",
"synchronized",
"void",
"process",
"(",
"GrayF32",
"image",
",",
"List",
"<",
"Point2D_F64",
">",
"sides",
")",
"{",
"if",
"(",
"sides",
".",
"size",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expected 4 sidesColl... | Computes the sharpness score for the current image, if better than the current best image it's then saved.
@param image Gray scale input image for detector
@param sides Location of 4 corners on fiducial | [
"Computes",
"the",
"sharpness",
"score",
"for",
"the",
"current",
"image",
"if",
"better",
"than",
"the",
"current",
"best",
"image",
"it",
"s",
"then",
"saved",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L125-L138 |
50,629 | lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java | ImageSelectorAndSaver.updateScore | public synchronized void updateScore(GrayF32 image, List<Point2D_F64> sides) {
removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3));
GrayF32 current = removePerspective.getOutput();
float mean = (float)ImageStatistics.mean(current);
PixelMath.divide(current,mean,tempImage);
Pix... | java | public synchronized void updateScore(GrayF32 image, List<Point2D_F64> sides) {
removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3));
GrayF32 current = removePerspective.getOutput();
float mean = (float)ImageStatistics.mean(current);
PixelMath.divide(current,mean,tempImage);
Pix... | [
"public",
"synchronized",
"void",
"updateScore",
"(",
"GrayF32",
"image",
",",
"List",
"<",
"Point2D_F64",
">",
"sides",
")",
"{",
"removePerspective",
".",
"apply",
"(",
"image",
",",
"sides",
".",
"get",
"(",
"0",
")",
",",
"sides",
".",
"get",
"(",
... | Used when you just want to update the score for visualization purposes but not update the best image. | [
"Used",
"when",
"you",
"just",
"want",
"to",
"update",
"the",
"score",
"for",
"visualization",
"purposes",
"but",
"not",
"update",
"the",
"best",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L143-L155 |
50,630 | lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java | ImageSelectorAndSaver.save | public synchronized void save() {
if( bestImage != null ) {
File path = new File(outputDirectory, String.format("image%04d.png",imageNumber));
UtilImageIO.saveImage(bestImage,path.getAbsolutePath());
imageNumber++;
}
clearHistory();
} | java | public synchronized void save() {
if( bestImage != null ) {
File path = new File(outputDirectory, String.format("image%04d.png",imageNumber));
UtilImageIO.saveImage(bestImage,path.getAbsolutePath());
imageNumber++;
}
clearHistory();
} | [
"public",
"synchronized",
"void",
"save",
"(",
")",
"{",
"if",
"(",
"bestImage",
"!=",
"null",
")",
"{",
"File",
"path",
"=",
"new",
"File",
"(",
"outputDirectory",
",",
"String",
".",
"format",
"(",
"\"image%04d.png\"",
",",
"imageNumber",
")",
")",
";"... | Saves the image to a file | [
"Saves",
"the",
"image",
"to",
"a",
"file"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L160-L167 |
50,631 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/ImagePanel.java | ImagePanel.setImageRepaint | public void setImageRepaint(BufferedImage image) {
// if image is larger before than the new image then you need to make sure you repaint
// the entire image otherwise a ghost will be left
ScaleOffset workspace;
if( SwingUtilities.isEventDispatchThread() ) {
workspace = adjustmentGUI;
} else {
workspac... | java | public void setImageRepaint(BufferedImage image) {
// if image is larger before than the new image then you need to make sure you repaint
// the entire image otherwise a ghost will be left
ScaleOffset workspace;
if( SwingUtilities.isEventDispatchThread() ) {
workspace = adjustmentGUI;
} else {
workspac... | [
"public",
"void",
"setImageRepaint",
"(",
"BufferedImage",
"image",
")",
"{",
"// if image is larger before than the new image then you need to make sure you repaint",
"// the entire image otherwise a ghost will be left",
"ScaleOffset",
"workspace",
";",
"if",
"(",
"SwingUtilities",
... | Changes the buffered image and calls repaint. Does not need to be called in the UI thread. | [
"Changes",
"the",
"buffered",
"image",
"and",
"calls",
"repaint",
".",
"Does",
"not",
"need",
"to",
"be",
"called",
"in",
"the",
"UI",
"thread",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ImagePanel.java#L166-L182 |
50,632 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPtkSmartRespawn.java | ImageMotionPtkSmartRespawn.computeContainment | private void computeContainment( int imageArea ) {
// mark that the track is in the inlier set and compute the containment rectangle
contRect.x0 = contRect.y0 = Double.MAX_VALUE;
contRect.x1 = contRect.y1 = -Double.MAX_VALUE;
for( AssociatedPair p : motion.getModelMatcher().getMatchSet() ) {
Point2D_F64 t = ... | java | private void computeContainment( int imageArea ) {
// mark that the track is in the inlier set and compute the containment rectangle
contRect.x0 = contRect.y0 = Double.MAX_VALUE;
contRect.x1 = contRect.y1 = -Double.MAX_VALUE;
for( AssociatedPair p : motion.getModelMatcher().getMatchSet() ) {
Point2D_F64 t = ... | [
"private",
"void",
"computeContainment",
"(",
"int",
"imageArea",
")",
"{",
"// mark that the track is in the inlier set and compute the containment rectangle",
"contRect",
".",
"x0",
"=",
"contRect",
".",
"y0",
"=",
"Double",
".",
"MAX_VALUE",
";",
"contRect",
".",
"x1... | Computes an axis-aligned rectangle that contains all the inliers. It then computes the area contained in
that rectangle to the total area of the image
@param imageArea width*height | [
"Computes",
"an",
"axis",
"-",
"aligned",
"rectangle",
"that",
"contains",
"all",
"the",
"inliers",
".",
"It",
"then",
"computes",
"the",
"area",
"contained",
"in",
"that",
"rectangle",
"to",
"the",
"total",
"area",
"of",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPtkSmartRespawn.java#L149-L165 |
50,633 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneProjective.java | PruneStructureFromSceneProjective.pruneViews | public boolean pruneViews(int count) {
List<SceneStructureProjective.View> remainingS = new ArrayList<>();
List<SceneObservations.View> remainingO = new ArrayList<>();
// count number of observations in each view
int counts[] = new int[structure.views.length];
for (int pointIdx = 0; pointIdx < structure.poin... | java | public boolean pruneViews(int count) {
List<SceneStructureProjective.View> remainingS = new ArrayList<>();
List<SceneObservations.View> remainingO = new ArrayList<>();
// count number of observations in each view
int counts[] = new int[structure.views.length];
for (int pointIdx = 0; pointIdx < structure.poin... | [
"public",
"boolean",
"pruneViews",
"(",
"int",
"count",
")",
"{",
"List",
"<",
"SceneStructureProjective",
".",
"View",
">",
"remainingS",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"SceneObservations",
".",
"View",
">",
"remainingO",
"=",
... | Removes views with less than 'count' features visible. Observations of features in removed views are also
removed. Features are not automatically removed even if there are zero observations of them.
@param count Prune if it has this number of views or less
@return true if views were pruned or false if not | [
"Removes",
"views",
"with",
"less",
"than",
"count",
"features",
"visible",
".",
"Observations",
"of",
"features",
"in",
"removed",
"views",
"are",
"also",
"removed",
".",
"Features",
"are",
"not",
"automatically",
"removed",
"even",
"if",
"there",
"are",
"zer... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneProjective.java#L166-L214 |
50,634 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java | DisparityScoreRowFormat.process | public void process( Input left , Input right , Disparity disparity ) {
// initialize data structures
InputSanityCheck.checkSameShape(left, right, disparity);
if( maxDisparity > left.width-2*radiusX )
throw new RuntimeException(
"The maximum disparity is too large for this image size: max size "+(left.w... | java | public void process( Input left , Input right , Disparity disparity ) {
// initialize data structures
InputSanityCheck.checkSameShape(left, right, disparity);
if( maxDisparity > left.width-2*radiusX )
throw new RuntimeException(
"The maximum disparity is too large for this image size: max size "+(left.w... | [
"public",
"void",
"process",
"(",
"Input",
"left",
",",
"Input",
"right",
",",
"Disparity",
"disparity",
")",
"{",
"// initialize data structures",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"left",
",",
"right",
",",
"disparity",
")",
";",
"if",
"(",
"ma... | Computes disparity between two stereo images
@param left Left rectified stereo image. Input
@param right Right rectified stereo image. Input
@param disparity Disparity between the two images. Output | [
"Computes",
"disparity",
"between",
"two",
"stereo",
"images"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java#L92-L103 |
50,635 | lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java | SelfCalibrationLinearDualQuadratic.solve | public GeometricResult solve() {
if( cameras.size < minimumProjectives )
throw new IllegalArgumentException("You need at least "+minimumProjectives+" motions");
int N = cameras.size;
DMatrixRMaj L = new DMatrixRMaj(N*eqs,10);
// Convert constraints into a (N*eqs) by 10 matrix. Null space is Q
constructMa... | java | public GeometricResult solve() {
if( cameras.size < minimumProjectives )
throw new IllegalArgumentException("You need at least "+minimumProjectives+" motions");
int N = cameras.size;
DMatrixRMaj L = new DMatrixRMaj(N*eqs,10);
// Convert constraints into a (N*eqs) by 10 matrix. Null space is Q
constructMa... | [
"public",
"GeometricResult",
"solve",
"(",
")",
"{",
"if",
"(",
"cameras",
".",
"size",
"<",
"minimumProjectives",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"You need at least \"",
"+",
"minimumProjectives",
"+",
"\" motions\"",
")",
";",
"int",
"N",... | Solve for camera calibration. A sanity check is performed to ensure that a valid calibration is found.
All values must be countable numbers and the focal lengths must be positive numbers.
@return Indicates if it was successful or not. If it fails it says why | [
"Solve",
"for",
"camera",
"calibration",
".",
"A",
"sanity",
"check",
"is",
"performed",
"to",
"ensure",
"that",
"a",
"valid",
"calibration",
"is",
"found",
".",
"All",
"values",
"must",
"be",
"countable",
"numbers",
"and",
"the",
"focal",
"lengths",
"must",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L124-L162 |
50,636 | lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java | SelfCalibrationLinearDualQuadratic.extractSolutionForQ | private void extractSolutionForQ( DMatrix4x4 Q ) {
DMatrixRMaj nv = new DMatrixRMaj(10,1);
SingularOps_DDRM.nullVector(svd,true,nv);
// Convert the solution into a fixed sized matrix because it's easier to read
encodeQ(Q,nv.data);
// diagonal elements must be positive because Q = [K*K' .. ; ... ]
// If th... | java | private void extractSolutionForQ( DMatrix4x4 Q ) {
DMatrixRMaj nv = new DMatrixRMaj(10,1);
SingularOps_DDRM.nullVector(svd,true,nv);
// Convert the solution into a fixed sized matrix because it's easier to read
encodeQ(Q,nv.data);
// diagonal elements must be positive because Q = [K*K' .. ; ... ]
// If th... | [
"private",
"void",
"extractSolutionForQ",
"(",
"DMatrix4x4",
"Q",
")",
"{",
"DMatrixRMaj",
"nv",
"=",
"new",
"DMatrixRMaj",
"(",
"10",
",",
"1",
")",
";",
"SingularOps_DDRM",
".",
"nullVector",
"(",
"svd",
",",
"true",
",",
"nv",
")",
";",
"// Convert the ... | Extracts the null space and converts it into the Q matrix | [
"Extracts",
"the",
"null",
"space",
"and",
"converts",
"it",
"into",
"the",
"Q",
"matrix"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L167-L180 |
50,637 | lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java | SelfCalibrationLinearDualQuadratic.computeSolutions | private void computeSolutions(DMatrix4x4 Q) {
DMatrixRMaj w_i = new DMatrixRMaj(3,3);
for (int i = 0; i < cameras.size; i++) {
computeW(cameras.get(i),Q,w_i);
Intrinsic calib = solveForCalibration(w_i);
if( sanityCheck(calib)) {
solutions.add(calib);
}
}
} | java | private void computeSolutions(DMatrix4x4 Q) {
DMatrixRMaj w_i = new DMatrixRMaj(3,3);
for (int i = 0; i < cameras.size; i++) {
computeW(cameras.get(i),Q,w_i);
Intrinsic calib = solveForCalibration(w_i);
if( sanityCheck(calib)) {
solutions.add(calib);
}
}
} | [
"private",
"void",
"computeSolutions",
"(",
"DMatrix4x4",
"Q",
")",
"{",
"DMatrixRMaj",
"w_i",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cameras",
".",
"size",
";",
"i",
"++",
")",
... | Computes the calibration for each view.. | [
"Computes",
"the",
"calibration",
"for",
"each",
"view",
".."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L185-L195 |
50,638 | lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java | SelfCalibrationLinearDualQuadratic.solveForCalibration | private Intrinsic solveForCalibration(DMatrixRMaj w) {
Intrinsic calib = new Intrinsic();
// CholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false);
//
// chol.decompose(w.copy());
// DMatrixRMaj R = chol.getT(w);
// R.print();
if( zeroSkew ) {
calib.skew = 0;
calib.fy = Mat... | java | private Intrinsic solveForCalibration(DMatrixRMaj w) {
Intrinsic calib = new Intrinsic();
// CholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false);
//
// chol.decompose(w.copy());
// DMatrixRMaj R = chol.getT(w);
// R.print();
if( zeroSkew ) {
calib.skew = 0;
calib.fy = Mat... | [
"private",
"Intrinsic",
"solveForCalibration",
"(",
"DMatrixRMaj",
"w",
")",
"{",
"Intrinsic",
"calib",
"=",
"new",
"Intrinsic",
"(",
")",
";",
"//\t\tCholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false);",
"//",
"//\t\tchol.decompose(w.copy());",
... | Given the solution for w and the constraints solve for the remaining parameters | [
"Given",
"the",
"solution",
"for",
"w",
"and",
"the",
"constraints",
"solve",
"for",
"the",
"remaining",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L200-L228 |
50,639 | lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java | SelfCalibrationLinearDualQuadratic.sanityCheck | boolean sanityCheck(Intrinsic calib ) {
if(UtilEjml.isUncountable(calib.fx))
return false;
if(UtilEjml.isUncountable(calib.fy))
return false;
if(UtilEjml.isUncountable(calib.skew))
return false;
if( calib.fx < 0 )
return false;
if( calib.fy < 0 )
return false;
return true;
} | java | boolean sanityCheck(Intrinsic calib ) {
if(UtilEjml.isUncountable(calib.fx))
return false;
if(UtilEjml.isUncountable(calib.fy))
return false;
if(UtilEjml.isUncountable(calib.skew))
return false;
if( calib.fx < 0 )
return false;
if( calib.fy < 0 )
return false;
return true;
} | [
"boolean",
"sanityCheck",
"(",
"Intrinsic",
"calib",
")",
"{",
"if",
"(",
"UtilEjml",
".",
"isUncountable",
"(",
"calib",
".",
"fx",
")",
")",
"return",
"false",
";",
"if",
"(",
"UtilEjml",
".",
"isUncountable",
"(",
"calib",
".",
"fy",
")",
")",
"retu... | Makes sure that the found solution is valid and physically possible
@return true if valid | [
"Makes",
"sure",
"that",
"the",
"found",
"solution",
"is",
"valid",
"and",
"physically",
"possible"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L234-L248 |
50,640 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplSelectRectStandardBase_S32.java | ImplSelectRectStandardBase_S32.selectRightToLeft | private int selectRightToLeft( int col , int[] scores ) {
// see how far it can search
int localMax = Math.min(imageWidth-regionWidth,col+maxDisparity)-col-minDisparity;
int indexBest = 0;
int indexScore = col;
int scoreBest = scores[col];
indexScore += imageWidth+1;
for( int i = 1; i < localMax; i++ ,i... | java | private int selectRightToLeft( int col , int[] scores ) {
// see how far it can search
int localMax = Math.min(imageWidth-regionWidth,col+maxDisparity)-col-minDisparity;
int indexBest = 0;
int indexScore = col;
int scoreBest = scores[col];
indexScore += imageWidth+1;
for( int i = 1; i < localMax; i++ ,i... | [
"private",
"int",
"selectRightToLeft",
"(",
"int",
"col",
",",
"int",
"[",
"]",
"scores",
")",
"{",
"// see how far it can search",
"int",
"localMax",
"=",
"Math",
".",
"min",
"(",
"imageWidth",
"-",
"regionWidth",
",",
"col",
"+",
"maxDisparity",
")",
"-",
... | Finds the best disparity going from right to left image. | [
"Finds",
"the",
"best",
"disparity",
"going",
"from",
"right",
"to",
"left",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplSelectRectStandardBase_S32.java#L135-L154 |
50,641 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldNonMaximalSuppression.java | TldNonMaximalSuppression.process | public void process( FastQueue<TldRegion> regions , FastQueue<TldRegion> output ) {
final int N = regions.size;
// set all connections to be a local maximum initially
conn.growArray(N);
for( int i = 0; i < N; i++ ) {
conn.data[i].reset();
}
// Create the graph of connected regions and mark which regio... | java | public void process( FastQueue<TldRegion> regions , FastQueue<TldRegion> output ) {
final int N = regions.size;
// set all connections to be a local maximum initially
conn.growArray(N);
for( int i = 0; i < N; i++ ) {
conn.data[i].reset();
}
// Create the graph of connected regions and mark which regio... | [
"public",
"void",
"process",
"(",
"FastQueue",
"<",
"TldRegion",
">",
"regions",
",",
"FastQueue",
"<",
"TldRegion",
">",
"output",
")",
"{",
"final",
"int",
"N",
"=",
"regions",
".",
"size",
";",
"// set all connections to be a local maximum initially",
"conn",
... | Finds local maximums from the set of provided regions
@param regions Set of high confidence regions for target
@param output Output after non-maximum suppression | [
"Finds",
"local",
"maximums",
"from",
"the",
"set",
"of",
"provided",
"regions"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldNonMaximalSuppression.java#L61-L108 |
50,642 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java | ImageType.createImage | public T createImage( int width , int height ) {
switch( family ) {
case GRAY:
return (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height);
case INTERLEAVED:
return (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands);
case PLANAR:
return (T)new Pl... | java | public T createImage( int width , int height ) {
switch( family ) {
case GRAY:
return (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height);
case INTERLEAVED:
return (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands);
case PLANAR:
return (T)new Pl... | [
"public",
"T",
"createImage",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"switch",
"(",
"family",
")",
"{",
"case",
"GRAY",
":",
"return",
"(",
"T",
")",
"GeneralizedImageOps",
".",
"createSingleBand",
"(",
"getImageClass",
"(",
")",
",",
"widt... | Creates a new image.
@param width Number of columns in the image.
@param height Number of rows in the image.
@return New instance of the image. | [
"Creates",
"a",
"new",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L87-L101 |
50,643 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java | ImageType.createArray | public T[] createArray( int length ) {
switch( family ) {
case GRAY:
case INTERLEAVED:
return (T[])Array.newInstance(getImageClass(),length);
case PLANAR:
return (T[])new Planar[ length ];
default:
throw new IllegalArgumentException("Type not yet supported");
}
} | java | public T[] createArray( int length ) {
switch( family ) {
case GRAY:
case INTERLEAVED:
return (T[])Array.newInstance(getImageClass(),length);
case PLANAR:
return (T[])new Planar[ length ];
default:
throw new IllegalArgumentException("Type not yet supported");
}
} | [
"public",
"T",
"[",
"]",
"createArray",
"(",
"int",
"length",
")",
"{",
"switch",
"(",
"family",
")",
"{",
"case",
"GRAY",
":",
"case",
"INTERLEAVED",
":",
"return",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
"getImageClass",
"(",
")"... | Creates an array of the specified iamge type
@param length Number of elements in the array
@return array of image type | [
"Creates",
"an",
"array",
"of",
"the",
"specified",
"iamge",
"type"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L108-L120 |
50,644 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java | ImageType.isSameType | public boolean isSameType( ImageType o ) {
if( family != o.family )
return false;
if( dataType != o.dataType)
return false;
if( numBands != o.numBands )
return false;
return true;
} | java | public boolean isSameType( ImageType o ) {
if( family != o.family )
return false;
if( dataType != o.dataType)
return false;
if( numBands != o.numBands )
return false;
return true;
} | [
"public",
"boolean",
"isSameType",
"(",
"ImageType",
"o",
")",
"{",
"if",
"(",
"family",
"!=",
"o",
".",
"family",
")",
"return",
"false",
";",
"if",
"(",
"dataType",
"!=",
"o",
".",
"dataType",
")",
"return",
"false",
";",
"if",
"(",
"numBands",
"!=... | Returns true if the passed in ImageType is the same as this image type | [
"Returns",
"true",
"if",
"the",
"passed",
"in",
"ImageType",
"is",
"the",
"same",
"as",
"this",
"image",
"type"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L178-L186 |
50,645 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java | ImageType.setTo | public void setTo( ImageType o ) {
this.family = o.family;
this.dataType = o.dataType;
this.numBands = o.numBands;
} | java | public void setTo( ImageType o ) {
this.family = o.family;
this.dataType = o.dataType;
this.numBands = o.numBands;
} | [
"public",
"void",
"setTo",
"(",
"ImageType",
"o",
")",
"{",
"this",
".",
"family",
"=",
"o",
".",
"family",
";",
"this",
".",
"dataType",
"=",
"o",
".",
"dataType",
";",
"this",
".",
"numBands",
"=",
"o",
".",
"numBands",
";",
"}"
] | Sets 'this' to be identical to 'o'
@param o What is to be copied. | [
"Sets",
"this",
"to",
"be",
"identical",
"to",
"o"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L192-L196 |
50,646 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.growCellArray | void growCellArray(int imageWidth, int imageHeight) {
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cell[] a = new Cell[cellCols*cellRows];
System.arraycopy(cells,0,a,0,cells.length);
for (int i = cells.length; i < a.length; i++) {... | java | void growCellArray(int imageWidth, int imageHeight) {
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cell[] a = new Cell[cellCols*cellRows];
System.arraycopy(cells,0,a,0,cells.length);
for (int i = cells.length; i < a.length; i++) {... | [
"void",
"growCellArray",
"(",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"{",
"cellCols",
"=",
"imageWidth",
"/",
"pixelsPerCell",
";",
"cellRows",
"=",
"imageHeight",
"/",
"pixelsPerCell",
";",
"if",
"(",
"cellRows",
"*",
"cellCols",
">",
"cells",
... | Determines if the cell array needs to grow. If it does a new array is declared. Old data is recycled when
possible | [
"Determines",
"if",
"the",
"cell",
"array",
"needs",
"to",
"grow",
".",
"If",
"it",
"does",
"a",
"new",
"array",
"is",
"declared",
".",
"Old",
"data",
"is",
"recycled",
"when",
"possible"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L104-L118 |
50,647 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.getDescriptorsInRegion | public void getDescriptorsInRegion(int pixelX0 , int pixelY0 , int pixelX1 , int pixelY1 ,
List<TupleDesc_F64> output ) {
int gridX0 = (int)Math.ceil(pixelX0/(double) pixelsPerCell);
int gridY0 = (int)Math.ceil(pixelY0/(double) pixelsPerCell);
int gridX1 = pixelX1/ pixelsPerCell - cellsPerBlockX;
i... | java | public void getDescriptorsInRegion(int pixelX0 , int pixelY0 , int pixelX1 , int pixelY1 ,
List<TupleDesc_F64> output ) {
int gridX0 = (int)Math.ceil(pixelX0/(double) pixelsPerCell);
int gridY0 = (int)Math.ceil(pixelY0/(double) pixelsPerCell);
int gridX1 = pixelX1/ pixelsPerCell - cellsPerBlockX;
i... | [
"public",
"void",
"getDescriptorsInRegion",
"(",
"int",
"pixelX0",
",",
"int",
"pixelY0",
",",
"int",
"pixelX1",
",",
"int",
"pixelY1",
",",
"List",
"<",
"TupleDesc_F64",
">",
"output",
")",
"{",
"int",
"gridX0",
"=",
"(",
"int",
")",
"Math",
".",
"ceil"... | Convenience function which returns a list of all the descriptors computed inside the specified region in the image
@param pixelX0 Pixel coordinate X-axis lower extent
@param pixelY0 Pixel coordinate Y-axis lower extent
@param pixelX1 Pixel coordinate X-axis upper extent
@param pixelY1 Pixel coordinate Y-axis upper ext... | [
"Convenience",
"function",
"which",
"returns",
"a",
"list",
"of",
"all",
"the",
"descriptors",
"computed",
"inside",
"the",
"specified",
"region",
"in",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L129-L143 |
50,648 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.computeCellHistograms | void computeCellHistograms() {
int width = cellCols* pixelsPerCell;
int height = cellRows* pixelsPerCell;
float angleBinSize = GrlConstants.F_PI/orientationBins;
int indexCell = 0;
for (int i = 0; i < height; i += pixelsPerCell) {
for (int j = 0; j < width; j += pixelsPerCell, indexCell++ ) {
Cell c... | java | void computeCellHistograms() {
int width = cellCols* pixelsPerCell;
int height = cellRows* pixelsPerCell;
float angleBinSize = GrlConstants.F_PI/orientationBins;
int indexCell = 0;
for (int i = 0; i < height; i += pixelsPerCell) {
for (int j = 0; j < width; j += pixelsPerCell, indexCell++ ) {
Cell c... | [
"void",
"computeCellHistograms",
"(",
")",
"{",
"int",
"width",
"=",
"cellCols",
"*",
"pixelsPerCell",
";",
"int",
"height",
"=",
"cellRows",
"*",
"pixelsPerCell",
";",
"float",
"angleBinSize",
"=",
"GrlConstants",
".",
"F_PI",
"/",
"orientationBins",
";",
"in... | Compute histograms for all the cells inside the image using precomputed derivative. | [
"Compute",
"histograms",
"for",
"all",
"the",
"cells",
"inside",
"the",
"image",
"using",
"precomputed",
"derivative",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L175-L215 |
50,649 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detdesc/DetectDescribeSurfPlanar.java | DetectDescribeSurfPlanar.detect | public void detect( II grayII , Planar<II> colorII ) {
descriptions.reset();
featureAngles.reset();
// detect features
detector.detect(grayII);
// describe the found interest points
foundPoints = detector.getFoundPoints();
descriptions.resize(foundPoints.size());
featureAngles.resize(foundPoints.siz... | java | public void detect( II grayII , Planar<II> colorII ) {
descriptions.reset();
featureAngles.reset();
// detect features
detector.detect(grayII);
// describe the found interest points
foundPoints = detector.getFoundPoints();
descriptions.resize(foundPoints.size());
featureAngles.resize(foundPoints.siz... | [
"public",
"void",
"detect",
"(",
"II",
"grayII",
",",
"Planar",
"<",
"II",
">",
"colorII",
")",
"{",
"descriptions",
".",
"reset",
"(",
")",
";",
"featureAngles",
".",
"reset",
"(",
")",
";",
"// detect features",
"detector",
".",
"detect",
"(",
"grayII"... | Detects and describes features inside provide images. All images are integral images.
@param grayII Gray-scale integral image
@param colorII Color integral image | [
"Detects",
"and",
"describes",
"features",
"inside",
"provide",
"images",
".",
"All",
"images",
"are",
"integral",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detdesc/DetectDescribeSurfPlanar.java#L87-L102 |
50,650 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java | QrPose3DUtils.getLandmark3D | public List<Point3D_F64> getLandmark3D( int version ) {
int N = QrCode.totalModules(version);
set3D( 0,0,N,point3D.get(0));
set3D( 0,7,N,point3D.get(1));
set3D( 7,7,N,point3D.get(2));
set3D( 7,0,N,point3D.get(3));
set3D( 0,N-7,N,point3D.get(4));
set3D( 0,N,N,point3D.get(5));
set3D( 7,N,N,point3D.get(6... | java | public List<Point3D_F64> getLandmark3D( int version ) {
int N = QrCode.totalModules(version);
set3D( 0,0,N,point3D.get(0));
set3D( 0,7,N,point3D.get(1));
set3D( 7,7,N,point3D.get(2));
set3D( 7,0,N,point3D.get(3));
set3D( 0,N-7,N,point3D.get(4));
set3D( 0,N,N,point3D.get(5));
set3D( 7,N,N,point3D.get(6... | [
"public",
"List",
"<",
"Point3D_F64",
">",
"getLandmark3D",
"(",
"int",
"version",
")",
"{",
"int",
"N",
"=",
"QrCode",
".",
"totalModules",
"(",
"version",
")",
";",
"set3D",
"(",
"0",
",",
"0",
",",
"N",
",",
"point3D",
".",
"get",
"(",
"0",
")",... | Location of each corner in the QR Code's reference frame in 3D
@param version QR Code's version
@return List. Recycled on each call | [
"Location",
"of",
"each",
"corner",
"in",
"the",
"QR",
"Code",
"s",
"reference",
"frame",
"in",
"3D"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L119-L138 |
50,651 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java | QrPose3DUtils.setPair | private void setPair(int which, int row, int col, int N , Point2D_F64 pixel ) {
set3D(row,col,N,point23.get(which).location);
pixelToNorm.compute(pixel.x,pixel.y,point23.get(which).observation);
} | java | private void setPair(int which, int row, int col, int N , Point2D_F64 pixel ) {
set3D(row,col,N,point23.get(which).location);
pixelToNorm.compute(pixel.x,pixel.y,point23.get(which).observation);
} | [
"private",
"void",
"setPair",
"(",
"int",
"which",
",",
"int",
"row",
",",
"int",
"col",
",",
"int",
"N",
",",
"Point2D_F64",
"pixel",
")",
"{",
"set3D",
"(",
"row",
",",
"col",
",",
"N",
",",
"point23",
".",
"get",
"(",
"which",
")",
".",
"locat... | Specifies PNP parameters for a single feature
@param which Landmark's index
@param row row in the QR code's grid coordinate system
@param col column in the QR code's grid coordinate system
@param N width of grid
@param pixel observed pixel coordinate of feature | [
"Specifies",
"PNP",
"parameters",
"for",
"a",
"single",
"feature"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L149-L152 |
50,652 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java | QrPose3DUtils.set3D | private void set3D(int row, int col, int N , Point3D_F64 location ) {
double _N = N;
double gridX = 2.0*(col/_N-0.5);
double gridY = 2.0*(0.5-row/_N);
location.set(gridX,gridY,0);
} | java | private void set3D(int row, int col, int N , Point3D_F64 location ) {
double _N = N;
double gridX = 2.0*(col/_N-0.5);
double gridY = 2.0*(0.5-row/_N);
location.set(gridX,gridY,0);
} | [
"private",
"void",
"set3D",
"(",
"int",
"row",
",",
"int",
"col",
",",
"int",
"N",
",",
"Point3D_F64",
"location",
")",
"{",
"double",
"_N",
"=",
"N",
";",
"double",
"gridX",
"=",
"2.0",
"*",
"(",
"col",
"/",
"_N",
"-",
"0.5",
")",
";",
"double",... | Specifies 3D location of landmark in marker coordinate system
@param row row in the QR code's grid coordinate system
@param col column in the QR code's grid coordinate system
@param N width of grid
@param location (Output) location of feature in marker reference frame | [
"Specifies",
"3D",
"location",
"of",
"landmark",
"in",
"marker",
"coordinate",
"system"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L161-L167 |
50,653 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java | QrPose3DUtils.setLensDistortion | public void setLensDistortion(Point2Transform2_F64 pixelToNorm, Point2Transform2_F64 undistToDist) {
if( pixelToNorm == null ) {
this.pixelToNorm = new DoNothing2Transform2_F64();
this.undistToDist = new DoNothing2Transform2_F64();
} else {
this.pixelToNorm = pixelToNorm;
this.undistToDist = undistToDis... | java | public void setLensDistortion(Point2Transform2_F64 pixelToNorm, Point2Transform2_F64 undistToDist) {
if( pixelToNorm == null ) {
this.pixelToNorm = new DoNothing2Transform2_F64();
this.undistToDist = new DoNothing2Transform2_F64();
} else {
this.pixelToNorm = pixelToNorm;
this.undistToDist = undistToDis... | [
"public",
"void",
"setLensDistortion",
"(",
"Point2Transform2_F64",
"pixelToNorm",
",",
"Point2Transform2_F64",
"undistToDist",
")",
"{",
"if",
"(",
"pixelToNorm",
"==",
"null",
")",
"{",
"this",
".",
"pixelToNorm",
"=",
"new",
"DoNothing2Transform2_F64",
"(",
")",
... | Specifies transform from pixel to normalize image coordinates | [
"Specifies",
"transform",
"from",
"pixel",
"to",
"normalize",
"image",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L172-L180 |
50,654 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/SnapToLineEdge.java | SnapToLineEdge.refine | public boolean refine(Point2D_F64 a, Point2D_F64 b, LineGeneral2D_F64 found) {
// determine the local coordinate system
center.x = (a.x + b.x)/2.0;
center.y = (a.y + b.y)/2.0;
localScale = a.distance(center);
// define the line which points are going to be sampled along
double slopeX = (b.x - a.x);
doub... | java | public boolean refine(Point2D_F64 a, Point2D_F64 b, LineGeneral2D_F64 found) {
// determine the local coordinate system
center.x = (a.x + b.x)/2.0;
center.y = (a.y + b.y)/2.0;
localScale = a.distance(center);
// define the line which points are going to be sampled along
double slopeX = (b.x - a.x);
doub... | [
"public",
"boolean",
"refine",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"LineGeneral2D_F64",
"found",
")",
"{",
"// determine the local coordinate system",
"center",
".",
"x",
"=",
"(",
"a",
".",
"x",
"+",
"b",
".",
"x",
")",
"/",
"2.0",
";",... | Fits a line defined by the two points. When fitting the line the weight of the edge is used to determine.
how influential the point is. Multiple calls might be required to get a perfect fit.
@param a Start of line
@param b End of line..
@param found (output) Fitted line to the edge
@return true if successful or false... | [
"Fits",
"a",
"line",
"defined",
"by",
"the",
"two",
"points",
".",
"When",
"fitting",
"the",
"line",
"the",
"weight",
"of",
"the",
"edge",
"is",
"used",
"to",
"determine",
".",
"how",
"influential",
"the",
"point",
"is",
".",
"Multiple",
"calls",
"might"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/SnapToLineEdge.java#L103-L138 |
50,655 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/SnapToLineEdge.java | SnapToLineEdge.localToGlobal | protected void localToGlobal( LineGeneral2D_F64 line ) {
line.C = localScale*line.C - center.x*line.A - center.y*line.B;
} | java | protected void localToGlobal( LineGeneral2D_F64 line ) {
line.C = localScale*line.C - center.x*line.A - center.y*line.B;
} | [
"protected",
"void",
"localToGlobal",
"(",
"LineGeneral2D_F64",
"line",
")",
"{",
"line",
".",
"C",
"=",
"localScale",
"*",
"line",
".",
"C",
"-",
"center",
".",
"x",
"*",
"line",
".",
"A",
"-",
"center",
".",
"y",
"*",
"line",
".",
"B",
";",
"}"
] | Converts the line from local to global image coordinates | [
"Converts",
"the",
"line",
"from",
"local",
"to",
"global",
"image",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/SnapToLineEdge.java#L184-L186 |
50,656 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ComputeRegionMeanColor.java | ComputeRegionMeanColor.process | public void process( T image , GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount ,
FastQueue<float[]> regionColor ) {
this.image = image;
// Initialize data structures
regionSums.resize(regionColor.size);
for( int i = 0; i < regionSums.size; i++ ) {
float v[] = regionSums.get(i);
f... | java | public void process( T image , GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount ,
FastQueue<float[]> regionColor ) {
this.image = image;
// Initialize data structures
regionSums.resize(regionColor.size);
for( int i = 0; i < regionSums.size; i++ ) {
float v[] = regionSums.get(i);
f... | [
"public",
"void",
"process",
"(",
"T",
"image",
",",
"GrayS32",
"pixelToRegion",
",",
"GrowQueue_I32",
"regionMemberCount",
",",
"FastQueue",
"<",
"float",
"[",
"]",
">",
"regionColor",
")",
"{",
"this",
".",
"image",
"=",
"image",
";",
"// Initialize data str... | Compute the average color for each region
@param image Input image
@param pixelToRegion Conversion between pixel to region index
@param regionMemberCount List which stores the number of members for each region
@param regionColor (Output) Storage for mean color throughout the region. Internal array must be fully
decla... | [
"Compute",
"the",
"average",
"color",
"for",
"each",
"region"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ComputeRegionMeanColor.java#L61-L99 |
50,657 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.process | @Override
public boolean process(PairwiseImageGraph pairwiseGraph ) {
this.graph = new MetricSceneGraph(pairwiseGraph);
for (int i = 0; i < graph.edges.size(); i++) {
decomposeEssential(graph.edges.get(i));
}
declareModelFitting();
for (int i = 0; i < graph.edges.size(); i++) {
Motion e = graph.edges... | java | @Override
public boolean process(PairwiseImageGraph pairwiseGraph ) {
this.graph = new MetricSceneGraph(pairwiseGraph);
for (int i = 0; i < graph.edges.size(); i++) {
decomposeEssential(graph.edges.get(i));
}
declareModelFitting();
for (int i = 0; i < graph.edges.size(); i++) {
Motion e = graph.edges... | [
"@",
"Override",
"public",
"boolean",
"process",
"(",
"PairwiseImageGraph",
"pairwiseGraph",
")",
"{",
"this",
".",
"graph",
"=",
"new",
"MetricSceneGraph",
"(",
"pairwiseGraph",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"graph",
".",
"e... | Processes the paired up scene features and computes an initial estimate for the scene's
structure.
@param pairwiseGraph (Input) matched features across views/cameras. Must be calibrated. Modified.
@return true if successful | [
"Processes",
"the",
"paired",
"up",
"scene",
"features",
"and",
"computes",
"an",
"initial",
"estimate",
"for",
"the",
"scene",
"s",
"structure",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L110-L170 |
50,658 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.decomposeEssential | void decomposeEssential( Motion motion ) {
List<Se3_F64> candidates = MultiViewOps.decomposeEssential(motion.F);
int bestScore = 0;
Se3_F64 best = null;
PositiveDepthConstraintCheck check = new PositiveDepthConstraintCheck();
for (int i = 0; i < candidates.size(); i++) {
Se3_F64 a_to_b = candidates.get(... | java | void decomposeEssential( Motion motion ) {
List<Se3_F64> candidates = MultiViewOps.decomposeEssential(motion.F);
int bestScore = 0;
Se3_F64 best = null;
PositiveDepthConstraintCheck check = new PositiveDepthConstraintCheck();
for (int i = 0; i < candidates.size(); i++) {
Se3_F64 a_to_b = candidates.get(... | [
"void",
"decomposeEssential",
"(",
"Motion",
"motion",
")",
"{",
"List",
"<",
"Se3_F64",
">",
"candidates",
"=",
"MultiViewOps",
".",
"decomposeEssential",
"(",
"motion",
".",
"F",
")",
";",
"int",
"bestScore",
"=",
"0",
";",
"Se3_F64",
"best",
"=",
"null"... | Sets the a_to_b transform for the motion given. | [
"Sets",
"the",
"a_to_b",
"transform",
"for",
"the",
"motion",
"given",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L175-L205 |
50,659 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.medianTriangulationAngle | double medianTriangulationAngle( Motion edge ) {
GrowQueue_F64 angles = new GrowQueue_F64(edge.associated.size());
angles.size = edge.associated.size();
for (int i = 0; i < edge.associated.size(); i++) {
AssociatedIndex a = edge.associated.get(i);
Point2D_F64 normA = edge.viewSrc.observationNorm.get( a.sr... | java | double medianTriangulationAngle( Motion edge ) {
GrowQueue_F64 angles = new GrowQueue_F64(edge.associated.size());
angles.size = edge.associated.size();
for (int i = 0; i < edge.associated.size(); i++) {
AssociatedIndex a = edge.associated.get(i);
Point2D_F64 normA = edge.viewSrc.observationNorm.get( a.sr... | [
"double",
"medianTriangulationAngle",
"(",
"Motion",
"edge",
")",
"{",
"GrowQueue_F64",
"angles",
"=",
"new",
"GrowQueue_F64",
"(",
"edge",
".",
"associated",
".",
"size",
"(",
")",
")",
";",
"angles",
".",
"size",
"=",
"edge",
".",
"associated",
".",
"siz... | Compares the angle that different observations form when their lines intersect. Returns
the median angle. Used to determine if this edge is good for triangulation
@param edge edge
@return median angle between observations in radians | [
"Compares",
"the",
"angle",
"that",
"different",
"observations",
"form",
"when",
"their",
"lines",
"intersect",
".",
"Returns",
"the",
"median",
"angle",
".",
"Used",
"to",
"determine",
"if",
"this",
"edge",
"is",
"good",
"for",
"triangulation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L213-L229 |
50,660 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.convertToOutput | private void convertToOutput( View origin ) {
structure = new SceneStructureMetric(false);
observations = new SceneObservations(viewsAdded.size());
// TODO can this be simplified?
int idx = 0;
for( String key : graph.cameras.keySet() ) {
cameraToIndex.put(key,idx++);
}
structure.initialize(cameraToIn... | java | private void convertToOutput( View origin ) {
structure = new SceneStructureMetric(false);
observations = new SceneObservations(viewsAdded.size());
// TODO can this be simplified?
int idx = 0;
for( String key : graph.cameras.keySet() ) {
cameraToIndex.put(key,idx++);
}
structure.initialize(cameraToIn... | [
"private",
"void",
"convertToOutput",
"(",
"View",
"origin",
")",
"{",
"structure",
"=",
"new",
"SceneStructureMetric",
"(",
"false",
")",
";",
"observations",
"=",
"new",
"SceneObservations",
"(",
"viewsAdded",
".",
"size",
"(",
")",
")",
";",
"// TODO can th... | Converts the internal data structures into the output format for bundle adjustment. Camera models are omitted
since they are not available
@param origin The origin of the coordinate system | [
"Converts",
"the",
"internal",
"data",
"structures",
"into",
"the",
"output",
"format",
"for",
"bundle",
"adjustment",
".",
"Camera",
"models",
"are",
"omitted",
"since",
"they",
"are",
"not",
"available"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L240-L289 |
50,661 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.addTriangulatedStereoFeatures | void addTriangulatedStereoFeatures(View base , Motion edge , double scale ) {
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
boolean baseIsA = base == viewA;
View other = baseIsA ? viewB : viewA;
// Determine transform from other to world
edge.a_to_b.T.scale(scale);
Se3_F64 otherToBase = baseIsA ... | java | void addTriangulatedStereoFeatures(View base , Motion edge , double scale ) {
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
boolean baseIsA = base == viewA;
View other = baseIsA ? viewB : viewA;
// Determine transform from other to world
edge.a_to_b.T.scale(scale);
Se3_F64 otherToBase = baseIsA ... | [
"void",
"addTriangulatedStereoFeatures",
"(",
"View",
"base",
",",
"Motion",
"edge",
",",
"double",
"scale",
")",
"{",
"View",
"viewA",
"=",
"edge",
".",
"viewSrc",
";",
"View",
"viewB",
"=",
"edge",
".",
"viewDst",
";",
"boolean",
"baseIsA",
"=",
"base",
... | Adds features which were triangulated using the stereo pair after the scale factor has been determined.
Don't mark the other view as being processed. It's 3D pose will be estimated later on using PNP with the
new features and features determined later on | [
"Adds",
"features",
"which",
"were",
"triangulated",
"using",
"the",
"stereo",
"pair",
"after",
"the",
"scale",
"factor",
"has",
"been",
"determined",
".",
"Don",
"t",
"mark",
"the",
"other",
"view",
"as",
"being",
"processed",
".",
"It",
"s",
"3D",
"pose"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L296-L351 |
50,662 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.determineScale | static double determineScale(View base , Motion edge )
throws Exception
{
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
boolean baseIsA = base == viewA;
// determine the scale factor difference
Point3D_F64 worldInBase3D = new Point3D_F64();
Point3D_F64 localInBase3D = new Point3D_F64();
GrowQ... | java | static double determineScale(View base , Motion edge )
throws Exception
{
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
boolean baseIsA = base == viewA;
// determine the scale factor difference
Point3D_F64 worldInBase3D = new Point3D_F64();
Point3D_F64 localInBase3D = new Point3D_F64();
GrowQ... | [
"static",
"double",
"determineScale",
"(",
"View",
"base",
",",
"Motion",
"edge",
")",
"throws",
"Exception",
"{",
"View",
"viewA",
"=",
"edge",
".",
"viewSrc",
";",
"View",
"viewB",
"=",
"edge",
".",
"viewDst",
";",
"boolean",
"baseIsA",
"=",
"base",
"=... | Determine scale factor difference between edge triangulation and world | [
"Determine",
"scale",
"factor",
"difference",
"between",
"edge",
"triangulation",
"and",
"world"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L356-L397 |
50,663 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.estimateAllFeatures | private void estimateAllFeatures(View seedA, View seedB ) {
List<View> open = new ArrayList<>();
// Add features for all the other views connected to the root view and determine the translation scale factor
addUnvistedToStack(seedA, open);
addUnvistedToStack(seedB, open);
// Do a breath first search. The qu... | java | private void estimateAllFeatures(View seedA, View seedB ) {
List<View> open = new ArrayList<>();
// Add features for all the other views connected to the root view and determine the translation scale factor
addUnvistedToStack(seedA, open);
addUnvistedToStack(seedB, open);
// Do a breath first search. The qu... | [
"private",
"void",
"estimateAllFeatures",
"(",
"View",
"seedA",
",",
"View",
"seedB",
")",
"{",
"List",
"<",
"View",
">",
"open",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Add features for all the other views connected to the root view and determine the translat... | Perform a breath first search to find the structure of all the remaining camrea views | [
"Perform",
"a",
"breath",
"first",
"search",
"to",
"find",
"the",
"structure",
"of",
"all",
"the",
"remaining",
"camrea",
"views"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L402-L462 |
50,664 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.countFeaturesWith3D | int countFeaturesWith3D(View v ) {
int count = 0;
for (int i = 0; i < v.connections.size(); i++) {
Motion m = v.connections.get(i);
boolean isSrc = m.viewSrc == v;
for (int j = 0; j < m.associated.size(); j++) {
AssociatedIndex a = m.associated.get(j);
if( isSrc ) {
count += m.viewDst.fea... | java | int countFeaturesWith3D(View v ) {
int count = 0;
for (int i = 0; i < v.connections.size(); i++) {
Motion m = v.connections.get(i);
boolean isSrc = m.viewSrc == v;
for (int j = 0; j < m.associated.size(); j++) {
AssociatedIndex a = m.associated.get(j);
if( isSrc ) {
count += m.viewDst.fea... | [
"int",
"countFeaturesWith3D",
"(",
"View",
"v",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v",
".",
"connections",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Motion",
"m",
"=",
"v",
".",
... | Count how many 3D features are in view. | [
"Count",
"how",
"many",
"3D",
"features",
"are",
"in",
"view",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L479-L500 |
50,665 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.determinePose | boolean determinePose(View target ) {
// Find all Features which are visible in this view and have a known 3D location
List<Point2D3D> list = new ArrayList<>();
List<Feature3D> features = new ArrayList<>();
GrowQueue_I32 featureIndexes = new GrowQueue_I32();
// TODO mark need to handle casees where the targ... | java | boolean determinePose(View target ) {
// Find all Features which are visible in this view and have a known 3D location
List<Point2D3D> list = new ArrayList<>();
List<Feature3D> features = new ArrayList<>();
GrowQueue_I32 featureIndexes = new GrowQueue_I32();
// TODO mark need to handle casees where the targ... | [
"boolean",
"determinePose",
"(",
"View",
"target",
")",
"{",
"// Find all Features which are visible in this view and have a known 3D location",
"List",
"<",
"Point2D3D",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Feature3D",
">",
"featur... | Uses the previously found motion between the two cameras to estimate the scale and 3D point of common features.
If a feature already has a known 3D point that is not modified. Scale is found by computing the 3D coordinate
of all points with a 3D point again then dividing the two distances. New features are also triangu... | [
"Uses",
"the",
"previously",
"found",
"motion",
"between",
"the",
"two",
"cameras",
"to",
"estimate",
"the",
"scale",
"and",
"3D",
"point",
"of",
"common",
"features",
".",
"If",
"a",
"feature",
"already",
"has",
"a",
"known",
"3D",
"point",
"that",
"is",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L510-L574 |
50,666 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.triangulateNoLocation | private void triangulateNoLocation( View target ) {
Se3_F64 otherToTarget = new Se3_F64();
Se3_F64 worldToTarget = target.viewToWorld.invert(null);
for( Motion c : target.connections ) {
boolean isSrc = c.viewSrc == target;
View other = c.destination(target);
if( other.state != ViewState.PROCESSED )
... | java | private void triangulateNoLocation( View target ) {
Se3_F64 otherToTarget = new Se3_F64();
Se3_F64 worldToTarget = target.viewToWorld.invert(null);
for( Motion c : target.connections ) {
boolean isSrc = c.viewSrc == target;
View other = c.destination(target);
if( other.state != ViewState.PROCESSED )
... | [
"private",
"void",
"triangulateNoLocation",
"(",
"View",
"target",
")",
"{",
"Se3_F64",
"otherToTarget",
"=",
"new",
"Se3_F64",
"(",
")",
";",
"Se3_F64",
"worldToTarget",
"=",
"target",
".",
"viewToWorld",
".",
"invert",
"(",
"null",
")",
";",
"for",
"(",
... | Go through all connections to the view and triangulate all features which have
not been triangulated already | [
"Go",
"through",
"all",
"connections",
"to",
"the",
"view",
"and",
"triangulate",
"all",
"features",
"which",
"have",
"not",
"been",
"triangulated",
"already"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L580-L635 |
50,667 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.triangulationAngle | double triangulationAngle( Point2D_F64 normA , Point2D_F64 normB , Se3_F64 a_to_b ) {
// the more parallel a line is worse the triangulation. Get rid of bad ideas early here
arrowA.set(normA.x,normA.y,1);
arrowB.set(normB.x,normB.y,1);
GeometryMath_F64.mult(a_to_b.R,arrowA,arrowA); // put them into the same ref... | java | double triangulationAngle( Point2D_F64 normA , Point2D_F64 normB , Se3_F64 a_to_b ) {
// the more parallel a line is worse the triangulation. Get rid of bad ideas early here
arrowA.set(normA.x,normA.y,1);
arrowB.set(normB.x,normB.y,1);
GeometryMath_F64.mult(a_to_b.R,arrowA,arrowA); // put them into the same ref... | [
"double",
"triangulationAngle",
"(",
"Point2D_F64",
"normA",
",",
"Point2D_F64",
"normB",
",",
"Se3_F64",
"a_to_b",
")",
"{",
"// the more parallel a line is worse the triangulation. Get rid of bad ideas early here",
"arrowA",
".",
"set",
"(",
"normA",
".",
"x",
",",
"nor... | Computes the acture angle between two vectors. Larger this angle is the better the triangulation
of the features 3D location is in general | [
"Computes",
"the",
"acture",
"angle",
"between",
"two",
"vectors",
".",
"Larger",
"this",
"angle",
"is",
"the",
"better",
"the",
"triangulation",
"of",
"the",
"features",
"3D",
"location",
"is",
"in",
"general"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L641-L648 |
50,668 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.addUnvistedToStack | void addUnvistedToStack(View viewed, List<View> open) {
for (int i = 0; i < viewed.connections.size(); i++) {
View other = viewed.connections.get(i).destination(viewed);
if( other.state == ViewState.UNPROCESSED) {
other.state = ViewState.PENDING;
open.add(other);
if( verbose != null )
verbose.p... | java | void addUnvistedToStack(View viewed, List<View> open) {
for (int i = 0; i < viewed.connections.size(); i++) {
View other = viewed.connections.get(i).destination(viewed);
if( other.state == ViewState.UNPROCESSED) {
other.state = ViewState.PENDING;
open.add(other);
if( verbose != null )
verbose.p... | [
"void",
"addUnvistedToStack",
"(",
"View",
"viewed",
",",
"List",
"<",
"View",
">",
"open",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"viewed",
".",
"connections",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"View",
"other",... | Looks to see which connections have yet to be visited and adds them to the open list | [
"Looks",
"to",
"see",
"which",
"connections",
"have",
"yet",
"to",
"be",
"visited",
"and",
"adds",
"them",
"to",
"the",
"open",
"list"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L653-L663 |
50,669 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.defineCoordinateSystem | void defineCoordinateSystem(View viewA, Motion motion) {
View viewB = motion.destination(viewA);
viewA.viewToWorld.reset(); // identity since it's the origin
viewB.viewToWorld.set(motion.motionSrcToDst(viewB));
// translation is only known up to a scale factor so pick a reasonable scale factor
double scale =... | java | void defineCoordinateSystem(View viewA, Motion motion) {
View viewB = motion.destination(viewA);
viewA.viewToWorld.reset(); // identity since it's the origin
viewB.viewToWorld.set(motion.motionSrcToDst(viewB));
// translation is only known up to a scale factor so pick a reasonable scale factor
double scale =... | [
"void",
"defineCoordinateSystem",
"(",
"View",
"viewA",
",",
"Motion",
"motion",
")",
"{",
"View",
"viewB",
"=",
"motion",
".",
"destination",
"(",
"viewA",
")",
";",
"viewA",
".",
"viewToWorld",
".",
"reset",
"(",
")",
";",
"// identity since it's the origin"... | Sets the origin and scale of the coordinate system
@param viewA The origin of the coordinate system
@param motion Motion which will define the coordinate system's scale | [
"Sets",
"the",
"origin",
"and",
"scale",
"of",
"the",
"coordinate",
"system"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L671-L720 |
50,670 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.selectOriginNode | View selectOriginNode() {
double bestScore = 0;
View best = null;
if( verbose != null )
verbose.println("selectOriginNode");
for (int i = 0; i < graph.nodes.size(); i++) {
double score = scoreNodeAsOrigin(graph.nodes.get(i));
if( score > bestScore ) {
bestScore = score;
best = graph.nodes.get... | java | View selectOriginNode() {
double bestScore = 0;
View best = null;
if( verbose != null )
verbose.println("selectOriginNode");
for (int i = 0; i < graph.nodes.size(); i++) {
double score = scoreNodeAsOrigin(graph.nodes.get(i));
if( score > bestScore ) {
bestScore = score;
best = graph.nodes.get... | [
"View",
"selectOriginNode",
"(",
")",
"{",
"double",
"bestScore",
"=",
"0",
";",
"View",
"best",
"=",
"null",
";",
"if",
"(",
"verbose",
"!=",
"null",
")",
"verbose",
".",
"println",
"(",
"\"selectOriginNode\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Select the view which will be coordinate system's origin. This should be a well connected node which have
favorable geometry to the other views it's connected to.
@return The selected view | [
"Select",
"the",
"view",
"which",
"will",
"be",
"coordinate",
"system",
"s",
"origin",
".",
"This",
"should",
"be",
"a",
"well",
"connected",
"node",
"which",
"have",
"favorable",
"geometry",
"to",
"the",
"other",
"views",
"it",
"s",
"connected",
"to",
"."... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L727-L748 |
50,671 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.selectCoordinateBase | Motion selectCoordinateBase(View view ) {
double bestScore = 0;
Motion best = null;
if( verbose != null )
verbose.println("selectCoordinateBase");
for (int i = 0; i < view.connections.size(); i++) {
Motion e = view.connections.get(i);
double s = e.scoreTriangulation();
if( verbose != null )
ve... | java | Motion selectCoordinateBase(View view ) {
double bestScore = 0;
Motion best = null;
if( verbose != null )
verbose.println("selectCoordinateBase");
for (int i = 0; i < view.connections.size(); i++) {
Motion e = view.connections.get(i);
double s = e.scoreTriangulation();
if( verbose != null )
ve... | [
"Motion",
"selectCoordinateBase",
"(",
"View",
"view",
")",
"{",
"double",
"bestScore",
"=",
"0",
";",
"Motion",
"best",
"=",
"null",
";",
"if",
"(",
"verbose",
"!=",
"null",
")",
"verbose",
".",
"println",
"(",
"\"selectCoordinateBase\"",
")",
";",
"for",... | Select motion which will define the coordinate system. | [
"Select",
"motion",
"which",
"will",
"define",
"the",
"coordinate",
"system",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L765-L783 |
50,672 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.triangulateStereoEdges | void triangulateStereoEdges(Motion edge ) {
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
triangulationError.configure(viewA.camera.pinhole,viewB.camera.pinhole);
for (int i = 0; i < edge.associated.size(); i++) {
AssociatedIndex f = edge.associated.get(i);
Point2D_F64 normA = viewA.observation... | java | void triangulateStereoEdges(Motion edge ) {
View viewA = edge.viewSrc;
View viewB = edge.viewDst;
triangulationError.configure(viewA.camera.pinhole,viewB.camera.pinhole);
for (int i = 0; i < edge.associated.size(); i++) {
AssociatedIndex f = edge.associated.get(i);
Point2D_F64 normA = viewA.observation... | [
"void",
"triangulateStereoEdges",
"(",
"Motion",
"edge",
")",
"{",
"View",
"viewA",
"=",
"edge",
".",
"viewSrc",
";",
"View",
"viewB",
"=",
"edge",
".",
"viewDst",
";",
"triangulationError",
".",
"configure",
"(",
"viewA",
".",
"camera",
".",
"pinhole",
",... | An edge has been declared as defining a good stereo pair. All associated feature will now be
triangulated. It is assumed that there is no global coordinate system at this point. | [
"An",
"edge",
"has",
"been",
"declared",
"as",
"defining",
"a",
"good",
"stereo",
"pair",
".",
"All",
"associated",
"feature",
"will",
"now",
"be",
"triangulated",
".",
"It",
"is",
"assumed",
"that",
"there",
"is",
"no",
"global",
"coordinate",
"system",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L789-L828 |
50,673 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.approximatePinhole | public static CameraPinhole approximatePinhole( Point2Transform2_F64 p2n ,
int width , int height )
{
Point2D_F64 na = new Point2D_F64();
Point2D_F64 nb = new Point2D_F64();
// determine horizontal FOV using dot product of (na.x, na.y, 1 ) and (nb.x, nb.y, 1)
p2n.compute(0,height/2,na);
p2n.com... | java | public static CameraPinhole approximatePinhole( Point2Transform2_F64 p2n ,
int width , int height )
{
Point2D_F64 na = new Point2D_F64();
Point2D_F64 nb = new Point2D_F64();
// determine horizontal FOV using dot product of (na.x, na.y, 1 ) and (nb.x, nb.y, 1)
p2n.compute(0,height/2,na);
p2n.com... | [
"public",
"static",
"CameraPinhole",
"approximatePinhole",
"(",
"Point2Transform2_F64",
"p2n",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Point2D_F64",
"na",
"=",
"new",
"Point2D_F64",
"(",
")",
";",
"Point2D_F64",
"nb",
"=",
"new",
"Point2D_F64",
"... | Approximates a pinhole camera using the distoriton model
@param p2n Distorted pixel to undistorted normalized image coordinates
@return | [
"Approximates",
"a",
"pinhole",
"camera",
"using",
"the",
"distoriton",
"model"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L59-L86 |
50,674 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.createIntrinsic | public static CameraPinhole createIntrinsic(int width, int height, double hfov, double vfov) {
CameraPinhole intrinsic = new CameraPinhole();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadi... | java | public static CameraPinhole createIntrinsic(int width, int height, double hfov, double vfov) {
CameraPinhole intrinsic = new CameraPinhole();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadi... | [
"public",
"static",
"CameraPinhole",
"createIntrinsic",
"(",
"int",
"width",
",",
"int",
"height",
",",
"double",
"hfov",
",",
"double",
"vfov",
")",
"{",
"CameraPinhole",
"intrinsic",
"=",
"new",
"CameraPinhole",
"(",
")",
";",
"intrinsic",
".",
"width",
"=... | Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics
@param width Image width
@param height Image height
@param hfov Horizontal FOV in degrees
@param vfov Vertical FOV in degrees
@return guess camera parameters | [
"Creates",
"a",
"set",
"of",
"intrinsic",
"parameters",
"without",
"distortion",
"for",
"a",
"camera",
"with",
"the",
"specified",
"characteristics"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L97-L107 |
50,675 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.createIntrinsic | public static CameraPinholeBrown createIntrinsic(int width, int height, double hfov) {
CameraPinholeBrown intrinsic = new CameraPinholeBrown();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRa... | java | public static CameraPinholeBrown createIntrinsic(int width, int height, double hfov) {
CameraPinholeBrown intrinsic = new CameraPinholeBrown();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRa... | [
"public",
"static",
"CameraPinholeBrown",
"createIntrinsic",
"(",
"int",
"width",
",",
"int",
"height",
",",
"double",
"hfov",
")",
"{",
"CameraPinholeBrown",
"intrinsic",
"=",
"new",
"CameraPinholeBrown",
"(",
")",
";",
"intrinsic",
".",
"width",
"=",
"width",
... | Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics.
The focal length is assumed to be the same for x and y.
@param width Image width
@param height Image height
@param hfov Horizontal FOV in degrees
@return guess camera parameters | [
"Creates",
"a",
"set",
"of",
"intrinsic",
"parameters",
"without",
"distortion",
"for",
"a",
"camera",
"with",
"the",
"specified",
"characteristics",
".",
"The",
"focal",
"length",
"is",
"assumed",
"to",
"be",
"the",
"same",
"for",
"x",
"and",
"y",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L118-L128 |
50,676 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.scaleIntrinsic | public static void scaleIntrinsic(CameraPinhole param , double scale ) {
param.width = (int)(param.width*scale);
param.height = (int)(param.height*scale);
param.cx *= scale;
param.cy *= scale;
param.fx *= scale;
param.fy *= scale;
param.skew *= scale;
} | java | public static void scaleIntrinsic(CameraPinhole param , double scale ) {
param.width = (int)(param.width*scale);
param.height = (int)(param.height*scale);
param.cx *= scale;
param.cy *= scale;
param.fx *= scale;
param.fy *= scale;
param.skew *= scale;
} | [
"public",
"static",
"void",
"scaleIntrinsic",
"(",
"CameraPinhole",
"param",
",",
"double",
"scale",
")",
"{",
"param",
".",
"width",
"=",
"(",
"int",
")",
"(",
"param",
".",
"width",
"*",
"scale",
")",
";",
"param",
".",
"height",
"=",
"(",
"int",
"... | Multiplies each element of the intrinsic parameters by the provided scale factor. Useful
if the image has been rescaled.
@param param Intrinsic parameters
@param scale Scale factor that input image is being scaled by. | [
"Multiplies",
"each",
"element",
"of",
"the",
"intrinsic",
"parameters",
"by",
"the",
"provided",
"scale",
"factor",
".",
"Useful",
"if",
"the",
"image",
"has",
"been",
"rescaled",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L137-L145 |
50,677 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.invertPinhole | public static void invertPinhole( DMatrix3x3 K , DMatrix3x3 Kinv) {
double fx = K.a11;
double skew = K.a12;
double cx = K.a13;
double fy = K.a22;
double cy = K.a23;
Kinv.a11 = 1.0/fx;
Kinv.a12 = -skew/(fx*fy);
Kinv.a13 = (skew*cy - cx*fy)/(fx*fy);
Kinv.a22 = 1.0/fy;
Kinv.a23 = -cy/fy;
Kinv.a33 = 1... | java | public static void invertPinhole( DMatrix3x3 K , DMatrix3x3 Kinv) {
double fx = K.a11;
double skew = K.a12;
double cx = K.a13;
double fy = K.a22;
double cy = K.a23;
Kinv.a11 = 1.0/fx;
Kinv.a12 = -skew/(fx*fy);
Kinv.a13 = (skew*cy - cx*fy)/(fx*fy);
Kinv.a22 = 1.0/fy;
Kinv.a23 = -cy/fy;
Kinv.a33 = 1... | [
"public",
"static",
"void",
"invertPinhole",
"(",
"DMatrix3x3",
"K",
",",
"DMatrix3x3",
"Kinv",
")",
"{",
"double",
"fx",
"=",
"K",
".",
"a11",
";",
"double",
"skew",
"=",
"K",
".",
"a12",
";",
"double",
"cx",
"=",
"K",
".",
"a13",
";",
"double",
"... | Analytic matrix inversion to 3x3 camera calibration matrix. Input and output
can be the same matrix. Zeros are not set.
@param K (Input) Calibration matrix
@param Kinv (Output) inverse. | [
"Analytic",
"matrix",
"inversion",
"to",
"3x3",
"camera",
"calibration",
"matrix",
".",
"Input",
"and",
"output",
"can",
"be",
"the",
"same",
"matrix",
".",
"Zeros",
"are",
"not",
"set",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L223-L235 |
50,678 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.renderPixel | public static Point2D_F64 renderPixel( Se3_F64 worldToCamera , DMatrixRMaj K , Point3D_F64 X ) {
return ImplPerspectiveOps_F64.renderPixel(worldToCamera,K,X);
// if( K == null )
// return renderPixel(worldToCamera,X);
// return ImplPerspectiveOps_F64.renderPixel(worldToCamera,
// K.data[0], K.data[1], K.data[2... | java | public static Point2D_F64 renderPixel( Se3_F64 worldToCamera , DMatrixRMaj K , Point3D_F64 X ) {
return ImplPerspectiveOps_F64.renderPixel(worldToCamera,K,X);
// if( K == null )
// return renderPixel(worldToCamera,X);
// return ImplPerspectiveOps_F64.renderPixel(worldToCamera,
// K.data[0], K.data[1], K.data[2... | [
"public",
"static",
"Point2D_F64",
"renderPixel",
"(",
"Se3_F64",
"worldToCamera",
",",
"DMatrixRMaj",
"K",
",",
"Point3D_F64",
"X",
")",
"{",
"return",
"ImplPerspectiveOps_F64",
".",
"renderPixel",
"(",
"worldToCamera",
",",
"K",
",",
"X",
")",
";",
"//\t\tif( ... | Renders a point in world coordinates into the image plane in pixels or normalized image
coordinates.
@param worldToCamera Transform from world to camera frame
@param K Optional. Intrinsic camera calibration matrix. If null then normalized image coordinates are returned.
@param X 3D Point in world reference frame..
@... | [
"Renders",
"a",
"point",
"in",
"world",
"coordinates",
"into",
"the",
"image",
"plane",
"in",
"pixels",
"or",
"normalized",
"image",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L513-L519 |
50,679 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.renderPixel | public static Point2D_F64 renderPixel(CameraPinhole intrinsic , Point3D_F64 X ) {
Point2D_F64 norm = new Point2D_F64(X.x/X.z,X.y/X.z);
return convertNormToPixel(intrinsic, norm, norm);
} | java | public static Point2D_F64 renderPixel(CameraPinhole intrinsic , Point3D_F64 X ) {
Point2D_F64 norm = new Point2D_F64(X.x/X.z,X.y/X.z);
return convertNormToPixel(intrinsic, norm, norm);
} | [
"public",
"static",
"Point2D_F64",
"renderPixel",
"(",
"CameraPinhole",
"intrinsic",
",",
"Point3D_F64",
"X",
")",
"{",
"Point2D_F64",
"norm",
"=",
"new",
"Point2D_F64",
"(",
"X",
".",
"x",
"/",
"X",
".",
"z",
",",
"X",
".",
"y",
"/",
"X",
".",
"z",
... | Renders a point in camera coordinates into the image plane in pixels.
@param intrinsic Intrinsic camera parameters.
@param X 3D Point in world reference frame..
@return 2D Render point on image plane or null if it's behind the camera | [
"Renders",
"a",
"point",
"in",
"camera",
"coordinates",
"into",
"the",
"image",
"plane",
"in",
"pixels",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L538-L541 |
50,680 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.renderPixel | public static Point2D_F64 renderPixel( DMatrixRMaj worldToCamera , Point3D_F64 X ) {
return renderPixel(worldToCamera,X,(Point2D_F64)null);
} | java | public static Point2D_F64 renderPixel( DMatrixRMaj worldToCamera , Point3D_F64 X ) {
return renderPixel(worldToCamera,X,(Point2D_F64)null);
} | [
"public",
"static",
"Point2D_F64",
"renderPixel",
"(",
"DMatrixRMaj",
"worldToCamera",
",",
"Point3D_F64",
"X",
")",
"{",
"return",
"renderPixel",
"(",
"worldToCamera",
",",
"X",
",",
"(",
"Point2D_F64",
")",
"null",
")",
";",
"}"
] | Computes the image coordinate of a point given its 3D location and the camera matrix.
@param worldToCamera 3x4 camera matrix for transforming a 3D point from world to image coordinates.
@param X 3D Point in world reference frame..
@return 2D Render point on image plane. | [
"Computes",
"the",
"image",
"coordinate",
"of",
"a",
"point",
"given",
"its",
"3D",
"location",
"and",
"the",
"camera",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L550-L552 |
50,681 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.crossRatios | public static double crossRatios( Point3D_F64 a0 , Point3D_F64 a1 , Point3D_F64 a2 , Point3D_F64 a3) {
double d01 = a0.distance(a1);
double d23 = a2.distance(a3);
double d02 = a0.distance(a2);
double d13 = a1.distance(a3);
return (d01*d23)/(d02*d13);
} | java | public static double crossRatios( Point3D_F64 a0 , Point3D_F64 a1 , Point3D_F64 a2 , Point3D_F64 a3) {
double d01 = a0.distance(a1);
double d23 = a2.distance(a3);
double d02 = a0.distance(a2);
double d13 = a1.distance(a3);
return (d01*d23)/(d02*d13);
} | [
"public",
"static",
"double",
"crossRatios",
"(",
"Point3D_F64",
"a0",
",",
"Point3D_F64",
"a1",
",",
"Point3D_F64",
"a2",
",",
"Point3D_F64",
"a3",
")",
"{",
"double",
"d01",
"=",
"a0",
".",
"distance",
"(",
"a1",
")",
";",
"double",
"d23",
"=",
"a2",
... | Computes the cross-ratio between 4 points. This is an invariant under projective geometry.
@param a0 Point
@param a1 Point
@param a2 Point
@param a3 Point
@return cross ratio | [
"Computes",
"the",
"cross",
"-",
"ratio",
"between",
"4",
"points",
".",
"This",
"is",
"an",
"invariant",
"under",
"projective",
"geometry",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L720-L727 |
50,682 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.extractColumn | public static void extractColumn(DMatrixRMaj P, int col, GeoTuple3D_F64 a) {
a.x = P.unsafe_get(0,col);
a.y = P.unsafe_get(1,col);
a.z = P.unsafe_get(2,col);
} | java | public static void extractColumn(DMatrixRMaj P, int col, GeoTuple3D_F64 a) {
a.x = P.unsafe_get(0,col);
a.y = P.unsafe_get(1,col);
a.z = P.unsafe_get(2,col);
} | [
"public",
"static",
"void",
"extractColumn",
"(",
"DMatrixRMaj",
"P",
",",
"int",
"col",
",",
"GeoTuple3D_F64",
"a",
")",
"{",
"a",
".",
"x",
"=",
"P",
".",
"unsafe_get",
"(",
"0",
",",
"col",
")",
";",
"a",
".",
"y",
"=",
"P",
".",
"unsafe_get",
... | Extracts a column from the camera matrix and puts it into the geometric 3-tuple. | [
"Extracts",
"a",
"column",
"from",
"the",
"camera",
"matrix",
"and",
"puts",
"it",
"into",
"the",
"geometric",
"3",
"-",
"tuple",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L766-L770 |
50,683 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.insertColumn | public static void insertColumn(DMatrixRMaj P, int col, GeoTuple3D_F64 a) {
P.unsafe_set(0,col,a.x);
P.unsafe_set(1,col,a.y);
P.unsafe_set(2,col,a.z);
} | java | public static void insertColumn(DMatrixRMaj P, int col, GeoTuple3D_F64 a) {
P.unsafe_set(0,col,a.x);
P.unsafe_set(1,col,a.y);
P.unsafe_set(2,col,a.z);
} | [
"public",
"static",
"void",
"insertColumn",
"(",
"DMatrixRMaj",
"P",
",",
"int",
"col",
",",
"GeoTuple3D_F64",
"a",
")",
"{",
"P",
".",
"unsafe_set",
"(",
"0",
",",
"col",
",",
"a",
".",
"x",
")",
";",
"P",
".",
"unsafe_set",
"(",
"1",
",",
"col",
... | Inserts 3-tuple into the camera matrix's columns | [
"Inserts",
"3",
"-",
"tuple",
"into",
"the",
"camera",
"matrix",
"s",
"columns"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L775-L779 |
50,684 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/DecomposeEssential.java | DecomposeEssential.decompose | public void decompose( DMatrixRMaj E ) {
if( svd.inputModified() ) {
E_copy.set(E);
E = E_copy;
}
if( !svd.decompose(E))
throw new RuntimeException("Svd some how failed");
U = svd.getU(U,false);
V = svd.getV(V,false);
S = svd.getW(S);
SingularOps_DDRM.descendingOrder(U,false,S,V,false);
dec... | java | public void decompose( DMatrixRMaj E ) {
if( svd.inputModified() ) {
E_copy.set(E);
E = E_copy;
}
if( !svd.decompose(E))
throw new RuntimeException("Svd some how failed");
U = svd.getU(U,false);
V = svd.getV(V,false);
S = svd.getW(S);
SingularOps_DDRM.descendingOrder(U,false,S,V,false);
dec... | [
"public",
"void",
"decompose",
"(",
"DMatrixRMaj",
"E",
")",
"{",
"if",
"(",
"svd",
".",
"inputModified",
"(",
")",
")",
"{",
"E_copy",
".",
"set",
"(",
"E",
")",
";",
"E",
"=",
"E_copy",
";",
"}",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
... | Computes the decomposition from an essential matrix.
@param E essential matrix | [
"Computes",
"the",
"decomposition",
"from",
"an",
"essential",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/DecomposeEssential.java#L82-L98 |
50,685 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/DecomposeEssential.java | DecomposeEssential.extractTransform | private void extractTransform( DMatrixRMaj U , DMatrixRMaj V , DMatrixRMaj S ,
Se3_F64 se , boolean optionA , boolean optionB )
{
DMatrixRMaj R = se.getR();
Vector3D_F64 T = se.getT();
// extract rotation
if( optionA )
CommonOps_DDRM.mult(U,Rz,temp);
else
CommonOps_DDRM.multTransB(U,Rz,temp... | java | private void extractTransform( DMatrixRMaj U , DMatrixRMaj V , DMatrixRMaj S ,
Se3_F64 se , boolean optionA , boolean optionB )
{
DMatrixRMaj R = se.getR();
Vector3D_F64 T = se.getT();
// extract rotation
if( optionA )
CommonOps_DDRM.mult(U,Rz,temp);
else
CommonOps_DDRM.multTransB(U,Rz,temp... | [
"private",
"void",
"extractTransform",
"(",
"DMatrixRMaj",
"U",
",",
"DMatrixRMaj",
"V",
",",
"DMatrixRMaj",
"S",
",",
"Se3_F64",
"se",
",",
"boolean",
"optionA",
",",
"boolean",
"optionB",
")",
"{",
"DMatrixRMaj",
"R",
"=",
"se",
".",
"getR",
"(",
")",
... | There are four possible reconstructions from an essential matrix. This function will compute different
permutations depending on optionA and optionB being true or false. | [
"There",
"are",
"four",
"possible",
"reconstructions",
"from",
"an",
"essential",
"matrix",
".",
"This",
"function",
"will",
"compute",
"different",
"permutations",
"depending",
"on",
"optionA",
"and",
"optionB",
"being",
"true",
"or",
"false",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/DecomposeEssential.java#L147-L171 |
50,686 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.process | public boolean process( List<AssociatedPair> points )
{
if( points.size() < estimateHomography.getMinimumPoints())
throw new IllegalArgumentException("At least "+estimateHomography.getMinimumPoints()+" must be provided");
// center location of points in model
zeroMeanWorldPoints(points);
// make sure there... | java | public boolean process( List<AssociatedPair> points )
{
if( points.size() < estimateHomography.getMinimumPoints())
throw new IllegalArgumentException("At least "+estimateHomography.getMinimumPoints()+" must be provided");
// center location of points in model
zeroMeanWorldPoints(points);
// make sure there... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
")",
"{",
"if",
"(",
"points",
".",
"size",
"(",
")",
"<",
"estimateHomography",
".",
"getMinimumPoints",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"At... | Estimates the transform from world coordinate system to camera given known points and observations.
For each observation p1=World 3D location. z=0 is implicit. p2=Observed location of points in image in
normalized image coordinates
@param points List of world coordinates in 2D (p1) and normalized image coordinates (p2... | [
"Estimates",
"the",
"transform",
"from",
"world",
"coordinate",
"system",
"to",
"camera",
"given",
"known",
"points",
"and",
"observations",
".",
"For",
"each",
"observation",
"p1",
"=",
"World",
"3D",
"location",
".",
"z",
"=",
"0",
"is",
"implicit",
".",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L115-L166 |
50,687 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.computeError | double computeError( List<AssociatedPair> points , Se3_F64 worldToCamera ) {
double error = 0;
for (int i = 0; i < points.size(); i++) {
AssociatedPair pair = points.get(i);
tmpP.set(pair.p1.x,pair.p1.y,0);
SePointOps_F64.transform(worldToCamera,tmpP,tmpP);
error += pair.p2.distance2(tmpP.x/tmpP.z,tm... | java | double computeError( List<AssociatedPair> points , Se3_F64 worldToCamera ) {
double error = 0;
for (int i = 0; i < points.size(); i++) {
AssociatedPair pair = points.get(i);
tmpP.set(pair.p1.x,pair.p1.y,0);
SePointOps_F64.transform(worldToCamera,tmpP,tmpP);
error += pair.p2.distance2(tmpP.x/tmpP.z,tm... | [
"double",
"computeError",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"Se3_F64",
"worldToCamera",
")",
"{",
"double",
"error",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"points",
".",
"size",
"(",
")",
";",
"i",
"+... | Computes reprojection error to select best model | [
"Computes",
"reprojection",
"error",
"to",
"select",
"best",
"model"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L172-L185 |
50,688 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.zeroMeanWorldPoints | private void zeroMeanWorldPoints(List<AssociatedPair> points) {
center.set(0,0);
pointsAdj.reset();
for (int i = 0; i < points.size(); i++) {
AssociatedPair pair = points.get(i);
Point2D_F64 p = pair.p1;
pointsAdj.grow().p2.set(pair.p2);
center.x += p.x;
center.y += p.y;
}
center.x /= points.si... | java | private void zeroMeanWorldPoints(List<AssociatedPair> points) {
center.set(0,0);
pointsAdj.reset();
for (int i = 0; i < points.size(); i++) {
AssociatedPair pair = points.get(i);
Point2D_F64 p = pair.p1;
pointsAdj.grow().p2.set(pair.p2);
center.x += p.x;
center.y += p.y;
}
center.x /= points.si... | [
"private",
"void",
"zeroMeanWorldPoints",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
")",
"{",
"center",
".",
"set",
"(",
"0",
",",
"0",
")",
";",
"pointsAdj",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Ensure zero mean for world location. Creates a local copy of the input | [
"Ensure",
"zero",
"mean",
"for",
"world",
"location",
".",
"Creates",
"a",
"local",
"copy",
"of",
"the",
"input"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L190-L206 |
50,689 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.estimateTranslation | void estimateTranslation( DMatrixRMaj R , List<AssociatedPair> points , Vector3D_F64 T )
{
final int N = points.size();
W.reshape(N*2,3);
y.reshape(N*2,1);
Wty.reshape(3,1);
DMatrix3x3 Rtmp = new DMatrix3x3();
ConvertDMatrixStruct.convert(R,Rtmp);
int indexY = 0,indexW = 0;
for (int i = 0; i < N; i++... | java | void estimateTranslation( DMatrixRMaj R , List<AssociatedPair> points , Vector3D_F64 T )
{
final int N = points.size();
W.reshape(N*2,3);
y.reshape(N*2,1);
Wty.reshape(3,1);
DMatrix3x3 Rtmp = new DMatrix3x3();
ConvertDMatrixStruct.convert(R,Rtmp);
int indexY = 0,indexW = 0;
for (int i = 0; i < N; i++... | [
"void",
"estimateTranslation",
"(",
"DMatrixRMaj",
"R",
",",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"Vector3D_F64",
"T",
")",
"{",
"final",
"int",
"N",
"=",
"points",
".",
"size",
"(",
")",
";",
"W",
".",
"reshape",
"(",
"N",
"*",
"2",
",... | Estimate's the translation given the previously found rotation
@param R Rotation matrix
@param T (Output) estimated translation | [
"Estimate",
"s",
"the",
"translation",
"given",
"the",
"previously",
"found",
"rotation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L213-L258 |
50,690 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.IPPE | protected void IPPE( DMatrixRMaj R1 , DMatrixRMaj R2 ) {
// Equation 23 - Compute R_v from v
double norm_v = Math.sqrt(v1*v1 + v2*v2);
if( norm_v <= UtilEjml.EPS ) {
// the plane is fronto-parallel to the camera, so set the corrective rotation Rv to identity.
// There will be only one solution to pose.
... | java | protected void IPPE( DMatrixRMaj R1 , DMatrixRMaj R2 ) {
// Equation 23 - Compute R_v from v
double norm_v = Math.sqrt(v1*v1 + v2*v2);
if( norm_v <= UtilEjml.EPS ) {
// the plane is fronto-parallel to the camera, so set the corrective rotation Rv to identity.
// There will be only one solution to pose.
... | [
"protected",
"void",
"IPPE",
"(",
"DMatrixRMaj",
"R1",
",",
"DMatrixRMaj",
"R2",
")",
"{",
"// Equation 23 - Compute R_v from v",
"double",
"norm_v",
"=",
"Math",
".",
"sqrt",
"(",
"v1",
"*",
"v1",
"+",
"v2",
"*",
"v2",
")",
";",
"if",
"(",
"norm_v",
"<=... | Solves the IPPE problem | [
"Solves",
"the",
"IPPE",
"problem"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L263-L306 |
50,691 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleClassifySceneKnn.java | ExampleClassifySceneKnn.learnAndSave | public void learnAndSave() {
System.out.println("======== Learning Classifier");
// Either load pre-computed words or compute the words from the training images
AssignCluster<double[]> assignment;
if( new File(CLUSTER_FILE_NAME).exists() ) {
assignment = UtilIO.load(CLUSTER_FILE_NAME);
} else {
System.... | java | public void learnAndSave() {
System.out.println("======== Learning Classifier");
// Either load pre-computed words or compute the words from the training images
AssignCluster<double[]> assignment;
if( new File(CLUSTER_FILE_NAME).exists() ) {
assignment = UtilIO.load(CLUSTER_FILE_NAME);
} else {
System.... | [
"public",
"void",
"learnAndSave",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"======== Learning Classifier\"",
")",
";",
"// Either load pre-computed words or compute the words from the training images",
"AssignCluster",
"<",
"double",
"[",
"]",
">",
"ass... | Process all the data in the training data set to learn the classifications. See code for details. | [
"Process",
"all",
"the",
"data",
"in",
"the",
"training",
"data",
"set",
"to",
"learn",
"the",
"classifications",
".",
"See",
"code",
"for",
"details",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleClassifySceneKnn.java#L107-L130 |
50,692 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleClassifySceneKnn.java | ExampleClassifySceneKnn.computeClusters | private AssignCluster<double[]> computeClusters() {
System.out.println("Image Features");
// computes features in the training image set
List<TupleDesc_F64> features = new ArrayList<>();
for( String scene : train.keySet() ) {
List<String> imagePaths = train.get(scene);
System.out.println(" " + scene);
... | java | private AssignCluster<double[]> computeClusters() {
System.out.println("Image Features");
// computes features in the training image set
List<TupleDesc_F64> features = new ArrayList<>();
for( String scene : train.keySet() ) {
List<String> imagePaths = train.get(scene);
System.out.println(" " + scene);
... | [
"private",
"AssignCluster",
"<",
"double",
"[",
"]",
">",
"computeClusters",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Image Features\"",
")",
";",
"// computes features in the training image set",
"List",
"<",
"TupleDesc_F64",
">",
"features",
... | Extract dense features across the training set. Then clusters are found within those features. | [
"Extract",
"dense",
"features",
"across",
"the",
"training",
"set",
".",
"Then",
"clusters",
"are",
"found",
"within",
"those",
"features",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleClassifySceneKnn.java#L135-L166 |
50,693 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.grow | public void grow() {
if( tailBlockSize >= blockLength ) {
tailBlockSize = 0;
blocks.grow();
}
BlockIndexLength s = sets.grow();
s.block = blocks.size-1;
s.start = tailBlockSize;
s.length = 0;
tail = s;
} | java | public void grow() {
if( tailBlockSize >= blockLength ) {
tailBlockSize = 0;
blocks.grow();
}
BlockIndexLength s = sets.grow();
s.block = blocks.size-1;
s.start = tailBlockSize;
s.length = 0;
tail = s;
} | [
"public",
"void",
"grow",
"(",
")",
"{",
"if",
"(",
"tailBlockSize",
">=",
"blockLength",
")",
"{",
"tailBlockSize",
"=",
"0",
";",
"blocks",
".",
"grow",
"(",
")",
";",
"}",
"BlockIndexLength",
"s",
"=",
"sets",
".",
"grow",
"(",
")",
";",
"s",
".... | Adds a new point set to the end. | [
"Adds",
"a",
"new",
"point",
"set",
"to",
"the",
"end",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L81-L93 |
50,694 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.removeTail | public void removeTail() {
while( blocks.size-1 != tail.block )
blocks.removeTail();
tailBlockSize = tail.start;
sets.removeTail();
tail = sets.size > 0 ? sets.get( sets.size-1 ) : null;
} | java | public void removeTail() {
while( blocks.size-1 != tail.block )
blocks.removeTail();
tailBlockSize = tail.start;
sets.removeTail();
tail = sets.size > 0 ? sets.get( sets.size-1 ) : null;
} | [
"public",
"void",
"removeTail",
"(",
")",
"{",
"while",
"(",
"blocks",
".",
"size",
"-",
"1",
"!=",
"tail",
".",
"block",
")",
"blocks",
".",
"removeTail",
"(",
")",
";",
"tailBlockSize",
"=",
"tail",
".",
"start",
";",
"sets",
".",
"removeTail",
"("... | Removes the current point set from the end | [
"Removes",
"the",
"current",
"point",
"set",
"from",
"the",
"end"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L98-L104 |
50,695 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.addPointToTail | public void addPointToTail( int x , int y ) {
int index = tail.start + tail.length*2;
int block[];
int blockIndex = tail.block + index/blockLength;
if( blockIndex == blocks.size ) {
tailBlockSize = 0;
block = blocks.grow();
} else {
block = blocks.get( blockIndex );
}
tailBlockSize += 2;
index... | java | public void addPointToTail( int x , int y ) {
int index = tail.start + tail.length*2;
int block[];
int blockIndex = tail.block + index/blockLength;
if( blockIndex == blocks.size ) {
tailBlockSize = 0;
block = blocks.grow();
} else {
block = blocks.get( blockIndex );
}
tailBlockSize += 2;
index... | [
"public",
"void",
"addPointToTail",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"index",
"=",
"tail",
".",
"start",
"+",
"tail",
".",
"length",
"*",
"2",
";",
"int",
"block",
"[",
"]",
";",
"int",
"blockIndex",
"=",
"tail",
".",
"block",
"... | Adds a point to the tail point set
@param x coordinate
@param y coordinate | [
"Adds",
"a",
"point",
"to",
"the",
"tail",
"point",
"set"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L111-L128 |
50,696 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.getSet | public void getSet(int which , FastQueue<Point2D_I32> list ) {
list.reset();
BlockIndexLength set = sets.get(which);
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = set.block + index/blockLength;
index %= blockLength;
int block[] = blocks.get( blockIndex );
l... | java | public void getSet(int which , FastQueue<Point2D_I32> list ) {
list.reset();
BlockIndexLength set = sets.get(which);
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = set.block + index/blockLength;
index %= blockLength;
int block[] = blocks.get( blockIndex );
l... | [
"public",
"void",
"getSet",
"(",
"int",
"which",
",",
"FastQueue",
"<",
"Point2D_I32",
">",
"list",
")",
"{",
"list",
".",
"reset",
"(",
")",
";",
"BlockIndexLength",
"set",
"=",
"sets",
".",
"get",
"(",
"which",
")",
";",
"for",
"(",
"int",
"i",
"... | Copies all the points in the set into the specified list
@param which (Input) which point set
@param list (Output) Storage for points | [
"Copies",
"all",
"the",
"points",
"in",
"the",
"set",
"into",
"the",
"specified",
"list"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L160-L173 |
50,697 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.writeOverSet | public void writeOverSet(int which, List<Point2D_I32> points) {
BlockIndexLength set = sets.get(which);
if( set.length != points.size() )
throw new IllegalArgumentException("points and set don't have the same length");
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = ... | java | public void writeOverSet(int which, List<Point2D_I32> points) {
BlockIndexLength set = sets.get(which);
if( set.length != points.size() )
throw new IllegalArgumentException("points and set don't have the same length");
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = ... | [
"public",
"void",
"writeOverSet",
"(",
"int",
"which",
",",
"List",
"<",
"Point2D_I32",
">",
"points",
")",
"{",
"BlockIndexLength",
"set",
"=",
"sets",
".",
"get",
"(",
"which",
")",
";",
"if",
"(",
"set",
".",
"length",
"!=",
"points",
".",
"size",
... | Overwrites the points in the set with the list of points.
@param points Points which are to be written into the set. Must be the same size as the set. | [
"Overwrites",
"the",
"points",
"in",
"the",
"set",
"with",
"the",
"list",
"of",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L199-L214 |
50,698 | lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/fiducial/DetectFiducialSquareBinaryApp.java | DetectFiducialSquareBinaryApp.viewUpdated | public void viewUpdated() {
BufferedImage active = null;
if( controls.selectedView == 0 ) {
active = original;
} else if( controls.selectedView == 1 ) {
synchronized (lockProcessing) {
VisualizeBinaryData.renderBinary(detector.getBinary(), false, work);
}
active = work;
work.setRGB(0, 0, work.g... | java | public void viewUpdated() {
BufferedImage active = null;
if( controls.selectedView == 0 ) {
active = original;
} else if( controls.selectedView == 1 ) {
synchronized (lockProcessing) {
VisualizeBinaryData.renderBinary(detector.getBinary(), false, work);
}
active = work;
work.setRGB(0, 0, work.g... | [
"public",
"void",
"viewUpdated",
"(",
")",
"{",
"BufferedImage",
"active",
"=",
"null",
";",
"if",
"(",
"controls",
".",
"selectedView",
"==",
"0",
")",
"{",
"active",
"=",
"original",
";",
"}",
"else",
"if",
"(",
"controls",
".",
"selectedView",
"==",
... | Called when how the data is visualized has changed | [
"Called",
"when",
"how",
"the",
"data",
"is",
"visualized",
"has",
"changed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/fiducial/DetectFiducialSquareBinaryApp.java#L176-L197 |
50,699 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java | SquaresIntoRegularClusters.disconnectSingleConnections | void disconnectSingleConnections() {
List<SquareNode> open = new ArrayList<>();
List<SquareNode> open2 = new ArrayList<>();
for (int i = 0; i < nodes.size(); i++) {
SquareNode n = nodes.get(i);
checkDisconnectSingleEdge(open, n);
}
while( !open.isEmpty() ) {
for (int i = 0; i < open.size(); i++) ... | java | void disconnectSingleConnections() {
List<SquareNode> open = new ArrayList<>();
List<SquareNode> open2 = new ArrayList<>();
for (int i = 0; i < nodes.size(); i++) {
SquareNode n = nodes.get(i);
checkDisconnectSingleEdge(open, n);
}
while( !open.isEmpty() ) {
for (int i = 0; i < open.size(); i++) ... | [
"void",
"disconnectSingleConnections",
"(",
")",
"{",
"List",
"<",
"SquareNode",
">",
"open",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"SquareNode",
">",
"open2",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
... | Nodes that have only a single connection to one other node are disconnected since they are likely to be noise.
This is done recursively | [
"Nodes",
"that",
"have",
"only",
"a",
"single",
"connection",
"to",
"one",
"other",
"node",
"are",
"disconnected",
"since",
"they",
"are",
"likely",
"to",
"be",
"noise",
".",
"This",
"is",
"done",
"recursively"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java#L158-L180 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.