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 | integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java | StreamOpenKinectRgbDepth.start | public void start( Device device , Resolution resolution , Listener listener )
{
if( resolution != Resolution.MEDIUM ) {
throw new IllegalArgumentException("Depth image is always at medium resolution. Possible bug in kinect driver");
}
this.device = device;
this.listener = listener;
// Configure the ki... | java | public void start( Device device , Resolution resolution , Listener listener )
{
if( resolution != Resolution.MEDIUM ) {
throw new IllegalArgumentException("Depth image is always at medium resolution. Possible bug in kinect driver");
}
this.device = device;
this.listener = listener;
// Configure the ki... | [
"public",
"void",
"start",
"(",
"Device",
"device",
",",
"Resolution",
"resolution",
",",
"Listener",
"listener",
")",
"{",
"if",
"(",
"resolution",
"!=",
"Resolution",
".",
"MEDIUM",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Depth image is a... | Adds listeners to the device and sets its resolutions.
@param device Kinect device
@param resolution Resolution that images are being processed at. Must be medium for now
@param listener Listener for data | [
"Adds",
"listeners",
"to",
"the",
"device",
"and",
"sets",
"its",
"resolutions",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java#L66-L108 | train |
lessthanoptimal/BoofCV | integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java | StreamOpenKinectRgbDepth.stop | public void stop() {
thread.requestStop = true;
long start = System.currentTimeMillis()+timeout;
while( start > System.currentTimeMillis() && thread.running )
Thread.yield();
device.stopDepth();
device.stopVideo();
device.close();
} | java | public void stop() {
thread.requestStop = true;
long start = System.currentTimeMillis()+timeout;
while( start > System.currentTimeMillis() && thread.running )
Thread.yield();
device.stopDepth();
device.stopVideo();
device.close();
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"thread",
".",
"requestStop",
"=",
"true",
";",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"timeout",
";",
"while",
"(",
"start",
">",
"System",
".",
"currentTimeMillis",
"(",
")",
... | Stops all the threads from running and closes the video channels and video device | [
"Stops",
"all",
"the",
"threads",
"from",
"running",
"and",
"closes",
"the",
"video",
"channels",
"and",
"video",
"device"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java#L113-L122 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java | RefineDualQuadraticAlgebra.refine | public boolean refine(List<CameraPinhole> calibration , DMatrix4x4 Q ) {
if( calibration.size() != cameras.size )
throw new RuntimeException("Calibration and cameras do not match");
computeNumberOfCalibrationParameters();
func = new ResidualK();
if( func.getNumOfInputsN() > 6*calibration.size() )
throw ... | java | public boolean refine(List<CameraPinhole> calibration , DMatrix4x4 Q ) {
if( calibration.size() != cameras.size )
throw new RuntimeException("Calibration and cameras do not match");
computeNumberOfCalibrationParameters();
func = new ResidualK();
if( func.getNumOfInputsN() > 6*calibration.size() )
throw ... | [
"public",
"boolean",
"refine",
"(",
"List",
"<",
"CameraPinhole",
">",
"calibration",
",",
"DMatrix4x4",
"Q",
")",
"{",
"if",
"(",
"calibration",
".",
"size",
"(",
")",
"!=",
"cameras",
".",
"size",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Calibrat... | Refine calibration matrix K given the dual absolute quadratic Q.
@param calibration (Input) Initial estimates of K. (Output) Refined estimate.
@param Q (Input) Initial estimate of absolute quadratic (Output) refined estimate. | [
"Refine",
"calibration",
"matrix",
"K",
"given",
"the",
"dual",
"absolute",
"quadratic",
"Q",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L99-L135 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java | RefineDualQuadraticAlgebra.recomputeQ | void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) {
Equation eq = new Equation();
DMatrix3x3 K = new DMatrix3x3();
encodeK(K,0,3,param.data);
eq.alias(p,"p",K,"K");
eq.process("w=K*K'");
eq.process("Q=[w , -w*p;-p'*w , p'*w*p]");
DMatrixRMaj _Q = eq.lookupDDRM("Q");
CommonOps_DDRM.divide(_Q, NormOps_DDRM.... | java | void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) {
Equation eq = new Equation();
DMatrix3x3 K = new DMatrix3x3();
encodeK(K,0,3,param.data);
eq.alias(p,"p",K,"K");
eq.process("w=K*K'");
eq.process("Q=[w , -w*p;-p'*w , p'*w*p]");
DMatrixRMaj _Q = eq.lookupDDRM("Q");
CommonOps_DDRM.divide(_Q, NormOps_DDRM.... | [
"void",
"recomputeQ",
"(",
"DMatrixRMaj",
"p",
",",
"DMatrix4x4",
"Q",
")",
"{",
"Equation",
"eq",
"=",
"new",
"Equation",
"(",
")",
";",
"DMatrix3x3",
"K",
"=",
"new",
"DMatrix3x3",
"(",
")",
";",
"encodeK",
"(",
"K",
",",
"0",
",",
"3",
",",
"par... | Compuets the absolute dual quadratic from the first camera parameters and
plane at infinity
@param p plane at infinity
@param Q (Output) ABQ | [
"Compuets",
"the",
"absolute",
"dual",
"quadratic",
"from",
"the",
"first",
"camera",
"parameters",
"and",
"plane",
"at",
"infinity"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L155-L165 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java | RefineDualQuadraticAlgebra.encodeK | public int encodeK( DMatrix3x3 K , int which, int offset, double params[] ) {
if( fixedAspectRatio ) {
K.a11 = params[offset++];
K.a22 = aspect.data[which]*K.a11;
} else {
K.a11 = params[offset++];
K.a22 = params[offset++];
}
if( !zeroSkew ) {
K.a12 = params[offset++];
}
if( !zeroPrinciple... | java | public int encodeK( DMatrix3x3 K , int which, int offset, double params[] ) {
if( fixedAspectRatio ) {
K.a11 = params[offset++];
K.a22 = aspect.data[which]*K.a11;
} else {
K.a11 = params[offset++];
K.a22 = params[offset++];
}
if( !zeroSkew ) {
K.a12 = params[offset++];
}
if( !zeroPrinciple... | [
"public",
"int",
"encodeK",
"(",
"DMatrix3x3",
"K",
",",
"int",
"which",
",",
"int",
"offset",
",",
"double",
"params",
"[",
"]",
")",
"{",
"if",
"(",
"fixedAspectRatio",
")",
"{",
"K",
".",
"a11",
"=",
"params",
"[",
"offset",
"++",
"]",
";",
"K",... | Encode the calibration as a 3x3 matrix. K is assumed to zero initially or at
least all non-zero elements will align with values that are written to. | [
"Encode",
"the",
"calibration",
"as",
"a",
"3x3",
"matrix",
".",
"K",
"is",
"assumed",
"to",
"zero",
"initially",
"or",
"at",
"least",
"all",
"non",
"-",
"zero",
"elements",
"will",
"align",
"with",
"values",
"that",
"are",
"written",
"to",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L230-L250 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java | RegionMergeTree.initializeMerge | public void initializeMerge(int numRegions) {
mergeList.resize(numRegions);
for( int i = 0; i < numRegions; i++ )
mergeList.data[i] = i;
} | java | public void initializeMerge(int numRegions) {
mergeList.resize(numRegions);
for( int i = 0; i < numRegions; i++ )
mergeList.data[i] = i;
} | [
"public",
"void",
"initializeMerge",
"(",
"int",
"numRegions",
")",
"{",
"mergeList",
".",
"resize",
"(",
"numRegions",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numRegions",
";",
"i",
"++",
")",
"mergeList",
".",
"data",
"[",
"i",
... | Must call before any other functions.
@param numRegions Total number of regions. | [
"Must",
"call",
"before",
"any",
"other",
"functions",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L57-L61 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java | RegionMergeTree.performMerge | public void performMerge( GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount ) {
// update member counts
flowIntoRootNode(regionMemberCount);
// re-assign the number of the root node and trim excessive nodes from the lists
setToRootNodeNewID(regionMemberCount);
// change the labels in the pixe... | java | public void performMerge( GrayS32 pixelToRegion ,
GrowQueue_I32 regionMemberCount ) {
// update member counts
flowIntoRootNode(regionMemberCount);
// re-assign the number of the root node and trim excessive nodes from the lists
setToRootNodeNewID(regionMemberCount);
// change the labels in the pixe... | [
"public",
"void",
"performMerge",
"(",
"GrayS32",
"pixelToRegion",
",",
"GrowQueue_I32",
"regionMemberCount",
")",
"{",
"// update member counts",
"flowIntoRootNode",
"(",
"regionMemberCount",
")",
";",
"// re-assign the number of the root node and trim excessive nodes from the lis... | Merges regions together and updates the provided data structures for said changes.
@param pixelToRegion (Input/Output) Image used to convert pixel location in region ID. Modified.
@param regionMemberCount (Input/Output) List containing how many pixels belong to each region. Modified. | [
"Merges",
"regions",
"together",
"and",
"updates",
"the",
"provided",
"data",
"structures",
"for",
"said",
"changes",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L69-L79 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java | RegionMergeTree.flowIntoRootNode | protected void flowIntoRootNode(GrowQueue_I32 regionMemberCount) {
rootID.resize(regionMemberCount.size);
int count = 0;
for( int i = 0; i < mergeList.size; i++ ) {
int p = mergeList.data[i];
// see if it is a root note
if( p == i ) {
// mark the root nodes new ID
rootID.data[i] = count++;
... | java | protected void flowIntoRootNode(GrowQueue_I32 regionMemberCount) {
rootID.resize(regionMemberCount.size);
int count = 0;
for( int i = 0; i < mergeList.size; i++ ) {
int p = mergeList.data[i];
// see if it is a root note
if( p == i ) {
// mark the root nodes new ID
rootID.data[i] = count++;
... | [
"protected",
"void",
"flowIntoRootNode",
"(",
"GrowQueue_I32",
"regionMemberCount",
")",
"{",
"rootID",
".",
"resize",
"(",
"regionMemberCount",
".",
"size",
")",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"merge... | For each region in the merge list which is not a root node, find its root node and add to the root node
its member count and set the index in mergeList to the root node. If a node is a root node just note
what its new ID will be after all the other segments are removed. | [
"For",
"each",
"region",
"in",
"the",
"merge",
"list",
"which",
"is",
"not",
"a",
"root",
"node",
"find",
"its",
"root",
"node",
"and",
"add",
"to",
"the",
"root",
"node",
"its",
"member",
"count",
"and",
"set",
"the",
"index",
"in",
"mergeList",
"to",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L86-L111 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java | RegionMergeTree.setToRootNodeNewID | protected void setToRootNodeNewID( GrowQueue_I32 regionMemberCount ) {
tmpMemberCount.reset();
for( int i = 0; i < mergeList.size; i++ ) {
int p = mergeList.data[i];
if( p == i ) {
mergeList.data[i] = rootID.data[i];
tmpMemberCount.add( regionMemberCount.data[i] );
} else {
mergeList.data[i]... | java | protected void setToRootNodeNewID( GrowQueue_I32 regionMemberCount ) {
tmpMemberCount.reset();
for( int i = 0; i < mergeList.size; i++ ) {
int p = mergeList.data[i];
if( p == i ) {
mergeList.data[i] = rootID.data[i];
tmpMemberCount.add( regionMemberCount.data[i] );
} else {
mergeList.data[i]... | [
"protected",
"void",
"setToRootNodeNewID",
"(",
"GrowQueue_I32",
"regionMemberCount",
")",
"{",
"tmpMemberCount",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mergeList",
".",
"size",
";",
"i",
"++",
")",
"{",
"int",
"... | Does much of the work needed to remove the redundant segments that are being merged into their root node.
The list of member count is updated. mergeList is updated with the new segment IDs. | [
"Does",
"much",
"of",
"the",
"work",
"needed",
"to",
"remove",
"the",
"redundant",
"segments",
"that",
"are",
"being",
"merged",
"into",
"their",
"root",
"node",
".",
"The",
"list",
"of",
"member",
"count",
"is",
"updated",
".",
"mergeList",
"is",
"updated... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L117-L134 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.homographyRefine | public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) {
ModelObservationResidualN residuals;
switch( type ) {
case SIMPLE:
residuals = new HomographyResidualTransfer();
break;
case SAMPSON:
residuals = new HomographyResidualSampson();
break;
d... | java | public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) {
ModelObservationResidualN residuals;
switch( type ) {
case SIMPLE:
residuals = new HomographyResidualTransfer();
break;
case SAMPSON:
residuals = new HomographyResidualSampson();
break;
d... | [
"public",
"static",
"RefineEpipolar",
"homographyRefine",
"(",
"double",
"tol",
",",
"int",
"maxIterations",
",",
"EpipolarError",
"type",
")",
"{",
"ModelObservationResidualN",
"residuals",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"SIMPLE",
":",
"residuals",... | Creates a non-linear optimizer for refining estimates of homography matrices.
@see HomographyResidualSampson
@see HomographyResidualTransfer
@param tol Tolerance for convergence. Try 1e-8
@param maxIterations Maximum number of iterations it will perform. Try 100 or more.
@return Homography refinement | [
"Creates",
"a",
"non",
"-",
"linear",
"optimizer",
"for",
"refining",
"estimates",
"of",
"homography",
"matrices",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L211-L227 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.fundamentalRefine | public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type )
{
switch( type ) {
case SAMPSON:
return new LeastSquaresFundamental(tol,maxIterations,true);
case SIMPLE:
return new LeastSquaresFundamental(tol,maxIterations,false);
}
throw new IllegalArgumentExc... | java | public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type )
{
switch( type ) {
case SAMPSON:
return new LeastSquaresFundamental(tol,maxIterations,true);
case SIMPLE:
return new LeastSquaresFundamental(tol,maxIterations,false);
}
throw new IllegalArgumentExc... | [
"public",
"static",
"RefineEpipolar",
"fundamentalRefine",
"(",
"double",
"tol",
",",
"int",
"maxIterations",
",",
"EpipolarError",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"SAMPSON",
":",
"return",
"new",
"LeastSquaresFundamental",
"(",
"tol",... | Creates a non-linear optimizer for refining estimates of fundamental or essential matrices.
@see boofcv.alg.geo.f.FundamentalResidualSampson
@see boofcv.alg.geo.f.FundamentalResidualSimple
@param tol Tolerance for convergence. Try 1e-8
@param maxIterations Maximum number of iterations it will perform. Try 100 or mo... | [
"Creates",
"a",
"non",
"-",
"linear",
"optimizer",
"for",
"refining",
"estimates",
"of",
"fundamental",
"or",
"essential",
"matrices",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L370-L380 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.pnp_N | public static EstimateNofPnP pnp_N(EnumPNP which , int numIterations ) {
MotionTransformPoint<Se3_F64, Point3D_F64> motionFit = FitSpecialEuclideanOps_F64.fitPoints3D();
switch( which ) {
case P3P_GRUNERT:
P3PGrunert grunert = new P3PGrunert(PolynomialOps.createRootFinder(5, RootFinderType.STURM));
ret... | java | public static EstimateNofPnP pnp_N(EnumPNP which , int numIterations ) {
MotionTransformPoint<Se3_F64, Point3D_F64> motionFit = FitSpecialEuclideanOps_F64.fitPoints3D();
switch( which ) {
case P3P_GRUNERT:
P3PGrunert grunert = new P3PGrunert(PolynomialOps.createRootFinder(5, RootFinderType.STURM));
ret... | [
"public",
"static",
"EstimateNofPnP",
"pnp_N",
"(",
"EnumPNP",
"which",
",",
"int",
"numIterations",
")",
"{",
"MotionTransformPoint",
"<",
"Se3_F64",
",",
"Point3D_F64",
">",
"motionFit",
"=",
"FitSpecialEuclideanOps_F64",
".",
"fitPoints3D",
"(",
")",
";",
"swit... | Creates an estimator for the PnP problem that uses only three observations, which is the minimal case
and known as P3P.
<p>NOTE: Observations are in normalized image coordinates NOT pixels.</p>
@param which The algorithm which is to be returned.
@param numIterations Number of iterations. Only used by some algorithms ... | [
"Creates",
"an",
"estimator",
"for",
"the",
"PnP",
"problem",
"that",
"uses",
"only",
"three",
"observations",
"which",
"is",
"the",
"minimal",
"case",
"and",
"known",
"as",
"P3P",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L440-L463 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.pnp_1 | public static Estimate1ofPnP pnp_1(EnumPNP which, int numIterations , int numTest) {
if( which == EnumPNP.EPNP ) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(0.1);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} else if( which == EnumPNP.IPPE ) {
Estimate1ofEpipolar H = FactoryM... | java | public static Estimate1ofPnP pnp_1(EnumPNP which, int numIterations , int numTest) {
if( which == EnumPNP.EPNP ) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(0.1);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} else if( which == EnumPNP.IPPE ) {
Estimate1ofEpipolar H = FactoryM... | [
"public",
"static",
"Estimate1ofPnP",
"pnp_1",
"(",
"EnumPNP",
"which",
",",
"int",
"numIterations",
",",
"int",
"numTest",
")",
"{",
"if",
"(",
"which",
"==",
"EnumPNP",
".",
"EPNP",
")",
"{",
"PnPLepetitEPnP",
"alg",
"=",
"new",
"PnPLepetitEPnP",
"(",
"0... | Created an estimator for the P3P problem that selects a single solution by considering additional
observations.
<p>NOTE: Observations are in normalized image coordinates NOT pixels.</p>
<p>
NOTE: EPnP has several tuning parameters and the defaults here might not be the best for your situation.
Use {@link #computePnPw... | [
"Created",
"an",
"estimator",
"for",
"the",
"P3P",
"problem",
"that",
"selects",
"a",
"single",
"solution",
"by",
"considering",
"additional",
"observations",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L483-L497 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.computePnPwithEPnP | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} | java | public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) {
PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber);
alg.setNumIterations(numIterations);
return new WrapPnPLepetitEPnP(alg);
} | [
"public",
"static",
"Estimate1ofPnP",
"computePnPwithEPnP",
"(",
"int",
"numIterations",
",",
"double",
"magicNumber",
")",
"{",
"PnPLepetitEPnP",
"alg",
"=",
"new",
"PnPLepetitEPnP",
"(",
"magicNumber",
")",
";",
"alg",
".",
"setNumIterations",
"(",
"numIterations"... | Returns a solution to the PnP problem for 4 or more points using EPnP. Fast and fairly
accurate algorithm. Can handle general and planar scenario automatically.
<p>NOTE: Observations are in normalized image coordinates NOT pixels.</p>
@see PnPLepetitEPnP
@param numIterations If more then zero then non-linear optimi... | [
"Returns",
"a",
"solution",
"to",
"the",
"PnP",
"problem",
"for",
"4",
"or",
"more",
"points",
"using",
"EPnP",
".",
"Fast",
"and",
"fairly",
"accurate",
"algorithm",
".",
"Can",
"handle",
"general",
"and",
"planar",
"scenario",
"automatically",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L511-L515 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerable.java | FactorySteerable.gaussian | public static <K extends Kernel2D> SteerableKernel<K> gaussian(Class<K> kernelType, int orderX, int orderY, double sigma, int radius) {
if( orderX < 0 || orderX > 4 )
throw new IllegalArgumentException("derivX must be from 0 to 4 inclusive.");
if( orderY < 0 || orderY > 4 )
throw new IllegalArgumentException(... | java | public static <K extends Kernel2D> SteerableKernel<K> gaussian(Class<K> kernelType, int orderX, int orderY, double sigma, int radius) {
if( orderX < 0 || orderX > 4 )
throw new IllegalArgumentException("derivX must be from 0 to 4 inclusive.");
if( orderY < 0 || orderY > 4 )
throw new IllegalArgumentException(... | [
"public",
"static",
"<",
"K",
"extends",
"Kernel2D",
">",
"SteerableKernel",
"<",
"K",
">",
"gaussian",
"(",
"Class",
"<",
"K",
">",
"kernelType",
",",
"int",
"orderX",
",",
"int",
"orderY",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"if",... | Steerable filter for 2D Gaussian derivatives. The basis is composed of a set of rotated kernels.
@param kernelType Specifies which type of 2D kernel should be generated.
@param orderX Order of the derivative in the x-axis.
@param orderY Order of the derivative in the y-axis.
@param sigma
@param radius Radius of the ... | [
"Steerable",
"filter",
"for",
"2D",
"Gaussian",
"derivatives",
".",
"The",
"basis",
"is",
"composed",
"of",
"a",
"set",
"of",
"rotated",
"kernels",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerable.java#L54-L107 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java | WatershedVincentSoille1991.process | public void process( GrayU8 input ) {
// input = im_0
removedWatersheds = false;
output.reshape(input.width+2,input.height+2);
distance.reshape(input.width+2,input.height+2);
ImageMiscOps.fill(output, INIT);
ImageMiscOps.fill(distance, 0);
fifo.reset();
// sort pixels
sortPixels(input);
currentL... | java | public void process( GrayU8 input ) {
// input = im_0
removedWatersheds = false;
output.reshape(input.width+2,input.height+2);
distance.reshape(input.width+2,input.height+2);
ImageMiscOps.fill(output, INIT);
ImageMiscOps.fill(distance, 0);
fifo.reset();
// sort pixels
sortPixels(input);
currentL... | [
"public",
"void",
"process",
"(",
"GrayU8",
"input",
")",
"{",
"// input = im_0",
"removedWatersheds",
"=",
"false",
";",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
"+",
"2",
",",
"input",
".",
"height",
"+",
"2",
")",
";",
"distance",
".",
... | Perform watershed segmentation on the provided input image. New basins are created at each local minima.
@param input Input gray-scale image. | [
"Perform",
"watershed",
"segmentation",
"on",
"the",
"provided",
"input",
"image",
".",
"New",
"basins",
"are",
"created",
"at",
"each",
"local",
"minima",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java#L119-L189 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java | WatershedVincentSoille1991.sortPixels | protected void sortPixels(GrayU8 input) {
// initialize histogram
for( int i = 0; i < histogram.length; i++ ) {
histogram[i].reset();
}
// sort by creating a histogram
for( int y = 0; y < input.height; y++ ) {
int index = input.startIndex + y*input.stride;
int indexOut = (y+1)*output.stride + 1;
f... | java | protected void sortPixels(GrayU8 input) {
// initialize histogram
for( int i = 0; i < histogram.length; i++ ) {
histogram[i].reset();
}
// sort by creating a histogram
for( int y = 0; y < input.height; y++ ) {
int index = input.startIndex + y*input.stride;
int indexOut = (y+1)*output.stride + 1;
f... | [
"protected",
"void",
"sortPixels",
"(",
"GrayU8",
"input",
")",
"{",
"// initialize histogram",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogram",
".",
"length",
";",
"i",
"++",
")",
"{",
"histogram",
"[",
"i",
"]",
".",
"reset",
"(",
")",... | Very fast histogram based sorting. Index of each pixel is placed inside a list for its intensity level. | [
"Very",
"fast",
"histogram",
"based",
"sorting",
".",
"Index",
"of",
"each",
"pixel",
"is",
"placed",
"inside",
"a",
"list",
"for",
"its",
"intensity",
"level",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java#L341-L355 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java | BoofMiscOps.numDigits | public static int numDigits(int number) {
if( number == 0 )
return 1;
int adjustment = 0;
if( number < 0 ) {
adjustment = 1;
number = -number;
}
return adjustment + (int)Math.log10(number)+1;
} | java | public static int numDigits(int number) {
if( number == 0 )
return 1;
int adjustment = 0;
if( number < 0 ) {
adjustment = 1;
number = -number;
}
return adjustment + (int)Math.log10(number)+1;
} | [
"public",
"static",
"int",
"numDigits",
"(",
"int",
"number",
")",
"{",
"if",
"(",
"number",
"==",
"0",
")",
"return",
"1",
";",
"int",
"adjustment",
"=",
"0",
";",
"if",
"(",
"number",
"<",
"0",
")",
"{",
"adjustment",
"=",
"1",
";",
"number",
"... | Returns the number of digits in a number. E.g. 345 = 3, -345 = 4, 0 = 1 | [
"Returns",
"the",
"number",
"of",
"digits",
"in",
"a",
"number",
".",
"E",
".",
"g",
".",
"345",
"=",
"3",
"-",
"345",
"=",
"4",
"0",
"=",
"1"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L49-L58 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java | BoofMiscOps.boundRectangleInside | public static void boundRectangleInside( ImageBase b , ImageRectangle r )
{
if( r.x0 < 0 )
r.x0 = 0;
if( r.x1 > b.width )
r.x1 = b.width;
if( r.y0 < 0 )
r.y0 = 0;
if( r.y1 > b.height )
r.y1 = b.height;
} | java | public static void boundRectangleInside( ImageBase b , ImageRectangle r )
{
if( r.x0 < 0 )
r.x0 = 0;
if( r.x1 > b.width )
r.x1 = b.width;
if( r.y0 < 0 )
r.y0 = 0;
if( r.y1 > b.height )
r.y1 = b.height;
} | [
"public",
"static",
"void",
"boundRectangleInside",
"(",
"ImageBase",
"b",
",",
"ImageRectangle",
"r",
")",
"{",
"if",
"(",
"r",
".",
"x0",
"<",
"0",
")",
"r",
".",
"x0",
"=",
"0",
";",
"if",
"(",
"r",
".",
"x1",
">",
"b",
".",
"width",
")",
"r... | Bounds the provided rectangle to be inside the image.
@param b An image.
@param r Rectangle | [
"Bounds",
"the",
"provided",
"rectangle",
"to",
"be",
"inside",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L149-L160 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java | BoofMiscOps.checkInside | public static boolean checkInside(ImageBase b, int x , int y , int radius ) {
if( x-radius < 0 )
return false;
if( x+radius >= b.width )
return false;
if( y-radius < 0 )
return false;
if( y+radius >= b.height )
return false;
return true;
} | java | public static boolean checkInside(ImageBase b, int x , int y , int radius ) {
if( x-radius < 0 )
return false;
if( x+radius >= b.width )
return false;
if( y-radius < 0 )
return false;
if( y+radius >= b.height )
return false;
return true;
} | [
"public",
"static",
"boolean",
"checkInside",
"(",
"ImageBase",
"b",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"radius",
")",
"{",
"if",
"(",
"x",
"-",
"radius",
"<",
"0",
")",
"return",
"false",
";",
"if",
"(",
"x",
"+",
"radius",
">=",
"b",... | Returns true if the point is contained inside the image and 'radius' away from the image border.
@param b Image
@param x x-coordinate of point
@param y y-coordinate of point
@param radius How many pixels away from the border it needs to be to be considered inside
@return true if the point is inside and false if it is ... | [
"Returns",
"true",
"if",
"the",
"point",
"is",
"contained",
"inside",
"the",
"image",
"and",
"radius",
"away",
"from",
"the",
"image",
"border",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L184-L195 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java | BoofMiscOps.pause | public static void pause(long milli) {
final Thread t = Thread.currentThread();
long start = System.currentTimeMillis();
while( System.currentTimeMillis() - start < milli ) {
synchronized( t ) {
try {
long target = milli - (System.currentTimeMillis() - start);
if( target > 0 )
t.wait(targe... | java | public static void pause(long milli) {
final Thread t = Thread.currentThread();
long start = System.currentTimeMillis();
while( System.currentTimeMillis() - start < milli ) {
synchronized( t ) {
try {
long target = milli - (System.currentTimeMillis() - start);
if( target > 0 )
t.wait(targe... | [
"public",
"static",
"void",
"pause",
"(",
"long",
"milli",
")",
"{",
"final",
"Thread",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"while",
"(",
"System",
".",
"curr... | Invokes wait until the elapsed time has passed. In the thread is interrupted, the interrupt is ignored.
@param milli Length of desired pause in milliseconds. | [
"Invokes",
"wait",
"until",
"the",
"elapsed",
"time",
"has",
"passed",
".",
"In",
"the",
"thread",
"is",
"interrupted",
"the",
"interrupt",
"is",
"ignored",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L300-L313 | train |
lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/FiducialDetection.java | FiducialDetection.processStream | private void processStream(CameraPinholeBrown intrinsic , SimpleImageSequence<GrayU8> sequence , ImagePanel gui , long pauseMilli) {
Font font = new Font("Serif", Font.BOLD, 24);
Se3_F64 fiducialToCamera = new Se3_F64();
int frameNumber = 0;
while( sequence.hasNext() ) {
long before = System.currentTimeMil... | java | private void processStream(CameraPinholeBrown intrinsic , SimpleImageSequence<GrayU8> sequence , ImagePanel gui , long pauseMilli) {
Font font = new Font("Serif", Font.BOLD, 24);
Se3_F64 fiducialToCamera = new Se3_F64();
int frameNumber = 0;
while( sequence.hasNext() ) {
long before = System.currentTimeMil... | [
"private",
"void",
"processStream",
"(",
"CameraPinholeBrown",
"intrinsic",
",",
"SimpleImageSequence",
"<",
"GrayU8",
">",
"sequence",
",",
"ImagePanel",
"gui",
",",
"long",
"pauseMilli",
")",
"{",
"Font",
"font",
"=",
"new",
"Font",
"(",
"\"Serif\"",
",",
"F... | Displays a continuous stream of images | [
"Displays",
"a",
"continuous",
"stream",
"of",
"images"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/FiducialDetection.java#L395-L439 | train |
lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/FiducialDetection.java | FiducialDetection.processImage | private void processImage(CameraPinholeBrown intrinsic , BufferedImage buffered , ImagePanel gui ) {
Font font = new Font("Serif", Font.BOLD, 24);
GrayU8 gray = new GrayU8(buffered.getWidth(),buffered.getHeight());
ConvertBufferedImage.convertFrom(buffered,gray);
Se3_F64 fiducialToCamera = new Se3_F64();
t... | java | private void processImage(CameraPinholeBrown intrinsic , BufferedImage buffered , ImagePanel gui ) {
Font font = new Font("Serif", Font.BOLD, 24);
GrayU8 gray = new GrayU8(buffered.getWidth(),buffered.getHeight());
ConvertBufferedImage.convertFrom(buffered,gray);
Se3_F64 fiducialToCamera = new Se3_F64();
t... | [
"private",
"void",
"processImage",
"(",
"CameraPinholeBrown",
"intrinsic",
",",
"BufferedImage",
"buffered",
",",
"ImagePanel",
"gui",
")",
"{",
"Font",
"font",
"=",
"new",
"Font",
"(",
"\"Serif\"",
",",
"Font",
".",
"BOLD",
",",
"24",
")",
";",
"GrayU8",
... | Displays a simple image | [
"Displays",
"a",
"simple",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/FiducialDetection.java#L444-L479 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/video/VideoMjpegCodec.java | VideoMjpegCodec.readFrame | public byte[] readFrame( DataInputStream in ) {
try {
if( findMarker(in,SOI) && in.available() > 0 ) {
return readJpegData(in, EOI);
}
} catch (IOException e) {}
return null;
} | java | public byte[] readFrame( DataInputStream in ) {
try {
if( findMarker(in,SOI) && in.available() > 0 ) {
return readJpegData(in, EOI);
}
} catch (IOException e) {}
return null;
} | [
"public",
"byte",
"[",
"]",
"readFrame",
"(",
"DataInputStream",
"in",
")",
"{",
"try",
"{",
"if",
"(",
"findMarker",
"(",
"in",
",",
"SOI",
")",
"&&",
"in",
".",
"available",
"(",
")",
">",
"0",
")",
"{",
"return",
"readJpegData",
"(",
"in",
",",
... | Read a single frame at a time | [
"Read",
"a",
"single",
"frame",
"at",
"a",
"time"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/video/VideoMjpegCodec.java#L59-L66 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdLocalOtsu.java | ThresholdLocalOtsu.applyToBorder | void applyToBorder(GrayU8 input, GrayU8 output, int y0, int y1, int x0, int x1, ApplyHelper h) {
// top-left corner
h.computeHistogram(0,0,input);
h.applyToBlock(0,0,x0+1,y0+1,input,output);
// top-middle
for (int x = x0+1; x < x1; x++) {
h.updateHistogramX(x-x0,0,input);
h.applyToBlock(x,0,x+1,y0,input... | java | void applyToBorder(GrayU8 input, GrayU8 output, int y0, int y1, int x0, int x1, ApplyHelper h) {
// top-left corner
h.computeHistogram(0,0,input);
h.applyToBlock(0,0,x0+1,y0+1,input,output);
// top-middle
for (int x = x0+1; x < x1; x++) {
h.updateHistogramX(x-x0,0,input);
h.applyToBlock(x,0,x+1,y0,input... | [
"void",
"applyToBorder",
"(",
"GrayU8",
"input",
",",
"GrayU8",
"output",
",",
"int",
"y0",
",",
"int",
"y1",
",",
"int",
"x0",
",",
"int",
"x1",
",",
"ApplyHelper",
"h",
")",
"{",
"// top-left corner",
"h",
".",
"computeHistogram",
"(",
"0",
",",
"0",... | Apply around the image border. Use a region that's the full size but apply to all pixels that the region
would go outside of it was centered on them. | [
"Apply",
"around",
"the",
"image",
"border",
".",
"Use",
"a",
"region",
"that",
"s",
"the",
"full",
"size",
"but",
"apply",
"to",
"all",
"pixels",
"that",
"the",
"region",
"would",
"go",
"outside",
"of",
"it",
"was",
"centered",
"on",
"them",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdLocalOtsu.java#L132-L174 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/UtilImageMotion.java | UtilImageMotion.createPixelTransform | public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) {
PixelTransform<Point2D_F32> pixelTran;
if( transform instanceof Homography2D_F64) {
Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null);
pixelTran = new PixelTransformHomography_F32(t)... | java | public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) {
PixelTransform<Point2D_F32> pixelTran;
if( transform instanceof Homography2D_F64) {
Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null);
pixelTran = new PixelTransformHomography_F32(t)... | [
"public",
"static",
"PixelTransform",
"<",
"Point2D_F32",
">",
"createPixelTransform",
"(",
"InvertibleTransform",
"transform",
")",
"{",
"PixelTransform",
"<",
"Point2D_F32",
">",
"pixelTran",
";",
"if",
"(",
"transform",
"instanceof",
"Homography2D_F64",
")",
"{",
... | Given a motion model create a PixelTransform used to distort the image
@param transform Motion transform
@return PixelTransform_F32 used to distort the image | [
"Given",
"a",
"motion",
"model",
"create",
"a",
"PixelTransform",
"used",
"to",
"distort",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/UtilImageMotion.java#L44-L60 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/orientation/FactoryOrientation.java | FactoryOrientation.sift | public static <T extends ImageGray<T>>
OrientationImage<T> sift(ConfigSiftScaleSpace configSS , ConfigSiftOrientation configOri, Class<T> imageType ) {
if( configSS == null )
configSS = new ConfigSiftScaleSpace();
configSS.checkValidity();
OrientationHistogramSift<GrayF32> ori = FactoryOrientationAlgs.sift(c... | java | public static <T extends ImageGray<T>>
OrientationImage<T> sift(ConfigSiftScaleSpace configSS , ConfigSiftOrientation configOri, Class<T> imageType ) {
if( configSS == null )
configSS = new ConfigSiftScaleSpace();
configSS.checkValidity();
OrientationHistogramSift<GrayF32> ori = FactoryOrientationAlgs.sift(c... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"OrientationImage",
"<",
"T",
">",
"sift",
"(",
"ConfigSiftScaleSpace",
"configSS",
",",
"ConfigSiftOrientation",
"configOri",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"if",... | Creates an implementation of the SIFT orientation estimation algorithm
@param configSS Configuration of the scale-space. null for default
@param configOri Orientation configuration. null for default
@param imageType Type of input image
@return SIFT orientation image | [
"Creates",
"an",
"implementation",
"of",
"the",
"SIFT",
"orientation",
"estimation",
"algorithm"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/orientation/FactoryOrientation.java#L69-L80 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java | CalibrationDetectorChessboard2.gridChess | public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth)
{
List<Point2D_F64> all = new ArrayList<>();
// convert it into the number of calibration points
numCols = numCols - 1;
numRows = numRows - 1;
// center the grid around the origin. length of a size divided by two
doub... | java | public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth)
{
List<Point2D_F64> all = new ArrayList<>();
// convert it into the number of calibration points
numCols = numCols - 1;
numRows = numRows - 1;
// center the grid around the origin. length of a size divided by two
doub... | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"gridChess",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"double",
"squareWidth",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"all",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// convert it int... | This target is composed of a checkered chess board like squares. Each corner of an interior square
touches an adjacent square, but the sides are separated. Only interior square corners provide
calibration points.
@param numRows Number of grid rows in the calibration target
@param numCols Number of grid columns in th... | [
"This",
"target",
"is",
"composed",
"of",
"a",
"checkered",
"chess",
"board",
"like",
"squares",
".",
"Each",
"corner",
"of",
"an",
"interior",
"square",
"touches",
"an",
"adjacent",
"square",
"but",
"the",
"sides",
"are",
"separated",
".",
"Only",
"interior... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java#L143-L164 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/impl/ImplSurfDescribeOps.java | ImplSurfDescribeOps.naiveGradient | public static <T extends ImageGray<T>>
void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod ,
int regionSize, double kernelSize,
boolean useHaar, double[] derivX, double derivY[])
{
SparseScaleGradient<T,?> gg = SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass());
gg... | java | public static <T extends ImageGray<T>>
void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod ,
int regionSize, double kernelSize,
boolean useHaar, double[] derivX, double derivY[])
{
SparseScaleGradient<T,?> gg = SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass());
gg... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"naiveGradient",
"(",
"T",
"ii",
",",
"double",
"tl_x",
",",
"double",
"tl_y",
",",
"double",
"samplePeriod",
",",
"int",
"regionSize",
",",
"double",
"kernelSize",
",",
"b... | Simple algorithm for computing the gradient of a region. Can handle image borders | [
"Simple",
"algorithm",
"for",
"computing",
"the",
"gradient",
"of",
"a",
"region",
".",
"Can",
"handle",
"image",
"borders"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/impl/ImplSurfDescribeOps.java#L161-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java | DescribeDenseSiftAlg.setImageGradient | public void setImageGradient(D derivX , D derivY ) {
InputSanityCheck.checkSameShape(derivX,derivY);
if( derivX.stride != derivY.stride || derivX.startIndex != derivY.startIndex )
throw new IllegalArgumentException("stride and start index must be the same");
savedAngle.reshape(derivX.width,derivX.height);
s... | java | public void setImageGradient(D derivX , D derivY ) {
InputSanityCheck.checkSameShape(derivX,derivY);
if( derivX.stride != derivY.stride || derivX.startIndex != derivY.startIndex )
throw new IllegalArgumentException("stride and start index must be the same");
savedAngle.reshape(derivX.width,derivX.height);
s... | [
"public",
"void",
"setImageGradient",
"(",
"D",
"derivX",
",",
"D",
"derivY",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"derivX",
",",
"derivY",
")",
";",
"if",
"(",
"derivX",
".",
"stride",
"!=",
"derivY",
".",
"stride",
"||",
"derivX",
... | Sets the gradient and precomputes pixel orientation and magnitude
@param derivX image derivative x-axis
@param derivY image derivative y-axis | [
"Sets",
"the",
"gradient",
"and",
"precomputes",
"pixel",
"orientation",
"and",
"magnitude"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L103-L115 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java | DescribeDenseSiftAlg.process | public void process() {
int width = widthSubregion*widthGrid;
int radius = width/2;
int X0 = radius,X1 = savedAngle.width-radius;
int Y0 = radius,Y1 = savedAngle.height-radius;
int numX = (int)((X1-X0)/periodColumns);
int numY = (int)((Y1-Y0)/periodRows);
descriptors.reset();
sampleLocations.reset()... | java | public void process() {
int width = widthSubregion*widthGrid;
int radius = width/2;
int X0 = radius,X1 = savedAngle.width-radius;
int Y0 = radius,Y1 = savedAngle.height-radius;
int numX = (int)((X1-X0)/periodColumns);
int numY = (int)((Y1-Y0)/periodRows);
descriptors.reset();
sampleLocations.reset()... | [
"public",
"void",
"process",
"(",
")",
"{",
"int",
"width",
"=",
"widthSubregion",
"*",
"widthGrid",
";",
"int",
"radius",
"=",
"width",
"/",
"2",
";",
"int",
"X0",
"=",
"radius",
",",
"X1",
"=",
"savedAngle",
".",
"width",
"-",
"radius",
";",
"int",... | Computes SIFT descriptors across the entire image | [
"Computes",
"SIFT",
"descriptors",
"across",
"the",
"entire",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L120-L146 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java | DescribeDenseSiftAlg.precomputeAngles | void precomputeAngles(D image) {
int savecIndex = 0;
for (int y = 0; y < image.height; y++) {
int pixelIndex = y*image.stride + image.startIndex;
for (int x = 0; x < image.width; x++, pixelIndex++, savecIndex++ ) {
float spacialDX = imageDerivX.getF(pixelIndex);
float spacialDY = imageDerivY.getF(pix... | java | void precomputeAngles(D image) {
int savecIndex = 0;
for (int y = 0; y < image.height; y++) {
int pixelIndex = y*image.stride + image.startIndex;
for (int x = 0; x < image.width; x++, pixelIndex++, savecIndex++ ) {
float spacialDX = imageDerivX.getF(pixelIndex);
float spacialDY = imageDerivY.getF(pix... | [
"void",
"precomputeAngles",
"(",
"D",
"image",
")",
"{",
"int",
"savecIndex",
"=",
"0",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"image",
".",
"height",
";",
"y",
"++",
")",
"{",
"int",
"pixelIndex",
"=",
"y",
"*",
"image",
".",
"s... | Computes the angle of each pixel and its gradient magnitude | [
"Computes",
"the",
"angle",
"of",
"each",
"pixel",
"and",
"its",
"gradient",
"magnitude"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L151-L164 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java | DescribeDenseSiftAlg.computeDescriptor | public void computeDescriptor( int cx , int cy , TupleDesc_F64 desc ) {
desc.fill(0);
int widthPixels = widthSubregion*widthGrid;
int radius = widthPixels/2;
for (int i = 0; i < widthPixels; i++) {
int angleIndex = (cy-radius+i)*savedAngle.width + (cx-radius);
float subY = i/(float)widthSubregion;
... | java | public void computeDescriptor( int cx , int cy , TupleDesc_F64 desc ) {
desc.fill(0);
int widthPixels = widthSubregion*widthGrid;
int radius = widthPixels/2;
for (int i = 0; i < widthPixels; i++) {
int angleIndex = (cy-radius+i)*savedAngle.width + (cx-radius);
float subY = i/(float)widthSubregion;
... | [
"public",
"void",
"computeDescriptor",
"(",
"int",
"cx",
",",
"int",
"cy",
",",
"TupleDesc_F64",
"desc",
")",
"{",
"desc",
".",
"fill",
"(",
"0",
")",
";",
"int",
"widthPixels",
"=",
"widthSubregion",
"*",
"widthGrid",
";",
"int",
"radius",
"=",
"widthPi... | Computes the descriptor centered at the specified coordinate
@param cx center of region x-axis
@param cy center of region y-axis
@param desc The descriptor | [
"Computes",
"the",
"descriptor",
"centered",
"at",
"the",
"specified",
"coordinate"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L172-L198 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/impl/ImplEdgeNonMaxSuppression_MT.java | ImplEdgeNonMaxSuppression_MT.naive4 | static public void naive4(GrayF32 _intensity , GrayS8 direction , GrayF32 output )
{
final int w = _intensity.width;
final int h = _intensity.height;
ImageBorder_F32 intensity = (ImageBorder_F32)FactoryImageBorderAlgs.value(_intensity, 0);
BoofConcurrency.loopFor(0,h,y->{
for( int x = 0; x < w; x++ ) {
... | java | static public void naive4(GrayF32 _intensity , GrayS8 direction , GrayF32 output )
{
final int w = _intensity.width;
final int h = _intensity.height;
ImageBorder_F32 intensity = (ImageBorder_F32)FactoryImageBorderAlgs.value(_intensity, 0);
BoofConcurrency.loopFor(0,h,y->{
for( int x = 0; x < w; x++ ) {
... | [
"static",
"public",
"void",
"naive4",
"(",
"GrayF32",
"_intensity",
",",
"GrayS8",
"direction",
",",
"GrayF32",
"output",
")",
"{",
"final",
"int",
"w",
"=",
"_intensity",
".",
"width",
";",
"final",
"int",
"h",
"=",
"_intensity",
".",
"height",
";",
"Im... | Slow algorithm which processes the whole image. | [
"Slow",
"algorithm",
"which",
"processes",
"the",
"whole",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/impl/ImplEdgeNonMaxSuppression_MT.java#L83-L118 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java | QrCode.reset | public void reset() {
for (int i = 0; i < 4; i++) {
ppCorner.get(i).set(0,0);
ppDown.get(i).set(0,0);
ppRight.get(i).set(0,0);
}
this.threshCorner = 0;
this.threshDown = 0;
this.threshRight = 0;
version = -1;
error = L;
mask = QrCodeMaskPattern.M111;
alignment.reset();
mode = Mode.UNKNOWN;
... | java | public void reset() {
for (int i = 0; i < 4; i++) {
ppCorner.get(i).set(0,0);
ppDown.get(i).set(0,0);
ppRight.get(i).set(0,0);
}
this.threshCorner = 0;
this.threshDown = 0;
this.threshRight = 0;
version = -1;
error = L;
mask = QrCodeMaskPattern.M111;
alignment.reset();
mode = Mode.UNKNOWN;
... | [
"public",
"void",
"reset",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"ppCorner",
".",
"get",
"(",
"i",
")",
".",
"set",
"(",
"0",
",",
"0",
")",
";",
"ppDown",
".",
"get",
"(",
"i",
"... | Resets the QR-Code so that it's in its initial state. | [
"Resets",
"the",
"QR",
"-",
"Code",
"so",
"that",
"it",
"s",
"in",
"its",
"initial",
"state",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java#L398-L416 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java | QrCode.set | public void set( QrCode o ) {
this.version = o.version;
this.error = o.error;
this.mask = o.mask;
this.mode = o.mode;
this.rawbits = o.rawbits == null ? null : o.rawbits.clone();
this.corrected = o.corrected == null ? null : o.corrected.clone();
this.message = o.message;
this.threshCorner = o.threshCorn... | java | public void set( QrCode o ) {
this.version = o.version;
this.error = o.error;
this.mask = o.mask;
this.mode = o.mode;
this.rawbits = o.rawbits == null ? null : o.rawbits.clone();
this.corrected = o.corrected == null ? null : o.corrected.clone();
this.message = o.message;
this.threshCorner = o.threshCorn... | [
"public",
"void",
"set",
"(",
"QrCode",
"o",
")",
"{",
"this",
".",
"version",
"=",
"o",
".",
"version",
";",
"this",
".",
"error",
"=",
"o",
".",
"error",
";",
"this",
".",
"mask",
"=",
"o",
".",
"mask",
";",
"this",
".",
"mode",
"=",
"o",
"... | Sets 'this' so that it's equivalent to 'o'.
@param o The target object | [
"Sets",
"this",
"so",
"that",
"it",
"s",
"equivalent",
"to",
"o",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java#L429-L450 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java | SelfCalibrationLinearRotationSingle.ensureDeterminantOfOne | public static void ensureDeterminantOfOne(List<Homography2D_F64> homography0toI) {
int N = homography0toI.size();
for (int i = 0; i < N; i++) {
Homography2D_F64 H = homography0toI.get(i);
double d = CommonOps_DDF3.det(H);
// System.out.println("Before = "+d);
if( d < 0 )
CommonOps_DDF3.divide(H,-Math... | java | public static void ensureDeterminantOfOne(List<Homography2D_F64> homography0toI) {
int N = homography0toI.size();
for (int i = 0; i < N; i++) {
Homography2D_F64 H = homography0toI.get(i);
double d = CommonOps_DDF3.det(H);
// System.out.println("Before = "+d);
if( d < 0 )
CommonOps_DDF3.divide(H,-Math... | [
"public",
"static",
"void",
"ensureDeterminantOfOne",
"(",
"List",
"<",
"Homography2D_F64",
">",
"homography0toI",
")",
"{",
"int",
"N",
"=",
"homography0toI",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
... | Scales all homographies so that their determinants are equal to one
@param homography0toI | [
"Scales",
"all",
"homographies",
"so",
"that",
"their",
"determinants",
"are",
"equal",
"to",
"one"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L107-L119 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java | SelfCalibrationLinearRotationSingle.extractCalibration | private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) {
double s = x.data[5];
double cx = calibration.cx = x.data[2]/s;
double cy = calibration.cy = x.data[4]/s;
double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy);
double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy;
calibra... | java | private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) {
double s = x.data[5];
double cx = calibration.cx = x.data[2]/s;
double cy = calibration.cy = x.data[4]/s;
double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy);
double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy;
calibra... | [
"private",
"boolean",
"extractCalibration",
"(",
"DMatrixRMaj",
"x",
",",
"CameraPinhole",
"calibration",
")",
"{",
"double",
"s",
"=",
"x",
".",
"data",
"[",
"5",
"]",
";",
"double",
"cx",
"=",
"calibration",
".",
"cx",
"=",
"x",
".",
"data",
"[",
"2"... | Extracts camera parameters from the solution. Checks for errors | [
"Extracts",
"camera",
"parameters",
"from",
"the",
"solution",
".",
"Checks",
"for",
"errors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L123-L139 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java | FactoryWaveletDaub.computeBorderCoefficients | private static WlBorderCoef<WlCoef_F32> computeBorderCoefficients( BorderIndex1D border ,
WlCoef_F32 forward ,
WlCoef_F32 inverse ) {
int N = Math.max(forward.getScalingLength(),forward.getWaveletLength());
N += N%2;
N *= 2;
border.setLength(N);
// Because the wavelet ... | java | private static WlBorderCoef<WlCoef_F32> computeBorderCoefficients( BorderIndex1D border ,
WlCoef_F32 forward ,
WlCoef_F32 inverse ) {
int N = Math.max(forward.getScalingLength(),forward.getWaveletLength());
N += N%2;
N *= 2;
border.setLength(N);
// Because the wavelet ... | [
"private",
"static",
"WlBorderCoef",
"<",
"WlCoef_F32",
">",
"computeBorderCoefficients",
"(",
"BorderIndex1D",
"border",
",",
"WlCoef_F32",
"forward",
",",
"WlCoef_F32",
"inverse",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"max",
"(",
"forward",
".",
"getScalingL... | Computes inverse coefficients
@param border
@param forward Forward coefficients.
@param inverse Inverse used in the inner portion of the data stream.
@return | [
"Computes",
"inverse",
"coefficients"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java#L182-L231 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java | FactoryWaveletDaub.convertToInt | public static WlBorderCoefFixed<WlCoef_I32> convertToInt( WlBorderCoefFixed<WlCoef_F32> orig ,
WlCoef_I32 inner ) {
WlBorderCoefFixed<WlCoef_I32> ret =
new WlBorderCoefFixed<>(orig.getLowerLength(), orig.getUpperLength());
for( int i = 0; i < orig.getLowerLength(); i++ ) {
WlCoef_F32 o = or... | java | public static WlBorderCoefFixed<WlCoef_I32> convertToInt( WlBorderCoefFixed<WlCoef_F32> orig ,
WlCoef_I32 inner ) {
WlBorderCoefFixed<WlCoef_I32> ret =
new WlBorderCoefFixed<>(orig.getLowerLength(), orig.getUpperLength());
for( int i = 0; i < orig.getLowerLength(); i++ ) {
WlCoef_F32 o = or... | [
"public",
"static",
"WlBorderCoefFixed",
"<",
"WlCoef_I32",
">",
"convertToInt",
"(",
"WlBorderCoefFixed",
"<",
"WlCoef_F32",
">",
"orig",
",",
"WlCoef_I32",
"inner",
")",
"{",
"WlBorderCoefFixed",
"<",
"WlCoef_I32",
">",
"ret",
"=",
"new",
"WlBorderCoefFixed",
"<... | todo rename and move to a utility function? | [
"todo",
"rename",
"and",
"move",
"to",
"a",
"utility",
"function?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java#L351-L372 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java | BackgroundGmmCommon.updateMixture | public int updateMixture( float[] pixelValue , float[] dataRow , int modelIndex ) {
// see which gaussian is the best fit based on Mahalanobis distance
int index = modelIndex;
float bestDistance = maxDistance*numBands;
int bestIndex=-1;
int ng; // number of gaussians in use
for (ng = 0; ng < maxGaussians;... | java | public int updateMixture( float[] pixelValue , float[] dataRow , int modelIndex ) {
// see which gaussian is the best fit based on Mahalanobis distance
int index = modelIndex;
float bestDistance = maxDistance*numBands;
int bestIndex=-1;
int ng; // number of gaussians in use
for (ng = 0; ng < maxGaussians;... | [
"public",
"int",
"updateMixture",
"(",
"float",
"[",
"]",
"pixelValue",
",",
"float",
"[",
"]",
"dataRow",
",",
"int",
"modelIndex",
")",
"{",
"// see which gaussian is the best fit based on Mahalanobis distance",
"int",
"index",
"=",
"modelIndex",
";",
"float",
"be... | Updates the mixtures of gaussian and determines if the pixel matches the background model
@return true if it matches the background or false if not | [
"Updates",
"the",
"mixtures",
"of",
"gaussian",
"and",
"determines",
"if",
"the",
"pixel",
"matches",
"the",
"background",
"model"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L112-L183 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java | BackgroundGmmCommon.updateWeightAndPrune | public void updateWeightAndPrune(float[] dataRow, int modelIndex, int ng, int bestIndex, float bestWeight) {
int index = modelIndex;
float weightTotal = 0;
for (int i = 0; i < ng; ) {
float weight = dataRow[index];
// if( ng > 1 )
// System.out.println("["+i+"] = "+ng+" weight "+weight);
weight = wei... | java | public void updateWeightAndPrune(float[] dataRow, int modelIndex, int ng, int bestIndex, float bestWeight) {
int index = modelIndex;
float weightTotal = 0;
for (int i = 0; i < ng; ) {
float weight = dataRow[index];
// if( ng > 1 )
// System.out.println("["+i+"] = "+ng+" weight "+weight);
weight = wei... | [
"public",
"void",
"updateWeightAndPrune",
"(",
"float",
"[",
"]",
"dataRow",
",",
"int",
"modelIndex",
",",
"int",
"ng",
",",
"int",
"bestIndex",
",",
"float",
"bestWeight",
")",
"{",
"int",
"index",
"=",
"modelIndex",
";",
"float",
"weightTotal",
"=",
"0"... | Updates the weight of each Gaussian and prunes one which have a negative weight after the update. | [
"Updates",
"the",
"weight",
"of",
"each",
"Gaussian",
"and",
"prunes",
"one",
"which",
"have",
"a",
"negative",
"weight",
"after",
"the",
"update",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L188-L234 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java | BackgroundGmmCommon.checkBackground | public int checkBackground( float[] pixelValue , float[] dataRow , int modelIndex ) {
// see which gaussian is the best fit based on Mahalanobis distance
int index = modelIndex;
float bestDistance = maxDistance*numBands;
float bestWeight = 0;
int ng; // number of gaussians in use
for (ng = 0; ng < maxGaus... | java | public int checkBackground( float[] pixelValue , float[] dataRow , int modelIndex ) {
// see which gaussian is the best fit based on Mahalanobis distance
int index = modelIndex;
float bestDistance = maxDistance*numBands;
float bestWeight = 0;
int ng; // number of gaussians in use
for (ng = 0; ng < maxGaus... | [
"public",
"int",
"checkBackground",
"(",
"float",
"[",
"]",
"pixelValue",
",",
"float",
"[",
"]",
"dataRow",
",",
"int",
"modelIndex",
")",
"{",
"// see which gaussian is the best fit based on Mahalanobis distance",
"int",
"index",
"=",
"modelIndex",
";",
"float",
"... | Checks to see if the the pivel value refers to the background or foreground
@return true for background or false for foreground | [
"Checks",
"to",
"see",
"if",
"the",
"the",
"pivel",
"value",
"refers",
"to",
"the",
"background",
"or",
"foreground"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L311-L341 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java | ConvertYuv420_888.yuvToGray | public static <T extends ImageGray<T>>
T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType )
{
if( outputType == GrayU8.class ) {
return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output);
} else if( outputType == GrayF32.cla... | java | public static <T extends ImageGray<T>>
T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType )
{
if( outputType == GrayU8.class ) {
return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output);
} else if( outputType == GrayF32.cla... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"yuvToGray",
"(",
"ByteBuffer",
"bufferY",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"strideRow",
",",
"T",
"output",
",",
"BWorkArrays",
"workArrays",
",",
"Clas... | Converts an YUV 420 888 into gray
@param output Output: Optional storage for output image. Can be null.
@param outputType Output: Type of output image
@param <T> Output image type
@return Gray scale image | [
"Converts",
"an",
"YUV",
"420",
"888",
"into",
"gray"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java#L111-L121 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/shapes/DetectBlackShapeAppBase.java | DetectBlackShapeAppBase.requestSaveInputImage | public void requestSaveInputImage() {
saveRequested = false;
switch( inputMethod ) {
case IMAGE:
new Thread(() -> saveInputImage()).start();
break;
case VIDEO:
case WEBCAM:
if( streamPaused ) {
saveInputImage();
} else {
saveRequested = true;
}
break;
}
} | java | public void requestSaveInputImage() {
saveRequested = false;
switch( inputMethod ) {
case IMAGE:
new Thread(() -> saveInputImage()).start();
break;
case VIDEO:
case WEBCAM:
if( streamPaused ) {
saveInputImage();
} else {
saveRequested = true;
}
break;
}
} | [
"public",
"void",
"requestSaveInputImage",
"(",
")",
"{",
"saveRequested",
"=",
"false",
";",
"switch",
"(",
"inputMethod",
")",
"{",
"case",
"IMAGE",
":",
"new",
"Thread",
"(",
"(",
")",
"->",
"saveInputImage",
"(",
")",
")",
".",
"start",
"(",
")",
"... | Makes a request that the input image be saved. This request might be carried out immediately
or when then next image is processed. | [
"Makes",
"a",
"request",
"that",
"the",
"input",
"image",
"be",
"saved",
".",
"This",
"request",
"might",
"be",
"carried",
"out",
"immediately",
"or",
"when",
"then",
"next",
"image",
"is",
"processed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/shapes/DetectBlackShapeAppBase.java#L170-L186 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/Se3FromEssentialGenerator.java | Se3FromEssentialGenerator.generate | @Override
public boolean generate(List<AssociatedPair> dataSet, Se3_F64 model ) {
if( !computeEssential.process(dataSet,E) )
return false;
// extract the possible motions
decomposeE.decompose(E);
selectBest.select(decomposeE.getSolutions(),dataSet,model);
return true;
} | java | @Override
public boolean generate(List<AssociatedPair> dataSet, Se3_F64 model ) {
if( !computeEssential.process(dataSet,E) )
return false;
// extract the possible motions
decomposeE.decompose(E);
selectBest.select(decomposeE.getSolutions(),dataSet,model);
return true;
} | [
"@",
"Override",
"public",
"boolean",
"generate",
"(",
"List",
"<",
"AssociatedPair",
">",
"dataSet",
",",
"Se3_F64",
"model",
")",
"{",
"if",
"(",
"!",
"computeEssential",
".",
"process",
"(",
"dataSet",
",",
"E",
")",
")",
"return",
"false",
";",
"// e... | Computes the camera motion from the set of observations. The motion is from the first
into the second camera frame.
@param dataSet Associated pairs in normalized camera coordinates.
@param model The best pose according to the positive depth constraint. | [
"Computes",
"the",
"camera",
"motion",
"from",
"the",
"set",
"of",
"observations",
".",
"The",
"motion",
"is",
"from",
"the",
"first",
"into",
"the",
"second",
"camera",
"frame",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/Se3FromEssentialGenerator.java#L69-L79 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.setCameraParameters | public void setCameraParameters( float fx , float fy , float cx , float cy ,
int width , int height ) {
this.fx = fx;
this.fy = fy;
this.cx = cx;
this.cy = cy;
derivX.reshape(width, height);
derivY.reshape(width, height);
// set these to the maximum possible size
int N = width*height*imageTy... | java | public void setCameraParameters( float fx , float fy , float cx , float cy ,
int width , int height ) {
this.fx = fx;
this.fy = fy;
this.cx = cx;
this.cy = cy;
derivX.reshape(width, height);
derivY.reshape(width, height);
// set these to the maximum possible size
int N = width*height*imageTy... | [
"public",
"void",
"setCameraParameters",
"(",
"float",
"fx",
",",
"float",
"fy",
",",
"float",
"cx",
",",
"float",
"cy",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"this",
".",
"fx",
"=",
"fx",
";",
"this",
".",
"fy",
"=",
"fy",
";",
"t... | Specifies intrinsic camera parameters. Must be called.
@param fx focal length x (pixels)
@param fy focal length y (pixels)
@param cx principle point x (pixels)
@param cy principle point y (pixels)
@param width Width of the image
@param height Height of the image | [
"Specifies",
"intrinsic",
"camera",
"parameters",
".",
"Must",
"be",
"called",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L143-L157 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.setInterpolation | public void setInterpolation( double inputMin , double inputMax, double derivMin , double derivMax ,
InterpolationType type) {
interpI = FactoryInterpolation.createPixelS(inputMin,inputMax,type, BorderType.EXTENDED, imageType.getImageClass());
interpDX = FactoryInterpolation.createPixelS(derivMin,derivMax... | java | public void setInterpolation( double inputMin , double inputMax, double derivMin , double derivMax ,
InterpolationType type) {
interpI = FactoryInterpolation.createPixelS(inputMin,inputMax,type, BorderType.EXTENDED, imageType.getImageClass());
interpDX = FactoryInterpolation.createPixelS(derivMin,derivMax... | [
"public",
"void",
"setInterpolation",
"(",
"double",
"inputMin",
",",
"double",
"inputMax",
",",
"double",
"derivMin",
",",
"double",
"derivMax",
",",
"InterpolationType",
"type",
")",
"{",
"interpI",
"=",
"FactoryInterpolation",
".",
"createPixelS",
"(",
"inputMi... | Used to change interpolation method. Probably don't want to do this.
@param inputMin min value for input pixels. 0 is typical
@param inputMax max value for input pixels. 255 is typical
@param derivMin min value for the derivative of input pixels
@param derivMax max value for the derivative of input pixels
@param type ... | [
"Used",
"to",
"change",
"interpolation",
"method",
".",
"Probably",
"don",
"t",
"want",
"to",
"do",
"this",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L167-L172 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.setKeyFrame | void setKeyFrame(Planar<I> input, ImagePixelTo3D pixelTo3D) {
InputSanityCheck.checkSameShape(derivX,input);
wrapI.wrap(input);
keypixels.reset();
for (int y = 0; y < input.height; y++) {
for (int x = 0; x < input.width; x++) {
// See if there's a valid 3D point at this location
if( !pixelTo3D.proce... | java | void setKeyFrame(Planar<I> input, ImagePixelTo3D pixelTo3D) {
InputSanityCheck.checkSameShape(derivX,input);
wrapI.wrap(input);
keypixels.reset();
for (int y = 0; y < input.height; y++) {
for (int x = 0; x < input.width; x++) {
// See if there's a valid 3D point at this location
if( !pixelTo3D.proce... | [
"void",
"setKeyFrame",
"(",
"Planar",
"<",
"I",
">",
"input",
",",
"ImagePixelTo3D",
"pixelTo3D",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"derivX",
",",
"input",
")",
";",
"wrapI",
".",
"wrap",
"(",
"input",
")",
";",
"keypixels",
".",
... | Set's the keyframe. This is the image which motion is estimated relative to. The 3D location of points in
the keyframe must be known.
@param input Image which is to be used as the key frame
@param pixelTo3D Used to compute 3D points from pixels in key frame | [
"Set",
"s",
"the",
"keyframe",
".",
"This",
"is",
"the",
"image",
"which",
"motion",
"is",
"estimated",
"relative",
"to",
".",
"The",
"3D",
"location",
"of",
"points",
"in",
"the",
"keyframe",
"must",
"be",
"known",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L192-L223 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.computeFeatureDiversity | public double computeFeatureDiversity(Se3_F32 keyToCurrent ) {
diversity.reset();
for (int i = 0; i < keypixels.size(); i++) {
Pixel p = keypixels.data[i];
if( !p.valid )
continue;
SePointOps_F32.transform(keyToCurrent, p.p3, S);
diversity.addPoint(S.x, S.y, S.z);
}
diversity.process();
re... | java | public double computeFeatureDiversity(Se3_F32 keyToCurrent ) {
diversity.reset();
for (int i = 0; i < keypixels.size(); i++) {
Pixel p = keypixels.data[i];
if( !p.valid )
continue;
SePointOps_F32.transform(keyToCurrent, p.p3, S);
diversity.addPoint(S.x, S.y, S.z);
}
diversity.process();
re... | [
"public",
"double",
"computeFeatureDiversity",
"(",
"Se3_F32",
"keyToCurrent",
")",
"{",
"diversity",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"keypixels",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Pixel",... | Computes the diversity of valid pixels in keyframe to the location in the current frame.
@return Angular spread along the smallest axis in radians | [
"Computes",
"the",
"diversity",
"of",
"valid",
"pixels",
"in",
"keyframe",
"to",
"the",
"location",
"in",
"the",
"current",
"frame",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L229-L244 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.estimateMotion | public boolean estimateMotion(Planar<I> input , Se3_F32 hintKeyToInput ) {
InputSanityCheck.checkSameShape(derivX,input);
initMotion(input);
keyToCurrent.set(hintKeyToInput);
boolean foundSolution = false;
float previousError = Float.MAX_VALUE;
for (int i = 0; i < maxIterations; i++) {
constructLinearS... | java | public boolean estimateMotion(Planar<I> input , Se3_F32 hintKeyToInput ) {
InputSanityCheck.checkSameShape(derivX,input);
initMotion(input);
keyToCurrent.set(hintKeyToInput);
boolean foundSolution = false;
float previousError = Float.MAX_VALUE;
for (int i = 0; i < maxIterations; i++) {
constructLinearS... | [
"public",
"boolean",
"estimateMotion",
"(",
"Planar",
"<",
"I",
">",
"input",
",",
"Se3_F32",
"hintKeyToInput",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"derivX",
",",
"input",
")",
";",
"initMotion",
"(",
"input",
")",
";",
"keyToCurrent",
... | Estimates the motion relative to the key frame.
@param input Next image in the sequence
@param hintKeyToInput estimated transform from keyframe to the current input image
@return true if it was successful at estimating the motion or false if it failed for some reason | [
"Estimates",
"the",
"motion",
"relative",
"to",
"the",
"key",
"frame",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L252-L276 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java | VisOdomDirectColorDepth.initMotion | void initMotion(Planar<I> input) {
if( solver == null ) {
solver = LinearSolverFactory_DDRM.qr(input.width*input.height*input.getNumBands(),6);
}
// compute image derivative and setup interpolation functions
computeD.process(input,derivX,derivY);
} | java | void initMotion(Planar<I> input) {
if( solver == null ) {
solver = LinearSolverFactory_DDRM.qr(input.width*input.height*input.getNumBands(),6);
}
// compute image derivative and setup interpolation functions
computeD.process(input,derivX,derivY);
} | [
"void",
"initMotion",
"(",
"Planar",
"<",
"I",
">",
"input",
")",
"{",
"if",
"(",
"solver",
"==",
"null",
")",
"{",
"solver",
"=",
"LinearSolverFactory_DDRM",
".",
"qr",
"(",
"input",
".",
"width",
"*",
"input",
".",
"height",
"*",
"input",
".",
"get... | Initialize motion related data structures | [
"Initialize",
"motion",
"related",
"data",
"structures"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L281-L288 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java | EssentialNister5.process | public boolean process( List<AssociatedPair> points , FastQueue<DMatrixRMaj> solutions ) {
if( points.size() != 5 )
throw new IllegalArgumentException("Exactly 5 points are required, not "+points.size());
solutions.reset();
// Computes the 4-vector span which contains E. See equations 7-9
computeSpan(point... | java | public boolean process( List<AssociatedPair> points , FastQueue<DMatrixRMaj> solutions ) {
if( points.size() != 5 )
throw new IllegalArgumentException("Exactly 5 points are required, not "+points.size());
solutions.reset();
// Computes the 4-vector span which contains E. See equations 7-9
computeSpan(point... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"FastQueue",
"<",
"DMatrixRMaj",
">",
"solutions",
")",
"{",
"if",
"(",
"points",
".",
"size",
"(",
")",
"!=",
"5",
")",
"throw",
"new",
"IllegalArgumentException",
"("... | Computes the essential matrix from point correspondences.
@param points Input: List of points correspondences in normalized image coordinates
@param solutions Output: Storage for the found solutions. .
@return true for success or false if a fault has been detected | [
"Computes",
"the",
"essential",
"matrix",
"from",
"point",
"correspondences",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java#L104-L142 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java | EssentialNister5.solveForXandY | private void solveForXandY( double z ) {
this.z = z;
// solve for x and y using the first two rows of B
tmpA.data[0] = ((helper.K00*z + helper.K01)*z + helper.K02)*z + helper.K03;
tmpA.data[1] = ((helper.K04*z + helper.K05)*z + helper.K06)*z + helper.K07;
tmpY.data[0] = (((helper.K08*z + helper.K09)*z + help... | java | private void solveForXandY( double z ) {
this.z = z;
// solve for x and y using the first two rows of B
tmpA.data[0] = ((helper.K00*z + helper.K01)*z + helper.K02)*z + helper.K03;
tmpA.data[1] = ((helper.K04*z + helper.K05)*z + helper.K06)*z + helper.K07;
tmpY.data[0] = (((helper.K08*z + helper.K09)*z + help... | [
"private",
"void",
"solveForXandY",
"(",
"double",
"z",
")",
"{",
"this",
".",
"z",
"=",
"z",
";",
"// solve for x and y using the first two rows of B",
"tmpA",
".",
"data",
"[",
"0",
"]",
"=",
"(",
"(",
"helper",
".",
"K00",
"*",
"z",
"+",
"helper",
"."... | Once z is known then x and y can be solved for using the B matrix | [
"Once",
"z",
"is",
"known",
"then",
"x",
"and",
"y",
"can",
"be",
"solved",
"for",
"using",
"the",
"B",
"matrix"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java#L189-L210 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java | StereoConsistencyCheck.checkPixel | public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) {
leftImageToRect.compute(left.x,left.y,rectLeft);
rightImageToRect.compute(right.x, right.y, rectRight);
return checkRectified(rectLeft,rectRight);
} | java | public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) {
leftImageToRect.compute(left.x,left.y,rectLeft);
rightImageToRect.compute(right.x, right.y, rectRight);
return checkRectified(rectLeft,rectRight);
} | [
"public",
"boolean",
"checkPixel",
"(",
"Point2D_F64",
"left",
",",
"Point2D_F64",
"right",
")",
"{",
"leftImageToRect",
".",
"compute",
"(",
"left",
".",
"x",
",",
"left",
".",
"y",
",",
"rectLeft",
")",
";",
"rightImageToRect",
".",
"compute",
"(",
"righ... | Checks to see if the observations from the left and right camera are consistent. Observations
are assumed to be in the original image pixel coordinates.
@param left Left camera observation in original pixels
@param right Right camera observation in original pixels
@return true for consistent | [
"Checks",
"to",
"see",
"if",
"the",
"observations",
"from",
"the",
"left",
"and",
"right",
"camera",
"are",
"consistent",
".",
"Observations",
"are",
"assumed",
"to",
"be",
"in",
"the",
"original",
"image",
"pixel",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java#L87-L92 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java | StereoConsistencyCheck.checkRectified | public boolean checkRectified( Point2D_F64 left , Point2D_F64 right ) {
// rectifications should make them appear along the same y-coordinate/epipolar line
if( Math.abs(left.y - right.y) > toleranceY )
return false;
// features in the right camera should appear left of features in the image image
return rig... | java | public boolean checkRectified( Point2D_F64 left , Point2D_F64 right ) {
// rectifications should make them appear along the same y-coordinate/epipolar line
if( Math.abs(left.y - right.y) > toleranceY )
return false;
// features in the right camera should appear left of features in the image image
return rig... | [
"public",
"boolean",
"checkRectified",
"(",
"Point2D_F64",
"left",
",",
"Point2D_F64",
"right",
")",
"{",
"// rectifications should make them appear along the same y-coordinate/epipolar line",
"if",
"(",
"Math",
".",
"abs",
"(",
"left",
".",
"y",
"-",
"right",
".",
"y... | Checks to see if the observations from the left and right camera are consistent. Observations
are assumed to be in the rectified image pixel coordinates.
@param left Left camera observation in rectified pixels
@param right Right camera observation in rectified pixels
@return true for consistent | [
"Checks",
"to",
"see",
"if",
"the",
"observations",
"from",
"the",
"left",
"and",
"right",
"camera",
"are",
"consistent",
".",
"Observations",
"are",
"assumed",
"to",
"be",
"in",
"the",
"rectified",
"image",
"pixel",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java#L102-L109 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribePointAlgs.java | FactoryDescribePointAlgs.briefso | public static <T extends ImageGray<T>>
DescribePointBriefSO<T> briefso(BinaryCompareDefinition_I32 definition, BlurFilter<T> filterBlur) {
Class<T> imageType = filterBlur.getInputType().getImageClass();
InterpolatePixelS<T> interp = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
return ne... | java | public static <T extends ImageGray<T>>
DescribePointBriefSO<T> briefso(BinaryCompareDefinition_I32 definition, BlurFilter<T> filterBlur) {
Class<T> imageType = filterBlur.getInputType().getImageClass();
InterpolatePixelS<T> interp = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
return ne... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"DescribePointBriefSO",
"<",
"T",
">",
"briefso",
"(",
"BinaryCompareDefinition_I32",
"definition",
",",
"BlurFilter",
"<",
"T",
">",
"filterBlur",
")",
"{",
"Class",
"<",
"T",
">",
... | todo remove filterBlur for all BRIEF change to radius,sigma,type | [
"todo",
"remove",
"filterBlur",
"for",
"all",
"BRIEF",
"change",
"to",
"radius",
"sigma",
"type"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/describe/FactoryDescribePointAlgs.java#L91-L98 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.checkVariance | public boolean checkVariance( ImageRectangle r ) {
double sigma2 = computeVariance(r.x0,r.y0,r.x1,r.y1);
return sigma2 >= thresholdLower;
} | java | public boolean checkVariance( ImageRectangle r ) {
double sigma2 = computeVariance(r.x0,r.y0,r.x1,r.y1);
return sigma2 >= thresholdLower;
} | [
"public",
"boolean",
"checkVariance",
"(",
"ImageRectangle",
"r",
")",
"{",
"double",
"sigma2",
"=",
"computeVariance",
"(",
"r",
".",
"x0",
",",
"r",
".",
"y0",
",",
"r",
".",
"x1",
",",
"r",
".",
"y1",
")",
";",
"return",
"sigma2",
">=",
"threshold... | Performs variance test at the specified rectangle
@return true if it passes and false if not | [
"Performs",
"variance",
"test",
"at",
"the",
"specified",
"rectangle"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L94-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.computeVariance | protected double computeVariance(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_unsafe(integral, x0 - 1, ... | java | protected double computeVariance(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_unsafe(integral, x0 - 1, ... | [
"protected",
"double",
"computeVariance",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"// can use unsafe operations here since x0 > 0 and y0 > 0",
"double",
"square",
"=",
"GIntegralImageOps",
".",
"block_unsafe",
"(",
"integral... | Computes the variance inside the specified rectangle. x0 and y0 must be > 0.
@return variance | [
"Computes",
"the",
"variance",
"inside",
"the",
"specified",
"rectangle",
".",
"x0",
"and",
"y0",
"must",
"be",
">",
";",
"0",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L106-L114 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.computeVarianceSafe | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_zero(integral, x0 - 1, ... | java | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_zero(integral, x0 - 1, ... | [
"protected",
"double",
"computeVarianceSafe",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"// can use unsafe operations here since x0 > 0 and y0 > 0",
"double",
"square",
"=",
"GIntegralImageOps",
".",
"block_zero",
"(",
"integr... | Computes the variance inside the specified rectangle.
@return variance | [
"Computes",
"the",
"variance",
"inside",
"the",
"specified",
"rectangle",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L120-L128 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.transformSq | public static void transformSq(final GrayU8 input , final GrayS64 transformed )
{
int indexSrc = input.startIndex;
int indexDst = transformed.startIndex;
int end = indexSrc + input.width;
long total = 0;
for( ; indexSrc < end; indexSrc++ ) {
int value = input.data[indexSrc]& 0xFF;
transformed.data[ind... | java | public static void transformSq(final GrayU8 input , final GrayS64 transformed )
{
int indexSrc = input.startIndex;
int indexDst = transformed.startIndex;
int end = indexSrc + input.width;
long total = 0;
for( ; indexSrc < end; indexSrc++ ) {
int value = input.data[indexSrc]& 0xFF;
transformed.data[ind... | [
"public",
"static",
"void",
"transformSq",
"(",
"final",
"GrayU8",
"input",
",",
"final",
"GrayS64",
"transformed",
")",
"{",
"int",
"indexSrc",
"=",
"input",
".",
"startIndex",
";",
"int",
"indexDst",
"=",
"transformed",
".",
"startIndex",
";",
"int",
"end"... | Integral image of pixel value squared. integer | [
"Integral",
"image",
"of",
"pixel",
"value",
"squared",
".",
"integer"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L133-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.transformSq | public static void transformSq(final GrayF32 input , final GrayF64 transformed )
{
int indexSrc = input.startIndex;
int indexDst = transformed.startIndex;
int end = indexSrc + input.width;
double total = 0;
for( ; indexSrc < end; indexSrc++ ) {
float value = input.data[indexSrc];
transformed.data[inde... | java | public static void transformSq(final GrayF32 input , final GrayF64 transformed )
{
int indexSrc = input.startIndex;
int indexDst = transformed.startIndex;
int end = indexSrc + input.width;
double total = 0;
for( ; indexSrc < end; indexSrc++ ) {
float value = input.data[indexSrc];
transformed.data[inde... | [
"public",
"static",
"void",
"transformSq",
"(",
"final",
"GrayF32",
"input",
",",
"final",
"GrayF64",
"transformed",
")",
"{",
"int",
"indexSrc",
"=",
"input",
".",
"startIndex",
";",
"int",
"indexDst",
"=",
"transformed",
".",
"startIndex",
";",
"int",
"end... | Integral image of pixel value squared. floating point | [
"Integral",
"image",
"of",
"pixel",
"value",
"squared",
".",
"floating",
"point"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L164-L190 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/TriangulateProjectiveLinearDLT.java | TriangulateProjectiveLinearDLT.addView | private int addView( DMatrixRMaj P , Point2D_F64 a , int index ) {
final double sx = stats.stdX, sy = stats.stdY;
// final double cx = stats.meanX, cy = stats.meanY;
// Easier to read the code when P is broken up this way
double r11 = P.data[0], r12 = P.data[1], r13 = P.data[2], r14=P.data[3];
double r21 =... | java | private int addView( DMatrixRMaj P , Point2D_F64 a , int index ) {
final double sx = stats.stdX, sy = stats.stdY;
// final double cx = stats.meanX, cy = stats.meanY;
// Easier to read the code when P is broken up this way
double r11 = P.data[0], r12 = P.data[1], r13 = P.data[2], r14=P.data[3];
double r21 =... | [
"private",
"int",
"addView",
"(",
"DMatrixRMaj",
"P",
",",
"Point2D_F64",
"a",
",",
"int",
"index",
")",
"{",
"final",
"double",
"sx",
"=",
"stats",
".",
"stdX",
",",
"sy",
"=",
"stats",
".",
"stdY",
";",
"//\t\tfinal double cx = stats.meanX, cy = stats.meanY;... | Adds a view to the A matrix. Computed using cross product. | [
"Adds",
"a",
"view",
"to",
"the",
"A",
"matrix",
".",
"Computed",
"using",
"cross",
"product",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/TriangulateProjectiveLinearDLT.java#L111-L140 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java | TldDetection.detectionCascade | protected void detectionCascade( FastQueue<ImageRectangle> cascadeRegions ) {
// initialize data structures
success = false;
ambiguous = false;
best = null;
candidateDetections.reset();
localMaximums.reset();
ambiguousRegions.clear();
storageMetric.reset();
storageIndexes.reset();
storageRect.clea... | java | protected void detectionCascade( FastQueue<ImageRectangle> cascadeRegions ) {
// initialize data structures
success = false;
ambiguous = false;
best = null;
candidateDetections.reset();
localMaximums.reset();
ambiguousRegions.clear();
storageMetric.reset();
storageIndexes.reset();
storageRect.clea... | [
"protected",
"void",
"detectionCascade",
"(",
"FastQueue",
"<",
"ImageRectangle",
">",
"cascadeRegions",
")",
"{",
"// initialize data structures",
"success",
"=",
"false",
";",
"ambiguous",
"=",
"false",
";",
"best",
"=",
"null",
";",
"candidateDetections",
".",
... | Detects the object inside the image. Eliminates candidate regions using a cascade of tests | [
"Detects",
"the",
"object",
"inside",
"the",
"image",
".",
"Eliminates",
"candidate",
"regions",
"using",
"a",
"cascade",
"of",
"tests"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java#L95-L160 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java | TldDetection.computeTemplateConfidence | protected void computeTemplateConfidence() {
double max = 0;
for( int i = 0; i < fernRegions.size(); i++ ) {
ImageRectangle region = fernRegions.get(i);
double confidence = template.computeConfidence(region);
max = Math.max(max,confidence);
if( confidence < config.confidenceThresholdUpper)
contin... | java | protected void computeTemplateConfidence() {
double max = 0;
for( int i = 0; i < fernRegions.size(); i++ ) {
ImageRectangle region = fernRegions.get(i);
double confidence = template.computeConfidence(region);
max = Math.max(max,confidence);
if( confidence < config.confidenceThresholdUpper)
contin... | [
"protected",
"void",
"computeTemplateConfidence",
"(",
")",
"{",
"double",
"max",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fernRegions",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"ImageRectangle",
"region",
"=",
"fernRe... | Computes the confidence for all the regions which pass the fern test | [
"Computes",
"the",
"confidence",
"for",
"all",
"the",
"regions",
"which",
"pass",
"the",
"fern",
"test"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java#L165-L181 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java | TldDetection.selectBestRegionsFern | protected void selectBestRegionsFern(double totalP, double totalN) {
for( int i = 0; i < fernInfo.size; i++ ) {
TldRegionFernInfo info = fernInfo.get(i);
double probP = info.sumP/totalP;
double probN = info.sumN/totalN;
// only consider regions with a higher P likelihood
if( probP > probN ) {
//... | java | protected void selectBestRegionsFern(double totalP, double totalN) {
for( int i = 0; i < fernInfo.size; i++ ) {
TldRegionFernInfo info = fernInfo.get(i);
double probP = info.sumP/totalP;
double probN = info.sumN/totalN;
// only consider regions with a higher P likelihood
if( probP > probN ) {
//... | [
"protected",
"void",
"selectBestRegionsFern",
"(",
"double",
"totalP",
",",
"double",
"totalN",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fernInfo",
".",
"size",
";",
"i",
"++",
")",
"{",
"TldRegionFernInfo",
"info",
"=",
"fernInfo",
... | compute the probability that each region is the target conditional upon this image
the sumP and sumN are needed for image conditional probability
NOTE: This is a big change from the original paper | [
"compute",
"the",
"probability",
"that",
"each",
"region",
"is",
"the",
"target",
"conditional",
"upon",
"this",
"image",
"the",
"sumP",
"and",
"sumN",
"are",
"needed",
"for",
"image",
"conditional",
"probability"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldDetection.java#L189-L217 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/PyramidKltTracker.java | PyramidKltTracker.setImage | public void setImage(ImagePyramid<InputImage> image,
DerivativeImage[] derivX, DerivativeImage[] derivY) {
if( image.getNumLayers() != derivX.length || image.getNumLayers() != derivY.length )
throw new IllegalArgumentException("Number of layers does not match.");
this.image = image;
this.derivX = deriv... | java | public void setImage(ImagePyramid<InputImage> image,
DerivativeImage[] derivX, DerivativeImage[] derivY) {
if( image.getNumLayers() != derivX.length || image.getNumLayers() != derivY.length )
throw new IllegalArgumentException("Number of layers does not match.");
this.image = image;
this.derivX = deriv... | [
"public",
"void",
"setImage",
"(",
"ImagePyramid",
"<",
"InputImage",
">",
"image",
",",
"DerivativeImage",
"[",
"]",
"derivX",
",",
"DerivativeImage",
"[",
"]",
"derivY",
")",
"{",
"if",
"(",
"image",
".",
"getNumLayers",
"(",
")",
"!=",
"derivX",
".",
... | Sets the current input images for the tracker to use.
@param image Original image pyramid.
@param derivX Derivative along x-axis.
@param derivY Derivative along y-axis. | [
"Sets",
"the",
"current",
"input",
"images",
"for",
"the",
"tracker",
"to",
"use",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/PyramidKltTracker.java#L79-L87 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/PyramidKltTracker.java | PyramidKltTracker.setImage | public void setImage(ImagePyramid<InputImage> image ) {
this.image = image;
this.derivX = null;
this.derivY = null;
} | java | public void setImage(ImagePyramid<InputImage> image ) {
this.image = image;
this.derivX = null;
this.derivY = null;
} | [
"public",
"void",
"setImage",
"(",
"ImagePyramid",
"<",
"InputImage",
">",
"image",
")",
"{",
"this",
".",
"image",
"=",
"image",
";",
"this",
".",
"derivX",
"=",
"null",
";",
"this",
".",
"derivY",
"=",
"null",
";",
"}"
] | Only sets the image pyramid. The derivatives are set to null. Only use this when tracking.
@param image Image pyramid | [
"Only",
"sets",
"the",
"image",
"pyramid",
".",
"The",
"derivatives",
"are",
"set",
"to",
"null",
".",
"Only",
"use",
"this",
"when",
"tracking",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/PyramidKltTracker.java#L93-L97 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java | EnhanceImageOps.equalize | public static void equalize( int histogram[] , int transform[] ) {
int sum = 0;
for( int i = 0; i < histogram.length; i++ ) {
transform[i] = sum += histogram[i];
}
int maxValue = histogram.length-1;
for( int i = 0; i < histogram.length; i++ ) {
transform[i] = (transform[i]*maxValue)/sum;
}
} | java | public static void equalize( int histogram[] , int transform[] ) {
int sum = 0;
for( int i = 0; i < histogram.length; i++ ) {
transform[i] = sum += histogram[i];
}
int maxValue = histogram.length-1;
for( int i = 0; i < histogram.length; i++ ) {
transform[i] = (transform[i]*maxValue)/sum;
}
} | [
"public",
"static",
"void",
"equalize",
"(",
"int",
"histogram",
"[",
"]",
",",
"int",
"transform",
"[",
"]",
")",
"{",
"int",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogram",
".",
"length",
";",
"i",
"++",
")... | Computes a transformation table which will equalize the provided histogram. An equalized histogram spreads
the 'weight' across the whole spectrum of values. Often used to make dim images easier for people to see.
@param histogram Input image histogram.
@param transform Output transformation table. | [
"Computes",
"a",
"transformation",
"table",
"which",
"will",
"equalize",
"the",
"provided",
"histogram",
".",
"An",
"equalized",
"histogram",
"spreads",
"the",
"weight",
"across",
"the",
"whole",
"spectrum",
"of",
"values",
".",
"Often",
"used",
"to",
"make",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L65-L77 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java | EnhanceImageOps.sharpen8 | public static void sharpen8(GrayU8 input , GrayU8 output ) {
InputSanityCheck.checkSameShape(input, output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEnhanceFilter_MT.sharpenInner8(input,output,0,255);
ImplEnhanceFilter_MT.sharpenBorder8(input,output,0,255);
} else {
ImplEnhanceFilter.sharpenInner8(in... | java | public static void sharpen8(GrayU8 input , GrayU8 output ) {
InputSanityCheck.checkSameShape(input, output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEnhanceFilter_MT.sharpenInner8(input,output,0,255);
ImplEnhanceFilter_MT.sharpenBorder8(input,output,0,255);
} else {
ImplEnhanceFilter.sharpenInner8(in... | [
"public",
"static",
"void",
"sharpen8",
"(",
"GrayU8",
"input",
",",
"GrayU8",
"output",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"BoofConcurrency",
".",
"USE_CONCURRENT",
")",
"{",
"ImplEnhanceFilt... | Applies a Laplacian-8 based sharpen filter to the image.
@param input Input image.
@param output Output image. | [
"Applies",
"a",
"Laplacian",
"-",
"8",
"based",
"sharpen",
"filter",
"to",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/EnhanceImageOps.java#L343-L353 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociateTwoPass.java | DetectDescribeAssociateTwoPass.updateTrackLocation | protected void updateTrackLocation( SetTrackInfo<Desc> info, FastQueue<AssociatedIndex> matches) {
info.matches.resize(matches.size);
for (int i = 0; i < matches.size; i++) {
info.matches.get(i).set(matches.get(i));
}
tracksActive.clear();
for( int i = 0; i < info.matches.size; i++ ) {
AssociatedIndex ... | java | protected void updateTrackLocation( SetTrackInfo<Desc> info, FastQueue<AssociatedIndex> matches) {
info.matches.resize(matches.size);
for (int i = 0; i < matches.size; i++) {
info.matches.get(i).set(matches.get(i));
}
tracksActive.clear();
for( int i = 0; i < info.matches.size; i++ ) {
AssociatedIndex ... | [
"protected",
"void",
"updateTrackLocation",
"(",
"SetTrackInfo",
"<",
"Desc",
">",
"info",
",",
"FastQueue",
"<",
"AssociatedIndex",
">",
"matches",
")",
"{",
"info",
".",
"matches",
".",
"resize",
"(",
"matches",
".",
"size",
")",
";",
"for",
"(",
"int",
... | Update each track's location only and not its description. Update the active list too | [
"Update",
"each",
"track",
"s",
"location",
"only",
"and",
"not",
"its",
"description",
".",
"Update",
"the",
"active",
"list",
"too"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociateTwoPass.java#L139-L153 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/experimental/java/boofcv/alg/descriptor/ExperimentalDescriptorDistance.java | ExperimentalDescriptorDistance.hamming | public static int hamming(TupleDesc_B a, TupleDesc_B b ) {
int score = 0;
final int N = a.data.length;
for( int i = 0; i < N; i++ ) {
score += hamming(a.data[i] ^ b.data[i]);
}
return score;
} | java | public static int hamming(TupleDesc_B a, TupleDesc_B b ) {
int score = 0;
final int N = a.data.length;
for( int i = 0; i < N; i++ ) {
score += hamming(a.data[i] ^ b.data[i]);
}
return score;
} | [
"public",
"static",
"int",
"hamming",
"(",
"TupleDesc_B",
"a",
",",
"TupleDesc_B",
"b",
")",
"{",
"int",
"score",
"=",
"0",
";",
"final",
"int",
"N",
"=",
"a",
".",
"data",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N... | Computes the hamming distance between two binary feature descriptors
@param a First variable
@param b Second variable
@return The hamming distance | [
"Computes",
"the",
"hamming",
"distance",
"between",
"two",
"binary",
"feature",
"descriptors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/experimental/java/boofcv/alg/descriptor/ExperimentalDescriptorDistance.java#L34-L41 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientThree_Share.java | GradientThree_Share.derivX_F32 | public static void derivX_F32(GrayF32 orig,
GrayF32 derivX) {
final float[] data = orig.data;
final float[] imgX = derivX.data;
final int width = orig.getWidth();
final int height = orig.getHeight();
for (int y = 0; y < height; y++) {
int index = width * y + 1;
int endX = index + width - 2;
... | java | public static void derivX_F32(GrayF32 orig,
GrayF32 derivX) {
final float[] data = orig.data;
final float[] imgX = derivX.data;
final int width = orig.getWidth();
final int height = orig.getHeight();
for (int y = 0; y < height; y++) {
int index = width * y + 1;
int endX = index + width - 2;
... | [
"public",
"static",
"void",
"derivX_F32",
"(",
"GrayF32",
"orig",
",",
"GrayF32",
"derivX",
")",
"{",
"final",
"float",
"[",
"]",
"data",
"=",
"orig",
".",
"data",
";",
"final",
"float",
"[",
"]",
"imgX",
"=",
"derivX",
".",
"data",
";",
"final",
"in... | Can only be used with images that are NOT sub-images. | [
"Can",
"only",
"be",
"used",
"with",
"images",
"that",
"are",
"NOT",
"sub",
"-",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientThree_Share.java#L41-L70 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.pruneTracks | private void pruneTracks(SetTrackInfo<Desc> info, GrowQueue_I32 unassociated) {
if( unassociated.size > maxInactiveTracks ) {
// make the first N elements the ones which will be dropped
int numDrop = unassociated.size-maxInactiveTracks;
for (int i = 0; i < numDrop; i++) {
int selected = rand.nextInt(unas... | java | private void pruneTracks(SetTrackInfo<Desc> info, GrowQueue_I32 unassociated) {
if( unassociated.size > maxInactiveTracks ) {
// make the first N elements the ones which will be dropped
int numDrop = unassociated.size-maxInactiveTracks;
for (int i = 0; i < numDrop; i++) {
int selected = rand.nextInt(unas... | [
"private",
"void",
"pruneTracks",
"(",
"SetTrackInfo",
"<",
"Desc",
">",
"info",
",",
"GrowQueue_I32",
"unassociated",
")",
"{",
"if",
"(",
"unassociated",
".",
"size",
">",
"maxInactiveTracks",
")",
"{",
"// make the first N elements the ones which will be dropped",
... | If there are too many unassociated tracks, randomly select some of those tracks and drop them | [
"If",
"there",
"are",
"too",
"many",
"unassociated",
"tracks",
"randomly",
"select",
"some",
"of",
"those",
"tracks",
"and",
"drop",
"them"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L174-L192 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.putIntoSrcList | protected void putIntoSrcList( SetTrackInfo<Desc> info ) {
// make sure isAssociated is large enough
if( info.isAssociated.length < info.tracks.size() ) {
info.isAssociated = new boolean[ info.tracks.size() ];
}
info.featSrc.reset();
info.locSrc.reset();
for( int i = 0; i < info.tracks.size(); i++ ) {
... | java | protected void putIntoSrcList( SetTrackInfo<Desc> info ) {
// make sure isAssociated is large enough
if( info.isAssociated.length < info.tracks.size() ) {
info.isAssociated = new boolean[ info.tracks.size() ];
}
info.featSrc.reset();
info.locSrc.reset();
for( int i = 0; i < info.tracks.size(); i++ ) {
... | [
"protected",
"void",
"putIntoSrcList",
"(",
"SetTrackInfo",
"<",
"Desc",
">",
"info",
")",
"{",
"// make sure isAssociated is large enough",
"if",
"(",
"info",
".",
"isAssociated",
".",
"length",
"<",
"info",
".",
"tracks",
".",
"size",
"(",
")",
")",
"{",
"... | Put existing tracks into source list for association | [
"Put",
"existing",
"tracks",
"into",
"source",
"list",
"for",
"association"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L218-L234 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.spawnTracks | @Override
public void spawnTracks() {
for (int setIndex = 0; setIndex < sets.length; setIndex++) {
SetTrackInfo<Desc> info = sets[setIndex];
// setup data structures
if( info.isAssociated.length < info.featDst.size ) {
info.isAssociated = new boolean[ info.featDst.size ];
}
// see which features... | java | @Override
public void spawnTracks() {
for (int setIndex = 0; setIndex < sets.length; setIndex++) {
SetTrackInfo<Desc> info = sets[setIndex];
// setup data structures
if( info.isAssociated.length < info.featDst.size ) {
info.isAssociated = new boolean[ info.featDst.size ];
}
// see which features... | [
"@",
"Override",
"public",
"void",
"spawnTracks",
"(",
")",
"{",
"for",
"(",
"int",
"setIndex",
"=",
"0",
";",
"setIndex",
"<",
"sets",
".",
"length",
";",
"setIndex",
"++",
")",
"{",
"SetTrackInfo",
"<",
"Desc",
">",
"info",
"=",
"sets",
"[",
"setIn... | Takes the current crop of detected features and makes them the keyframe | [
"Takes",
"the",
"current",
"crop",
"of",
"detected",
"features",
"and",
"makes",
"them",
"the",
"keyframe"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L260-L289 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.addNewTrack | protected PointTrack addNewTrack( int setIndex, double x , double y , Desc desc ) {
PointTrack p = getUnused();
p.set(x, y);
((Desc)p.getDescription()).setTo(desc);
if( checkValidSpawn(setIndex,p) ) {
p.setId = setIndex;
p.featureId = featureID++;
sets[setIndex].tracks.add(p);
tracksNew.add(p);
... | java | protected PointTrack addNewTrack( int setIndex, double x , double y , Desc desc ) {
PointTrack p = getUnused();
p.set(x, y);
((Desc)p.getDescription()).setTo(desc);
if( checkValidSpawn(setIndex,p) ) {
p.setId = setIndex;
p.featureId = featureID++;
sets[setIndex].tracks.add(p);
tracksNew.add(p);
... | [
"protected",
"PointTrack",
"addNewTrack",
"(",
"int",
"setIndex",
",",
"double",
"x",
",",
"double",
"y",
",",
"Desc",
"desc",
")",
"{",
"PointTrack",
"p",
"=",
"getUnused",
"(",
")",
";",
"p",
".",
"set",
"(",
"x",
",",
"y",
")",
";",
"(",
"(",
... | Adds a new track given its location and description | [
"Adds",
"a",
"new",
"track",
"given",
"its",
"location",
"and",
"description"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L294-L311 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.getUnused | protected PointTrack getUnused() {
PointTrack p;
if( unused.size() > 0 ) {
p = unused.remove( unused.size()-1 );
} else {
p = new PointTrack();
p.setDescription(manager.createDescription());
}
return p;
} | java | protected PointTrack getUnused() {
PointTrack p;
if( unused.size() > 0 ) {
p = unused.remove( unused.size()-1 );
} else {
p = new PointTrack();
p.setDescription(manager.createDescription());
}
return p;
} | [
"protected",
"PointTrack",
"getUnused",
"(",
")",
"{",
"PointTrack",
"p",
";",
"if",
"(",
"unused",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"p",
"=",
"unused",
".",
"remove",
"(",
"unused",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"}",
"el... | Returns an unused track. If there are no unused tracks then it creates a ne one. | [
"Returns",
"an",
"unused",
"track",
".",
"If",
"there",
"are",
"no",
"unused",
"tracks",
"then",
"it",
"creates",
"a",
"ne",
"one",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L323-L332 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java | DetectDescribeAssociate.dropTrack | @Override
public boolean dropTrack(PointTrack track) {
if( !tracksAll.remove(track) )
return false;
if( !sets[track.setId].tracks.remove(track) ) {
return false;
}
// the track may or may not be in the active list
tracksActive.remove(track);
tracksInactive.remove(track);
// it must be in the all l... | java | @Override
public boolean dropTrack(PointTrack track) {
if( !tracksAll.remove(track) )
return false;
if( !sets[track.setId].tracks.remove(track) ) {
return false;
}
// the track may or may not be in the active list
tracksActive.remove(track);
tracksInactive.remove(track);
// it must be in the all l... | [
"@",
"Override",
"public",
"boolean",
"dropTrack",
"(",
"PointTrack",
"track",
")",
"{",
"if",
"(",
"!",
"tracksAll",
".",
"remove",
"(",
"track",
")",
")",
"return",
"false",
";",
"if",
"(",
"!",
"sets",
"[",
"track",
".",
"setId",
"]",
".",
"tracks... | Remove from active list and mark so that it is dropped in the next cycle
@param track The track which is to be dropped | [
"Remove",
"from",
"active",
"list",
"and",
"mark",
"so",
"that",
"it",
"is",
"dropped",
"in",
"the",
"next",
"cycle"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/DetectDescribeAssociate.java#L353-L368 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java | PnPStereoJacobianRodrigues.addRodriguesJacobian | private void addRodriguesJacobian( DMatrixRMaj Rj , Point3D_F64 worldPt , Point3D_F64 cameraPt )
{
// (1/z)*dot(R)*X
double Rx = (Rj.data[0]*worldPt.x + Rj.data[1]*worldPt.y + Rj.data[2]*worldPt.z)/cameraPt.z;
double Ry = (Rj.data[3]*worldPt.x + Rj.data[4]*worldPt.y + Rj.data[5]*worldPt.z)/cameraPt.z;
// dot(... | java | private void addRodriguesJacobian( DMatrixRMaj Rj , Point3D_F64 worldPt , Point3D_F64 cameraPt )
{
// (1/z)*dot(R)*X
double Rx = (Rj.data[0]*worldPt.x + Rj.data[1]*worldPt.y + Rj.data[2]*worldPt.z)/cameraPt.z;
double Ry = (Rj.data[3]*worldPt.x + Rj.data[4]*worldPt.y + Rj.data[5]*worldPt.z)/cameraPt.z;
// dot(... | [
"private",
"void",
"addRodriguesJacobian",
"(",
"DMatrixRMaj",
"Rj",
",",
"Point3D_F64",
"worldPt",
",",
"Point3D_F64",
"cameraPt",
")",
"{",
"// (1/z)*dot(R)*X",
"double",
"Rx",
"=",
"(",
"Rj",
".",
"data",
"[",
"0",
"]",
"*",
"worldPt",
".",
"x",
"+",
"R... | Adds to the Jacobian matrix using the derivative from a Rodrigues parameter.
deriv [x,y] = -dot(z)/(z^2)*(R*X+T) + (1/z)*dot(R)*X
where R is rotation matrix, T is translation, z = z-coordinate of point in camera frame
@param Rj Jacobian for Rodrigues
@param worldPt Location of point in world coordinates
@param camer... | [
"Adds",
"to",
"the",
"Jacobian",
"matrix",
"using",
"the",
"derivative",
"from",
"a",
"Rodrigues",
"parameter",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java#L154-L166 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java | PnPStereoJacobianRodrigues.addTranslationJacobian | private void addTranslationJacobian( Point3D_F64 cameraPt )
{
double divZ = 1.0/cameraPt.z;
double divZ2 = 1.0/(cameraPt.z*cameraPt.z);
// partial T.x
output[indexX++] = divZ;
output[indexY++] = 0;
// partial T.y
output[indexX++] = 0;
output[indexY++] = divZ;
// partial T.z
output[indexX++] = -cam... | java | private void addTranslationJacobian( Point3D_F64 cameraPt )
{
double divZ = 1.0/cameraPt.z;
double divZ2 = 1.0/(cameraPt.z*cameraPt.z);
// partial T.x
output[indexX++] = divZ;
output[indexY++] = 0;
// partial T.y
output[indexX++] = 0;
output[indexY++] = divZ;
// partial T.z
output[indexX++] = -cam... | [
"private",
"void",
"addTranslationJacobian",
"(",
"Point3D_F64",
"cameraPt",
")",
"{",
"double",
"divZ",
"=",
"1.0",
"/",
"cameraPt",
".",
"z",
";",
"double",
"divZ2",
"=",
"1.0",
"/",
"(",
"cameraPt",
".",
"z",
"*",
"cameraPt",
".",
"z",
")",
";",
"//... | Derivative for translation element
deriv [x,y] = -dot(z)*T/(z^2) + dot(T)/z
where T is translation, z = z-coordinate of point in camera frame | [
"Derivative",
"for",
"translation",
"element"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java#L175-L189 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java | PnPStereoJacobianRodrigues.addTranslationJacobian | private void addTranslationJacobian( DMatrixRMaj R ,
Point3D_F64 cameraPt )
{
double z = cameraPt.z;
double z2 = z*z;
// partial T.x
output[indexX++] = R.get(0,0)/cameraPt.z - R.get(2,0)/z2*cameraPt.x;
output[indexY++] = R.get(1,0)/cameraPt.z - R.get(2,0)/z2*cameraPt.y;
// partial T.y
output[... | java | private void addTranslationJacobian( DMatrixRMaj R ,
Point3D_F64 cameraPt )
{
double z = cameraPt.z;
double z2 = z*z;
// partial T.x
output[indexX++] = R.get(0,0)/cameraPt.z - R.get(2,0)/z2*cameraPt.x;
output[indexY++] = R.get(1,0)/cameraPt.z - R.get(2,0)/z2*cameraPt.y;
// partial T.y
output[... | [
"private",
"void",
"addTranslationJacobian",
"(",
"DMatrixRMaj",
"R",
",",
"Point3D_F64",
"cameraPt",
")",
"{",
"double",
"z",
"=",
"cameraPt",
".",
"z",
";",
"double",
"z2",
"=",
"z",
"*",
"z",
";",
"// partial T.x",
"output",
"[",
"indexX",
"++",
"]",
... | The translation vector is now multiplied by 3x3 matrix R. The components of T are no longer decoupled.
deriv [x,y] = R*dot(T)/z - (dot(z)/(z^2))(R*T)
@param R
@param cameraPt | [
"The",
"translation",
"vector",
"is",
"now",
"multiplied",
"by",
"3x3",
"matrix",
"R",
".",
"The",
"components",
"of",
"T",
"are",
"no",
"longer",
"decoupled",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java#L199-L214 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java | UtilDenoiseWavelet.subbandAbsVal | public static float[] subbandAbsVal(GrayF32 subband, float[] coef ) {
if( coef == null ) {
coef = new float[subband.width*subband.height];
}
int i = 0;
for( int y = 0; y < subband.height; y++ ) {
int index = subband.startIndex + subband.stride*y;
int end = index + subband.width;
for( ;index < end;... | java | public static float[] subbandAbsVal(GrayF32 subband, float[] coef ) {
if( coef == null ) {
coef = new float[subband.width*subband.height];
}
int i = 0;
for( int y = 0; y < subband.height; y++ ) {
int index = subband.startIndex + subband.stride*y;
int end = index + subband.width;
for( ;index < end;... | [
"public",
"static",
"float",
"[",
"]",
"subbandAbsVal",
"(",
"GrayF32",
"subband",
",",
"float",
"[",
"]",
"coef",
")",
"{",
"if",
"(",
"coef",
"==",
"null",
")",
"{",
"coef",
"=",
"new",
"float",
"[",
"subband",
".",
"width",
"*",
"subband",
".",
... | Computes the absolute value of each element in the subband image are places it into
'coef' | [
"Computes",
"the",
"absolute",
"value",
"of",
"each",
"element",
"in",
"the",
"subband",
"image",
"are",
"places",
"it",
"into",
"coef"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java#L65-L80 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java | FactoryBlurFilter.median | public static <T extends ImageBase<T>> BlurStorageFilter<T> median(ImageType<T> type , int radius ) {
return new BlurStorageFilter<>("median", type, radius);
} | java | public static <T extends ImageBase<T>> BlurStorageFilter<T> median(ImageType<T> type , int radius ) {
return new BlurStorageFilter<>("median", type, radius);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"BlurStorageFilter",
"<",
"T",
">",
"median",
"(",
"ImageType",
"<",
"T",
">",
"type",
",",
"int",
"radius",
")",
"{",
"return",
"new",
"BlurStorageFilter",
"<>",
"(",
"\"median\""... | Creates a median filter for the specified image type.
@param type Image type.
@param radius Size of the filter.
@return Median image filter. | [
"Creates",
"a",
"median",
"filter",
"for",
"the",
"specified",
"image",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java#L40-L42 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java | FactoryBlurFilter.mean | public static <T extends ImageBase<T>> BlurStorageFilter<T> mean(ImageType<T> type , int radius ) {
return new BlurStorageFilter<>("mean", type, radius);
} | java | public static <T extends ImageBase<T>> BlurStorageFilter<T> mean(ImageType<T> type , int radius ) {
return new BlurStorageFilter<>("mean", type, radius);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"BlurStorageFilter",
"<",
"T",
">",
"mean",
"(",
"ImageType",
"<",
"T",
">",
"type",
",",
"int",
"radius",
")",
"{",
"return",
"new",
"BlurStorageFilter",
"<>",
"(",
"\"mean\"",
... | Creates a mean filter for the specified image type.
@param type Image type.
@param radius Size of the filter.
@return mean image filter. | [
"Creates",
"a",
"mean",
"filter",
"for",
"the",
"specified",
"image",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java#L55-L57 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java | FactoryBlurFilter.gaussian | public static <T extends ImageBase<T>> BlurStorageFilter<T> gaussian(ImageType<T> type , double sigma , int radius ) {
return new BlurStorageFilter<>("gaussian", type, sigma, radius);
} | java | public static <T extends ImageBase<T>> BlurStorageFilter<T> gaussian(ImageType<T> type , double sigma , int radius ) {
return new BlurStorageFilter<>("gaussian", type, sigma, radius);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"BlurStorageFilter",
"<",
"T",
">",
"gaussian",
"(",
"ImageType",
"<",
"T",
">",
"type",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"return",
"new",
"BlurStorageFilter... | Creates a Gaussian filter for the specified image type.
@param type Image type.
@param radius Size of the filter.
@return mean image filter. | [
"Creates",
"a",
"Gaussian",
"filter",
"for",
"the",
"specified",
"image",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/blur/FactoryBlurFilter.java#L70-L72 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.initialize | public void initialize( T image , int x0 , int y0 , int regionWidth , int regionHeight ) {
this.imageWidth = image.width;
this.imageHeight = image.height;
setTrackLocation(x0,y0,regionWidth,regionHeight);
initialLearning(image);
} | java | public void initialize( T image , int x0 , int y0 , int regionWidth , int regionHeight ) {
this.imageWidth = image.width;
this.imageHeight = image.height;
setTrackLocation(x0,y0,regionWidth,regionHeight);
initialLearning(image);
} | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"regionWidth",
",",
"int",
"regionHeight",
")",
"{",
"this",
".",
"imageWidth",
"=",
"image",
".",
"width",
";",
"this",
".",
"imageHeight",
"=",
"image"... | Initializes tracking around the specified rectangle region
@param image Image to start tracking from
@param x0 top-left corner of region
@param y0 top-left corner of region
@param regionWidth region's width
@param regionHeight region's height | [
"Initializes",
"tracking",
"around",
"the",
"specified",
"rectangle",
"region"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L189-L197 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.setTrackLocation | public void setTrackLocation( int x0 , int y0 , int regionWidth , int regionHeight ) {
if( imageWidth < regionWidth || imageHeight < regionHeight)
throw new IllegalArgumentException("Track region is larger than input image: "+regionWidth+" "+regionHeight);
regionOut.width = regionWidth;
regionOut.height = reg... | java | public void setTrackLocation( int x0 , int y0 , int regionWidth , int regionHeight ) {
if( imageWidth < regionWidth || imageHeight < regionHeight)
throw new IllegalArgumentException("Track region is larger than input image: "+regionWidth+" "+regionHeight);
regionOut.width = regionWidth;
regionOut.height = reg... | [
"public",
"void",
"setTrackLocation",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"regionWidth",
",",
"int",
"regionHeight",
")",
"{",
"if",
"(",
"imageWidth",
"<",
"regionWidth",
"||",
"imageHeight",
"<",
"regionHeight",
")",
"throw",
"new",
"IllegalArg... | Used to change the track's location. If this method is used it is assumed that tracking is active and that
the appearance of the target has not changed
@param x0 top-left corner of region
@param y0 top-left corner of region
@param regionWidth region's width
@param regionHeight region's height | [
"Used",
"to",
"change",
"the",
"track",
"s",
"location",
".",
"If",
"this",
"method",
"is",
"used",
"it",
"is",
"assumed",
"that",
"tracking",
"is",
"active",
"and",
"that",
"the",
"appearance",
"of",
"the",
"target",
"has",
"not",
"changed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L207-L230 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.initialLearning | protected void initialLearning( T image ) {
// get subwindow at current estimated target position, to train classifier
get_subwindow(image, template);
// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)
// k = dense_gauss_kernel(sigma, x);
dense_gauss_kernel(sigma, template, template,k)... | java | protected void initialLearning( T image ) {
// get subwindow at current estimated target position, to train classifier
get_subwindow(image, template);
// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)
// k = dense_gauss_kernel(sigma, x);
dense_gauss_kernel(sigma, template, template,k)... | [
"protected",
"void",
"initialLearning",
"(",
"T",
"image",
")",
"{",
"// get subwindow at current estimated target position, to train classifier",
"get_subwindow",
"(",
"image",
",",
"template",
")",
";",
"// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)",
... | Learn the target's appearance. | [
"Learn",
"the",
"target",
"s",
"appearance",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L236-L247 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.computeCosineWindow | protected static void computeCosineWindow( GrayF64 cosine ) {
double cosX[] = new double[ cosine.width ];
for( int x = 0; x < cosine.width; x++ ) {
cosX[x] = 0.5*(1 - Math.cos( 2.0*Math.PI*x/(cosine.width-1) ));
}
for( int y = 0; y < cosine.height; y++ ) {
int index = cosine.startIndex + y*cosine.stride;
... | java | protected static void computeCosineWindow( GrayF64 cosine ) {
double cosX[] = new double[ cosine.width ];
for( int x = 0; x < cosine.width; x++ ) {
cosX[x] = 0.5*(1 - Math.cos( 2.0*Math.PI*x/(cosine.width-1) ));
}
for( int y = 0; y < cosine.height; y++ ) {
int index = cosine.startIndex + y*cosine.stride;
... | [
"protected",
"static",
"void",
"computeCosineWindow",
"(",
"GrayF64",
"cosine",
")",
"{",
"double",
"cosX",
"[",
"]",
"=",
"new",
"double",
"[",
"cosine",
".",
"width",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"cosine",
".",
"width"... | Computes the cosine window | [
"Computes",
"the",
"cosine",
"window"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L252-L264 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.computeGaussianWeights | protected void computeGaussianWeights( int width ) {
// desired output (gaussian shaped), bandwidth proportional to target size
double output_sigma = Math.sqrt(width*width) * output_sigma_factor;
double left = -0.5/(output_sigma*output_sigma);
int radius = width/2;
for( int y = 0; y < gaussianWeight.height... | java | protected void computeGaussianWeights( int width ) {
// desired output (gaussian shaped), bandwidth proportional to target size
double output_sigma = Math.sqrt(width*width) * output_sigma_factor;
double left = -0.5/(output_sigma*output_sigma);
int radius = width/2;
for( int y = 0; y < gaussianWeight.height... | [
"protected",
"void",
"computeGaussianWeights",
"(",
"int",
"width",
")",
"{",
"// desired output (gaussian shaped), bandwidth proportional to target size",
"double",
"output_sigma",
"=",
"Math",
".",
"sqrt",
"(",
"width",
"*",
"width",
")",
"*",
"output_sigma_factor",
";"... | Computes the weights used in the gaussian kernel
This isn't actually symmetric for even widths. These weights are used has label in the learning phase. Closer
to one the more likely it is the true target. It should be a peak in the image center. If it is not then
it will learn an incorrect model. | [
"Computes",
"the",
"weights",
"used",
"in",
"the",
"gaussian",
"kernel"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L273-L294 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.performTracking | public void performTracking( T image ) {
if( image.width != imageWidth || image.height != imageHeight )
throw new IllegalArgumentException("Tracking image size is not the same as " +
"input image. Expected "+imageWidth+" x "+imageHeight);
updateTrackLocation(image);
if( interp_factor != 0 )
performLear... | java | public void performTracking( T image ) {
if( image.width != imageWidth || image.height != imageHeight )
throw new IllegalArgumentException("Tracking image size is not the same as " +
"input image. Expected "+imageWidth+" x "+imageHeight);
updateTrackLocation(image);
if( interp_factor != 0 )
performLear... | [
"public",
"void",
"performTracking",
"(",
"T",
"image",
")",
"{",
"if",
"(",
"image",
".",
"width",
"!=",
"imageWidth",
"||",
"image",
".",
"height",
"!=",
"imageHeight",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Tracking image size is not the same ... | Search for the track in the image and
@param image Next image in the sequence | [
"Search",
"for",
"the",
"track",
"in",
"the",
"image",
"and"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L320-L327 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.updateTrackLocation | protected void updateTrackLocation(T image) {
get_subwindow(image, templateNew);
// calculate response of the classifier at all locations
// matlab: k = dense_gauss_kernel(sigma, x, z);
dense_gauss_kernel(sigma, templateNew, template,k);
fft.forward(k,kf);
// response = real(ifft2(alphaf .* fft2(k))); ... | java | protected void updateTrackLocation(T image) {
get_subwindow(image, templateNew);
// calculate response of the classifier at all locations
// matlab: k = dense_gauss_kernel(sigma, x, z);
dense_gauss_kernel(sigma, templateNew, template,k);
fft.forward(k,kf);
// response = real(ifft2(alphaf .* fft2(k))); ... | [
"protected",
"void",
"updateTrackLocation",
"(",
"T",
"image",
")",
"{",
"get_subwindow",
"(",
"image",
",",
"templateNew",
")",
";",
"// calculate response of the classifier at all locations",
"// matlab: k = dense_gauss_kernel(sigma, x, z);",
"dense_gauss_kernel",
"(",
"sigma... | Find the target inside the current image by searching around its last known location | [
"Find",
"the",
"target",
"inside",
"the",
"current",
"image",
"by",
"searching",
"around",
"its",
"last",
"known",
"location"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L332-L372 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.subpixelPeak | protected void subpixelPeak(int peakX, int peakY) {
// this function for r was determined empirically by using work regions of 32,64,128
int r = Math.min(2,response.width/25);
if( r < 0 )
return;
localPeak.setSearchRadius(r);
localPeak.search(peakX,peakY);
offX = localPeak.getPeakX() - peakX;
offY = ... | java | protected void subpixelPeak(int peakX, int peakY) {
// this function for r was determined empirically by using work regions of 32,64,128
int r = Math.min(2,response.width/25);
if( r < 0 )
return;
localPeak.setSearchRadius(r);
localPeak.search(peakX,peakY);
offX = localPeak.getPeakX() - peakX;
offY = ... | [
"protected",
"void",
"subpixelPeak",
"(",
"int",
"peakX",
",",
"int",
"peakY",
")",
"{",
"// this function for r was determined empirically by using work regions of 32,64,128",
"int",
"r",
"=",
"Math",
".",
"min",
"(",
"2",
",",
"response",
".",
"width",
"/",
"25",
... | Refine the local-peak using a search algorithm for sub-pixel accuracy. | [
"Refine",
"the",
"local",
"-",
"peak",
"using",
"a",
"search",
"algorithm",
"for",
"sub",
"-",
"pixel",
"accuracy",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L377-L388 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.performLearning | public void performLearning(T image) {
// use the update track location
get_subwindow(image, templateNew);
// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)
// k = dense_gauss_kernel(sigma, x);
dense_gauss_kernel(sigma, templateNew, templateNew, k);
fft.forward(k,kf);
// new_alph... | java | public void performLearning(T image) {
// use the update track location
get_subwindow(image, templateNew);
// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)
// k = dense_gauss_kernel(sigma, x);
dense_gauss_kernel(sigma, templateNew, templateNew, k);
fft.forward(k,kf);
// new_alph... | [
"public",
"void",
"performLearning",
"(",
"T",
"image",
")",
"{",
"// use the update track location",
"get_subwindow",
"(",
"image",
",",
"templateNew",
")",
";",
"// Kernel Regularized Least-Squares, calculate alphas (in Fourier domain)",
"//\tk = dense_gauss_kernel(sigma, x);",
... | Update the alphas and the track's appearance | [
"Update",
"the",
"alphas",
"and",
"the",
"track",
"s",
"appearance"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L398-L423 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.imageDotProduct | public static double imageDotProduct(GrayF64 a) {
double total = 0;
int N = a.width*a.height;
for( int index = 0; index < N; index++ ) {
double value = a.data[index];
total += value*value;
}
return total;
} | java | public static double imageDotProduct(GrayF64 a) {
double total = 0;
int N = a.width*a.height;
for( int index = 0; index < N; index++ ) {
double value = a.data[index];
total += value*value;
}
return total;
} | [
"public",
"static",
"double",
"imageDotProduct",
"(",
"GrayF64",
"a",
")",
"{",
"double",
"total",
"=",
"0",
";",
"int",
"N",
"=",
"a",
".",
"width",
"*",
"a",
".",
"height",
";",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"N",
";",... | Computes the dot product of the image with itself | [
"Computes",
"the",
"dot",
"product",
"of",
"the",
"image",
"with",
"itself"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L488-L499 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.elementMultConjB | public static void elementMultConjB( InterleavedF64 a , InterleavedF64 b , InterleavedF64 output ) {
for( int y = 0; y < a.height; y++ ) {
int index = a.startIndex + y*a.stride;
for( int x = 0; x < a.width; x++, index += 2 ) {
double realA = a.data[index];
double imgA = a.data[index+1];
double re... | java | public static void elementMultConjB( InterleavedF64 a , InterleavedF64 b , InterleavedF64 output ) {
for( int y = 0; y < a.height; y++ ) {
int index = a.startIndex + y*a.stride;
for( int x = 0; x < a.width; x++, index += 2 ) {
double realA = a.data[index];
double imgA = a.data[index+1];
double re... | [
"public",
"static",
"void",
"elementMultConjB",
"(",
"InterleavedF64",
"a",
",",
"InterleavedF64",
"b",
",",
"InterleavedF64",
"output",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"a",
".",
"height",
";",
"y",
"++",
")",
"{",
"int",
"... | Element-wise multiplication of 'a' and the complex conjugate of 'b' | [
"Element",
"-",
"wise",
"multiplication",
"of",
"a",
"and",
"the",
"complex",
"conjugate",
"of",
"b"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L504-L520 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.gaussianKernel | protected static void gaussianKernel(double xx , double yy , GrayF64 xy , double sigma , GrayF64 output ) {
double sigma2 = sigma*sigma;
double N = xy.width*xy.height;
for( int y = 0; y < xy.height; y++ ) {
int index = xy.startIndex + y*xy.stride;
for( int x = 0; x < xy.width; x++ , index++ ) {
// (... | java | protected static void gaussianKernel(double xx , double yy , GrayF64 xy , double sigma , GrayF64 output ) {
double sigma2 = sigma*sigma;
double N = xy.width*xy.height;
for( int y = 0; y < xy.height; y++ ) {
int index = xy.startIndex + y*xy.stride;
for( int x = 0; x < xy.width; x++ , index++ ) {
// (... | [
"protected",
"static",
"void",
"gaussianKernel",
"(",
"double",
"xx",
",",
"double",
"yy",
",",
"GrayF64",
"xy",
",",
"double",
"sigma",
",",
"GrayF64",
"output",
")",
"{",
"double",
"sigma2",
"=",
"sigma",
"*",
"sigma",
";",
"double",
"N",
"=",
"xy",
... | Computes the output of the Gaussian kernel for each element in the target region
k = exp(-1 / sigma^2 * max(0, (xx + yy - 2 * xy) / numel(x)));
@param xx ||x||^2
@param yy ||y||^2 | [
"Computes",
"the",
"output",
"of",
"the",
"Gaussian",
"kernel",
"for",
"each",
"element",
"in",
"the",
"target",
"region"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L555-L572 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.get_subwindow | protected void get_subwindow( T image , GrayF64 output ) {
// copy the target region
interp.setImage(image);
int index = 0;
for( int y = 0; y < workRegionSize; y++ ) {
float yy = regionTrack.y0 + y*stepY;
for( int x = 0; x < workRegionSize; x++ ) {
float xx = regionTrack.x0 + x*stepX;
if( inte... | java | protected void get_subwindow( T image , GrayF64 output ) {
// copy the target region
interp.setImage(image);
int index = 0;
for( int y = 0; y < workRegionSize; y++ ) {
float yy = regionTrack.y0 + y*stepY;
for( int x = 0; x < workRegionSize; x++ ) {
float xx = regionTrack.x0 + x*stepX;
if( inte... | [
"protected",
"void",
"get_subwindow",
"(",
"T",
"image",
",",
"GrayF64",
"output",
")",
"{",
"// copy the target region",
"interp",
".",
"setImage",
"(",
"image",
")",
";",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",... | Copies the target into the output image and applies the cosine window to it. | [
"Copies",
"the",
"target",
"into",
"the",
"output",
"image",
"and",
"applies",
"the",
"cosine",
"window",
"to",
"it",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L577-L606 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java | ThresholdBlock.selectBlockSize | void selectBlockSize( int width , int height , int requestedBlockWidth) {
if( height < requestedBlockWidth ) {
blockHeight = height;
} else {
int rows = height/requestedBlockWidth;
blockHeight = height/rows;
}
if( width < requestedBlockWidth ) {
blockWidth = width;
} else {
int cols = width/r... | java | void selectBlockSize( int width , int height , int requestedBlockWidth) {
if( height < requestedBlockWidth ) {
blockHeight = height;
} else {
int rows = height/requestedBlockWidth;
blockHeight = height/rows;
}
if( width < requestedBlockWidth ) {
blockWidth = width;
} else {
int cols = width/r... | [
"void",
"selectBlockSize",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"requestedBlockWidth",
")",
"{",
"if",
"(",
"height",
"<",
"requestedBlockWidth",
")",
"{",
"blockHeight",
"=",
"height",
";",
"}",
"else",
"{",
"int",
"rows",
"=",
"height",... | Selects a block size which is close to the requested block size by the user | [
"Selects",
"a",
"block",
"size",
"which",
"is",
"close",
"to",
"the",
"requested",
"block",
"size",
"by",
"the",
"user"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L112-L127 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.