repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java | GPixelMath.boundImage | public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
if( input instanceof ImageGray ) {
if (GrayU8.class == input.getClass()) {
PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
} else if (GrayS8.class == input.getClass()) {
PixelMath.boundImage((GrayS8)... | java | public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
if( input instanceof ImageGray ) {
if (GrayU8.class == input.getClass()) {
PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
} else if (GrayS8.class == input.getClass()) {
PixelMath.boundImage((GrayS8)... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"boundImage",
"(",
"T",
"input",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"input",
"instanceof",
"ImageGray",
")",
"{",
"if",
"(",
"GrayU8",
"."... | Bounds image pixels to be between these two values.
@param input Input image.
@param min minimum value. Inclusive.
@param max maximum value. Inclusive. | [
"Bounds",
"image",
"pixels",
"to",
"be",
"between",
"these",
"two",
"values",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java#L1039-L1067 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/feature/describe/VisualizeRegionDescriptionApp.java | VisualizeRegionDescriptionApp.updateTargetDescription | private void updateTargetDescription() {
if( targetPt != null ) {
TupleDesc feature = describe.createDescription();
describe.process(targetPt.x,targetPt.y,targetOrientation,targetRadius,feature);
tuplePanel.setDescription(feature);
} else {
tuplePanel.setDescription(null);
}
tuplePanel.repaint();
} | java | private void updateTargetDescription() {
if( targetPt != null ) {
TupleDesc feature = describe.createDescription();
describe.process(targetPt.x,targetPt.y,targetOrientation,targetRadius,feature);
tuplePanel.setDescription(feature);
} else {
tuplePanel.setDescription(null);
}
tuplePanel.repaint();
} | [
"private",
"void",
"updateTargetDescription",
"(",
")",
"{",
"if",
"(",
"targetPt",
"!=",
"null",
")",
"{",
"TupleDesc",
"feature",
"=",
"describe",
".",
"createDescription",
"(",
")",
";",
"describe",
".",
"process",
"(",
"targetPt",
".",
"x",
",",
"targe... | Extracts the target description and updates the panel. Should only be called from a swing thread | [
"Extracts",
"the",
"target",
"description",
"and",
"updates",
"the",
"panel",
".",
"Should",
"only",
"be",
"called",
"from",
"a",
"swing",
"thread"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/describe/VisualizeRegionDescriptionApp.java#L163-L172 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.inducedHomography13 | public static DMatrixRMaj inducedHomography13( TrifocalTensor tensor ,
Vector3D_F64 line2 ,
DMatrixRMaj output ) {
if( output == null )
output = new DMatrixRMaj(3,3);
DMatrixRMaj T = tensor.T1;
// H(:,0) = transpose(T1)*line
output.data[0] = T.data[0]*line2.x + T.data[3]*line2... | java | public static DMatrixRMaj inducedHomography13( TrifocalTensor tensor ,
Vector3D_F64 line2 ,
DMatrixRMaj output ) {
if( output == null )
output = new DMatrixRMaj(3,3);
DMatrixRMaj T = tensor.T1;
// H(:,0) = transpose(T1)*line
output.data[0] = T.data[0]*line2.x + T.data[3]*line2... | [
"public",
"static",
"DMatrixRMaj",
"inducedHomography13",
"(",
"TrifocalTensor",
"tensor",
",",
"Vector3D_F64",
"line2",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
... | Computes the homography induced from view 1 to 3 by a line in view 2. The provided line in
view 2 must contain the view 2 observation.
p3 = H13*p1
@param tensor Input: Trifocal tensor
@param line2 Input: Line in view 2. {@link LineGeneral2D_F64 General notation}.
@param output Output: Optional storage for homograph... | [
"Computes",
"the",
"homography",
"induced",
"from",
"view",
"1",
"to",
"3",
"by",
"a",
"line",
"in",
"view",
"2",
".",
"The",
"provided",
"line",
"in",
"view",
"2",
"must",
"contain",
"the",
"view",
"2",
"observation",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L438-L473 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.inducedHomography12 | public static DMatrixRMaj inducedHomography12( TrifocalTensor tensor ,
Vector3D_F64 line3 ,
DMatrixRMaj output ) {
if( output == null )
output = new DMatrixRMaj(3,3);
// H(:,0) = T1*line
DMatrixRMaj T = tensor.T1;
output.data[0] = T.data[0]*line3.x + T.data[1]*line3.y + T.data[... | java | public static DMatrixRMaj inducedHomography12( TrifocalTensor tensor ,
Vector3D_F64 line3 ,
DMatrixRMaj output ) {
if( output == null )
output = new DMatrixRMaj(3,3);
// H(:,0) = T1*line
DMatrixRMaj T = tensor.T1;
output.data[0] = T.data[0]*line3.x + T.data[1]*line3.y + T.data[... | [
"public",
"static",
"DMatrixRMaj",
"inducedHomography12",
"(",
"TrifocalTensor",
"tensor",
",",
"Vector3D_F64",
"line3",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
... | Computes the homography induced from view 1 to 2 by a line in view 3. The provided line in
view 3 must contain the view 3 observation.
p2 = H12*p1
@param tensor Input: Trifocal tensor
@param line3 Input: Line in view 3. {@link LineGeneral2D_F64 General notation}.
@param output Output: Optional storage for homograph... | [
"Computes",
"the",
"homography",
"induced",
"from",
"view",
"1",
"to",
"2",
"by",
"a",
"line",
"in",
"view",
"3",
".",
"The",
"provided",
"line",
"in",
"view",
"3",
"must",
"contain",
"the",
"view",
"3",
"observation",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L486-L520 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.homographyStereo3Pts | public static DMatrixRMaj homographyStereo3Pts( DMatrixRMaj F , AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) {
HomographyInducedStereo3Pts alg = new HomographyInducedStereo3Pts();
alg.setFundamental(F,null);
if( !alg.process(p1,p2,p3) )
return null;
return alg.getHomography();
} | java | public static DMatrixRMaj homographyStereo3Pts( DMatrixRMaj F , AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) {
HomographyInducedStereo3Pts alg = new HomographyInducedStereo3Pts();
alg.setFundamental(F,null);
if( !alg.process(p1,p2,p3) )
return null;
return alg.getHomography();
} | [
"public",
"static",
"DMatrixRMaj",
"homographyStereo3Pts",
"(",
"DMatrixRMaj",
"F",
",",
"AssociatedPair",
"p1",
",",
"AssociatedPair",
"p2",
",",
"AssociatedPair",
"p3",
")",
"{",
"HomographyInducedStereo3Pts",
"alg",
"=",
"new",
"HomographyInducedStereo3Pts",
"(",
"... | Computes the homography induced from a planar surface when viewed from two views using correspondences
of three points. Observations must be on the planar surface.
@see boofcv.alg.geo.h.HomographyInducedStereo3Pts
@param F Fundamental matrix
@param p1 Associated point observation
@param p2 Associated point observatio... | [
"Computes",
"the",
"homography",
"induced",
"from",
"a",
"planar",
"surface",
"when",
"viewed",
"from",
"two",
"views",
"using",
"correspondences",
"of",
"three",
"points",
".",
"Observations",
"must",
"be",
"on",
"the",
"planar",
"surface",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L534-L541 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.homographyStereoLinePt | public static DMatrixRMaj homographyStereoLinePt( DMatrixRMaj F , PairLineNorm line, AssociatedPair point) {
HomographyInducedStereoLinePt alg = new HomographyInducedStereoLinePt();
alg.setFundamental(F,null);
alg.process(line,point);
return alg.getHomography();
} | java | public static DMatrixRMaj homographyStereoLinePt( DMatrixRMaj F , PairLineNorm line, AssociatedPair point) {
HomographyInducedStereoLinePt alg = new HomographyInducedStereoLinePt();
alg.setFundamental(F,null);
alg.process(line,point);
return alg.getHomography();
} | [
"public",
"static",
"DMatrixRMaj",
"homographyStereoLinePt",
"(",
"DMatrixRMaj",
"F",
",",
"PairLineNorm",
"line",
",",
"AssociatedPair",
"point",
")",
"{",
"HomographyInducedStereoLinePt",
"alg",
"=",
"new",
"HomographyInducedStereoLinePt",
"(",
")",
";",
"alg",
".",... | Computes the homography induced from a planar surface when viewed from two views using correspondences
of a line and a point. Observations must be on the planar surface.
@see HomographyInducedStereoLinePt
@param F Fundamental matrix
@param line Line on the plane
@param point Point on the plane
@return The homography ... | [
"Computes",
"the",
"homography",
"induced",
"from",
"a",
"planar",
"surface",
"when",
"viewed",
"from",
"two",
"views",
"using",
"correspondences",
"of",
"a",
"line",
"and",
"a",
"point",
".",
"Observations",
"must",
"be",
"on",
"the",
"planar",
"surface",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L554-L560 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.homographyStereo2Lines | public static DMatrixRMaj homographyStereo2Lines( DMatrixRMaj F , PairLineNorm line0, PairLineNorm line1) {
HomographyInducedStereo2Line alg = new HomographyInducedStereo2Line();
alg.setFundamental(F,null);
if( !alg.process(line0,line1) )
return null;
return alg.getHomography();
} | java | public static DMatrixRMaj homographyStereo2Lines( DMatrixRMaj F , PairLineNorm line0, PairLineNorm line1) {
HomographyInducedStereo2Line alg = new HomographyInducedStereo2Line();
alg.setFundamental(F,null);
if( !alg.process(line0,line1) )
return null;
return alg.getHomography();
} | [
"public",
"static",
"DMatrixRMaj",
"homographyStereo2Lines",
"(",
"DMatrixRMaj",
"F",
",",
"PairLineNorm",
"line0",
",",
"PairLineNorm",
"line1",
")",
"{",
"HomographyInducedStereo2Line",
"alg",
"=",
"new",
"HomographyInducedStereo2Line",
"(",
")",
";",
"alg",
".",
... | Computes the homography induced from a planar surface when viewed from two views using correspondences
of two lines. Observations must be on the planar surface.
@see HomographyInducedStereo2Line
@param F Fundamental matrix
@param line0 Line on the plane
@param line1 Line on the plane
@return The homography from view ... | [
"Computes",
"the",
"homography",
"induced",
"from",
"a",
"planar",
"surface",
"when",
"viewed",
"from",
"two",
"views",
"using",
"correspondences",
"of",
"two",
"lines",
".",
"Observations",
"must",
"be",
"on",
"the",
"planar",
"surface",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L573-L580 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.createFundamental | public static DMatrixRMaj createFundamental(DMatrixRMaj E, CameraPinhole intrinsic ) {
DMatrixRMaj K = PerspectiveOps.pinholeToMatrix(intrinsic,(DMatrixRMaj)null);
return createFundamental(E,K);
} | java | public static DMatrixRMaj createFundamental(DMatrixRMaj E, CameraPinhole intrinsic ) {
DMatrixRMaj K = PerspectiveOps.pinholeToMatrix(intrinsic,(DMatrixRMaj)null);
return createFundamental(E,K);
} | [
"public",
"static",
"DMatrixRMaj",
"createFundamental",
"(",
"DMatrixRMaj",
"E",
",",
"CameraPinhole",
"intrinsic",
")",
"{",
"DMatrixRMaj",
"K",
"=",
"PerspectiveOps",
".",
"pinholeToMatrix",
"(",
"intrinsic",
",",
"(",
"DMatrixRMaj",
")",
"null",
")",
";",
"re... | Computes a Fundamental matrix given an Essential matrix and the camera's intrinsic
parameters.
@see #createFundamental(DMatrixRMaj, DMatrixRMaj)
@param E Essential matrix
@param intrinsic Intrinsic camera calibration
@return Fundamental matrix | [
"Computes",
"a",
"Fundamental",
"matrix",
"given",
"an",
"Essential",
"matrix",
"and",
"the",
"camera",
"s",
"intrinsic",
"parameters",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L707-L710 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.projectiveToMetric | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
MultiViewOps.decomposeMetricCamera(tmp,K,worldToView);
} | java | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
MultiViewOps.decomposeMetricCamera(tmp,K,worldToView);
} | [
"public",
"static",
"void",
"projectiveToMetric",
"(",
"DMatrixRMaj",
"cameraMatrix",
",",
"DMatrixRMaj",
"H",
",",
"Se3_F64",
"worldToView",
",",
"DMatrixRMaj",
"K",
")",
"{",
"DMatrixRMaj",
"tmp",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"4",
")",
";",
"C... | Elevates a projective camera matrix into a metric one using the rectifying homography.
Extracts calibration and Se3 pose.
<pre>
P'=P*H
K,R,t = decompose(P')
</pre>
where P is the camera matrix, H is the homography, (K,R,t) are the intrinsic calibration matrix, rotation,
and translation
@see MultiViewOps#absoluteQuadr... | [
"Elevates",
"a",
"projective",
"camera",
"matrix",
"into",
"a",
"metric",
"one",
"using",
"the",
"rectifying",
"homography",
".",
"Extracts",
"calibration",
"and",
"Se3",
"pose",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1358-L1365 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.projectiveToMetricKnownK | public static void projectiveToMetricKnownK( DMatrixRMaj cameraMatrix ,
DMatrixRMaj H , DMatrixRMaj K,
Se3_F64 worldToView )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
DMatrixRMaj K_inv = new DMatrixRMaj(3,3);
CommonOps_DDRM.invert(K,K_inv);
... | java | public static void projectiveToMetricKnownK( DMatrixRMaj cameraMatrix ,
DMatrixRMaj H , DMatrixRMaj K,
Se3_F64 worldToView )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
DMatrixRMaj K_inv = new DMatrixRMaj(3,3);
CommonOps_DDRM.invert(K,K_inv);
... | [
"public",
"static",
"void",
"projectiveToMetricKnownK",
"(",
"DMatrixRMaj",
"cameraMatrix",
",",
"DMatrixRMaj",
"H",
",",
"DMatrixRMaj",
"K",
",",
"Se3_F64",
"worldToView",
")",
"{",
"DMatrixRMaj",
"tmp",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"4",
")",
";"... | Convert the projective camera matrix into a metric transform given the rectifying homography and a
known calibration matrix.
{@code P = K*[R|T]*H} where H is the inverse of the rectifying homography.
@param cameraMatrix (Input) camera matrix. 3x4
@param H (Input) Rectifying homography. 4x4
@param K (Input) Known cali... | [
"Convert",
"the",
"projective",
"camera",
"matrix",
"into",
"a",
"metric",
"transform",
"given",
"the",
"rectifying",
"homography",
"and",
"a",
"known",
"calibration",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1378-L1410 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.rectifyHToAbsoluteQuadratic | public static void rectifyHToAbsoluteQuadratic(DMatrixRMaj H , DMatrixRMaj Q ) {
int indexQ = 0;
for (int rowA = 0; rowA < 4; rowA++) {
for (int colB = 0; colB < 4; colB++) {
int indexA = rowA*4;
int indexB = colB*4;
double sum = 0;
for (int i = 0; i < 3; i++) {
// sum += H.get(rowA,i)*H.get... | java | public static void rectifyHToAbsoluteQuadratic(DMatrixRMaj H , DMatrixRMaj Q ) {
int indexQ = 0;
for (int rowA = 0; rowA < 4; rowA++) {
for (int colB = 0; colB < 4; colB++) {
int indexA = rowA*4;
int indexB = colB*4;
double sum = 0;
for (int i = 0; i < 3; i++) {
// sum += H.get(rowA,i)*H.get... | [
"public",
"static",
"void",
"rectifyHToAbsoluteQuadratic",
"(",
"DMatrixRMaj",
"H",
",",
"DMatrixRMaj",
"Q",
")",
"{",
"int",
"indexQ",
"=",
"0",
";",
"for",
"(",
"int",
"rowA",
"=",
"0",
";",
"rowA",
"<",
"4",
";",
"rowA",
"++",
")",
"{",
"for",
"("... | Rectifying homography to dual absolute quadratic.
<p>Q = H*I*H<sup>T</sup> = H(:,1:3)*H(:,1:3)'</p>
<p>where I = diag(1 1 1 0)</p>
@param H (Input) 4x4 rectifying homography.
@param Q (Output) Absolute quadratic. Typically found in auto calibration. Not modified. | [
"Rectifying",
"homography",
"to",
"dual",
"absolute",
"quadratic",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1489-L1506 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.intrinsicFromAbsoluteQuadratic | public static void intrinsicFromAbsoluteQuadratic( DMatrixRMaj Q , DMatrixRMaj P , CameraPinhole intrinsic )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
DMatrixRMaj tmp2 = new DMatrixRMaj(3,3);
CommonOps_DDRM.mult(P,Q,tmp);
CommonOps_DDRM.multTransB(tmp,P,tmp2);
decomposeDiac(tmp2,intrinsic);
} | java | public static void intrinsicFromAbsoluteQuadratic( DMatrixRMaj Q , DMatrixRMaj P , CameraPinhole intrinsic )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
DMatrixRMaj tmp2 = new DMatrixRMaj(3,3);
CommonOps_DDRM.mult(P,Q,tmp);
CommonOps_DDRM.multTransB(tmp,P,tmp2);
decomposeDiac(tmp2,intrinsic);
} | [
"public",
"static",
"void",
"intrinsicFromAbsoluteQuadratic",
"(",
"DMatrixRMaj",
"Q",
",",
"DMatrixRMaj",
"P",
",",
"CameraPinhole",
"intrinsic",
")",
"{",
"DMatrixRMaj",
"tmp",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"4",
")",
";",
"DMatrixRMaj",
"tmp2",
"... | Extracts the intrinsic camera matrix from a view given its camera matrix and the dual absolute quadratic.
<p>w<sub>i</sub> = P<sub>i</sub>*Q*P<sub>i</sub><sup>T</sup>, where w<sub>i</sub> = K<sub>i</sub>*K'<sub>i</sub></p>
@param Q (Input) Dual absolute qudratic
@param P (Input) Camera matrix for a view
@param intrin... | [
"Extracts",
"the",
"intrinsic",
"camera",
"matrix",
"from",
"a",
"view",
"given",
"its",
"camera",
"matrix",
"and",
"the",
"dual",
"absolute",
"quadratic",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1517-L1525 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.split2 | public static Tuple2<List<Point2D_F64>,List<Point2D_F64>> split2( List<AssociatedPair> input )
{
List<Point2D_F64> list1 = new ArrayList<>();
List<Point2D_F64> list2 = new ArrayList<>();
for (int i = 0; i < input.size(); i++) {
list1.add( input.get(i).p1 );
list2.add( input.get(i).p2 );
}
return new ... | java | public static Tuple2<List<Point2D_F64>,List<Point2D_F64>> split2( List<AssociatedPair> input )
{
List<Point2D_F64> list1 = new ArrayList<>();
List<Point2D_F64> list2 = new ArrayList<>();
for (int i = 0; i < input.size(); i++) {
list1.add( input.get(i).p1 );
list2.add( input.get(i).p2 );
}
return new ... | [
"public",
"static",
"Tuple2",
"<",
"List",
"<",
"Point2D_F64",
">",
",",
"List",
"<",
"Point2D_F64",
">",
">",
"split2",
"(",
"List",
"<",
"AssociatedPair",
">",
"input",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"list1",
"=",
"new",
"ArrayList",
"<>",
... | Splits the associated pairs into two lists
@param input List of associated features
@return two lists containing each set of features | [
"Splits",
"the",
"associated",
"pairs",
"into",
"two",
"lists"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1623-L1634 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.split3 | public static Tuple3<List<Point2D_F64>,List<Point2D_F64>,List<Point2D_F64>> split3(List<AssociatedTriple> input )
{
List<Point2D_F64> list1 = new ArrayList<>();
List<Point2D_F64> list2 = new ArrayList<>();
List<Point2D_F64> list3 = new ArrayList<>();
for (int i = 0; i < input.size(); i++) {
list1.add( inpu... | java | public static Tuple3<List<Point2D_F64>,List<Point2D_F64>,List<Point2D_F64>> split3(List<AssociatedTriple> input )
{
List<Point2D_F64> list1 = new ArrayList<>();
List<Point2D_F64> list2 = new ArrayList<>();
List<Point2D_F64> list3 = new ArrayList<>();
for (int i = 0; i < input.size(); i++) {
list1.add( inpu... | [
"public",
"static",
"Tuple3",
"<",
"List",
"<",
"Point2D_F64",
">",
",",
"List",
"<",
"Point2D_F64",
">",
",",
"List",
"<",
"Point2D_F64",
">",
">",
"split3",
"(",
"List",
"<",
"AssociatedTriple",
">",
"input",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
... | Splits the associated triple into three lists
@param input List of associated features
@return three lists containing each set of features | [
"Splits",
"the",
"associated",
"triple",
"into",
"three",
"lists"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1641-L1654 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/SubbandShrink.java | SubbandShrink.performShrinkage | protected void performShrinkage( I transform , int numLevels ) {
// step through each layer in the pyramid.
for( int i = 0; i < numLevels; i++ ) {
int w = transform.width;
int h = transform.height;
int ww = w/2;
int hh = h/2;
Number threshold;
I subband;
// HL
subband = transform.subimage(... | java | protected void performShrinkage( I transform , int numLevels ) {
// step through each layer in the pyramid.
for( int i = 0; i < numLevels; i++ ) {
int w = transform.width;
int h = transform.height;
int ww = w/2;
int hh = h/2;
Number threshold;
I subband;
// HL
subband = transform.subimage(... | [
"protected",
"void",
"performShrinkage",
"(",
"I",
"transform",
",",
"int",
"numLevels",
")",
"{",
"// step through each layer in the pyramid.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numLevels",
";",
"i",
"++",
")",
"{",
"int",
"w",
"=",
"trans... | Performs wavelet shrinking using the specified rule and by computing a threshold
for each subband.
@param transform The image being transformed.
@param numLevels Number of levels in the transform. | [
"Performs",
"wavelet",
"shrinking",
"using",
"the",
"specified",
"rule",
"and",
"by",
"computing",
"a",
"threshold",
"for",
"each",
"subband",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/SubbandShrink.java#L56-L91 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/DenoiseVisuShrink_F32.java | DenoiseVisuShrink_F32.denoise | @Override
public void denoise(GrayF32 transform , int numLevels ) {
int scale = UtilWavelet.computeScale(numLevels);
final int h = transform.height;
final int w = transform.width;
// width and height of scaling image
final int innerWidth = w/scale;
final int innerHeight = h/scale;
GrayF32 subbandHH = ... | java | @Override
public void denoise(GrayF32 transform , int numLevels ) {
int scale = UtilWavelet.computeScale(numLevels);
final int h = transform.height;
final int w = transform.width;
// width and height of scaling image
final int innerWidth = w/scale;
final int innerHeight = h/scale;
GrayF32 subbandHH = ... | [
"@",
"Override",
"public",
"void",
"denoise",
"(",
"GrayF32",
"transform",
",",
"int",
"numLevels",
")",
"{",
"int",
"scale",
"=",
"UtilWavelet",
".",
"computeScale",
"(",
"numLevels",
")",
";",
"final",
"int",
"h",
"=",
"transform",
".",
"height",
";",
... | Applies VisuShrink denoising to the provided multilevel wavelet transform using
the provided threshold.
@param transform Mult-level wavelet transform. Modified.
@param numLevels Number of levels in the transform. | [
"Applies",
"VisuShrink",
"denoising",
"to",
"the",
"provided",
"multilevel",
"wavelet",
"transform",
"using",
"the",
"provided",
"threshold",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/DenoiseVisuShrink_F32.java#L51-L69 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletCoiflet.java | FactoryWaveletCoiflet.generate_F32 | public static WaveletDescription<WlCoef_F32> generate_F32( int I ) {
if( I != 6 ) {
throw new IllegalArgumentException("Only 6 is currently supported");
}
WlCoef_F32 coef = new WlCoef_F32();
coef.offsetScaling = -2;
coef.offsetWavelet = -2;
coef.scaling = new float[6];
coef.wavelet = new float[6];
... | java | public static WaveletDescription<WlCoef_F32> generate_F32( int I ) {
if( I != 6 ) {
throw new IllegalArgumentException("Only 6 is currently supported");
}
WlCoef_F32 coef = new WlCoef_F32();
coef.offsetScaling = -2;
coef.offsetWavelet = -2;
coef.scaling = new float[6];
coef.wavelet = new float[6];
... | [
"public",
"static",
"WaveletDescription",
"<",
"WlCoef_F32",
">",
"generate_F32",
"(",
"int",
"I",
")",
"{",
"if",
"(",
"I",
"!=",
"6",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Only 6 is currently supported\"",
")",
";",
"}",
"WlCoef_F32",
... | Creates a description of a Coiflet of order I wavelet.
@param I order of the wavelet.
@return Wavelet description. | [
"Creates",
"a",
"description",
"of",
"a",
"Coiflet",
"of",
"order",
"I",
"wavelet",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletCoiflet.java#L58-L90 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java | ShapeFittingOps.fitEllipse_F64 | public static FitData<EllipseRotated_F64> fitEllipse_F64( List<Point2D_F64> points, int iterations ,
boolean computeError ,
FitData<EllipseRotated_F64> outputStorage ) {
if( outputStorage == null ) {
outputStorage = new FitData<>(new EllipseRotated_F64());
}
// Compute the o... | java | public static FitData<EllipseRotated_F64> fitEllipse_F64( List<Point2D_F64> points, int iterations ,
boolean computeError ,
FitData<EllipseRotated_F64> outputStorage ) {
if( outputStorage == null ) {
outputStorage = new FitData<>(new EllipseRotated_F64());
}
// Compute the o... | [
"public",
"static",
"FitData",
"<",
"EllipseRotated_F64",
">",
"fitEllipse_F64",
"(",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"int",
"iterations",
",",
"boolean",
"computeError",
",",
"FitData",
"<",
"EllipseRotated_F64",
">",
"outputStorage",
")",
"{",
... | Computes the best fit ellipse based on minimizing Euclidean distance. An estimate is initially provided
using algebraic algorithm which is then refined using non-linear optimization. The amount of non-linear
optimization can be controlled using 'iterations' parameter. Will work with partial and complete contours
of ... | [
"Computes",
"the",
"best",
"fit",
"ellipse",
"based",
"on",
"minimizing",
"Euclidean",
"distance",
".",
"An",
"estimate",
"is",
"initially",
"provided",
"using",
"algebraic",
"algorithm",
"which",
"is",
"then",
"refined",
"using",
"non",
"-",
"linear",
"optimiza... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java#L104-L148 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java | ShapeFittingOps.convert_I32_F64 | public static List<Point2D_F64> convert_I32_F64(List<Point2D_I32> points) {
return convert_I32_F64(points,null).toList();
} | java | public static List<Point2D_F64> convert_I32_F64(List<Point2D_I32> points) {
return convert_I32_F64(points,null).toList();
} | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"convert_I32_F64",
"(",
"List",
"<",
"Point2D_I32",
">",
"points",
")",
"{",
"return",
"convert_I32_F64",
"(",
"points",
",",
"null",
")",
".",
"toList",
"(",
")",
";",
"}"
] | Converts a list of I32 points into F64
@param points Original points
@return Converted points | [
"Converts",
"a",
"list",
"of",
"I32",
"points",
"into",
"F64"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java#L174-L176 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java | ShapeFittingOps.averageCircle_I32 | public static FitData<Circle2D_F64> averageCircle_I32(List<Point2D_I32> points, GrowQueue_F64 optional,
FitData<Circle2D_F64> outputStorage) {
if( outputStorage == null ) {
outputStorage = new FitData<>(new Circle2D_F64());
}
if( optional == null ) {
optional = new GrowQueue_F64();
}
Ci... | java | public static FitData<Circle2D_F64> averageCircle_I32(List<Point2D_I32> points, GrowQueue_F64 optional,
FitData<Circle2D_F64> outputStorage) {
if( outputStorage == null ) {
outputStorage = new FitData<>(new Circle2D_F64());
}
if( optional == null ) {
optional = new GrowQueue_F64();
}
Ci... | [
"public",
"static",
"FitData",
"<",
"Circle2D_F64",
">",
"averageCircle_I32",
"(",
"List",
"<",
"Point2D_I32",
">",
"points",
",",
"GrowQueue_F64",
"optional",
",",
"FitData",
"<",
"Circle2D_F64",
">",
"outputStorage",
")",
"{",
"if",
"(",
"outputStorage",
"==",... | Computes a circle which has it's center at the mean position of the provided points and radius is equal to the
average distance of each point from the center. While fast to compute the provided circle is not a best
fit circle by any reasonable metric, except for special cases.
@param points (Input) Set of unordered p... | [
"Computes",
"a",
"circle",
"which",
"has",
"it",
"s",
"center",
"at",
"the",
"mean",
"position",
"of",
"the",
"provided",
"points",
"and",
"radius",
"is",
"equal",
"to",
"the",
"average",
"distance",
"of",
"each",
"point",
"from",
"the",
"center",
".",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java#L218-L265 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.fixate | public void fixate() {
ransac = FactoryMultiViewRobust.trifocalRansac(configTriRansac,configError,configRansac);
sba = FactoryMultiView.bundleSparseProjective(configSBA);
} | java | public void fixate() {
ransac = FactoryMultiViewRobust.trifocalRansac(configTriRansac,configError,configRansac);
sba = FactoryMultiView.bundleSparseProjective(configSBA);
} | [
"public",
"void",
"fixate",
"(",
")",
"{",
"ransac",
"=",
"FactoryMultiViewRobust",
".",
"trifocalRansac",
"(",
"configTriRansac",
",",
"configError",
",",
"configRansac",
")",
";",
"sba",
"=",
"FactoryMultiView",
".",
"bundleSparseProjective",
"(",
"configSBA",
"... | Must call if you change configurations. | [
"Must",
"call",
"if",
"you",
"change",
"configurations",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L128-L131 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.selectInitialTriplet | boolean selectInitialTriplet( View seed , GrowQueue_I32 motions , int selected[] ) {
double bestScore = 0;
for (int i = 0; i < motions.size; i++) {
View viewB = seed.connections.get(i).other(seed);
for (int j = i+1; j < motions.size; j++) {
View viewC = seed.connections.get(j).other(seed);
double s ... | java | boolean selectInitialTriplet( View seed , GrowQueue_I32 motions , int selected[] ) {
double bestScore = 0;
for (int i = 0; i < motions.size; i++) {
View viewB = seed.connections.get(i).other(seed);
for (int j = i+1; j < motions.size; j++) {
View viewC = seed.connections.get(j).other(seed);
double s ... | [
"boolean",
"selectInitialTriplet",
"(",
"View",
"seed",
",",
"GrowQueue_I32",
"motions",
",",
"int",
"selected",
"[",
"]",
")",
"{",
"double",
"bestScore",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"motions",
".",
"size",
";",
"... | Exhaustively look at all triplets that connect with the seed view | [
"Exhaustively",
"look",
"at",
"all",
"triplets",
"that",
"connect",
"with",
"the",
"seed",
"view"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L185-L202 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.triangulateFeatures | private void triangulateFeatures(List<AssociatedTriple> inliers,
DMatrixRMaj P1, DMatrixRMaj P2, DMatrixRMaj P3) {
List<DMatrixRMaj> cameraMatrices = new ArrayList<>();
cameraMatrices.add(P1);
cameraMatrices.add(P2);
cameraMatrices.add(P3);
// need elements to be non-empty so that it can use set().... | java | private void triangulateFeatures(List<AssociatedTriple> inliers,
DMatrixRMaj P1, DMatrixRMaj P2, DMatrixRMaj P3) {
List<DMatrixRMaj> cameraMatrices = new ArrayList<>();
cameraMatrices.add(P1);
cameraMatrices.add(P2);
cameraMatrices.add(P3);
// need elements to be non-empty so that it can use set().... | [
"private",
"void",
"triangulateFeatures",
"(",
"List",
"<",
"AssociatedTriple",
">",
"inliers",
",",
"DMatrixRMaj",
"P1",
",",
"DMatrixRMaj",
"P2",
",",
"DMatrixRMaj",
"P3",
")",
"{",
"List",
"<",
"DMatrixRMaj",
">",
"cameraMatrices",
"=",
"new",
"ArrayList",
... | Triangulates the location of each features in homogenous space | [
"Triangulates",
"the",
"location",
"of",
"each",
"features",
"in",
"homogenous",
"space"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L275-L304 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.initializeProjective3 | private void initializeProjective3(FastQueue<AssociatedTriple> associated ,
FastQueue<AssociatedTripleIndex> associatedIdx ,
int totalViews,
View viewA , View viewB , View viewC ,
int idxViewB , int idxViewC ) {
ransac.process(associated.toList());
List<AssociatedTri... | java | private void initializeProjective3(FastQueue<AssociatedTriple> associated ,
FastQueue<AssociatedTripleIndex> associatedIdx ,
int totalViews,
View viewA , View viewB , View viewC ,
int idxViewB , int idxViewC ) {
ransac.process(associated.toList());
List<AssociatedTri... | [
"private",
"void",
"initializeProjective3",
"(",
"FastQueue",
"<",
"AssociatedTriple",
">",
"associated",
",",
"FastQueue",
"<",
"AssociatedTripleIndex",
">",
"associatedIdx",
",",
"int",
"totalViews",
",",
"View",
"viewA",
",",
"View",
"viewB",
",",
"View",
"view... | Initializes projective reconstruction from 3-views.
1) RANSAC to fit a trifocal tensor
2) Extract camera matrices that have a common projective space
3) Triangulate location of 3D homogenous points
@param associated List of associated pixels
@param associatedIdx List of associated feature indexes | [
"Initializes",
"projective",
"reconstruction",
"from",
"3",
"-",
"views",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L331-L377 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.findRemainingCameraMatrices | boolean findRemainingCameraMatrices(LookupSimilarImages db, View seed, GrowQueue_I32 motions) {
points3D.reset(); // points in 3D
for (int i = 0; i < structure.points.length; i++) {
structure.points[i].get(points3D.grow());
}
// contains associated pairs of pixel observations
// save a call to db by using ... | java | boolean findRemainingCameraMatrices(LookupSimilarImages db, View seed, GrowQueue_I32 motions) {
points3D.reset(); // points in 3D
for (int i = 0; i < structure.points.length; i++) {
structure.points[i].get(points3D.grow());
}
// contains associated pairs of pixel observations
// save a call to db by using ... | [
"boolean",
"findRemainingCameraMatrices",
"(",
"LookupSimilarImages",
"db",
",",
"View",
"seed",
",",
"GrowQueue_I32",
"motions",
")",
"{",
"points3D",
".",
"reset",
"(",
")",
";",
"// points in 3D",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"structur... | Uses the triangulated points and observations in the root view to estimate the camera matrix for
all the views which are remaining
@return true if successful or false if not | [
"Uses",
"the",
"triangulated",
"points",
"and",
"observations",
"in",
"the",
"root",
"view",
"to",
"estimate",
"the",
"camera",
"matrix",
"for",
"all",
"the",
"views",
"which",
"are",
"remaining"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L384-L421 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.computeCameraMatrix | private boolean computeCameraMatrix(View seed, Motion edge, FastQueue<Point2D_F64> featsB, DMatrixRMaj cameraMatrix ) {
boolean seedSrc = edge.src == seed;
int matched = 0;
for (int i = 0; i < edge.inliers.size; i++) {
// need to go from i to index of detected features in view 'seed' to index index of feature... | java | private boolean computeCameraMatrix(View seed, Motion edge, FastQueue<Point2D_F64> featsB, DMatrixRMaj cameraMatrix ) {
boolean seedSrc = edge.src == seed;
int matched = 0;
for (int i = 0; i < edge.inliers.size; i++) {
// need to go from i to index of detected features in view 'seed' to index index of feature... | [
"private",
"boolean",
"computeCameraMatrix",
"(",
"View",
"seed",
",",
"Motion",
"edge",
",",
"FastQueue",
"<",
"Point2D_F64",
">",
"featsB",
",",
"DMatrixRMaj",
"cameraMatrix",
")",
"{",
"boolean",
"seedSrc",
"=",
"edge",
".",
"src",
"==",
"seed",
";",
"int... | Computes camera matrix between the seed view and a connected view
@param seed This will be the source view. It's observations have already been added to assocPixel
@param edge The edge which connects them
@param featsB The dst view
@param cameraMatrix (Output) resulting camera matrix
@return true if successful | [
"Computes",
"camera",
"matrix",
"between",
"the",
"seed",
"view",
"and",
"a",
"connected",
"view"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L431-L456 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.createObservationsForBundleAdjustment | private SceneObservations createObservationsForBundleAdjustment(LookupSimilarImages db, View seed, GrowQueue_I32 motions) {
// seed view + the motions
SceneObservations observations = new SceneObservations(motions.size+1);
// Observations for the seed view are a special case
SceneObservations.View obsView = ob... | java | private SceneObservations createObservationsForBundleAdjustment(LookupSimilarImages db, View seed, GrowQueue_I32 motions) {
// seed view + the motions
SceneObservations observations = new SceneObservations(motions.size+1);
// Observations for the seed view are a special case
SceneObservations.View obsView = ob... | [
"private",
"SceneObservations",
"createObservationsForBundleAdjustment",
"(",
"LookupSimilarImages",
"db",
",",
"View",
"seed",
",",
"GrowQueue_I32",
"motions",
")",
"{",
"// seed view + the motions",
"SceneObservations",
"observations",
"=",
"new",
"SceneObservations",
"(",
... | Convert observations into a format which bundle adjustment will understand
@param seed The first view which all other views are connected to
@param motions Which edges in seed
@return observations for SBA | [
"Convert",
"observations",
"into",
"a",
"format",
"which",
"bundle",
"adjustment",
"will",
"understand"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L464-L495 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.refineWithBundleAdjustment | private boolean refineWithBundleAdjustment(SceneObservations observations) {
if( scaleSBA ) {
scaler.applyScale(structure,observations);
}
sba.setVerbose(verbose,verboseLevel);
sba.setParameters(structure,observations);
sba.configure(converge.ftol,converge.gtol,converge.maxIterations);
if( !sba.optimiz... | java | private boolean refineWithBundleAdjustment(SceneObservations observations) {
if( scaleSBA ) {
scaler.applyScale(structure,observations);
}
sba.setVerbose(verbose,verboseLevel);
sba.setParameters(structure,observations);
sba.configure(converge.ftol,converge.gtol,converge.maxIterations);
if( !sba.optimiz... | [
"private",
"boolean",
"refineWithBundleAdjustment",
"(",
"SceneObservations",
"observations",
")",
"{",
"if",
"(",
"scaleSBA",
")",
"{",
"scaler",
".",
"applyScale",
"(",
"structure",
",",
"observations",
")",
";",
"}",
"sba",
".",
"setVerbose",
"(",
"verbose",
... | Last step is to refine the current initial estimate with bundle adjustment | [
"Last",
"step",
"is",
"to",
"refine",
"the",
"current",
"initial",
"estimate",
"with",
"bundle",
"adjustment"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L500-L522 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToBoof | public static void nv21ToBoof(byte[] data, int width, int height, ImageBase output) {
if( output instanceof Planar) {
Planar ms = (Planar) output;
if (ms.getBandType() == GrayU8.class) {
ConvertNV21.nv21TPlanarRgb_U8(data, width, height, ms);
} else if (ms.getBandType() == GrayF32.class) {
ConvertN... | java | public static void nv21ToBoof(byte[] data, int width, int height, ImageBase output) {
if( output instanceof Planar) {
Planar ms = (Planar) output;
if (ms.getBandType() == GrayU8.class) {
ConvertNV21.nv21TPlanarRgb_U8(data, width, height, ms);
} else if (ms.getBandType() == GrayF32.class) {
ConvertN... | [
"public",
"static",
"void",
"nv21ToBoof",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"ImageBase",
"output",
")",
"{",
"if",
"(",
"output",
"instanceof",
"Planar",
")",
"{",
"Planar",
"ms",
"=",
"(",
"Planar",
")",
... | Converts a NV21 encoded byte array into a BoofCV formatted image.
@param data (input) NV21 byte array
@param width (input) image width
@param height (input) image height
@param output (output) BoofCV image | [
"Converts",
"a",
"NV21",
"encoded",
"byte",
"array",
"into",
"a",
"BoofCV",
"formatted",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L44-L75 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToGray | public static <T extends ImageGray<T>>
T nv21ToGray( byte[] data , int width , int height ,
T output , Class<T> outputType ) {
if( outputType == GrayU8.class ) {
return (T)nv21ToGray(data,width,height,(GrayU8)output);
} else if( outputType == GrayF32.class ) {
return (T)nv21ToGray(data,width,height,(G... | java | public static <T extends ImageGray<T>>
T nv21ToGray( byte[] data , int width , int height ,
T output , Class<T> outputType ) {
if( outputType == GrayU8.class ) {
return (T)nv21ToGray(data,width,height,(GrayU8)output);
} else if( outputType == GrayF32.class ) {
return (T)nv21ToGray(data,width,height,(G... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"nv21ToGray",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"T",
"output",
",",
"Class",
"<",
"T",
">",
"outputType",
")",
"{",
"if",
... | Converts an NV21 image into a gray scale image. Image type is determined at runtime.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null.
@param outputType Output: Type of output image
@pa... | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"gray",
"scale",
"image",
".",
"Image",
"type",
"is",
"determined",
"at",
"runtime",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L88-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToGray | public static GrayU8 nv21ToGray(byte[] data , int width , int height , GrayU8 output ) {
if( output != null ) {
output.reshape(width,height);
} else {
output = new GrayU8(width,height);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToGray(data, output);
} else {
ImplConvertNV21.n... | java | public static GrayU8 nv21ToGray(byte[] data , int width , int height , GrayU8 output ) {
if( output != null ) {
output.reshape(width,height);
} else {
output = new GrayU8(width,height);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToGray(data, output);
} else {
ImplConvertNV21.n... | [
"public",
"static",
"GrayU8",
"nv21ToGray",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"GrayU8",
"output",
")",
"{",
"if",
"(",
"output",
"!=",
"null",
")",
"{",
"output",
".",
"reshape",
"(",
"width",
",",
"height... | Converts an NV21 image into a gray scale U8 image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null.
@return Gray scale image | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"gray",
"scale",
"U8",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L110-L124 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/FiducialSquareGenerator.java | FiducialSquareGenerator.generate | public void generate( long value , int gridWidth ) {
renderer.init();
drawBorder();
double whiteBorder = whiteBorderDoc /markerWidth;
double X0 = whiteBorder+blackBorder;
double Y0 = whiteBorder+blackBorder;
double bw = (1.0-2*X0)/gridWidth;
// Draw the black corner used to ID the orientation
square... | java | public void generate( long value , int gridWidth ) {
renderer.init();
drawBorder();
double whiteBorder = whiteBorderDoc /markerWidth;
double X0 = whiteBorder+blackBorder;
double Y0 = whiteBorder+blackBorder;
double bw = (1.0-2*X0)/gridWidth;
// Draw the black corner used to ID the orientation
square... | [
"public",
"void",
"generate",
"(",
"long",
"value",
",",
"int",
"gridWidth",
")",
"{",
"renderer",
".",
"init",
"(",
")",
";",
"drawBorder",
"(",
")",
";",
"double",
"whiteBorder",
"=",
"whiteBorderDoc",
"/",
"markerWidth",
";",
"double",
"X0",
"=",
"whi... | Renders a binary square fiducial
@param value Value encoded in the fiducial
@param gridWidth number of cells wide the grid is | [
"Renders",
"a",
"binary",
"square",
"fiducial"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/FiducialSquareGenerator.java#L92-L133 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java | CameraPlaneProjection.setConfiguration | public void setConfiguration( Se3_F64 planeToCamera ,
CameraPinholeBrown intrinsic )
{
this.planeToCamera = planeToCamera;
normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false, true);
pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
planeToCamera.i... | java | public void setConfiguration( Se3_F64 planeToCamera ,
CameraPinholeBrown intrinsic )
{
this.planeToCamera = planeToCamera;
normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false, true);
pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
planeToCamera.i... | [
"public",
"void",
"setConfiguration",
"(",
"Se3_F64",
"planeToCamera",
",",
"CameraPinholeBrown",
"intrinsic",
")",
"{",
"this",
".",
"planeToCamera",
"=",
"planeToCamera",
";",
"normToPixel",
"=",
"LensDistortionFactory",
".",
"narrow",
"(",
"intrinsic",
")",
".",
... | Configures the camera's intrinsic and extrinsic parameters
@param planeToCamera Transform from the plane to the camera
@param intrinsic Pixel to normalized image coordinates | [
"Configures",
"the",
"camera",
"s",
"intrinsic",
"and",
"extrinsic",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java#L64-L72 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java | CameraPlaneProjection.setIntrinsic | public void setIntrinsic(CameraPinholeBrown intrinsic )
{
normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false, true);
pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
} | java | public void setIntrinsic(CameraPinholeBrown intrinsic )
{
normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false, true);
pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
} | [
"public",
"void",
"setIntrinsic",
"(",
"CameraPinholeBrown",
"intrinsic",
")",
"{",
"normToPixel",
"=",
"LensDistortionFactory",
".",
"narrow",
"(",
"intrinsic",
")",
".",
"distort_F64",
"(",
"false",
",",
"true",
")",
";",
"pixelToNorm",
"=",
"LensDistortionFacto... | Configures the camera's intrinsic parameters
@param intrinsic Intrinsic camera parameters | [
"Configures",
"the",
"camera",
"s",
"intrinsic",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java#L78-L82 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java | CameraPlaneProjection.setPlaneToCamera | public void setPlaneToCamera(Se3_F64 planeToCamera, boolean computeInverse ) {
this.planeToCamera = planeToCamera;
if( computeInverse )
planeToCamera.invert(cameraToPlane);
} | java | public void setPlaneToCamera(Se3_F64 planeToCamera, boolean computeInverse ) {
this.planeToCamera = planeToCamera;
if( computeInverse )
planeToCamera.invert(cameraToPlane);
} | [
"public",
"void",
"setPlaneToCamera",
"(",
"Se3_F64",
"planeToCamera",
",",
"boolean",
"computeInverse",
")",
"{",
"this",
".",
"planeToCamera",
"=",
"planeToCamera",
";",
"if",
"(",
"computeInverse",
")",
"planeToCamera",
".",
"invert",
"(",
"cameraToPlane",
")",... | Specifies camera's extrinsic parameters.
@param planeToCamera Transform from plane to camera reference frame
@param computeInverse Set to true if pixelToPlane is going to be called. performs extra calculation | [
"Specifies",
"camera",
"s",
"extrinsic",
"parameters",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java#L90-L95 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java | CameraPlaneProjection.planeToPixel | public boolean planeToPixel( double pointX , double pointY , Point2D_F64 pixel ) {
// convert it into a 3D coordinate and transform into camera reference frame
plain3D.set(-pointY, 0, pointX);
SePointOps_F64.transform(planeToCamera, plain3D, camera3D);
// if it's behind the camera it can't be seen
if( camera... | java | public boolean planeToPixel( double pointX , double pointY , Point2D_F64 pixel ) {
// convert it into a 3D coordinate and transform into camera reference frame
plain3D.set(-pointY, 0, pointX);
SePointOps_F64.transform(planeToCamera, plain3D, camera3D);
// if it's behind the camera it can't be seen
if( camera... | [
"public",
"boolean",
"planeToPixel",
"(",
"double",
"pointX",
",",
"double",
"pointY",
",",
"Point2D_F64",
"pixel",
")",
"{",
"// convert it into a 3D coordinate and transform into camera reference frame",
"plain3D",
".",
"set",
"(",
"-",
"pointY",
",",
"0",
",",
"poi... | Given a point on the plane find the pixel in the image.
@param pointX (input) Point on the plane, x-axis
@param pointY (input) Point on the plane, y-axis
@param pixel (output) Pixel in the image
@return true if the point is in front of the camera. False if not. | [
"Given",
"a",
"point",
"on",
"the",
"plane",
"find",
"the",
"pixel",
"in",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java#L105-L120 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java | CameraPlaneProjection.planeToNormalized | public boolean planeToNormalized( double pointX , double pointY , Point2D_F64 normalized ) {
// convert it into a 3D coordinate and transform into camera reference frame
plain3D.set(-pointY, 0, pointX);
SePointOps_F64.transform(planeToCamera, plain3D, camera3D);
// if it's behind the camera it can't be seen
... | java | public boolean planeToNormalized( double pointX , double pointY , Point2D_F64 normalized ) {
// convert it into a 3D coordinate and transform into camera reference frame
plain3D.set(-pointY, 0, pointX);
SePointOps_F64.transform(planeToCamera, plain3D, camera3D);
// if it's behind the camera it can't be seen
... | [
"public",
"boolean",
"planeToNormalized",
"(",
"double",
"pointX",
",",
"double",
"pointY",
",",
"Point2D_F64",
"normalized",
")",
"{",
"// convert it into a 3D coordinate and transform into camera reference frame",
"plain3D",
".",
"set",
"(",
"-",
"pointY",
",",
"0",
"... | Given a point on the plane find the normalized image coordinate
@param pointX (input) Point on the plane, x-axis
@param pointY (input) Point on the plane, y-axis
@param normalized (output) Normalized image coordinate of pixel
@return true if the point is in front of the camera. False if not. | [
"Given",
"a",
"point",
"on",
"the",
"plane",
"find",
"the",
"normalized",
"image",
"coordinate"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CameraPlaneProjection.java#L130-L144 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerGraph.java | ChessboardCornerGraph.convert | public void convert( FeatureGraph2D graph ) {
graph.nodes.resize(corners.size);
graph.reset();
for (int i = 0; i < corners.size; i++) {
Node c = corners.get(i);
FeatureGraph2D.Node n = graph.nodes.grow();
n.reset();
n.set(c.x,c.y);
n.index = c.index;
}
for (int i = 0; i < corners.size; i++) {
... | java | public void convert( FeatureGraph2D graph ) {
graph.nodes.resize(corners.size);
graph.reset();
for (int i = 0; i < corners.size; i++) {
Node c = corners.get(i);
FeatureGraph2D.Node n = graph.nodes.grow();
n.reset();
n.set(c.x,c.y);
n.index = c.index;
}
for (int i = 0; i < corners.size; i++) {
... | [
"public",
"void",
"convert",
"(",
"FeatureGraph2D",
"graph",
")",
"{",
"graph",
".",
"nodes",
".",
"resize",
"(",
"corners",
".",
"size",
")",
";",
"graph",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"corners",
... | Convert into a generic graph. | [
"Convert",
"into",
"a",
"generic",
"graph",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerGraph.java#L42-L61 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPointTrackerKey.java | ImageMotionPointTrackerKey.process | public boolean process( I frame ) {
keyFrame = false;
// update the feature tracker
tracker.process(frame);
totalFramesProcessed++;
List<PointTrack> tracks = tracker.getActiveTracks(null);
if( tracks.size() == 0 )
return false;
List<AssociatedPair> pairs = new ArrayList<>();
for( PointTrack t : ... | java | public boolean process( I frame ) {
keyFrame = false;
// update the feature tracker
tracker.process(frame);
totalFramesProcessed++;
List<PointTrack> tracks = tracker.getActiveTracks(null);
if( tracks.size() == 0 )
return false;
List<AssociatedPair> pairs = new ArrayList<>();
for( PointTrack t : ... | [
"public",
"boolean",
"process",
"(",
"I",
"frame",
")",
"{",
"keyFrame",
"=",
"false",
";",
"// update the feature tracker",
"tracker",
".",
"process",
"(",
"frame",
")",
";",
"totalFramesProcessed",
"++",
";",
"List",
"<",
"PointTrack",
">",
"tracks",
"=",
... | Processes the next frame in the sequence.
@param frame Next frame in the video sequence
@return true if motion was estimated and false if no motion was estimated | [
"Processes",
"the",
"next",
"frame",
"in",
"the",
"sequence",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPointTrackerKey.java#L110-L152 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPointTrackerKey.java | ImageMotionPointTrackerKey.changeKeyFrame | public void changeKeyFrame() {
// drop all inactive tracks since their location is unknown in the current frame
List<PointTrack> inactive = tracker.getInactiveTracks(null);
for( PointTrack l : inactive ) {
tracker.dropTrack(l);
}
// set the keyframe for active tracks as their current location
List<Point... | java | public void changeKeyFrame() {
// drop all inactive tracks since their location is unknown in the current frame
List<PointTrack> inactive = tracker.getInactiveTracks(null);
for( PointTrack l : inactive ) {
tracker.dropTrack(l);
}
// set the keyframe for active tracks as their current location
List<Point... | [
"public",
"void",
"changeKeyFrame",
"(",
")",
"{",
"// drop all inactive tracks since their location is unknown in the current frame",
"List",
"<",
"PointTrack",
">",
"inactive",
"=",
"tracker",
".",
"getInactiveTracks",
"(",
"null",
")",
";",
"for",
"(",
"PointTrack",
... | Change the current frame into the keyframe. p1 location of existing tracks is set to
their current location and new tracks are spawned. Reference frame transformations are also updated | [
"Change",
"the",
"current",
"frame",
"into",
"the",
"keyframe",
".",
"p1",
"location",
"of",
"existing",
"tracks",
"is",
"set",
"to",
"their",
"current",
"location",
"and",
"new",
"tracks",
"are",
"spawned",
".",
"Reference",
"frame",
"transformations",
"are",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPointTrackerKey.java#L170-L203 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java | PointCloudUtils.autoScale | public static double autoScale( List<Point3D_F64> cloud , double target ) {
Point3D_F64 mean = new Point3D_F64();
Point3D_F64 stdev = new Point3D_F64();
statistics(cloud, mean, stdev);
double scale = target/(Math.max(Math.max(stdev.x,stdev.y),stdev.z));
int N = cloud.size();
for (int i = 0; i < N ; i++... | java | public static double autoScale( List<Point3D_F64> cloud , double target ) {
Point3D_F64 mean = new Point3D_F64();
Point3D_F64 stdev = new Point3D_F64();
statistics(cloud, mean, stdev);
double scale = target/(Math.max(Math.max(stdev.x,stdev.y),stdev.z));
int N = cloud.size();
for (int i = 0; i < N ; i++... | [
"public",
"static",
"double",
"autoScale",
"(",
"List",
"<",
"Point3D_F64",
">",
"cloud",
",",
"double",
"target",
")",
"{",
"Point3D_F64",
"mean",
"=",
"new",
"Point3D_F64",
"(",
")",
";",
"Point3D_F64",
"stdev",
"=",
"new",
"Point3D_F64",
"(",
")",
";",
... | Automatically rescales the point cloud based so that it has a standard deviation of 'target'
@param cloud The point cloud
@param target The desired standard deviation of the cloud. Try 100
@return The selected scale factor | [
"Automatically",
"rescales",
"the",
"point",
"cloud",
"based",
"so",
"that",
"it",
"has",
"a",
"standard",
"deviation",
"of",
"target"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java#L42-L57 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java | PointCloudUtils.statistics | public static void statistics( List<Point3D_F64> cloud , Point3D_F64 mean , Point3D_F64 stdev ) {
final int N = cloud.size();
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud.get(i);
mean.x += p.x / N;
mean.y += p.y / N;
mean.z += p.z / N;
}
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud... | java | public static void statistics( List<Point3D_F64> cloud , Point3D_F64 mean , Point3D_F64 stdev ) {
final int N = cloud.size();
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud.get(i);
mean.x += p.x / N;
mean.y += p.y / N;
mean.z += p.z / N;
}
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud... | [
"public",
"static",
"void",
"statistics",
"(",
"List",
"<",
"Point3D_F64",
">",
"cloud",
",",
"Point3D_F64",
"mean",
",",
"Point3D_F64",
"stdev",
")",
"{",
"final",
"int",
"N",
"=",
"cloud",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0... | Computes the mean and standard deviation of each axis in the point cloud computed in dependently
@param cloud (Input) Cloud
@param mean (Output) mean of each axis
@param stdev (Output) standard deviation of each axis | [
"Computes",
"the",
"mean",
"and",
"standard",
"deviation",
"of",
"each",
"axis",
"in",
"the",
"point",
"cloud",
"computed",
"in",
"dependently"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java#L65-L87 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java | PointCloudUtils.prune | public static void prune(List<Point3D_F64> cloud , int minNeighbors , double radius ) {
if( minNeighbors < 0 )
throw new IllegalArgumentException("minNeighbors must be >= 0");
NearestNeighbor<Point3D_F64> nn = FactoryNearestNeighbor.kdtree(new KdTreePoint3D_F64() );
NearestNeighbor.Search<Point3D_F64> search =... | java | public static void prune(List<Point3D_F64> cloud , int minNeighbors , double radius ) {
if( minNeighbors < 0 )
throw new IllegalArgumentException("minNeighbors must be >= 0");
NearestNeighbor<Point3D_F64> nn = FactoryNearestNeighbor.kdtree(new KdTreePoint3D_F64() );
NearestNeighbor.Search<Point3D_F64> search =... | [
"public",
"static",
"void",
"prune",
"(",
"List",
"<",
"Point3D_F64",
">",
"cloud",
",",
"int",
"minNeighbors",
",",
"double",
"radius",
")",
"{",
"if",
"(",
"minNeighbors",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"minNeighbors must b... | Prunes points from the point cloud if they have very few neighbors
@param cloud Point cloud
@param minNeighbors Minimum number of neighbors for it to not be pruned
@param radius search distance for neighbors | [
"Prunes",
"points",
"from",
"the",
"point",
"cloud",
"if",
"they",
"have",
"very",
"few",
"neighbors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java#L96-L118 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java | LowLevelMultiViewOps.computeNormalizationLL | public static void computeNormalizationLL(List<List<Point2D_F64>> points, NormalizationPoint2D normalize )
{
double meanX = 0;
double meanY = 0;
int count = 0;
for (int i = 0; i < points.size(); i++) {
List<Point2D_F64> l = points.get(i);
for (int j = 0; j < l.size(); j++) {
Point2D_F64 p = l.get(j... | java | public static void computeNormalizationLL(List<List<Point2D_F64>> points, NormalizationPoint2D normalize )
{
double meanX = 0;
double meanY = 0;
int count = 0;
for (int i = 0; i < points.size(); i++) {
List<Point2D_F64> l = points.get(i);
for (int j = 0; j < l.size(); j++) {
Point2D_F64 p = l.get(j... | [
"public",
"static",
"void",
"computeNormalizationLL",
"(",
"List",
"<",
"List",
"<",
"Point2D_F64",
">",
">",
"points",
",",
"NormalizationPoint2D",
"normalize",
")",
"{",
"double",
"meanX",
"=",
"0",
";",
"double",
"meanY",
"=",
"0",
";",
"int",
"count",
... | Computes normalization when points are contained in a list of lists
@param points Input: List of observed points. Not modified.
@param normalize Output: 3x3 normalization matrix for first set of points. Modified. | [
"Computes",
"normalization",
"when",
"points",
"are",
"contained",
"in",
"a",
"list",
"of",
"lists"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java#L82-L121 | train |
lessthanoptimal/BoofCV | main/autocode/src/main/java/boofcv/AutocodeConcurrentApp.java | AutocodeConcurrentApp.convertFile | public static void convertFile( File original ) throws IOException {
File outputFile = determineClassName(original);
String classNameOld = className(original);
String classNameNew = className(outputFile);
// Read the file and split it up into lines
List<String> inputLines = FileUtils.readLines(original,"UTF... | java | public static void convertFile( File original ) throws IOException {
File outputFile = determineClassName(original);
String classNameOld = className(original);
String classNameNew = className(outputFile);
// Read the file and split it up into lines
List<String> inputLines = FileUtils.readLines(original,"UTF... | [
"public",
"static",
"void",
"convertFile",
"(",
"File",
"original",
")",
"throws",
"IOException",
"{",
"File",
"outputFile",
"=",
"determineClassName",
"(",
"original",
")",
";",
"String",
"classNameOld",
"=",
"className",
"(",
"original",
")",
";",
"String",
... | Converts the file from single thread into concurrent implementation | [
"Converts",
"the",
"file",
"from",
"single",
"thread",
"into",
"concurrent",
"implementation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/autocode/src/main/java/boofcv/AutocodeConcurrentApp.java#L54-L119 | train |
lessthanoptimal/BoofCV | main/autocode/src/main/java/boofcv/AutocodeConcurrentApp.java | AutocodeConcurrentApp.determineClassName | private static File determineClassName( File original ) throws IOException {
String text = FileUtils.readFileToString(original, "UTF-8");
if(!text.contains("//CONCURRENT"))
throw new IOException("Not a concurrent file");
String pattern = "//CONCURRENT_CLASS_NAME ";
int where = text.indexOf(pattern);
if( ... | java | private static File determineClassName( File original ) throws IOException {
String text = FileUtils.readFileToString(original, "UTF-8");
if(!text.contains("//CONCURRENT"))
throw new IOException("Not a concurrent file");
String pattern = "//CONCURRENT_CLASS_NAME ";
int where = text.indexOf(pattern);
if( ... | [
"private",
"static",
"File",
"determineClassName",
"(",
"File",
"original",
")",
"throws",
"IOException",
"{",
"String",
"text",
"=",
"FileUtils",
".",
"readFileToString",
"(",
"original",
",",
"\"UTF-8\"",
")",
";",
"if",
"(",
"!",
"text",
".",
"contains",
... | Searches the input file for an override. If none is found then _MT is added to the class name.
@param original Input file
@return Output file | [
"Searches",
"the",
"input",
"file",
"for",
"an",
"override",
".",
"If",
"none",
"is",
"found",
"then",
"_MT",
"is",
"added",
"to",
"the",
"class",
"name",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/autocode/src/main/java/boofcv/AutocodeConcurrentApp.java#L208-L223 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/pyramid/ImagePyramidBase.java | ImagePyramidBase.initialize | @Override
public void initialize(int width, int height) {
// see if it has already been initialized
if( bottomWidth == width && bottomHeight == height )
return;
this.bottomWidth = width;
this.bottomHeight = height;
layers = imageType.createArray(getNumLayers());
double scaleFactor = getScale(0);
if ... | java | @Override
public void initialize(int width, int height) {
// see if it has already been initialized
if( bottomWidth == width && bottomHeight == height )
return;
this.bottomWidth = width;
this.bottomHeight = height;
layers = imageType.createArray(getNumLayers());
double scaleFactor = getScale(0);
if ... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"// see if it has already been initialized",
"if",
"(",
"bottomWidth",
"==",
"width",
"&&",
"bottomHeight",
"==",
"height",
")",
"return",
";",
"this",
".",
"... | Initializes internal data structures based on the input image's size. Should be called each time a new image
is processed.
@param width Image width
@param height Image height | [
"Initializes",
"internal",
"data",
"structures",
"based",
"on",
"the",
"input",
"image",
"s",
"size",
".",
"Should",
"be",
"called",
"each",
"time",
"a",
"new",
"image",
"is",
"processed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/pyramid/ImagePyramidBase.java#L72-L95 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/pyramid/ImagePyramidBase.java | ImagePyramidBase.checkScales | protected void checkScales() {
if( getScale(0) < 0 ) {
throw new IllegalArgumentException("The first layer must be more than zero.");
}
double prevScale = 0;
for( int i = 0; i < getNumLayers(); i++ ) {
double s = getScale(i);
if( s < prevScale )
throw new IllegalArgumentException("Higher layers mu... | java | protected void checkScales() {
if( getScale(0) < 0 ) {
throw new IllegalArgumentException("The first layer must be more than zero.");
}
double prevScale = 0;
for( int i = 0; i < getNumLayers(); i++ ) {
double s = getScale(i);
if( s < prevScale )
throw new IllegalArgumentException("Higher layers mu... | [
"protected",
"void",
"checkScales",
"(",
")",
"{",
"if",
"(",
"getScale",
"(",
"0",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The first layer must be more than zero.\"",
")",
";",
"}",
"double",
"prevScale",
"=",
"0",
";",
... | Used to internally check that the provided scales are valid. | [
"Used",
"to",
"internally",
"check",
"that",
"the",
"provided",
"scales",
"are",
"valid",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/pyramid/ImagePyramidBase.java#L100-L112 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoRegularGrid.java | EllipseClustersIntoRegularGrid.checkGridSize | static boolean checkGridSize(List<List<NodeInfo>> grid ,
int clusterSize ) {
int total = 0;
int expected = grid.get(0).size();
for (int i = 0; i < grid.size(); i++) {
if( expected != grid.get(i).size() )
return false;
total += grid.get(i).size();
}
return total == clusterSize;
} | java | static boolean checkGridSize(List<List<NodeInfo>> grid ,
int clusterSize ) {
int total = 0;
int expected = grid.get(0).size();
for (int i = 0; i < grid.size(); i++) {
if( expected != grid.get(i).size() )
return false;
total += grid.get(i).size();
}
return total == clusterSize;
} | [
"static",
"boolean",
"checkGridSize",
"(",
"List",
"<",
"List",
"<",
"NodeInfo",
">",
">",
"grid",
",",
"int",
"clusterSize",
")",
"{",
"int",
"total",
"=",
"0",
";",
"int",
"expected",
"=",
"grid",
".",
"get",
"(",
"0",
")",
".",
"size",
"(",
")",... | Makes sure the found grid is the same size as the original cluster. If it's not then.
not all the nodes were used. All lists must have he same size too. | [
"Makes",
"sure",
"the",
"found",
"grid",
"is",
"the",
"same",
"size",
"as",
"the",
"original",
"cluster",
".",
"If",
"it",
"s",
"not",
"then",
".",
"not",
"all",
"the",
"nodes",
"were",
"used",
".",
"All",
"lists",
"must",
"have",
"he",
"same",
"size... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoRegularGrid.java#L119-L130 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java | PixelDepthLinearMetric.depthNView | public double depthNView( List<Point2D_F64> obs ,
List<Se3_F64> motion )
{
double top = 0, bottom = 0;
Point2D_F64 a = obs.get(0);
for( int i = 1; i < obs.size(); i++ ) {
Se3_F64 se = motion.get(i-1);
Point2D_F64 b = obs.get(i);
GeometryMath_F64.multCrossA(b, se.getR(), temp0);
GeometryMa... | java | public double depthNView( List<Point2D_F64> obs ,
List<Se3_F64> motion )
{
double top = 0, bottom = 0;
Point2D_F64 a = obs.get(0);
for( int i = 1; i < obs.size(); i++ ) {
Se3_F64 se = motion.get(i-1);
Point2D_F64 b = obs.get(i);
GeometryMath_F64.multCrossA(b, se.getR(), temp0);
GeometryMa... | [
"public",
"double",
"depthNView",
"(",
"List",
"<",
"Point2D_F64",
">",
"obs",
",",
"List",
"<",
"Se3_F64",
">",
"motion",
")",
"{",
"double",
"top",
"=",
"0",
",",
"bottom",
"=",
"0",
";",
"Point2D_F64",
"a",
"=",
"obs",
".",
"get",
"(",
"0",
")",... | Computes the pixel depth from N views of the same object. Pixel depth in the first frame.
@param obs List of observations on a single feature in normalized coordinates
@param motion List of camera motions. Each index 'i' is the motion from view 0 to view i+1.
@return depth of the pixels | [
"Computes",
"the",
"pixel",
"depth",
"from",
"N",
"views",
"of",
"the",
"same",
"object",
".",
"Pixel",
"depth",
"in",
"the",
"first",
"frame",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java#L70-L91 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java | PixelDepthLinearMetric.depth2View | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB )
{
DMatrixRMaj R = fromAtoB.getR();
Vector3D_F64 T = fromAtoB.getT();
GeometryMath_F64.multCrossA(b, R, temp0);
GeometryMath_F64.mult(temp0,a,temp1);
GeometryMath_F64.cross(b, T, temp2);
return -(temp2.x+temp2.y+temp2.z)/(temp1.... | java | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB )
{
DMatrixRMaj R = fromAtoB.getR();
Vector3D_F64 T = fromAtoB.getT();
GeometryMath_F64.multCrossA(b, R, temp0);
GeometryMath_F64.mult(temp0,a,temp1);
GeometryMath_F64.cross(b, T, temp2);
return -(temp2.x+temp2.y+temp2.z)/(temp1.... | [
"public",
"double",
"depth2View",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"Se3_F64",
"fromAtoB",
")",
"{",
"DMatrixRMaj",
"R",
"=",
"fromAtoB",
".",
"getR",
"(",
")",
";",
"Vector3D_F64",
"T",
"=",
"fromAtoB",
".",
"getT",
"(",
")",
";",
... | Computes pixel depth in image 'a' from two observations.
@param a Observation in first frame. In calibrated coordinates. Not modified.
@param b Observation in second frame. In calibrated coordinates. Not modified.
@param fromAtoB Transform from frame a to frame b.
@return Pixel depth in first frame. In same units as... | [
"Computes",
"pixel",
"depth",
"in",
"image",
"a",
"from",
"two",
"observations",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java#L101-L112 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.initialize | public void initialize( int numFeatures , int numViews ) {
depths.reshape(numViews,numFeatures);
pixels.reshape(numViews*2,numFeatures);
pixelScale = 0;
} | java | public void initialize( int numFeatures , int numViews ) {
depths.reshape(numViews,numFeatures);
pixels.reshape(numViews*2,numFeatures);
pixelScale = 0;
} | [
"public",
"void",
"initialize",
"(",
"int",
"numFeatures",
",",
"int",
"numViews",
")",
"{",
"depths",
".",
"reshape",
"(",
"numViews",
",",
"numFeatures",
")",
";",
"pixels",
".",
"reshape",
"(",
"numViews",
"*",
"2",
",",
"numFeatures",
")",
";",
"pixe... | Initializes internal data structures. Must be called first
@param numFeatures Number of features
@param numViews Number of views | [
"Initializes",
"internal",
"data",
"structures",
".",
"Must",
"be",
"called",
"first"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L98-L102 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.setPixels | public void setPixels(int view , List<Point2D_F64> pixelsInView ) {
if( pixelsInView.size() != pixels.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int row = view*2;
for (int i = 0; i < pixelsInView.size(); i++) {
Point2D_F64 p = pixelsInView.get(i)... | java | public void setPixels(int view , List<Point2D_F64> pixelsInView ) {
if( pixelsInView.size() != pixels.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int row = view*2;
for (int i = 0; i < pixelsInView.size(); i++) {
Point2D_F64 p = pixelsInView.get(i)... | [
"public",
"void",
"setPixels",
"(",
"int",
"view",
",",
"List",
"<",
"Point2D_F64",
">",
"pixelsInView",
")",
"{",
"if",
"(",
"pixelsInView",
".",
"size",
"(",
")",
"!=",
"pixels",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pi... | Sets pixel observations for a paricular view
@param view the view
@param pixelsInView list of 2D pixel observations | [
"Sets",
"pixel",
"observations",
"for",
"a",
"paricular",
"view"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L109-L120 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.setDepths | public void setDepths( int view , double featureDepths[] ) {
if( featureDepths.length < depths.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int N = depths.numCols;
for (int i = 0; i < N; i++) {
depths.set(view,i, featureDepths[i]);
}
} | java | public void setDepths( int view , double featureDepths[] ) {
if( featureDepths.length < depths.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int N = depths.numCols;
for (int i = 0; i < N; i++) {
depths.set(view,i, featureDepths[i]);
}
} | [
"public",
"void",
"setDepths",
"(",
"int",
"view",
",",
"double",
"featureDepths",
"[",
"]",
")",
"{",
"if",
"(",
"featureDepths",
".",
"length",
"<",
"depths",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pixel count must be constant... | Sets depths for a particular value to the values in the passed in array
@param view
@param featureDepths | [
"Sets",
"depths",
"for",
"a",
"particular",
"value",
"to",
"the",
"values",
"in",
"the",
"passed",
"in",
"array"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L135-L143 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.setDepthsFrom3D | public void setDepthsFrom3D(int view , List<Point3D_F64> locations ) {
if( locations.size() != pixels.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int N = depths.numCols;
for (int i = 0; i < N; i++) {
depths.set(view,i, locations.get(i).z );
}
} | java | public void setDepthsFrom3D(int view , List<Point3D_F64> locations ) {
if( locations.size() != pixels.numCols )
throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);
int N = depths.numCols;
for (int i = 0; i < N; i++) {
depths.set(view,i, locations.get(i).z );
}
} | [
"public",
"void",
"setDepthsFrom3D",
"(",
"int",
"view",
",",
"List",
"<",
"Point3D_F64",
">",
"locations",
")",
"{",
"if",
"(",
"locations",
".",
"size",
"(",
")",
"!=",
"pixels",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pi... | Assigns depth to the z value of all the features in the list. Features must be in the coordinate system
of the view for this to be correct
@param view which view is features are in
@param locations Location of features in the view's reference frame | [
"Assigns",
"depth",
"to",
"the",
"z",
"value",
"of",
"all",
"the",
"features",
"in",
"the",
"list",
".",
"Features",
"must",
"be",
"in",
"the",
"coordinate",
"system",
"of",
"the",
"view",
"for",
"this",
"to",
"be",
"correct"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L151-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.process | public boolean process() {
int numViews = depths.numRows;
int numFeatures = depths.numCols;
P.reshape(3*numViews,4);
X.reshape(4,numFeatures);
A.reshape(numViews*3,numFeatures);
B.reshape(numViews*3,numFeatures);
// Scale depths so that they are close to unity
normalizeDepths(depths);
// Compute th... | java | public boolean process() {
int numViews = depths.numRows;
int numFeatures = depths.numCols;
P.reshape(3*numViews,4);
X.reshape(4,numFeatures);
A.reshape(numViews*3,numFeatures);
B.reshape(numViews*3,numFeatures);
// Scale depths so that they are close to unity
normalizeDepths(depths);
// Compute th... | [
"public",
"boolean",
"process",
"(",
")",
"{",
"int",
"numViews",
"=",
"depths",
".",
"numRows",
";",
"int",
"numFeatures",
"=",
"depths",
".",
"numCols",
";",
"P",
".",
"reshape",
"(",
"3",
"*",
"numViews",
",",
"4",
")",
";",
"X",
".",
"reshape",
... | Performs iteration to find camera matrices and feature locations in world frame
@return true if no exception was thrown. Does not mean it converged to a valid solution | [
"Performs",
"iteration",
"to",
"find",
"camera",
"matrices",
"and",
"feature",
"locations",
"in",
"world",
"frame"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L165-L212 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.getCameraMatrix | public void getCameraMatrix(int view , DMatrixRMaj cameraMatrix ) {
cameraMatrix.reshape(3,4);
CommonOps_DDRM.extract(P,view*3,0,cameraMatrix);
for (int col = 0; col < 4; col++) {
cameraMatrix.data[cameraMatrix.getIndex(0,col)] *= pixelScale;
cameraMatrix.data[cameraMatrix.getIndex(1,col)] *= pixelScale;
... | java | public void getCameraMatrix(int view , DMatrixRMaj cameraMatrix ) {
cameraMatrix.reshape(3,4);
CommonOps_DDRM.extract(P,view*3,0,cameraMatrix);
for (int col = 0; col < 4; col++) {
cameraMatrix.data[cameraMatrix.getIndex(0,col)] *= pixelScale;
cameraMatrix.data[cameraMatrix.getIndex(1,col)] *= pixelScale;
... | [
"public",
"void",
"getCameraMatrix",
"(",
"int",
"view",
",",
"DMatrixRMaj",
"cameraMatrix",
")",
"{",
"cameraMatrix",
".",
"reshape",
"(",
"3",
",",
"4",
")",
";",
"CommonOps_DDRM",
".",
"extract",
"(",
"P",
",",
"view",
"*",
"3",
",",
"0",
",",
"came... | Used to get found camera matrix for a view
@param view Which view
@param cameraMatrix storage for 3x4 projective camera matrix | [
"Used",
"to",
"get",
"found",
"camera",
"matrix",
"for",
"a",
"view"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L219-L227 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java | ProjectiveStructureByFactorization.getFeature3D | public void getFeature3D( int feature , Point4D_F64 out ) {
out.x = X.get(0,feature);
out.y = X.get(1,feature);
out.z = X.get(2,feature);
out.w = X.get(3,feature);
} | java | public void getFeature3D( int feature , Point4D_F64 out ) {
out.x = X.get(0,feature);
out.y = X.get(1,feature);
out.z = X.get(2,feature);
out.w = X.get(3,feature);
} | [
"public",
"void",
"getFeature3D",
"(",
"int",
"feature",
",",
"Point4D_F64",
"out",
")",
"{",
"out",
".",
"x",
"=",
"X",
".",
"get",
"(",
"0",
",",
"feature",
")",
";",
"out",
".",
"y",
"=",
"X",
".",
"get",
"(",
"1",
",",
"feature",
")",
";",
... | Returns location of 3D feature for a view
@param feature Index of feature to retrieve
@param out (Output) Storage for 3D feature. homogenous coordinates | [
"Returns",
"location",
"of",
"3D",
"feature",
"for",
"a",
"view"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureByFactorization.java#L234-L239 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRectFive_U8.java | ImplDisparityScoreSadRectFive_U8.computeScoreFive | protected void computeScoreFive( int top[] , int middle[] , int bottom[] , int score[] , int width ) {
// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
for( int d = minDisparity; d < maxDisparity; d++ ) {
// take in account the different in image border... | java | protected void computeScoreFive( int top[] , int middle[] , int bottom[] , int score[] , int width ) {
// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
for( int d = minDisparity; d < maxDisparity; d++ ) {
// take in account the different in image border... | [
"protected",
"void",
"computeScoreFive",
"(",
"int",
"top",
"[",
"]",
",",
"int",
"middle",
"[",
"]",
",",
"int",
"bottom",
"[",
"]",
",",
"int",
"score",
"[",
"]",
",",
"int",
"width",
")",
"{",
"// disparity as the outer loop to maximize common elements in i... | Compute the final score by sampling the 5 regions. Four regions are sampled around the center
region. Out of those four only the two with the smallest score are used. | [
"Compute",
"the",
"final",
"score",
"by",
"sampling",
"the",
"5",
"regions",
".",
"Four",
"regions",
"are",
"sampled",
"around",
"the",
"center",
"region",
".",
"Out",
"of",
"those",
"four",
"only",
"the",
"two",
"with",
"the",
"smallest",
"score",
"are",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRectFive_U8.java#L149-L194 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java | TrifocalTransfer.setTrifocal | public void setTrifocal(TrifocalTensor tensor ) {
this.tensor = tensor;
extract.setTensor(tensor);
extract.extractFundmental(F21,F31);
} | java | public void setTrifocal(TrifocalTensor tensor ) {
this.tensor = tensor;
extract.setTensor(tensor);
extract.extractFundmental(F21,F31);
} | [
"public",
"void",
"setTrifocal",
"(",
"TrifocalTensor",
"tensor",
")",
"{",
"this",
".",
"tensor",
"=",
"tensor",
";",
"extract",
".",
"setTensor",
"(",
"tensor",
")",
";",
"extract",
".",
"extractFundmental",
"(",
"F21",
",",
"F31",
")",
";",
"}"
] | Specify the trifocaltensor
@param tensor tensor | [
"Specify",
"the",
"trifocaltensor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java#L59-L63 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java | TrifocalTransfer.transfer_1_to_3 | public void transfer_1_to_3(double x1 , double y1 ,
double x2 , double y2 , Point3D_F64 p3)
{
// Adjust the observations so that they lie on the epipolar lines exactly
adjuster.process(F21,x1,y1,x2,y2,pa,pb);
GeometryMath_F64.mult(F21,pa,la);
// line through pb and perpendicular to la
l.x = la.y;
... | java | public void transfer_1_to_3(double x1 , double y1 ,
double x2 , double y2 , Point3D_F64 p3)
{
// Adjust the observations so that they lie on the epipolar lines exactly
adjuster.process(F21,x1,y1,x2,y2,pa,pb);
GeometryMath_F64.mult(F21,pa,la);
// line through pb and perpendicular to la
l.x = la.y;
... | [
"public",
"void",
"transfer_1_to_3",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
",",
"Point3D_F64",
"p3",
")",
"{",
"// Adjust the observations so that they lie on the epipolar lines exactly",
"adjuster",
".",
"process",
"(",
... | Transfer a point to third view give its observed location in view one and two.
@param x1 (Input) Observation in view 1. pixels.
@param y1 (Input) Observation in view 1. pixels.
@param x2 (Input) Observation in view 2. pixels.
@param y2 (Input) Observation in view 2. pixels.
@param p3 (Output) Estimated location in vie... | [
"Transfer",
"a",
"point",
"to",
"third",
"view",
"give",
"its",
"observed",
"location",
"in",
"view",
"one",
"and",
"two",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java#L74-L88 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java | TrifocalTransfer.transfer_1_to_2 | public void transfer_1_to_2(double x1 , double y1 ,
double x3 , double y3 , Point3D_F64 p2)
{
// Adjust the observations so that they lie on the epipolar lines exactly
adjuster.process(F31,x1,y1,x3,y3,pa,pb);
GeometryMath_F64.multTran(F31,pa,la);
// line through pb and perpendicular to la
l.x = la.... | java | public void transfer_1_to_2(double x1 , double y1 ,
double x3 , double y3 , Point3D_F64 p2)
{
// Adjust the observations so that they lie on the epipolar lines exactly
adjuster.process(F31,x1,y1,x3,y3,pa,pb);
GeometryMath_F64.multTran(F31,pa,la);
// line through pb and perpendicular to la
l.x = la.... | [
"public",
"void",
"transfer_1_to_2",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x3",
",",
"double",
"y3",
",",
"Point3D_F64",
"p2",
")",
"{",
"// Adjust the observations so that they lie on the epipolar lines exactly",
"adjuster",
".",
"process",
"(",
... | Transfer a point to third view give its observed location in view one and three.
@param x1 (Input) Observation in view 1. pixels.
@param y1 (Input) Observation in view 1. pixels.
@param x3 (Input) Observation in view 3. pixels.
@param y3 (Input) Observation in view 3. pixels.
@param p2 (Output) Estimated location in v... | [
"Transfer",
"a",
"point",
"to",
"third",
"view",
"give",
"its",
"observed",
"location",
"in",
"view",
"one",
"and",
"three",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalTransfer.java#L99-L113 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/deepboof/BaseImageClassifier.java | BaseImageClassifier.classify | @Override
public void classify(Planar<GrayF32> image) {
DataManipulationOps.imageToTensor(preprocess(image),tensorInput,0);
innerProcess(tensorInput);
} | java | @Override
public void classify(Planar<GrayF32> image) {
DataManipulationOps.imageToTensor(preprocess(image),tensorInput,0);
innerProcess(tensorInput);
} | [
"@",
"Override",
"public",
"void",
"classify",
"(",
"Planar",
"<",
"GrayF32",
">",
"image",
")",
"{",
"DataManipulationOps",
".",
"imageToTensor",
"(",
"preprocess",
"(",
"image",
")",
",",
"tensorInput",
",",
"0",
")",
";",
"innerProcess",
"(",
"tensorInput... | The original implementation takes in an image then crops it randomly. This is primarily for training but is
replicated here to reduce the number of differences
@param image Image being processed. Must be RGB image. Pixel values must have values from 0 to 255. | [
"The",
"original",
"implementation",
"takes",
"in",
"an",
"image",
"then",
"crops",
"it",
"randomly",
".",
"This",
"is",
"primarily",
"for",
"training",
"but",
"is",
"replicated",
"here",
"to",
"reduce",
"the",
"number",
"of",
"differences"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/BaseImageClassifier.java#L95-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java | UtilDisparityScore.computeScoreRow | public static void computeScoreRow(GrayU8 left, GrayU8 right, int row, int[] scores,
int minDisparity , int maxDisparity , int regionWidth ,
int elementScore[] ) {
// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
for( int d = minDisp... | java | public static void computeScoreRow(GrayU8 left, GrayU8 right, int row, int[] scores,
int minDisparity , int maxDisparity , int regionWidth ,
int elementScore[] ) {
// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
for( int d = minDisp... | [
"public",
"static",
"void",
"computeScoreRow",
"(",
"GrayU8",
"left",
",",
"GrayU8",
"right",
",",
"int",
"row",
",",
"int",
"[",
"]",
"scores",
",",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
",",
"int",
"regionWidth",
",",
"int",
"elementScore",
... | Computes disparity score for an entire row.
For a given disparity, the score for each region on the left share many components in common.
Because of this the scores are computed with disparity being the outer most loop
@param left left image
@param right Right image
@param row Image row being examined
@param scores S... | [
"Computes",
"disparity",
"score",
"for",
"an",
"entire",
"row",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java#L47-L80 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java | UtilDisparityScore.computeScoreRowSad | public static void computeScoreRowSad(GrayF32 left, GrayF32 right,
int elementMax, int indexLeft, int indexRight,
float elementScore[])
{
for( int rCol = 0; rCol < elementMax; rCol++ ) {
float diff = (left.data[ indexLeft++ ]) - (right.data[ indexRight++ ]);
elementScore[rCol] = Math.a... | java | public static void computeScoreRowSad(GrayF32 left, GrayF32 right,
int elementMax, int indexLeft, int indexRight,
float elementScore[])
{
for( int rCol = 0; rCol < elementMax; rCol++ ) {
float diff = (left.data[ indexLeft++ ]) - (right.data[ indexRight++ ]);
elementScore[rCol] = Math.a... | [
"public",
"static",
"void",
"computeScoreRowSad",
"(",
"GrayF32",
"left",
",",
"GrayF32",
"right",
",",
"int",
"elementMax",
",",
"int",
"indexLeft",
",",
"int",
"indexRight",
",",
"float",
"elementScore",
"[",
"]",
")",
"{",
"for",
"(",
"int",
"rCol",
"="... | compute the score for each element all at once to encourage the JVM to optimize and
encourage the JVM to optimize this section of code.
Was original inline, but was actually slightly slower by about 3% consistently, It
is in its own function so that it can be overridden and have different cost functions
inserted easi... | [
"compute",
"the",
"score",
"for",
"each",
"element",
"all",
"at",
"once",
"to",
"encourage",
"the",
"JVM",
"to",
"optimize",
"and",
"encourage",
"the",
"JVM",
"to",
"optimize",
"this",
"section",
"of",
"code",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java#L228-L237 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java | ExamplePnP.estimateOutliers | public Se3_F64 estimateOutliers( List<Point2D3D> observations ) {
// We can no longer trust that each point is a real observation. Let's use RANSAC to separate the points
// You will need to tune the number of iterations and inlier threshold!!!
ModelMatcherMultiview<Se3_F64,Point2D3D> ransac =
FactoryMultiVi... | java | public Se3_F64 estimateOutliers( List<Point2D3D> observations ) {
// We can no longer trust that each point is a real observation. Let's use RANSAC to separate the points
// You will need to tune the number of iterations and inlier threshold!!!
ModelMatcherMultiview<Se3_F64,Point2D3D> ransac =
FactoryMultiVi... | [
"public",
"Se3_F64",
"estimateOutliers",
"(",
"List",
"<",
"Point2D3D",
">",
"observations",
")",
"{",
"// We can no longer trust that each point is a real observation. Let's use RANSAC to separate the points",
"// You will need to tune the number of iterations and inlier threshold!!!",
"... | Uses robust techniques to remove outliers | [
"Uses",
"robust",
"techniques",
"to",
"remove",
"outliers"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java#L117-L141 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java | ExamplePnP.addOutliers | public void addOutliers( List<Point2D3D> observations , int total ) {
int size = observations.size();
for (int i = 0; i < total; i++) {
// outliers will be created by adding lots of noise to real observations
Point2D3D p = observations.get(rand.nextInt(size));
Point2D3D o = new Point2D3D();
o.observa... | java | public void addOutliers( List<Point2D3D> observations , int total ) {
int size = observations.size();
for (int i = 0; i < total; i++) {
// outliers will be created by adding lots of noise to real observations
Point2D3D p = observations.get(rand.nextInt(size));
Point2D3D o = new Point2D3D();
o.observa... | [
"public",
"void",
"addOutliers",
"(",
"List",
"<",
"Point2D3D",
">",
"observations",
",",
"int",
"total",
")",
"{",
"int",
"size",
"=",
"observations",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"total",
";",
"i",
... | Adds some really bad observations to the mix | [
"Adds",
"some",
"really",
"bad",
"observations",
"to",
"the",
"mix"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/sfm/ExamplePnP.java#L192-L211 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.loadInputData | @Override
public void loadInputData(String fileName) {
Reader r = media.openFile(fileName);
List<PathLabel> refs = new ArrayList<>();
try {
BufferedReader reader = new BufferedReader(r);
String line;
while( (line = reader.readLine()) != null ) {
String[]z = line.split(":");
String[] names = n... | java | @Override
public void loadInputData(String fileName) {
Reader r = media.openFile(fileName);
List<PathLabel> refs = new ArrayList<>();
try {
BufferedReader reader = new BufferedReader(r);
String line;
while( (line = reader.readLine()) != null ) {
String[]z = line.split(":");
String[] names = n... | [
"@",
"Override",
"public",
"void",
"loadInputData",
"(",
"String",
"fileName",
")",
"{",
"Reader",
"r",
"=",
"media",
".",
"openFile",
"(",
"fileName",
")",
";",
"List",
"<",
"PathLabel",
">",
"refs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try"... | Loads a standardized file for input references
@param fileName path to config file | [
"Loads",
"a",
"standardized",
"file",
"for",
"input",
"references"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L108-L133 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.addToToolbar | public void addToToolbar( JComponent comp ) {
toolbar.add(comp,1+algBoxes.length);
toolbar.revalidate();
addedComponents.add(comp);
} | java | public void addToToolbar( JComponent comp ) {
toolbar.add(comp,1+algBoxes.length);
toolbar.revalidate();
addedComponents.add(comp);
} | [
"public",
"void",
"addToToolbar",
"(",
"JComponent",
"comp",
")",
"{",
"toolbar",
".",
"add",
"(",
"comp",
",",
"1",
"+",
"algBoxes",
".",
"length",
")",
";",
"toolbar",
".",
"revalidate",
"(",
")",
";",
"addedComponents",
".",
"add",
"(",
"comp",
")",... | Adds a new component into the toolbar.
@param comp The component being added | [
"Adds",
"a",
"new",
"component",
"into",
"the",
"toolbar",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L147-L151 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.setMainGUI | public void setMainGUI( final Component gui ) {
postAlgorithmEvents = true;
this.gui = gui;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
add(gui,BorderLayout.CENTER);
}});
} | java | public void setMainGUI( final Component gui ) {
postAlgorithmEvents = true;
this.gui = gui;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
add(gui,BorderLayout.CENTER);
}});
} | [
"public",
"void",
"setMainGUI",
"(",
"final",
"Component",
"gui",
")",
"{",
"postAlgorithmEvents",
"=",
"true",
";",
"this",
".",
"gui",
"=",
"gui",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
... | Used to add the main GUI to this panel. Must use this function.
Algorithm change events will not be posted until this function has been set.
@param gui The main GUI being displayed. | [
"Used",
"to",
"add",
"the",
"main",
"GUI",
"to",
"this",
"panel",
".",
"Must",
"use",
"this",
"function",
".",
"Algorithm",
"change",
"events",
"will",
"not",
"be",
"posted",
"until",
"this",
"function",
"has",
"been",
"set",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L165-L172 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.setInputImage | public void setInputImage( BufferedImage image ) {
inputImage = image;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if( inputImage == null ) {
originalCheck.setEnabled(false);
} else {
originalCheck.setEnabled(true);
origPanel.setImage(inputImage);
origPanel.setPref... | java | public void setInputImage( BufferedImage image ) {
inputImage = image;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if( inputImage == null ) {
originalCheck.setEnabled(false);
} else {
originalCheck.setEnabled(true);
origPanel.setImage(inputImage);
origPanel.setPref... | [
"public",
"void",
"setInputImage",
"(",
"BufferedImage",
"image",
")",
"{",
"inputImage",
"=",
"image",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"inputImage",
"==",... | Specifies an image which contains the original input image. After this has been called the
view input image widget is activated and when selected this image will be displayed instead
of the main GUI. This functionality is optional.
@param image Original input image. | [
"Specifies",
"an",
"image",
"which",
"contains",
"the",
"original",
"input",
"image",
".",
"After",
"this",
"has",
"been",
"called",
"the",
"view",
"input",
"image",
"widget",
"is",
"activated",
"and",
"when",
"selected",
"this",
"image",
"will",
"be",
"disp... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L181-L194 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.setInputList | public void setInputList(final List<PathLabel> inputRefs) {
this.inputRefs = inputRefs;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for( int i = 0; i < inputRefs.size(); i++ ) {
imageBox.addItem(inputRefs.get(i).getLabel());
}
}});
} | java | public void setInputList(final List<PathLabel> inputRefs) {
this.inputRefs = inputRefs;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for( int i = 0; i < inputRefs.size(); i++ ) {
imageBox.addItem(inputRefs.get(i).getLabel());
}
}});
} | [
"public",
"void",
"setInputList",
"(",
"final",
"List",
"<",
"PathLabel",
">",
"inputRefs",
")",
"{",
"this",
".",
"inputRefs",
"=",
"inputRefs",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"("... | Specifies a list of images to use as input and loads them
@param inputRefs Name of input and where to get it | [
"Specifies",
"a",
"list",
"of",
"images",
"to",
"use",
"as",
"input",
"and",
"loads",
"them"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L201-L210 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java | SelectAlgorithmAndInputPanel.getAlgorithmCookie | protected <T> T getAlgorithmCookie( int indexFamily ) {
return (T)algCookies[indexFamily].get( algBoxes[indexFamily].getSelectedIndex() );
} | java | protected <T> T getAlgorithmCookie( int indexFamily ) {
return (T)algCookies[indexFamily].get( algBoxes[indexFamily].getSelectedIndex() );
} | [
"protected",
"<",
"T",
">",
"T",
"getAlgorithmCookie",
"(",
"int",
"indexFamily",
")",
"{",
"return",
"(",
"T",
")",
"algCookies",
"[",
"indexFamily",
"]",
".",
"get",
"(",
"algBoxes",
"[",
"indexFamily",
"]",
".",
"getSelectedIndex",
"(",
")",
")",
";",... | Returns the cookie associated with the specified algorithm family. | [
"Returns",
"the",
"cookie",
"associated",
"with",
"the",
"specified",
"algorithm",
"family",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/SelectAlgorithmAndInputPanel.java#L266-L268 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java | BaseDetectFiducialSquare.checkSideSize | private boolean checkSideSize( Polygon2D_F64 p ) {
double max=0,min=Double.MAX_VALUE;
for (int i = 0; i < p.size(); i++) {
double l = p.getSideLength(i);
max = Math.max(max,l);
min = Math.min(min,l);
}
// See if a side is too small to decode
if( min < 10 )
return false;
// see if it's under e... | java | private boolean checkSideSize( Polygon2D_F64 p ) {
double max=0,min=Double.MAX_VALUE;
for (int i = 0; i < p.size(); i++) {
double l = p.getSideLength(i);
max = Math.max(max,l);
min = Math.min(min,l);
}
// See if a side is too small to decode
if( min < 10 )
return false;
// see if it's under e... | [
"private",
"boolean",
"checkSideSize",
"(",
"Polygon2D_F64",
"p",
")",
"{",
"double",
"max",
"=",
"0",
",",
"min",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"size",
"(",
")",
";",
"i",
"++",
... | Sanity check the polygon based on the size of its sides to see if it could be a fiducial that can
be decoded | [
"Sanity",
"check",
"the",
"polygon",
"based",
"on",
"the",
"size",
"of",
"its",
"sides",
"to",
"see",
"if",
"it",
"could",
"be",
"a",
"fiducial",
"that",
"can",
"be",
"decoded"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java#L325-L340 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java | BaseDetectFiducialSquare.computeFractionBoundary | protected double computeFractionBoundary( float pixelThreshold ) {
// TODO ignore outer pixels from this computation. Will require 8 regions (4 corners + top/bottom + left/right)
final int w = square.width;
int radius = (int) (w * borderWidthFraction);
int innerWidth = w-2*radius;
int total = w*w - innerWid... | java | protected double computeFractionBoundary( float pixelThreshold ) {
// TODO ignore outer pixels from this computation. Will require 8 regions (4 corners + top/bottom + left/right)
final int w = square.width;
int radius = (int) (w * borderWidthFraction);
int innerWidth = w-2*radius;
int total = w*w - innerWid... | [
"protected",
"double",
"computeFractionBoundary",
"(",
"float",
"pixelThreshold",
")",
"{",
"// TODO ignore outer pixels from this computation. Will require 8 regions (4 corners + top/bottom + left/right)",
"final",
"int",
"w",
"=",
"square",
".",
"width",
";",
"int",
"radius",
... | Computes the fraction of pixels inside the image border which are black
@param pixelThreshold Pixel's less than this value are considered black
@return fraction of border that's black | [
"Computes",
"the",
"fraction",
"of",
"pixels",
"inside",
"the",
"image",
"border",
"which",
"are",
"black"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java#L359-L392 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java | BaseDetectFiducialSquare.prepareForOutput | private void prepareForOutput(Polygon2D_F64 imageShape, Result result) {
// the rotation estimate, apply in counter clockwise direction
// since result.rotation is a clockwise rotation in the visual sense, which
// is CCW on the grid
int rotationCCW = (4-result.rotation)%4;
for (int j = 0; j < rotationCCW; j+... | java | private void prepareForOutput(Polygon2D_F64 imageShape, Result result) {
// the rotation estimate, apply in counter clockwise direction
// since result.rotation is a clockwise rotation in the visual sense, which
// is CCW on the grid
int rotationCCW = (4-result.rotation)%4;
for (int j = 0; j < rotationCCW; j+... | [
"private",
"void",
"prepareForOutput",
"(",
"Polygon2D_F64",
"imageShape",
",",
"Result",
"result",
")",
"{",
"// the rotation estimate, apply in counter clockwise direction",
"// since result.rotation is a clockwise rotation in the visual sense, which",
"// is CCW on the grid",
"int",
... | Takes the found quadrilateral and the computed 3D information and prepares it for output | [
"Takes",
"the",
"found",
"quadrilateral",
"and",
"the",
"computed",
"3D",
"information",
"and",
"prepares",
"it",
"for",
"output"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/BaseDetectFiducialSquare.java#L397-L414 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeRegionMeanShift.java | MergeRegionMeanShift.process | public void process( GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount,
FastQueue<float[]> regionColor ,
FastQueue<Point2D_I32> modeLocation ) {
stopRequested = false;
initializeMerge(regionMemberCount.size);
markMergeRegions(regionColor,modeLocation,pixelToRegion);
if( stopRequested... | java | public void process( GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount,
FastQueue<float[]> regionColor ,
FastQueue<Point2D_I32> modeLocation ) {
stopRequested = false;
initializeMerge(regionMemberCount.size);
markMergeRegions(regionColor,modeLocation,pixelToRegion);
if( stopRequested... | [
"public",
"void",
"process",
"(",
"GrayS32",
"pixelToRegion",
",",
"GrowQueue_I32",
"regionMemberCount",
",",
"FastQueue",
"<",
"float",
"[",
"]",
">",
"regionColor",
",",
"FastQueue",
"<",
"Point2D_I32",
">",
"modeLocation",
")",
"{",
"stopRequested",
"=",
"fal... | Merges together similar regions which are in close proximity to each other. After merging
most of the input data structures are modified to take in account the changes.
@param pixelToRegion (Input/output) Image that specifies the segmentation. Modified.
@param regionMemberCount (Input/output) Number of pixels in ea... | [
"Merges",
"together",
"similar",
"regions",
"which",
"are",
"in",
"close",
"proximity",
"to",
"each",
"other",
".",
"After",
"merging",
"most",
"of",
"the",
"input",
"data",
"structures",
"are",
"modified",
"to",
"take",
"in",
"account",
"the",
"changes",
".... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeRegionMeanShift.java#L65-L77 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeRegionMeanShift.java | MergeRegionMeanShift.markMergeRegions | protected void markMergeRegions(FastQueue<float[]> regionColor,
FastQueue<Point2D_I32> modeLocation,
GrayS32 pixelToRegion ) {
for( int targetId = 0; targetId < modeLocation.size &&!stopRequested; targetId++ ) {
float[] color = regionColor.get(targetId);
Point2D_I32 location = modeLocation.g... | java | protected void markMergeRegions(FastQueue<float[]> regionColor,
FastQueue<Point2D_I32> modeLocation,
GrayS32 pixelToRegion ) {
for( int targetId = 0; targetId < modeLocation.size &&!stopRequested; targetId++ ) {
float[] color = regionColor.get(targetId);
Point2D_I32 location = modeLocation.g... | [
"protected",
"void",
"markMergeRegions",
"(",
"FastQueue",
"<",
"float",
"[",
"]",
">",
"regionColor",
",",
"FastQueue",
"<",
"Point2D_I32",
">",
"modeLocation",
",",
"GrayS32",
"pixelToRegion",
")",
"{",
"for",
"(",
"int",
"targetId",
"=",
"0",
";",
"target... | Takes the mode of a region and searches the local area around it for other regions. If the region's mode
is also within the local area its color is checked to see if it's similar enough. If the color is similar
enough then the two regions are marked for merger. | [
"Takes",
"the",
"mode",
"of",
"a",
"region",
"and",
"searches",
"the",
"local",
"area",
"around",
"it",
"for",
"other",
"regions",
".",
"If",
"the",
"region",
"s",
"mode",
"is",
"also",
"within",
"the",
"local",
"area",
"its",
"color",
"is",
"checked",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeRegionMeanShift.java#L84-L129 | train |
lessthanoptimal/BoofCV | integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/UtilJCodec.java | UtilJCodec.convertToBoof | public static void convertToBoof(Picture input, ImageBase output) {
if( input.getColor() == ColorSpace.RGB ) {
ImplConvertJCodecPicture.RGB_to_PLU8(input, (Planar) output);
} else if( input.getColor() == ColorSpace.YUV420 ) {
if( output instanceof Planar) {
Planar ms = (Planar)output;
if( ms.getImageT... | java | public static void convertToBoof(Picture input, ImageBase output) {
if( input.getColor() == ColorSpace.RGB ) {
ImplConvertJCodecPicture.RGB_to_PLU8(input, (Planar) output);
} else if( input.getColor() == ColorSpace.YUV420 ) {
if( output instanceof Planar) {
Planar ms = (Planar)output;
if( ms.getImageT... | [
"public",
"static",
"void",
"convertToBoof",
"(",
"Picture",
"input",
",",
"ImageBase",
"output",
")",
"{",
"if",
"(",
"input",
".",
"getColor",
"(",
")",
"==",
"ColorSpace",
".",
"RGB",
")",
"{",
"ImplConvertJCodecPicture",
".",
"RGB_to_PLU8",
"(",
"input",... | Converts an image in JCodec format into one in BoofCV format.
@param input JCodec image
@param output BoofCV image | [
"Converts",
"an",
"image",
"in",
"JCodec",
"format",
"into",
"one",
"in",
"BoofCV",
"format",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/UtilJCodec.java#L34-L53 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PositionFromPairLinear2.java | PositionFromPairLinear2.process | public boolean process( DMatrixRMaj R , List<Point3D_F64> worldPts , List<Point2D_F64> observed )
{
if( worldPts.size() != observed.size() )
throw new IllegalArgumentException("Number of worldPts and observed must be the same");
if( worldPts.size() < 2 )
throw new IllegalArgumentException("A minimum of two p... | java | public boolean process( DMatrixRMaj R , List<Point3D_F64> worldPts , List<Point2D_F64> observed )
{
if( worldPts.size() != observed.size() )
throw new IllegalArgumentException("Number of worldPts and observed must be the same");
if( worldPts.size() < 2 )
throw new IllegalArgumentException("A minimum of two p... | [
"public",
"boolean",
"process",
"(",
"DMatrixRMaj",
"R",
",",
"List",
"<",
"Point3D_F64",
">",
"worldPts",
",",
"List",
"<",
"Point2D_F64",
">",
"observed",
")",
"{",
"if",
"(",
"worldPts",
".",
"size",
"(",
")",
"!=",
"observed",
".",
"size",
"(",
")"... | Computes the translation given two or more feature observations and the known rotation
@param R Rotation matrix. World to view.
@param worldPts Location of features in world coordinates.
@param observed Observations of point in current view. Normalized coordinates.
@return true if it succeeded. | [
"Computes",
"the",
"translation",
"given",
"two",
"or",
"more",
"feature",
"observations",
"and",
"the",
"known",
"rotation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PositionFromPairLinear2.java#L78-L121 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java | BinaryEllipseDetectorPixel.process | public void process( GrayU8 binary ) {
found.reset();
labeled.reshape(binary.width, binary.height);
contourFinder.process(binary, labeled);
List<ContourPacked> blobs = contourFinder.getContours();
for (int i = 0; i < blobs.size(); i++) {
ContourPacked c = blobs.get(i);
contourFinder.loadContour(c.ext... | java | public void process( GrayU8 binary ) {
found.reset();
labeled.reshape(binary.width, binary.height);
contourFinder.process(binary, labeled);
List<ContourPacked> blobs = contourFinder.getContours();
for (int i = 0; i < blobs.size(); i++) {
ContourPacked c = blobs.get(i);
contourFinder.loadContour(c.ext... | [
"public",
"void",
"process",
"(",
"GrayU8",
"binary",
")",
"{",
"found",
".",
"reset",
"(",
")",
";",
"labeled",
".",
"reshape",
"(",
"binary",
".",
"width",
",",
"binary",
".",
"height",
")",
";",
"contourFinder",
".",
"process",
"(",
"binary",
",",
... | Finds all valid ellipses in the binary image
@param binary binary image | [
"Finds",
"all",
"valid",
"ellipses",
"in",
"the",
"binary",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java#L132-L152 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java | BinaryEllipseDetectorPixel.adjustElipseForBinaryBias | protected void adjustElipseForBinaryBias( EllipseRotated_F64 ellipse ) {
ellipse.center.x += 0.5;
ellipse.center.y += 0.5;
ellipse.a += 0.5;
ellipse.b += 0.5;
} | java | protected void adjustElipseForBinaryBias( EllipseRotated_F64 ellipse ) {
ellipse.center.x += 0.5;
ellipse.center.y += 0.5;
ellipse.a += 0.5;
ellipse.b += 0.5;
} | [
"protected",
"void",
"adjustElipseForBinaryBias",
"(",
"EllipseRotated_F64",
"ellipse",
")",
"{",
"ellipse",
".",
"center",
".",
"x",
"+=",
"0.5",
";",
"ellipse",
".",
"center",
".",
"y",
"+=",
"0.5",
";",
"ellipse",
".",
"a",
"+=",
"0.5",
";",
"ellipse",
... | In a binary image the contour on the right and bottom is off by one pixel. This is because the block region
extends the entire pixel not just the lower extent which is where it is indexed from. | [
"In",
"a",
"binary",
"image",
"the",
"contour",
"on",
"the",
"right",
"and",
"bottom",
"is",
"off",
"by",
"one",
"pixel",
".",
"This",
"is",
"because",
"the",
"block",
"region",
"extends",
"the",
"entire",
"pixel",
"not",
"just",
"the",
"lower",
"extent"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java#L210-L216 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java | BinaryEllipseDetectorPixel.undistortContour | void undistortContour(List<Point2D_I32> external, FastQueue<Point2D_F64> pointsF ) {
for (int j = 0; j < external.size(); j++) {
Point2D_I32 p = external.get(j);
if( distToUndist != null ) {
distToUndist.compute(p.x,p.y,distortedPoint);
pointsF.grow().set( distortedPoint.x , distortedPoint.y );
} el... | java | void undistortContour(List<Point2D_I32> external, FastQueue<Point2D_F64> pointsF ) {
for (int j = 0; j < external.size(); j++) {
Point2D_I32 p = external.get(j);
if( distToUndist != null ) {
distToUndist.compute(p.x,p.y,distortedPoint);
pointsF.grow().set( distortedPoint.x , distortedPoint.y );
} el... | [
"void",
"undistortContour",
"(",
"List",
"<",
"Point2D_I32",
">",
"external",
",",
"FastQueue",
"<",
"Point2D_F64",
">",
"pointsF",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"external",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"... | Undistort the contour points and convert into a floating point format for the fitting operation
@param external The external contour
@param pointsF Output of converted points | [
"Undistort",
"the",
"contour",
"points",
"and",
"convert",
"into",
"a",
"floating",
"point",
"format",
"for",
"the",
"fitting",
"operation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java#L239-L250 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java | BinaryEllipseDetectorPixel.isApproximatelyElliptical | boolean isApproximatelyElliptical(EllipseRotated_F64 ellipse , List<Point2D_F64> points , int maxSamples ) {
closestPoint.setEllipse(ellipse);
double maxDistance2 = maxDistanceFromEllipse*maxDistanceFromEllipse;
if( points.size() <= maxSamples ) {
for( int i = 0; i < points.size(); i++ ) {
Point2D_F64 p... | java | boolean isApproximatelyElliptical(EllipseRotated_F64 ellipse , List<Point2D_F64> points , int maxSamples ) {
closestPoint.setEllipse(ellipse);
double maxDistance2 = maxDistanceFromEllipse*maxDistanceFromEllipse;
if( points.size() <= maxSamples ) {
for( int i = 0; i < points.size(); i++ ) {
Point2D_F64 p... | [
"boolean",
"isApproximatelyElliptical",
"(",
"EllipseRotated_F64",
"ellipse",
",",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"int",
"maxSamples",
")",
"{",
"closestPoint",
".",
"setEllipse",
"(",
"ellipse",
")",
";",
"double",
"maxDistance2",
"=",
"maxDistan... | Look at the maximum distance contour points are from the ellipse and see if they exceed a maximum threshold | [
"Look",
"at",
"the",
"maximum",
"distance",
"contour",
"points",
"are",
"from",
"the",
"ellipse",
"and",
"see",
"if",
"they",
"exceed",
"a",
"maximum",
"threshold"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java#L255-L283 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardPolygonHelper.java | ChessboardPolygonHelper.filterPixelPolygon | @Override
public boolean filterPixelPolygon(Polygon2D_F64 undistorted , Polygon2D_F64 distorted,
GrowQueue_B touches, boolean touchesBorder) {
if( touchesBorder ) {
if( distorted.size() < 3)
return false;
int totalRegular = distorted.size();
for (int i = 0; i < distorted.size(); i++) {
i... | java | @Override
public boolean filterPixelPolygon(Polygon2D_F64 undistorted , Polygon2D_F64 distorted,
GrowQueue_B touches, boolean touchesBorder) {
if( touchesBorder ) {
if( distorted.size() < 3)
return false;
int totalRegular = distorted.size();
for (int i = 0; i < distorted.size(); i++) {
i... | [
"@",
"Override",
"public",
"boolean",
"filterPixelPolygon",
"(",
"Polygon2D_F64",
"undistorted",
",",
"Polygon2D_F64",
"distorted",
",",
"GrowQueue_B",
"touches",
",",
"boolean",
"touchesBorder",
")",
"{",
"if",
"(",
"touchesBorder",
")",
"{",
"if",
"(",
"distorte... | If not touching the border then the number of corners must be 4. If touching the border there must be
at least 3 corners not touching the border. 7 corners at most. If there were 8 then all sides of a square
would be touching the border. No more than 3 corners since that's the most number of non-border corners
a ... | [
"If",
"not",
"touching",
"the",
"border",
"then",
"the",
"number",
"of",
"corners",
"must",
"be",
"4",
".",
"If",
"touching",
"the",
"border",
"there",
"must",
"be",
"at",
"least",
"3",
"corners",
"not",
"touching",
"the",
"border",
".",
"7",
"corners",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardPolygonHelper.java#L57-L74 | train |
lessthanoptimal/BoofCV | integration/boofcv-ffmpeg/src/main/java/org/bytedeco/copiedstuff/Java2DFrameConverter.java | Java2DFrameConverter.getFrame | public Frame getFrame(BufferedImage image, double gamma, boolean flipChannels) {
if (image == null) {
return null;
}
SampleModel sm = image.getSampleModel();
int depth = 0, numChannels = sm.getNumBands();
switch (image.getType()) {
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
... | java | public Frame getFrame(BufferedImage image, double gamma, boolean flipChannels) {
if (image == null) {
return null;
}
SampleModel sm = image.getSampleModel();
int depth = 0, numChannels = sm.getNumBands();
switch (image.getType()) {
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
... | [
"public",
"Frame",
"getFrame",
"(",
"BufferedImage",
"image",
",",
"double",
"gamma",
",",
"boolean",
"flipChannels",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"SampleModel",
"sm",
"=",
"image",
".",
"getSampleModel"... | Returns a Frame based on a BufferedImage, given gamma, and inverted channels flag. | [
"Returns",
"a",
"Frame",
"based",
"on",
"a",
"BufferedImage",
"given",
"gamma",
"and",
"inverted",
"channels",
"flag",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-ffmpeg/src/main/java/org/bytedeco/copiedstuff/Java2DFrameConverter.java#L680-L712 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldOps.java | GaliosFieldOps.multiply | public static int multiply( int x , int y , int primitive , int domain ) {
int r = 0;
while( y > 0 ) {
if( (y&1) != 0 ) {
r = r ^ x;
}
y = y >> 1;
x = x << 1;
if( x >= domain) {
x ^= primitive;
}
}
return r;
} | java | public static int multiply( int x , int y , int primitive , int domain ) {
int r = 0;
while( y > 0 ) {
if( (y&1) != 0 ) {
r = r ^ x;
}
y = y >> 1;
x = x << 1;
if( x >= domain) {
x ^= primitive;
}
}
return r;
} | [
"public",
"static",
"int",
"multiply",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"primitive",
",",
"int",
"domain",
")",
"{",
"int",
"r",
"=",
"0",
";",
"while",
"(",
"y",
">",
"0",
")",
"{",
"if",
"(",
"(",
"y",
"&",
"1",
")",
"!=",
"0... | Implementation of multiplication with a primitive polynomial. The result will be a member of the same field
as the inputs, provided primitive is an appropriate irreducible polynomial for that field.
Uses 'Russian Peasant Multiplication' that should be a faster algorithm.
@param x polynomial
@param y polynomial
@param... | [
"Implementation",
"of",
"multiplication",
"with",
"a",
"primitive",
"polynomial",
".",
"The",
"result",
"will",
"be",
"a",
"member",
"of",
"the",
"same",
"field",
"as",
"the",
"inputs",
"provided",
"primitive",
"is",
"an",
"appropriate",
"irreducible",
"polynomi... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldOps.java#L76-L90 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleHexagonalGrid.java | DetectCircleHexagonalGrid.isClockWise | private static boolean isClockWise( Grid g ) {
EllipseRotated_F64 v00 = g.get(0,0);
EllipseRotated_F64 v02 = g.columns<3?g.get(1,1):g.get(0,2);
EllipseRotated_F64 v20 = g.rows<3?g.get(1,1):g.get(2,0);
double a_x = v02.center.x - v00.center.x;
double a_y = v02.center.y - v00.center.y;
double b_x = v20.cent... | java | private static boolean isClockWise( Grid g ) {
EllipseRotated_F64 v00 = g.get(0,0);
EllipseRotated_F64 v02 = g.columns<3?g.get(1,1):g.get(0,2);
EllipseRotated_F64 v20 = g.rows<3?g.get(1,1):g.get(2,0);
double a_x = v02.center.x - v00.center.x;
double a_y = v02.center.y - v00.center.y;
double b_x = v20.cent... | [
"private",
"static",
"boolean",
"isClockWise",
"(",
"Grid",
"g",
")",
"{",
"EllipseRotated_F64",
"v00",
"=",
"g",
".",
"get",
"(",
"0",
",",
"0",
")",
";",
"EllipseRotated_F64",
"v02",
"=",
"g",
".",
"columns",
"<",
"3",
"?",
"g",
".",
"get",
"(",
... | Uses the cross product to determine if the grid is in clockwise order | [
"Uses",
"the",
"cross",
"product",
"to",
"determine",
"if",
"the",
"grid",
"is",
"in",
"clockwise",
"order"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleHexagonalGrid.java#L136-L148 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.init | public FDistort init(ImageBase input, ImageBase output) {
this.input = input;
this.output = output;
inputType = input.getImageType();
interp(InterpolationType.BILINEAR);
border(0);
cached = false;
distorter = null;
outputToInput = null;
return this;
} | java | public FDistort init(ImageBase input, ImageBase output) {
this.input = input;
this.output = output;
inputType = input.getImageType();
interp(InterpolationType.BILINEAR);
border(0);
cached = false;
distorter = null;
outputToInput = null;
return this;
} | [
"public",
"FDistort",
"init",
"(",
"ImageBase",
"input",
",",
"ImageBase",
"output",
")",
"{",
"this",
".",
"input",
"=",
"input",
";",
"this",
".",
"output",
"=",
"output",
";",
"inputType",
"=",
"input",
".",
"getImageType",
"(",
")",
";",
"interp",
... | Specifies the input and output image and sets interpolation to BILINEAR, black image border, cache is off. | [
"Specifies",
"the",
"input",
"and",
"output",
"image",
"and",
"sets",
"interpolation",
"to",
"BILINEAR",
"black",
"image",
"border",
"cache",
"is",
"off",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L97-L110 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.setRefs | public FDistort setRefs( ImageBase input, ImageBase output ) {
this.input = input;
this.output = output;
inputType = input.getImageType();
return this;
} | java | public FDistort setRefs( ImageBase input, ImageBase output ) {
this.input = input;
this.output = output;
inputType = input.getImageType();
return this;
} | [
"public",
"FDistort",
"setRefs",
"(",
"ImageBase",
"input",
",",
"ImageBase",
"output",
")",
"{",
"this",
".",
"input",
"=",
"input",
";",
"this",
".",
"output",
"=",
"output",
";",
"inputType",
"=",
"input",
".",
"getImageType",
"(",
")",
";",
"return",... | All this does is set the references to the images. Nothing else is changed and its up to the
user to correctly update everything else.
If called the first time you need to do the following
<pre>
1) specify the interpolation method
2) specify the transform
3) specify the border
</pre>
If called again and the image sh... | [
"All",
"this",
"does",
"is",
"set",
"the",
"references",
"to",
"the",
"images",
".",
"Nothing",
"else",
"is",
"changed",
"and",
"its",
"up",
"to",
"the",
"user",
"to",
"correctly",
"update",
"everything",
"else",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L128-L134 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.input | public FDistort input( ImageBase input ) {
if( this.input == null || this.input.width != input.width || this.input.height != input.height ) {
distorter = null;
}
this.input = input;
inputType = input.getImageType();
return this;
} | java | public FDistort input( ImageBase input ) {
if( this.input == null || this.input.width != input.width || this.input.height != input.height ) {
distorter = null;
}
this.input = input;
inputType = input.getImageType();
return this;
} | [
"public",
"FDistort",
"input",
"(",
"ImageBase",
"input",
")",
"{",
"if",
"(",
"this",
".",
"input",
"==",
"null",
"||",
"this",
".",
"input",
".",
"width",
"!=",
"input",
".",
"width",
"||",
"this",
".",
"input",
".",
"height",
"!=",
"input",
".",
... | Changes the input image. The previous distortion is thrown away only if the input
image has a different shape | [
"Changes",
"the",
"input",
"image",
".",
"The",
"previous",
"distortion",
"is",
"thrown",
"away",
"only",
"if",
"the",
"input",
"image",
"has",
"a",
"different",
"shape"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L140-L147 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.output | public FDistort output( ImageBase output ) {
if( this.output == null || this.output.width != output.width || this.output.height != output.height ) {
distorter = null;
}
this.output = output;
return this;
} | java | public FDistort output( ImageBase output ) {
if( this.output == null || this.output.width != output.width || this.output.height != output.height ) {
distorter = null;
}
this.output = output;
return this;
} | [
"public",
"FDistort",
"output",
"(",
"ImageBase",
"output",
")",
"{",
"if",
"(",
"this",
".",
"output",
"==",
"null",
"||",
"this",
".",
"output",
".",
"width",
"!=",
"output",
".",
"width",
"||",
"this",
".",
"output",
".",
"height",
"!=",
"output",
... | Changes the output image. The previous distortion is thrown away only if the output
image has a different shape | [
"Changes",
"the",
"output",
"image",
".",
"The",
"previous",
"distortion",
"is",
"thrown",
"away",
"only",
"if",
"the",
"output",
"image",
"has",
"a",
"different",
"shape"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L153-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.border | public FDistort border( BorderType type ) {
if( borderType == type )
return this;
borderType = type;
return border(FactoryImageBorder.generic(type, inputType));
} | java | public FDistort border( BorderType type ) {
if( borderType == type )
return this;
borderType = type;
return border(FactoryImageBorder.generic(type, inputType));
} | [
"public",
"FDistort",
"border",
"(",
"BorderType",
"type",
")",
"{",
"if",
"(",
"borderType",
"==",
"type",
")",
"return",
"this",
";",
"borderType",
"=",
"type",
";",
"return",
"border",
"(",
"FactoryImageBorder",
".",
"generic",
"(",
"type",
",",
"inputT... | Sets the border by type. | [
"Sets",
"the",
"border",
"by",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L172-L177 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.border | public FDistort border( double value ) {
// to recycle here the value also needs to be saved
// if( borderType == BorderType.VALUE )
// return this;
borderType = BorderType.ZERO;
return border(FactoryImageBorder.genericValue(value, inputType));
} | java | public FDistort border( double value ) {
// to recycle here the value also needs to be saved
// if( borderType == BorderType.VALUE )
// return this;
borderType = BorderType.ZERO;
return border(FactoryImageBorder.genericValue(value, inputType));
} | [
"public",
"FDistort",
"border",
"(",
"double",
"value",
")",
"{",
"// to recycle here the value also needs to be saved",
"//\t\tif( borderType == BorderType.VALUE )",
"//\t\t\treturn this;",
"borderType",
"=",
"BorderType",
".",
"ZERO",
";",
"return",
"border",
"(",
"FactoryI... | Sets the border to a fixed gray-scale value | [
"Sets",
"the",
"border",
"to",
"a",
"fixed",
"gray",
"-",
"scale",
"value"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L182-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.interp | public FDistort interp(InterpolationType type) {
distorter = null;
this.interp = FactoryInterpolation.createPixel(0, 255, type, BorderType.EXTENDED, inputType);
return this;
} | java | public FDistort interp(InterpolationType type) {
distorter = null;
this.interp = FactoryInterpolation.createPixel(0, 255, type, BorderType.EXTENDED, inputType);
return this;
} | [
"public",
"FDistort",
"interp",
"(",
"InterpolationType",
"type",
")",
"{",
"distorter",
"=",
"null",
";",
"this",
".",
"interp",
"=",
"FactoryInterpolation",
".",
"createPixel",
"(",
"0",
",",
"255",
",",
"type",
",",
"BorderType",
".",
"EXTENDED",
",",
"... | Specifies the interpolation used by type. | [
"Specifies",
"the",
"interpolation",
"used",
"by",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L215-L220 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.affine | public FDistort affine(double a11, double a12, double a21, double a22,
double dx, double dy) {
PixelTransformAffine_F32 transform;
if( outputToInput != null && outputToInput instanceof PixelTransformAffine_F32 ) {
transform = (PixelTransformAffine_F32)outputToInput;
} else {
transform = new Pixel... | java | public FDistort affine(double a11, double a12, double a21, double a22,
double dx, double dy) {
PixelTransformAffine_F32 transform;
if( outputToInput != null && outputToInput instanceof PixelTransformAffine_F32 ) {
transform = (PixelTransformAffine_F32)outputToInput;
} else {
transform = new Pixel... | [
"public",
"FDistort",
"affine",
"(",
"double",
"a11",
",",
"double",
"a12",
",",
"double",
"a21",
",",
"double",
"a22",
",",
"double",
"dx",
",",
"double",
"dy",
")",
"{",
"PixelTransformAffine_F32",
"transform",
";",
"if",
"(",
"outputToInput",
"!=",
"nul... | Affine transform from input to output | [
"Affine",
"transform",
"from",
"input",
"to",
"output"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L256-L279 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.rotate | public FDistort rotate( double angleInputToOutput ) {
PixelTransform<Point2D_F32> outputToInput = DistortSupport.transformRotate(input.width/2,input.height/2,
output.width/2,output.height/2,(float)angleInputToOutput);
return transform(outputToInput);
} | java | public FDistort rotate( double angleInputToOutput ) {
PixelTransform<Point2D_F32> outputToInput = DistortSupport.transformRotate(input.width/2,input.height/2,
output.width/2,output.height/2,(float)angleInputToOutput);
return transform(outputToInput);
} | [
"public",
"FDistort",
"rotate",
"(",
"double",
"angleInputToOutput",
")",
"{",
"PixelTransform",
"<",
"Point2D_F32",
">",
"outputToInput",
"=",
"DistortSupport",
".",
"transformRotate",
"(",
"input",
".",
"width",
"/",
"2",
",",
"input",
".",
"height",
"/",
"2... | Applies a distortion which will rotate the input image by the specified amount. | [
"Applies",
"a",
"distortion",
"which",
"will",
"rotate",
"the",
"input",
"image",
"by",
"the",
"specified",
"amount",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L316-L321 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java | FDistort.apply | public void apply() {
// see if the distortion class needs to be created again
if( distorter == null ) {
Class typeOut = output.getImageType().getImageClass();
switch( input.getImageType().getFamily() ) {
case GRAY:
distorter = FactoryDistort.distortSB(cached, (InterpolatePixelS)interp, typeOut);
... | java | public void apply() {
// see if the distortion class needs to be created again
if( distorter == null ) {
Class typeOut = output.getImageType().getImageClass();
switch( input.getImageType().getFamily() ) {
case GRAY:
distorter = FactoryDistort.distortSB(cached, (InterpolatePixelS)interp, typeOut);
... | [
"public",
"void",
"apply",
"(",
")",
"{",
"// see if the distortion class needs to be created again",
"if",
"(",
"distorter",
"==",
"null",
")",
"{",
"Class",
"typeOut",
"=",
"output",
".",
"getImageType",
"(",
")",
".",
"getImageClass",
"(",
")",
";",
"switch",... | Applies the distortion. | [
"Applies",
"the",
"distortion",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/distort/FDistort.java#L326-L350 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ProjectiveToIdentity.java | ProjectiveToIdentity.process | public boolean process( DMatrixRMaj P ) {
if( !svd.decompose(P) )
return false;
svd.getU(Ut,true);
svd.getV(V,false);
double sv[] = svd.getSingularValues();
SingularOps_DDRM.descendingOrder(Ut,true,sv,3,V,false);
// compute W+, which is transposed and non-negative inverted
for (int i = 0; i < 3; i++... | java | public boolean process( DMatrixRMaj P ) {
if( !svd.decompose(P) )
return false;
svd.getU(Ut,true);
svd.getV(V,false);
double sv[] = svd.getSingularValues();
SingularOps_DDRM.descendingOrder(Ut,true,sv,3,V,false);
// compute W+, which is transposed and non-negative inverted
for (int i = 0; i < 3; i++... | [
"public",
"boolean",
"process",
"(",
"DMatrixRMaj",
"P",
")",
"{",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
"P",
")",
")",
"return",
"false",
";",
"svd",
".",
"getU",
"(",
"Ut",
",",
"true",
")",
";",
"svd",
".",
"getV",
"(",
"V",
",",
"fa... | Compute projective transform that converts P into identity
@param P (Input) 3x4 camera matrix
@return true if no errors | [
"Compute",
"projective",
"transform",
"that",
"converts",
"P",
"into",
"identity"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ProjectiveToIdentity.java#L52-L76 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ProjectiveToIdentity.java | ProjectiveToIdentity.computeH | public void computeH( DMatrixRMaj H ) {
H.reshape(4,4);
CommonOps_DDRM.insert(PA,H,0,0);
for (int i = 0; i < 4; i++) {
H.unsafe_set(i,3,ns.data[i]);
}
} | java | public void computeH( DMatrixRMaj H ) {
H.reshape(4,4);
CommonOps_DDRM.insert(PA,H,0,0);
for (int i = 0; i < 4; i++) {
H.unsafe_set(i,3,ns.data[i]);
}
} | [
"public",
"void",
"computeH",
"(",
"DMatrixRMaj",
"H",
")",
"{",
"H",
".",
"reshape",
"(",
"4",
",",
"4",
")",
";",
"CommonOps_DDRM",
".",
"insert",
"(",
"PA",
",",
"H",
",",
"0",
",",
"0",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | Retrieve projective transform H | [
"Retrieve",
"projective",
"transform",
"H"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/impl/ProjectiveToIdentity.java#L81-L90 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.