id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
49,800
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
49,801
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
49,802
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
49,803
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
49,804
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
49,805
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
49,806
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
49,807
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
49,808
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
49,809
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
49,810
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
49,811
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 &gt; 0. @return variance
[ "Computes", "the", "variance", "inside", "the", "specified", "rectangle", ".", "x0", "and", "y0", "must", "be", "&gt", ";", "0", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L106-L114
49,812
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
49,813
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
49,814
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
49,815
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
49,816
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
49,817
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
49,818
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
49,819
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
49,820
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
49,821
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
49,822
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
49,823
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
49,824
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
49,825
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
49,826
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
49,827
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
49,828
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
49,829
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
49,830
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
49,831
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
49,832
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
49,833
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
49,834
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
49,835
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
49,836
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
49,837
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
49,838
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
49,839
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
49,840
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
49,841
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
49,842
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
49,843
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
49,844
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
49,845
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
49,846
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
49,847
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
49,848
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
49,849
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
49,850
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
49,851
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
49,852
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
49,853
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java
ThresholdBlock.applyThreshold
protected void applyThreshold( T input, GrayU8 output ) { for (int blockY = 0; blockY < stats.height; blockY++) { for (int blockX = 0; blockX < stats.width; blockX++) { original.thresholdBlock(blockX,blockY,input,stats,output); } } }
java
protected void applyThreshold( T input, GrayU8 output ) { for (int blockY = 0; blockY < stats.height; blockY++) { for (int blockX = 0; blockX < stats.width; blockX++) { original.thresholdBlock(blockX,blockY,input,stats,output); } } }
[ "protected", "void", "applyThreshold", "(", "T", "input", ",", "GrayU8", "output", ")", "{", "for", "(", "int", "blockY", "=", "0", ";", "blockY", "<", "stats", ".", "height", ";", "blockY", "++", ")", "{", "for", "(", "int", "blockX", "=", "0", ";...
Applies the dynamically computed threshold to each pixel in the image, one block at a time
[ "Applies", "the", "dynamically", "computed", "threshold", "to", "each", "pixel", "in", "the", "image", "one", "block", "at", "a", "time" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L132-L138
49,854
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java
PairwiseImageMatching.addImage
public void addImage(T image , String cameraName ) { PairwiseImageGraph.View view = new PairwiseImageGraph.View(graph.nodes.size(), new FastQueue<TupleDesc>(TupleDesc.class,true) { @Override protected TupleDesc createInstance() { return detDesc.createDescription(); } }); view.camera =...
java
public void addImage(T image , String cameraName ) { PairwiseImageGraph.View view = new PairwiseImageGraph.View(graph.nodes.size(), new FastQueue<TupleDesc>(TupleDesc.class,true) { @Override protected TupleDesc createInstance() { return detDesc.createDescription(); } }); view.camera =...
[ "public", "void", "addImage", "(", "T", "image", ",", "String", "cameraName", ")", "{", "PairwiseImageGraph", ".", "View", "view", "=", "new", "PairwiseImageGraph", ".", "View", "(", "graph", ".", "nodes", ".", "size", "(", ")", ",", "new", "FastQueue", ...
Adds a new observation from a camera. Detects features inside the and saves those. @param image The image
[ "Adds", "a", "new", "observation", "from", "a", "camera", ".", "Detects", "features", "inside", "the", "and", "saves", "those", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L118-L162
49,855
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java
PairwiseImageMatching.connectViews
protected boolean connectViews(PairwiseImageGraph.View viewA , PairwiseImageGraph.View viewB , FastQueue<AssociatedIndex> matches) { // Estimate fundamental/essential with RANSAC PairwiseImageGraph.Motion edge = new PairwiseImageGraph.Motion(); int inliersEpipolar; CameraPinhole pinhole0 = viewA.ca...
java
protected boolean connectViews(PairwiseImageGraph.View viewA , PairwiseImageGraph.View viewB , FastQueue<AssociatedIndex> matches) { // Estimate fundamental/essential with RANSAC PairwiseImageGraph.Motion edge = new PairwiseImageGraph.Motion(); int inliersEpipolar; CameraPinhole pinhole0 = viewA.ca...
[ "protected", "boolean", "connectViews", "(", "PairwiseImageGraph", ".", "View", "viewA", ",", "PairwiseImageGraph", ".", "View", "viewB", ",", "FastQueue", "<", "AssociatedIndex", ">", "matches", ")", "{", "// Estimate fundamental/essential with RANSAC", "PairwiseImageGra...
Associate features between the two views. Then compute a homography and essential matrix using LSMed. Add features to the edge if they an inlier in essential. Save fit score of homography vs essential.
[ "Associate", "features", "between", "the", "two", "views", ".", "Then", "compute", "a", "homography", "and", "essential", "matrix", "using", "LSMed", ".", "Add", "features", "to", "the", "edge", "if", "they", "an", "inlier", "in", "essential", ".", "Save", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L215-L277
49,856
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java
PairwiseImageMatching.fitEpipolar
boolean fitEpipolar(FastQueue<AssociatedIndex> matches , List<Point2D_F64> pointsA , List<Point2D_F64> pointsB , ModelMatcher<?,AssociatedPair> ransac , PairwiseImageGraph.Motion edge ) { pairs.resize(matches.size); for (int i = 0; i < matches.size; i++) { AssociatedIndex a = matches.get(i); ...
java
boolean fitEpipolar(FastQueue<AssociatedIndex> matches , List<Point2D_F64> pointsA , List<Point2D_F64> pointsB , ModelMatcher<?,AssociatedPair> ransac , PairwiseImageGraph.Motion edge ) { pairs.resize(matches.size); for (int i = 0; i < matches.size; i++) { AssociatedIndex a = matches.get(i); ...
[ "boolean", "fitEpipolar", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "List", "<", "Point2D_F64", ">", "pointsA", ",", "List", "<", "Point2D_F64", ">", "pointsB", ",", "ModelMatcher", "<", "?", ",", "AssociatedPair", ">", "ransac", ",", "P...
Uses ransac to fit an epipolar model to the associated features. Adds list of matched features to the edge. @param matches List of matched features by index @param pointsA Set of observations from image A @param pointsB Set of observations from image B @param ransac Model fitter @param edge Edge which will contain a d...
[ "Uses", "ransac", "to", "fit", "an", "epipolar", "model", "to", "the", "associated", "features", ".", "Adds", "list", "of", "matched", "features", "to", "the", "edge", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L289-L308
49,857
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java
DetectPolygonFromContour.process
public void process(T gray, GrayU8 binary) { if( verbose ) System.out.println("ENTER DetectPolygonFromContour.process()"); if( contourPadded != null && !contourPadded.isCreatePaddedCopy() ) { int padding = 2; if( gray.width+padding != binary.width || gray.height+padding != binary.height ) { throw new Il...
java
public void process(T gray, GrayU8 binary) { if( verbose ) System.out.println("ENTER DetectPolygonFromContour.process()"); if( contourPadded != null && !contourPadded.isCreatePaddedCopy() ) { int padding = 2; if( gray.width+padding != binary.width || gray.height+padding != binary.height ) { throw new Il...
[ "public", "void", "process", "(", "T", "gray", ",", "GrayU8", "binary", ")", "{", "if", "(", "verbose", ")", "System", ".", "out", ".", "println", "(", "\"ENTER DetectPolygonFromContour.process()\"", ")", ";", "if", "(", "contourPadded", "!=", "null", "&&",...
Examines the undistorted gray scale input image for squares. If p @param gray Input image
[ "Examines", "the", "undistorted", "gray", "scale", "input", "image", "for", "squares", ".", "If", "p" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L212-L256
49,858
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java
DetectPolygonFromContour.determineCornersOnBorder
void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) { onImageBorder.reset(); for (int i = 0; i < polygon.size(); i++) { Point2D_F64 p = polygon.get(i); onImageBorder.add( p.x <= 1 || p.y <= 1 || p.x >= imageWidth-2 || p.y >= imageHeight-2); } }
java
void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) { onImageBorder.reset(); for (int i = 0; i < polygon.size(); i++) { Point2D_F64 p = polygon.get(i); onImageBorder.add( p.x <= 1 || p.y <= 1 || p.x >= imageWidth-2 || p.y >= imageHeight-2); } }
[ "void", "determineCornersOnBorder", "(", "Polygon2D_F64", "polygon", ",", "GrowQueue_B", "onImageBorder", ")", "{", "onImageBorder", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "polygon", ".", "size", "(", ")", ";", "i",...
Check to see if corners are touching the image border @param polygon Polygon in distorted (original image) pixels @param onImageBorder storage for corner indexes
[ "Check", "to", "see", "if", "corners", "are", "touching", "the", "image", "border" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L442-L449
49,859
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java
DetectPolygonFromContour.getContour
public List<Point2D_I32> getContour( Info info ) { contourTmp.reset(); contourFinder.loadContour(info.contour.externalIndex,contourTmp); return contourTmp.toList(); }
java
public List<Point2D_I32> getContour( Info info ) { contourTmp.reset(); contourFinder.loadContour(info.contour.externalIndex,contourTmp); return contourTmp.toList(); }
[ "public", "List", "<", "Point2D_I32", ">", "getContour", "(", "Info", "info", ")", "{", "contourTmp", ".", "reset", "(", ")", ";", "contourFinder", ".", "loadContour", "(", "info", ".", "contour", ".", "externalIndex", ",", "contourTmp", ")", ";", "return"...
Returns the undistorted contour for a shape. Data is potentially recycled the next time any function in this class is invoked. @param info Which shape @return List of points in the contour
[ "Returns", "the", "undistorted", "contour", "for", "a", "shape", ".", "Data", "is", "potentially", "recycled", "the", "next", "time", "any", "function", "in", "this", "class", "is", "invoked", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L457-L461
49,860
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java
DetectPolygonFromContour.removeDistortionFromContour
private void removeDistortionFromContour(List<Point2D_I32> distorted , FastQueue<Point2D_I32> undistorted ) { undistorted.reset(); for (int j = 0; j < distorted.size(); j++) { // remove distortion Point2D_I32 p = distorted.get(j); Point2D_I32 q = undistorted.grow(); distToUndist.compute(p.x,p.y,disto...
java
private void removeDistortionFromContour(List<Point2D_I32> distorted , FastQueue<Point2D_I32> undistorted ) { undistorted.reset(); for (int j = 0; j < distorted.size(); j++) { // remove distortion Point2D_I32 p = distorted.get(j); Point2D_I32 q = undistorted.grow(); distToUndist.compute(p.x,p.y,disto...
[ "private", "void", "removeDistortionFromContour", "(", "List", "<", "Point2D_I32", ">", "distorted", ",", "FastQueue", "<", "Point2D_I32", ">", "undistorted", ")", "{", "undistorted", ".", "reset", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j",...
Removes lens distortion from the found contour
[ "Removes", "lens", "distortion", "from", "the", "found", "contour" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L499-L513
49,861
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java
DetectPolygonFromContour.touchesBorder
protected final boolean touchesBorder( List<Point2D_I32> contour ) { int endX = imageWidth-1; int endY = imageHeight-1; for (int j = 0; j < contour.size(); j++) { Point2D_I32 p = contour.get(j); if( p.x == 0 || p.y == 0 || p.x == endX || p.y == endY ) { return true; } } return false; }
java
protected final boolean touchesBorder( List<Point2D_I32> contour ) { int endX = imageWidth-1; int endY = imageHeight-1; for (int j = 0; j < contour.size(); j++) { Point2D_I32 p = contour.get(j); if( p.x == 0 || p.y == 0 || p.x == endX || p.y == endY ) { return true; } } return false; }
[ "protected", "final", "boolean", "touchesBorder", "(", "List", "<", "Point2D_I32", ">", "contour", ")", "{", "int", "endX", "=", "imageWidth", "-", "1", ";", "int", "endY", "=", "imageHeight", "-", "1", ";", "for", "(", "int", "j", "=", "0", ";", "j"...
Checks to see if some part of the contour touches the image border. Most likely cropped
[ "Checks", "to", "see", "if", "some", "part", "of", "the", "contour", "touches", "the", "image", "border", ".", "Most", "likely", "cropped" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L518-L531
49,862
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizedToPixelError.java
NormalizedToPixelError.set
public void set(double fx, double fy, double skew) { this.fx = fx; this.fy = fy; this.skew = skew; }
java
public void set(double fx, double fy, double skew) { this.fx = fx; this.fy = fy; this.skew = skew; }
[ "public", "void", "set", "(", "double", "fx", ",", "double", "fy", ",", "double", "skew", ")", "{", "this", ".", "fx", "=", "fx", ";", "this", ".", "fy", "=", "fy", ";", "this", ".", "skew", "=", "skew", ";", "}" ]
Specify camera intrinsic parameters @param fx focal length x @param fy focal length y @param skew camera skew
[ "Specify", "camera", "intrinsic", "parameters" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizedToPixelError.java#L48-L52
49,863
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java
ExampleImageStitching.computeTransform
public static<T extends ImageGray<T>, FD extends TupleDesc> Homography2D_F64 computeTransform( T imageA , T imageB , DetectDescribePoint<T,FD> detDesc , AssociateDescription<FD> associate , ModelMatcher<Homography2D_F64,AssociatedPair> modelMatcher ) { // get the length of the description Lis...
java
public static<T extends ImageGray<T>, FD extends TupleDesc> Homography2D_F64 computeTransform( T imageA , T imageB , DetectDescribePoint<T,FD> detDesc , AssociateDescription<FD> associate , ModelMatcher<Homography2D_F64,AssociatedPair> modelMatcher ) { // get the length of the description Lis...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "FD", "extends", "TupleDesc", ">", "Homography2D_F64", "computeTransform", "(", "T", "imageA", ",", "T", "imageB", ",", "DetectDescribePoint", "<", "T", ",", "FD", ">", "detDesc", ",...
Using abstracted code, find a transform which minimizes the difference between corresponding features in both images. This code is completely model independent and is the core algorithms.
[ "Using", "abstracted", "code", "find", "a", "transform", "which", "minimizes", "the", "difference", "between", "corresponding", "features", "in", "both", "images", ".", "This", "code", "is", "completely", "model", "independent", "and", "is", "the", "core", "algo...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java#L82-L122
49,864
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java
ExampleImageStitching.stitch
public static <T extends ImageGray<T>> void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // Detect using the standard SURF feat...
java
public static <T extends ImageGray<T>> void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // Detect using the standard SURF feat...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "stitch", "(", "BufferedImage", "imageA", ",", "BufferedImage", "imageB", ",", "Class", "<", "T", ">", "imageType", ")", "{", "T", "inputA", "=", "ConvertBufferedImage", ".",...
Given two input images create and display an image where the two have been overlayed on top of each other.
[ "Given", "two", "input", "images", "create", "and", "display", "an", "image", "where", "the", "two", "have", "been", "overlayed", "on", "top", "of", "each", "other", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java#L144-L163
49,865
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java
DisparityToColorPointCloud.configure
public void configure(double baseline, DMatrixRMaj K, DMatrixRMaj rectifiedR, Point2Transform2_F64 rectifiedToColor, int minDisparity, int maxDisparity) { this.K = K; ConvertMatrixData.convert(rectifiedR,this.rectifiedR); this.rectifiedToColor = rectifiedToColor; this.baseline = (float)b...
java
public void configure(double baseline, DMatrixRMaj K, DMatrixRMaj rectifiedR, Point2Transform2_F64 rectifiedToColor, int minDisparity, int maxDisparity) { this.K = K; ConvertMatrixData.convert(rectifiedR,this.rectifiedR); this.rectifiedToColor = rectifiedToColor; this.baseline = (float)b...
[ "public", "void", "configure", "(", "double", "baseline", ",", "DMatrixRMaj", "K", ",", "DMatrixRMaj", "rectifiedR", ",", "Point2Transform2_F64", "rectifiedToColor", ",", "int", "minDisparity", ",", "int", "maxDisparity", ")", "{", "this", ".", "K", "=", "K", ...
Stereo and intrinsic camera parameters @param baseline Stereo baseline (world units) @param K Intrinsic camera calibration matrix of rectified camera @param rectifiedToColor Transform from rectified pixels to the color image pixels. @param minDisparity Minimum disparity that's computed (pixels) @param maxDisparity Maxi...
[ "Stereo", "and", "intrinsic", "camera", "parameters" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java#L93-L108
49,866
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java
DisparityToColorPointCloud.process
public void process(ImageGray disparity , BufferedImage color ) { cloudRgb.setMaxSize(disparity.width*disparity.height); cloudXyz.setMaxSize(disparity.width*disparity.height*3); cloudRgb.reset(); cloudXyz.reset(); if( disparity instanceof GrayU8) process((GrayU8)disparity,color); else process((GrayF3...
java
public void process(ImageGray disparity , BufferedImage color ) { cloudRgb.setMaxSize(disparity.width*disparity.height); cloudXyz.setMaxSize(disparity.width*disparity.height*3); cloudRgb.reset(); cloudXyz.reset(); if( disparity instanceof GrayU8) process((GrayU8)disparity,color); else process((GrayF3...
[ "public", "void", "process", "(", "ImageGray", "disparity", ",", "BufferedImage", "color", ")", "{", "cloudRgb", ".", "setMaxSize", "(", "disparity", ".", "width", "*", "disparity", ".", "height", ")", ";", "cloudXyz", ".", "setMaxSize", "(", "disparity", "....
Given the disparity image compute the 3D location of valid points and save pixel colors at that point @param disparity Disparity image @param color Color image of left camera
[ "Given", "the", "disparity", "image", "compute", "the", "3D", "location", "of", "valid", "points", "and", "save", "pixel", "colors", "at", "that", "point" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java#L117-L127
49,867
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/feature/detect/ImageCorruptPanel.java
ImageCorruptPanel.corruptImage
public <T extends ImageGray<T>> void corruptImage(T original , T corrupted ) { GGrayImageOps.stretch(original, valueScale, valueOffset, 255.0, corrupted); GImageMiscOps.addGaussian(corrupted, rand, valueNoise, 0, 255); GPixelMath.boundImage(corrupted,0,255); }
java
public <T extends ImageGray<T>> void corruptImage(T original , T corrupted ) { GGrayImageOps.stretch(original, valueScale, valueOffset, 255.0, corrupted); GImageMiscOps.addGaussian(corrupted, rand, valueNoise, 0, 255); GPixelMath.boundImage(corrupted,0,255); }
[ "public", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "corruptImage", "(", "T", "original", ",", "T", "corrupted", ")", "{", "GGrayImageOps", ".", "stretch", "(", "original", ",", "valueScale", ",", "valueOffset", ",", "255.0", ",", "co...
Applies the specified corruption to the image. @param original Original uncorrupted image. @param corrupted Corrupted mage.
[ "Applies", "the", "specified", "corruption", "to", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/detect/ImageCorruptPanel.java#L95-L100
49,868
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/AdjustHomographyMatrix.java
AdjustHomographyMatrix.findScaleH
protected boolean findScaleH( DMatrixRMaj H ) { if( !svd.decompose(H) ) return false; Arrays.sort(svd.getSingularValues(), 0, 3); double scale = svd.getSingularValues()[1]; CommonOps_DDRM.divide(H,scale); return true; }
java
protected boolean findScaleH( DMatrixRMaj H ) { if( !svd.decompose(H) ) return false; Arrays.sort(svd.getSingularValues(), 0, 3); double scale = svd.getSingularValues()[1]; CommonOps_DDRM.divide(H,scale); return true; }
[ "protected", "boolean", "findScaleH", "(", "DMatrixRMaj", "H", ")", "{", "if", "(", "!", "svd", ".", "decompose", "(", "H", ")", ")", "return", "false", ";", "Arrays", ".", "sort", "(", "svd", ".", "getSingularValues", "(", ")", ",", "0", ",", "3", ...
The scale of H is found by computing the second smallest singular value.
[ "The", "scale", "of", "H", "is", "found", "by", "computing", "the", "second", "smallest", "singular", "value", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/AdjustHomographyMatrix.java#L66-L76
49,869
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/impl/ImplWaveletTransformNaive.java
ImplWaveletTransformNaive.vertical
public static void vertical(BorderIndex1D border , WlCoef_I32 coefficients , GrayI input , GrayI output ) { UtilWavelet.checkShape(input,output); final int offsetA = coefficients.offsetScaling; final int offsetB = coefficients.offsetWavelet; final int[] alpha = coefficients.scaling; final int[] beta...
java
public static void vertical(BorderIndex1D border , WlCoef_I32 coefficients , GrayI input , GrayI output ) { UtilWavelet.checkShape(input,output); final int offsetA = coefficients.offsetScaling; final int offsetB = coefficients.offsetWavelet; final int[] alpha = coefficients.scaling; final int[] beta...
[ "public", "static", "void", "vertical", "(", "BorderIndex1D", "border", ",", "WlCoef_I32", "coefficients", ",", "GrayI", "input", ",", "GrayI", "output", ")", "{", "UtilWavelet", ".", "checkShape", "(", "input", ",", "output", ")", ";", "final", "int", "offs...
Performs a single level wavelet transform along the vertical axis. @param coefficients Description of wavelet coefficients. @param input Input image which is being transform. Not modified. @param output where the output is written to. Modified
[ "Performs", "a", "single", "level", "wavelet", "transform", "along", "the", "vertical", "axis", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/impl/ImplWaveletTransformNaive.java#L341-L382
49,870
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/convolve/FactoryConvolve.java
FactoryConvolve.convolve
public static <Input extends ImageBase<Input>, Output extends ImageBase<Output>> ConvolveInterface<Input,Output> convolve(Kernel1D kernel, ImageType<Input> inputType, ImageType<Output> outputType , BorderType border , boolean isHorizontal ) { if( inputType.getFamily() != ImageType.Family.GRAY ) throw new Illega...
java
public static <Input extends ImageBase<Input>, Output extends ImageBase<Output>> ConvolveInterface<Input,Output> convolve(Kernel1D kernel, ImageType<Input> inputType, ImageType<Output> outputType , BorderType border , boolean isHorizontal ) { if( inputType.getFamily() != ImageType.Family.GRAY ) throw new Illega...
[ "public", "static", "<", "Input", "extends", "ImageBase", "<", "Input", ">", ",", "Output", "extends", "ImageBase", "<", "Output", ">", ">", "ConvolveInterface", "<", "Input", ",", "Output", ">", "convolve", "(", "Kernel1D", "kernel", ",", "ImageType", "<", ...
Creates a filter for convolving 1D kernels along the image. @param kernel Convolution kernel. @param inputType Specifies input image type. @param outputType Specifies input image type. @param border How the image border is handled. @return FilterInterface which will perform the specified convolution.
[ "Creates", "a", "filter", "for", "convolving", "1D", "kernels", "along", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/convolve/FactoryConvolve.java#L53-L99
49,871
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps.java
LensDistortionOps.changeCameraModel
public static <T extends ImageBase<T>,O extends CameraPinhole, D extends CameraPinhole> ImageDistort<T,T> changeCameraModel(AdjustmentType type, BorderType borderType, O original, D desired, D modified, ImageType<T> imageType) { Class bandType = imageType.getImageClass(); b...
java
public static <T extends ImageBase<T>,O extends CameraPinhole, D extends CameraPinhole> ImageDistort<T,T> changeCameraModel(AdjustmentType type, BorderType borderType, O original, D desired, D modified, ImageType<T> imageType) { Class bandType = imageType.getImageClass(); b...
[ "public", "static", "<", "T", "extends", "ImageBase", "<", "T", ">", ",", "O", "extends", "CameraPinhole", ",", "D", "extends", "CameraPinhole", ">", "ImageDistort", "<", "T", ",", "T", ">", "changeCameraModel", "(", "AdjustmentType", "type", ",", "BorderTyp...
Creates a distortion for modifying the input image from one camera model into another camera model. If requested the camera model can be further modified to ensure certain visibility requirements are meet and the adjusted camera model will be returned. @param type How it should modify the image model to ensure visibil...
[ "Creates", "a", "distortion", "for", "modifying", "the", "input", "image", "from", "one", "camera", "model", "into", "another", "camera", "model", ".", "If", "requested", "the", "camera", "model", "can", "be", "further", "modified", "to", "ensure", "certain", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps.java#L53-L77
49,872
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java
ImplBinaryNaiveOps.getT
public static boolean getT(GrayU8 image, int x, int y) { if (image.isInBounds(x, y)) { return image.get(x, y) != 0; } else { return true; } }
java
public static boolean getT(GrayU8 image, int x, int y) { if (image.isInBounds(x, y)) { return image.get(x, y) != 0; } else { return true; } }
[ "public", "static", "boolean", "getT", "(", "GrayU8", "image", ",", "int", "x", ",", "int", "y", ")", "{", "if", "(", "image", ".", "isInBounds", "(", "x", ",", "y", ")", ")", "{", "return", "image", ".", "get", "(", "x", ",", "y", ")", "!=", ...
If a point is inside the image true is returned if its value is not zero, otherwise true is returned.
[ "If", "a", "point", "is", "inside", "the", "image", "true", "is", "returned", "if", "its", "value", "is", "not", "zero", "otherwise", "true", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L183-L189
49,873
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java
ImplBinaryNaiveOps.getF
public static boolean getF(GrayU8 image, int x, int y) { if (image.isInBounds(x, y)) { return image.get(x, y) != 0; } else { return false; } }
java
public static boolean getF(GrayU8 image, int x, int y) { if (image.isInBounds(x, y)) { return image.get(x, y) != 0; } else { return false; } }
[ "public", "static", "boolean", "getF", "(", "GrayU8", "image", ",", "int", "x", ",", "int", "y", ")", "{", "if", "(", "image", ".", "isInBounds", "(", "x", ",", "y", ")", ")", "{", "return", "image", ".", "get", "(", "x", ",", "y", ")", "!=", ...
If a point is inside the image true is returned if its value is not zero, otherwise false is returned.
[ "If", "a", "point", "is", "inside", "the", "image", "true", "is", "returned", "if", "its", "value", "is", "not", "zero", "otherwise", "false", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L194-L200
49,874
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.convert
public boolean convert( ChessboardCornerGraph cluster , GridInfo info ) { // default to an invalid value to ensure a failure doesn't go unnoticed. info.reset(); // Get the edges in a consistent order if( !orderEdges(cluster) ) return false; // Now we need to order the nodes into a proper grid which follo...
java
public boolean convert( ChessboardCornerGraph cluster , GridInfo info ) { // default to an invalid value to ensure a failure doesn't go unnoticed. info.reset(); // Get the edges in a consistent order if( !orderEdges(cluster) ) return false; // Now we need to order the nodes into a proper grid which follo...
[ "public", "boolean", "convert", "(", "ChessboardCornerGraph", "cluster", ",", "GridInfo", "info", ")", "{", "// default to an invalid value to ensure a failure doesn't go unnoticed.", "info", ".", "reset", "(", ")", ";", "// Get the edges in a consistent order", "if", "(", ...
Puts cluster nodes into grid order and computes the number of rows and columns. If the cluster is not a complete grid this function will fail and return false @param cluster (Input) cluster. Edge order will be modified. @param info (Output) Contains ordered nodes and the grid's size. @return true if successful or fals...
[ "Puts", "cluster", "nodes", "into", "grid", "order", "and", "computes", "the", "number", "of", "rows", "and", "columns", ".", "If", "the", "cluster", "is", "not", "a", "complete", "grid", "this", "function", "will", "fail", "and", "return", "false" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L79-L103
49,875
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.selectCorner
int selectCorner( GridInfo info ) { info.lookupGridCorners(cornerList); int bestCorner = -1; double bestScore = Double.MAX_VALUE; boolean bestIsCornerSquare = false; for (int i = 0; i < cornerList.size(); i++) { Node n = cornerList.get(i); boolean corner = isCornerValidOrigin(n); // If there are...
java
int selectCorner( GridInfo info ) { info.lookupGridCorners(cornerList); int bestCorner = -1; double bestScore = Double.MAX_VALUE; boolean bestIsCornerSquare = false; for (int i = 0; i < cornerList.size(); i++) { Node n = cornerList.get(i); boolean corner = isCornerValidOrigin(n); // If there are...
[ "int", "selectCorner", "(", "GridInfo", "info", ")", "{", "info", ".", "lookupGridCorners", "(", "cornerList", ")", ";", "int", "bestCorner", "=", "-", "1", ";", "double", "bestScore", "=", "Double", ".", "MAX_VALUE", ";", "boolean", "bestIsCornerSquare", "=...
Selects a corner to be the grid's origin. 0 = top-left, 1 = top-right, 2 = bottom-right, 3 = bottom-left. Looks at each grid and see if it can be valid. Out of the valid list
[ "Selects", "a", "corner", "to", "be", "the", "grid", "s", "origin", ".", "0", "=", "top", "-", "left", "1", "=", "top", "-", "right", "2", "=", "bottom", "-", "right", "3", "=", "bottom", "-", "left", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L110-L151
49,876
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.orderNodes
boolean orderNodes( FastQueue<Node> corners , GridInfo info ) { // Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph Node seed = null; for (int i = 0; i < corners.size; i++) { Node n = corners.get(i); if( n.countEdges() == 2 ) { seed = n; break; } ...
java
boolean orderNodes( FastQueue<Node> corners , GridInfo info ) { // Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph Node seed = null; for (int i = 0; i < corners.size; i++) { Node n = corners.get(i); if( n.countEdges() == 2 ) { seed = n; break; } ...
[ "boolean", "orderNodes", "(", "FastQueue", "<", "Node", ">", "corners", ",", "GridInfo", "info", ")", "{", "// Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph", "Node", "seed", "=", "null", ";", "for", "(", "int", "i", "="...
Put corners into a proper grid. Make sure its a rectangular grid or else return false. Rows and columns are selected to ensure right hand rule.
[ "Put", "corners", "into", "a", "proper", "grid", ".", "Make", "sure", "its", "a", "rectangular", "grid", "or", "else", "return", "false", ".", "Rows", "and", "columns", "are", "selected", "to", "ensure", "right", "hand", "rule", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L182-L236
49,877
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.isRightHanded
static boolean isRightHanded( Node seed , int idxRow , int idxCol ) { Node r = seed.edges[idxRow]; Node c = seed.edges[idxCol]; double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x); double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x); return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI; }
java
static boolean isRightHanded( Node seed , int idxRow , int idxCol ) { Node r = seed.edges[idxRow]; Node c = seed.edges[idxCol]; double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x); double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x); return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI; }
[ "static", "boolean", "isRightHanded", "(", "Node", "seed", ",", "int", "idxRow", ",", "int", "idxCol", ")", "{", "Node", "r", "=", "seed", ".", "edges", "[", "idxRow", "]", ";", "Node", "c", "=", "seed", ".", "edges", "[", "idxCol", "]", ";", "doub...
Checks to see if the rows and columns for a coordinate system which is right handed @param idxRow Index for moving up a row @param idxCol index for moving up a column
[ "Checks", "to", "see", "if", "the", "rows", "and", "columns", "for", "a", "coordinate", "system", "which", "is", "right", "handed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L244-L252
49,878
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.sortEdgesCCW
void sortEdgesCCW(FastQueue<Node> corners) { for (int nodeIdx = 0; nodeIdx < corners.size; nodeIdx++) { Node na = corners.get(nodeIdx); // reference node to do angles relative to. double ref = Double.NaN; int count = 0; for (int i = 0; i < 4; i++) { order[i] = i; tmpEdges[i] = na.edges[i]; ...
java
void sortEdgesCCW(FastQueue<Node> corners) { for (int nodeIdx = 0; nodeIdx < corners.size; nodeIdx++) { Node na = corners.get(nodeIdx); // reference node to do angles relative to. double ref = Double.NaN; int count = 0; for (int i = 0; i < 4; i++) { order[i] = i; tmpEdges[i] = na.edges[i]; ...
[ "void", "sortEdgesCCW", "(", "FastQueue", "<", "Node", ">", "corners", ")", "{", "for", "(", "int", "nodeIdx", "=", "0", ";", "nodeIdx", "<", "corners", ".", "size", ";", "nodeIdx", "++", ")", "{", "Node", "na", "=", "corners", ".", "get", "(", "no...
Sorts edges so that they point towards nodes in an increasing counter clockwise direction
[ "Sorts", "edges", "so", "that", "they", "point", "towards", "nodes", "in", "an", "increasing", "counter", "clockwise", "direction" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L320-L379
49,879
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java
ChessboardCornerClusterToGrid.rotateCCW
public void rotateCCW(GridInfo grid ) { cornerList.clear(); for (int col = 0; col < grid.cols; col++) { for (int row = 0; row < grid.rows; row++) { cornerList.add(grid.get(row,grid.cols - col - 1)); } } int tmp = grid.rows; grid.rows = grid.cols; grid.cols = tmp; grid.nodes.clear(); grid.node...
java
public void rotateCCW(GridInfo grid ) { cornerList.clear(); for (int col = 0; col < grid.cols; col++) { for (int row = 0; row < grid.rows; row++) { cornerList.add(grid.get(row,grid.cols - col - 1)); } } int tmp = grid.rows; grid.rows = grid.cols; grid.cols = tmp; grid.nodes.clear(); grid.node...
[ "public", "void", "rotateCCW", "(", "GridInfo", "grid", ")", "{", "cornerList", ".", "clear", "(", ")", ";", "for", "(", "int", "col", "=", "0", ";", "col", "<", "grid", ".", "cols", ";", "col", "++", ")", "{", "for", "(", "int", "row", "=", "0...
Rotates the grid in the CCW direction
[ "Rotates", "the", "grid", "in", "the", "CCW", "direction" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L384-L397
49,880
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java
StereoProcessingBase.setCalibration
public void setCalibration(StereoParameters stereoParam) { CameraPinholeBrown left = stereoParam.getLeft(); CameraPinholeBrown right = stereoParam.getRight(); // adjust image size imageLeftRect.reshape(left.getWidth(), left.getHeight()); imageRightRect.reshape(right.getWidth(), right.getHeight()); // comp...
java
public void setCalibration(StereoParameters stereoParam) { CameraPinholeBrown left = stereoParam.getLeft(); CameraPinholeBrown right = stereoParam.getRight(); // adjust image size imageLeftRect.reshape(left.getWidth(), left.getHeight()); imageRightRect.reshape(right.getWidth(), right.getHeight()); // comp...
[ "public", "void", "setCalibration", "(", "StereoParameters", "stereoParam", ")", "{", "CameraPinholeBrown", "left", "=", "stereoParam", ".", "getLeft", "(", ")", ";", "CameraPinholeBrown", "right", "=", "stereoParam", ".", "getRight", "(", ")", ";", "// adjust ima...
Specifies stereo parameters @param stereoParam stereo parameters
[ "Specifies", "stereo", "parameters" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java#L95-L136
49,881
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java
StereoProcessingBase.computeHomo3D
public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) { // Coordinate in rectified camera frame pointRect.z = baseline*fx; pointRect.x = pointRect.z*(x - cx)/fx; pointRect.y = pointRect.z*(y - cy)/fy; // rotate into the original left camera frame GeometryMath_F64.multTran(rectR,pointRect,poi...
java
public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) { // Coordinate in rectified camera frame pointRect.z = baseline*fx; pointRect.x = pointRect.z*(x - cx)/fx; pointRect.y = pointRect.z*(y - cy)/fy; // rotate into the original left camera frame GeometryMath_F64.multTran(rectR,pointRect,poi...
[ "public", "void", "computeHomo3D", "(", "double", "x", ",", "double", "y", ",", "Point3D_F64", "pointLeft", ")", "{", "// Coordinate in rectified camera frame", "pointRect", ".", "z", "=", "baseline", "*", "fx", ";", "pointRect", ".", "x", "=", "pointRect", "....
Given a coordinate of a point in the left rectified frame, compute the point's 3D coordinate in the camera's reference frame in homogeneous coordinates. To convert the coordinate into normal 3D, divide each element by the disparity. @param x x-coordinate of pixel in rectified left image @param y y-coordinate of pixel ...
[ "Given", "a", "coordinate", "of", "a", "point", "in", "the", "left", "rectified", "frame", "compute", "the", "point", "s", "3D", "coordinate", "in", "the", "camera", "s", "reference", "frame", "in", "homogeneous", "coordinates", ".", "To", "convert", "the", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java#L147-L155
49,882
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/GIntegralImageOps.java
GIntegralImageOps.getIntegralType
public static <I extends ImageGray<I>, II extends ImageGray<II>> Class<II> getIntegralType( Class<I> inputType ) { if( inputType == GrayF32.class ) { return (Class<II>)GrayF32.class; } else if( inputType == GrayU8.class ){ return (Class<II>)GrayS32.class; } else if( inputType == GrayS32.class ){ return ...
java
public static <I extends ImageGray<I>, II extends ImageGray<II>> Class<II> getIntegralType( Class<I> inputType ) { if( inputType == GrayF32.class ) { return (Class<II>)GrayF32.class; } else if( inputType == GrayU8.class ){ return (Class<II>)GrayS32.class; } else if( inputType == GrayS32.class ){ return ...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ",", "II", "extends", "ImageGray", "<", "II", ">", ">", "Class", "<", "II", ">", "getIntegralType", "(", "Class", "<", "I", ">", "inputType", ")", "{", "if", "(", "inputType", "==",...
Given the input image, return the type of image the integral image should be.
[ "Given", "the", "input", "image", "return", "the", "type", "of", "image", "the", "integral", "image", "should", "be", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/GIntegralImageOps.java#L35-L46
49,883
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java
FiducialDetectorPnP.computeStability
@Override public boolean computeStability(int which, double disturbance, FiducialStability results) { if( !getFiducialToCamera(which, targetToCamera)) return false; stability.setShape(getSideWidth(which), getSideHeight(which)); stability.computeStability(targetToCamera,disturbance,results); return true; ...
java
@Override public boolean computeStability(int which, double disturbance, FiducialStability results) { if( !getFiducialToCamera(which, targetToCamera)) return false; stability.setShape(getSideWidth(which), getSideHeight(which)); stability.computeStability(targetToCamera,disturbance,results); return true; ...
[ "@", "Override", "public", "boolean", "computeStability", "(", "int", "which", ",", "double", "disturbance", ",", "FiducialStability", "results", ")", "{", "if", "(", "!", "getFiducialToCamera", "(", "which", ",", "targetToCamera", ")", ")", "return", "false", ...
Estimates the stability by perturbing each land mark by the specified number of pixels in the distorted image.
[ "Estimates", "the", "stability", "by", "perturbing", "each", "land", "mark", "by", "the", "specified", "number", "of", "pixels", "in", "the", "distorted", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L98-L108
49,884
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java
FiducialDetectorPnP.createDetectedList
private void createDetectedList(int which, List<PointIndex2D_F64> pixels) { detected2D3D.clear(); List<Point2D3D> all = getControl3D(which); for (int i = 0; i < pixels.size(); i++) { PointIndex2D_F64 a = pixels.get(i); Point2D3D b = all.get(i); pixelToNorm.compute(a.x,a.y, b.observation); detected2D3...
java
private void createDetectedList(int which, List<PointIndex2D_F64> pixels) { detected2D3D.clear(); List<Point2D3D> all = getControl3D(which); for (int i = 0; i < pixels.size(); i++) { PointIndex2D_F64 a = pixels.get(i); Point2D3D b = all.get(i); pixelToNorm.compute(a.x,a.y, b.observation); detected2D3...
[ "private", "void", "createDetectedList", "(", "int", "which", ",", "List", "<", "PointIndex2D_F64", ">", "pixels", ")", "{", "detected2D3D", ".", "clear", "(", ")", ";", "List", "<", "Point2D3D", ">", "all", "=", "getControl3D", "(", "which", ")", ";", "...
Create the list of observed points in 2D3D
[ "Create", "the", "list", "of", "observed", "points", "in", "2D3D" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L148-L158
49,885
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java
FiducialDetectorPnP.estimatePose
protected boolean estimatePose( int which ,List<Point2D3D> points , Se3_F64 fiducialToCamera ) { if( !estimatePnP.process(points, initialEstimate) ) { return false; } filtered.clear(); // Don't bother if there are hardly any points to work with if( points.size() > 6 ) { w2p.configure(lensDistortion, ini...
java
protected boolean estimatePose( int which ,List<Point2D3D> points , Se3_F64 fiducialToCamera ) { if( !estimatePnP.process(points, initialEstimate) ) { return false; } filtered.clear(); // Don't bother if there are hardly any points to work with if( points.size() > 6 ) { w2p.configure(lensDistortion, ini...
[ "protected", "boolean", "estimatePose", "(", "int", "which", ",", "List", "<", "Point2D3D", ">", "points", ",", "Se3_F64", "fiducialToCamera", ")", "{", "if", "(", "!", "estimatePnP", ".", "process", "(", "points", ",", "initialEstimate", ")", ")", "{", "r...
Given the mapping of 2D observations to known 3D points estimate the pose of the fiducial. This solves the P-n-P problem. Do a simple form of robust estimation. Prune points which are greater than 3 standard deviations and likely noise the recompute the pose
[ "Given", "the", "mapping", "of", "2D", "observations", "to", "known", "3D", "points", "estimate", "the", "pose", "of", "the", "fiducial", ".", "This", "solves", "the", "P", "-", "n", "-", "P", "problem", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L167-L210
49,886
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java
HoughTransformLineFootOfNorm.transform
public <D extends ImageGray<D>> void transform(D derivX , D derivY , GrayU8 binary ) { InputSanityCheck.checkSameShape(derivX,derivY,binary); transform.reshape(derivX.width,derivY.height); ImageMiscOps.fill(transform,0); originX = derivX.width/2; originY = derivX.height/2; candidates.reset(); if( deri...
java
public <D extends ImageGray<D>> void transform(D derivX , D derivY , GrayU8 binary ) { InputSanityCheck.checkSameShape(derivX,derivY,binary); transform.reshape(derivX.width,derivY.height); ImageMiscOps.fill(transform,0); originX = derivX.width/2; originY = derivX.height/2; candidates.reset(); if( deri...
[ "public", "<", "D", "extends", "ImageGray", "<", "D", ">", ">", "void", "transform", "(", "D", "derivX", ",", "D", "derivY", ",", "GrayU8", "binary", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "derivX", ",", "derivY", ",", "binary", ")", ...
Computes the Hough transform using the image gradient and a binary image which flags pixels as being edges or not. @param derivX Image derivative along x-axis. @param derivY Image derivative along y-axis. @param binary Non-zero pixels are considered to be line pixels.
[ "Computes", "the", "Hough", "transform", "using", "the", "image", "gradient", "and", "a", "binary", "image", "which", "flags", "pixels", "as", "being", "edges", "or", "not", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java#L92-L111
49,887
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java
HoughTransformLineFootOfNorm.parameterize
public void parameterize( int x , int y , float derivX , float derivY ) { // put the point in a new coordinate system centered at the image's origin // this minimizes error, which is a function of distance from origin x -= originX; y -= originY; float v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY...
java
public void parameterize( int x , int y , float derivX , float derivY ) { // put the point in a new coordinate system centered at the image's origin // this minimizes error, which is a function of distance from origin x -= originX; y -= originY; float v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY...
[ "public", "void", "parameterize", "(", "int", "x", ",", "int", "y", ",", "float", "derivX", ",", "float", "derivY", ")", "{", "// put the point in a new coordinate system centered at the image's origin", "// this minimizes error, which is a function of distance from origin", "x...
Takes the detected point along the line and its gradient and converts it into transform space. @param x point in image. @param y point in image. @param derivX gradient of point. @param derivY gradient of point.
[ "Takes", "the", "detected", "point", "along", "the", "line", "and", "its", "gradient", "and", "converts", "it", "into", "transform", "space", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java#L150-L170
49,888
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleDenseImageFeatures.java
ExampleDenseImageFeatures.HighLevel
public static void HighLevel( GrayF32 input) { System.out.println("\n------------------- Dense High Level"); DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense. hog(new ConfigDenseHoG(),input.getImageType()); // sift(new ConfigDenseSift(),GrayF32.class); // surfFast(new Config...
java
public static void HighLevel( GrayF32 input) { System.out.println("\n------------------- Dense High Level"); DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense. hog(new ConfigDenseHoG(),input.getImageType()); // sift(new ConfigDenseSift(),GrayF32.class); // surfFast(new Config...
[ "public", "static", "void", "HighLevel", "(", "GrayF32", "input", ")", "{", "System", ".", "out", ".", "println", "(", "\"\\n------------------- Dense High Level\"", ")", ";", "DescribeImageDense", "<", "GrayF32", ",", "TupleDesc_F64", ">", "describer", "=", "Fact...
For much larger images you might need to shrink the image down or change the cell size to get good results.
[ "For", "much", "larger", "images", "you", "might", "need", "to", "shrink", "the", "image", "down", "or", "change", "the", "cell", "size", "to", "get", "good", "results", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDenseImageFeatures.java#L52-L72
49,889
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java
StereoDisparityWtoNaiveFive.process
public void process( I left , I right , GrayF32 imageDisparity ) { // check inputs and initialize data structures InputSanityCheck.checkSameShape(left,right,imageDisparity); this.imageLeft = left; this.imageRight = right; w = left.width; h = left.height; // Compute disparity for each pixel for( int y = ...
java
public void process( I left , I right , GrayF32 imageDisparity ) { // check inputs and initialize data structures InputSanityCheck.checkSameShape(left,right,imageDisparity); this.imageLeft = left; this.imageRight = right; w = left.width; h = left.height; // Compute disparity for each pixel for( int y = ...
[ "public", "void", "process", "(", "I", "left", ",", "I", "right", ",", "GrayF32", "imageDisparity", ")", "{", "// check inputs and initialize data structures", "InputSanityCheck", ".", "checkSameShape", "(", "left", ",", "right", ",", "imageDisparity", ")", ";", "...
Computes the disparity for two stereo images along the image's right axis. Both image must be rectified. @param left Left camera image. @param right Right camera image.
[ "Computes", "the", "disparity", "for", "two", "stereo", "images", "along", "the", "image", "s", "right", "axis", ".", "Both", "image", "must", "be", "rectified", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L75-L96
49,890
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java
StereoDisparityWtoNaiveFive.processPixel
private void processPixel( int c_x , int c_y , int maxDisparity ) { for( int i = minDisparity; i < maxDisparity; i++ ) { score[i] = computeScore( c_x , c_x-i,c_y); } }
java
private void processPixel( int c_x , int c_y , int maxDisparity ) { for( int i = minDisparity; i < maxDisparity; i++ ) { score[i] = computeScore( c_x , c_x-i,c_y); } }
[ "private", "void", "processPixel", "(", "int", "c_x", ",", "int", "c_y", ",", "int", "maxDisparity", ")", "{", "for", "(", "int", "i", "=", "minDisparity", ";", "i", "<", "maxDisparity", ";", "i", "++", ")", "{", "score", "[", "i", "]", "=", "compu...
Computes fit score for each possible disparity @param c_x Center of region on left image. x-axis @param c_y Center of region on left image. y-axis @param maxDisparity Max allowed disparity
[ "Computes", "fit", "score", "for", "each", "possible", "disparity" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L105-L110
49,891
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java
StereoDisparityWtoNaiveFive.selectBest
protected double selectBest( int length ) { double best = Double.MAX_VALUE; int index = -1; for( int i = minDisparity; i < length; i++ ) { if( score[i] < best ) { best = score[i]; index = i; } } return index-minDisparity; }
java
protected double selectBest( int length ) { double best = Double.MAX_VALUE; int index = -1; for( int i = minDisparity; i < length; i++ ) { if( score[i] < best ) { best = score[i]; index = i; } } return index-minDisparity; }
[ "protected", "double", "selectBest", "(", "int", "length", ")", "{", "double", "best", "=", "Double", ".", "MAX_VALUE", ";", "int", "index", "=", "-", "1", ";", "for", "(", "int", "i", "=", "minDisparity", ";", "i", "<", "length", ";", "i", "++", "...
Select best disparity using the inner takes all approach @param length The max allowed disparity at this pixel @return The best disparity selected.
[ "Select", "best", "disparity", "using", "the", "inner", "takes", "all", "approach" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L118-L129
49,892
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java
StereoDisparityWtoNaiveFive.computeScore
protected double computeScore( int leftX , int rightX , int centerY ) { double center = computeScoreRect(leftX,rightX,centerY); four[0] = computeScoreRect(leftX-radiusX,rightX-radiusX,centerY-radiusY); four[1] = computeScoreRect(leftX+radiusX,rightX+radiusX,centerY-radiusY); four[2] = computeScoreRect(leftX...
java
protected double computeScore( int leftX , int rightX , int centerY ) { double center = computeScoreRect(leftX,rightX,centerY); four[0] = computeScoreRect(leftX-radiusX,rightX-radiusX,centerY-radiusY); four[1] = computeScoreRect(leftX+radiusX,rightX+radiusX,centerY-radiusY); four[2] = computeScoreRect(leftX...
[ "protected", "double", "computeScore", "(", "int", "leftX", ",", "int", "rightX", ",", "int", "centerY", ")", "{", "double", "center", "=", "computeScoreRect", "(", "leftX", ",", "rightX", ",", "centerY", ")", ";", "four", "[", "0", "]", "=", "computeSco...
Compute the score for five local regions and just use the center + the two best @param leftX X-axis center left image @param rightX X-axis center left image @param centerY Y-axis center for both images @return Fit score for both regions.
[ "Compute", "the", "score", "for", "five", "local", "regions", "and", "just", "use", "the", "center", "+", "the", "two", "best" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L139-L150
49,893
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java
QrCodeGenerator.render
public void render( QrCode qr ) { initialize(qr); render.init(); positionPattern(0,0, qr.ppCorner); positionPattern((numModules-7)*moduleWidth,0, qr.ppRight); positionPattern(0,(numModules-7)*moduleWidth, qr.ppDown); timingPattern(7*moduleWidth,6*moduleWidth,moduleWidth,0); timingPattern(6*moduleWidth,7...
java
public void render( QrCode qr ) { initialize(qr); render.init(); positionPattern(0,0, qr.ppCorner); positionPattern((numModules-7)*moduleWidth,0, qr.ppRight); positionPattern(0,(numModules-7)*moduleWidth, qr.ppDown); timingPattern(7*moduleWidth,6*moduleWidth,moduleWidth,0); timingPattern(6*moduleWidth,7...
[ "public", "void", "render", "(", "QrCode", "qr", ")", "{", "initialize", "(", "qr", ")", ";", "render", ".", "init", "(", ")", ";", "positionPattern", "(", "0", ",", "0", ",", "qr", ".", "ppCorner", ")", ";", "positionPattern", "(", "(", "numModules"...
Generates a QR Code with the specified message. An exception is thrown if the message is too long to be encoded.
[ "Generates", "a", "QR", "Code", "with", "the", "specified", "message", ".", "An", "exception", "is", "thrown", "if", "the", "message", "is", "too", "long", "to", "be", "encoded", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java#L67-L122
49,894
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java
QrCodeGenerator.renderData
private void renderData() { QrCodeMaskPattern mask = qr.mask; int count = 0; int length = bitLocations.size() - bitLocations.size()%8; while( count < length ) { int bits = qr.rawbits[count/8]&0xFF; int N = Math.min(8,bitLocations.size()-count); for (int i = 0; i < N; i++) { Point2D_I32 coor = bi...
java
private void renderData() { QrCodeMaskPattern mask = qr.mask; int count = 0; int length = bitLocations.size() - bitLocations.size()%8; while( count < length ) { int bits = qr.rawbits[count/8]&0xFF; int N = Math.min(8,bitLocations.size()-count); for (int i = 0; i < N; i++) { Point2D_I32 coor = bi...
[ "private", "void", "renderData", "(", ")", "{", "QrCodeMaskPattern", "mask", "=", "qr", ".", "mask", ";", "int", "count", "=", "0", ";", "int", "length", "=", "bitLocations", ".", "size", "(", ")", "-", "bitLocations", ".", "size", "(", ")", "%", "8"...
Renders the raw data bit output while applying the selected mask
[ "Renders", "the", "raw", "data", "bit", "output", "while", "applying", "the", "selected", "mask" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java#L134-L155
49,895
lessthanoptimal/BoofCV
integration/boofcv-javacv/src/main/java/boofcv/javacv/UtilOpenCV.java
UtilOpenCV.loadPinholeRadial
public static CameraPinholeBrown loadPinholeRadial(String fileName ) { FileStorage fs = new FileStorage( new File(fileName).getAbsolutePath(), FileStorage.READ); IntPointer width = new IntPointer(1); IntPointer height = new IntPointer(1); read(fs.get("image_width"),width,-1); read(fs.get("image_height")...
java
public static CameraPinholeBrown loadPinholeRadial(String fileName ) { FileStorage fs = new FileStorage( new File(fileName).getAbsolutePath(), FileStorage.READ); IntPointer width = new IntPointer(1); IntPointer height = new IntPointer(1); read(fs.get("image_width"),width,-1); read(fs.get("image_height")...
[ "public", "static", "CameraPinholeBrown", "loadPinholeRadial", "(", "String", "fileName", ")", "{", "FileStorage", "fs", "=", "new", "FileStorage", "(", "new", "File", "(", "fileName", ")", ".", "getAbsolutePath", "(", ")", ",", "FileStorage", ".", "READ", ")"...
Loads a pinhole camera model with radian and tangential distortion in OpenCV format @param fileName path to file @return CameraPinholeRadial
[ "Loads", "a", "pinhole", "camera", "model", "with", "radian", "and", "tangential", "distortion", "in", "OpenCV", "format" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-javacv/src/main/java/boofcv/javacv/UtilOpenCV.java#L44-L79
49,896
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java
SquareNode.distanceSqCorner
public double distanceSqCorner( Point2D_F64 p ) { double best = Double.MAX_VALUE; for (int i = 0; i < 4; i++) { double d = square.get(i).distance2(p); if( d < best ) { best = d; } } return best; }
java
public double distanceSqCorner( Point2D_F64 p ) { double best = Double.MAX_VALUE; for (int i = 0; i < 4; i++) { double d = square.get(i).distance2(p); if( d < best ) { best = d; } } return best; }
[ "public", "double", "distanceSqCorner", "(", "Point2D_F64", "p", ")", "{", "double", "best", "=", "Double", ".", "MAX_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "double", "d", "=", "square", ".", ...
Finds the Euclidean distance squared of the closest corner to point p
[ "Finds", "the", "Euclidean", "distance", "squared", "of", "the", "closest", "corner", "to", "point", "p" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L59-L68
49,897
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java
SquareNode.reset
public void reset() { square = null; touch = null; center.set(-1,-1); largestSide = 0; smallestSide = Double.MAX_VALUE; graph = RESET_GRAPH; for (int i = 0; i < edges.length; i++) { if ( edges[i] != null ) throw new RuntimeException("BUG!"); sideLengths[i] = 0; } }
java
public void reset() { square = null; touch = null; center.set(-1,-1); largestSide = 0; smallestSide = Double.MAX_VALUE; graph = RESET_GRAPH; for (int i = 0; i < edges.length; i++) { if ( edges[i] != null ) throw new RuntimeException("BUG!"); sideLengths[i] = 0; } }
[ "public", "void", "reset", "(", ")", "{", "square", "=", "null", ";", "touch", "=", "null", ";", "center", ".", "set", "(", "-", "1", ",", "-", "1", ")", ";", "largestSide", "=", "0", ";", "smallestSide", "=", "Double", ".", "MAX_VALUE", ";", "gr...
Discards previous information
[ "Discards", "previous", "information" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L73-L85
49,898
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java
SquareNode.updateArrayLength
public void updateArrayLength() { if( edges.length != square.size() ) { edges = new SquareEdge[square.size()]; sideLengths = new double[square.size()]; } }
java
public void updateArrayLength() { if( edges.length != square.size() ) { edges = new SquareEdge[square.size()]; sideLengths = new double[square.size()]; } }
[ "public", "void", "updateArrayLength", "(", ")", "{", "if", "(", "edges", ".", "length", "!=", "square", ".", "size", "(", ")", ")", "{", "edges", "=", "new", "SquareEdge", "[", "square", ".", "size", "(", ")", "]", ";", "sideLengths", "=", "new", ...
touch the border?
[ "touch", "the", "border?" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L91-L96
49,899
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java
SquareNode.getNumberOfConnections
public int getNumberOfConnections() { int ret = 0; for (int i = 0; i < square.size(); i++) { if( edges[i] != null ) ret++; } return ret; }
java
public int getNumberOfConnections() { int ret = 0; for (int i = 0; i < square.size(); i++) { if( edges[i] != null ) ret++; } return ret; }
[ "public", "int", "getNumberOfConnections", "(", ")", "{", "int", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "square", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "edges", "[", "i", "]", "!=", "null"...
Computes the number of edges attached to this node
[ "Computes", "the", "number", "of", "edges", "attached", "to", "this", "node" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L101-L108