repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java
FactoryKernelGaussian.gaussianWidth
public static Kernel2D_F64 gaussianWidth( double sigma , int width ) { if( sigma <= 0 ) sigma = sigmaForRadius(width/2,0); else if( width <= 0 ) throw new IllegalArgumentException("Must specify the width since it doesn't know if it should be even or odd"); if( width % 2 == 0 ) { int r = width/2-1; K...
java
public static Kernel2D_F64 gaussianWidth( double sigma , int width ) { if( sigma <= 0 ) sigma = sigmaForRadius(width/2,0); else if( width <= 0 ) throw new IllegalArgumentException("Must specify the width since it doesn't know if it should be even or odd"); if( width % 2 == 0 ) { int r = width/2-1; K...
[ "public", "static", "Kernel2D_F64", "gaussianWidth", "(", "double", "sigma", ",", "int", "width", ")", "{", "if", "(", "sigma", "<=", "0", ")", "sigma", "=", "sigmaForRadius", "(", "width", "/", "2", ",", "0", ")", ";", "else", "if", "(", "width", "<...
Create a gaussian kernel based on its width. Supports kernels of even or odd widths . @param sigma Sigma of the Gaussian distribution. If &le; 0 then the width will be used. @param width How wide the kernel is. Can be even or odd. @return Gaussian convolution kernel.
[ "Create", "a", "gaussian", "kernel", "based", "on", "its", "width", ".", "Supports", "kernels", "of", "even", "or", "odd", "widths", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L386-L416
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.process
public boolean process(List<AssociatedTriple> associated , int width , int height ) { init(width, height); // Fit a trifocal tensor to the input observations if (!robustFitTrifocal(associated) ) return false; // estimate the scene's structure if( !estimateProjectiveScene()) return false; if( !proje...
java
public boolean process(List<AssociatedTriple> associated , int width , int height ) { init(width, height); // Fit a trifocal tensor to the input observations if (!robustFitTrifocal(associated) ) return false; // estimate the scene's structure if( !estimateProjectiveScene()) return false; if( !proje...
[ "public", "boolean", "process", "(", "List", "<", "AssociatedTriple", ">", "associated", ",", "int", "width", ",", "int", "height", ")", "{", "init", "(", "width", ",", "height", ")", ";", "// Fit a trifocal tensor to the input observations", "if", "(", "!", "...
Determines the metric scene. The principle point is assumed to be zero in the passed in pixel coordinates. Typically this is done by subtracting the image center from each pixel coordinate for each view. @param associated List of associated features from 3 views. pixels @param width width of all images @param height h...
[ "Determines", "the", "metric", "scene", ".", "The", "principle", "point", "is", "assumed", "to", "be", "zero", "in", "the", "passed", "in", "pixel", "coordinates", ".", "Typically", "this", "is", "done", "by", "subtracting", "the", "image", "center", "from",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L157-L181
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.robustFitTrifocal
private boolean robustFitTrifocal(List<AssociatedTriple> associated) { // Fit a trifocal tensor to the observations robustly ransac.process(associated); inliers = ransac.getMatchSet(); TrifocalTensor model = ransac.getModelParameters(); if( verbose != null ) verbose.println("Remaining after RANSAC "+inlie...
java
private boolean robustFitTrifocal(List<AssociatedTriple> associated) { // Fit a trifocal tensor to the observations robustly ransac.process(associated); inliers = ransac.getMatchSet(); TrifocalTensor model = ransac.getModelParameters(); if( verbose != null ) verbose.println("Remaining after RANSAC "+inlie...
[ "private", "boolean", "robustFitTrifocal", "(", "List", "<", "AssociatedTriple", ">", "associated", ")", "{", "// Fit a trifocal tensor to the observations robustly", "ransac", ".", "process", "(", "associated", ")", ";", "inliers", "=", "ransac", ".", "getMatchSet", ...
Fits a trifocal tensor to the list of matches features using a robust method
[ "Fits", "a", "trifocal", "tensor", "to", "the", "list", "of", "matches", "features", "using", "a", "robust", "method" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L195-L213
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.pruneOutliers
private void pruneOutliers(BundleAdjustment<SceneStructureMetric> bundleAdjustment) { // see if it's configured to not prune if( pruneFraction == 1.0 ) return; PruneStructureFromSceneMetric pruner = new PruneStructureFromSceneMetric(structure,observations); pruner.pruneObservationsByErrorRank(pruneFraction);...
java
private void pruneOutliers(BundleAdjustment<SceneStructureMetric> bundleAdjustment) { // see if it's configured to not prune if( pruneFraction == 1.0 ) return; PruneStructureFromSceneMetric pruner = new PruneStructureFromSceneMetric(structure,observations); pruner.pruneObservationsByErrorRank(pruneFraction);...
[ "private", "void", "pruneOutliers", "(", "BundleAdjustment", "<", "SceneStructureMetric", ">", "bundleAdjustment", ")", "{", "// see if it's configured to not prune", "if", "(", "pruneFraction", "==", "1.0", ")", "return", ";", "PruneStructureFromSceneMetric", "pruner", "...
Prunes the features with the largest reprojection error
[ "Prunes", "the", "features", "with", "the", "largest", "reprojection", "error" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L218-L240
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.estimateProjectiveScene
private boolean estimateProjectiveScene() { List<AssociatedTriple> inliers = ransac.getMatchSet(); TrifocalTensor model = ransac.getModelParameters(); MultiViewOps.extractCameraMatrices(model,P2,P3); // Most of the time this makes little difference, but in some edges cases this enables it to // converge cor...
java
private boolean estimateProjectiveScene() { List<AssociatedTriple> inliers = ransac.getMatchSet(); TrifocalTensor model = ransac.getModelParameters(); MultiViewOps.extractCameraMatrices(model,P2,P3); // Most of the time this makes little difference, but in some edges cases this enables it to // converge cor...
[ "private", "boolean", "estimateProjectiveScene", "(", ")", "{", "List", "<", "AssociatedTriple", ">", "inliers", "=", "ransac", ".", "getMatchSet", "(", ")", ";", "TrifocalTensor", "model", "=", "ransac", ".", "getModelParameters", "(", ")", ";", "MultiViewOps",...
Estimate the projective scene from the trifocal tensor
[ "Estimate", "the", "projective", "scene", "from", "the", "trifocal", "tensor" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L318-L334
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.setupMetricBundleAdjustment
private void setupMetricBundleAdjustment(List<AssociatedTriple> inliers) { // Construct bundle adjustment data structure structure = new SceneStructureMetric(false); observations = new SceneObservations(3); structure.initialize(3,3,inliers.size()); for (int i = 0; i < listPinhole.size(); i++) { CameraPinh...
java
private void setupMetricBundleAdjustment(List<AssociatedTriple> inliers) { // Construct bundle adjustment data structure structure = new SceneStructureMetric(false); observations = new SceneObservations(3); structure.initialize(3,3,inliers.size()); for (int i = 0; i < listPinhole.size(); i++) { CameraPinh...
[ "private", "void", "setupMetricBundleAdjustment", "(", "List", "<", "AssociatedTriple", ">", "inliers", ")", "{", "// Construct bundle adjustment data structure", "structure", "=", "new", "SceneStructureMetric", "(", "false", ")", ";", "observations", "=", "new", "Scene...
Using the initial metric reconstruction, provide the initial configurations for bundle adjustment
[ "Using", "the", "initial", "metric", "reconstruction", "provide", "the", "initial", "configurations", "for", "bundle", "adjustment" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L339-L368
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.checkBehindCamera
private boolean checkBehindCamera(SceneStructureMetric structure ) { int totalBehind = 0; Point3D_F64 X = new Point3D_F64(); for (int i = 0; i < structure.points.length; i++) { structure.points[i].get(X); if( X.z < 0 ) totalBehind++; } if( verbose != null ) { verbose.println("points behind "+to...
java
private boolean checkBehindCamera(SceneStructureMetric structure ) { int totalBehind = 0; Point3D_F64 X = new Point3D_F64(); for (int i = 0; i < structure.points.length; i++) { structure.points[i].get(X); if( X.z < 0 ) totalBehind++; } if( verbose != null ) { verbose.println("points behind "+to...
[ "private", "boolean", "checkBehindCamera", "(", "SceneStructureMetric", "structure", ")", "{", "int", "totalBehind", "=", "0", ";", "Point3D_F64", "X", "=", "new", "Point3D_F64", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "structure", ...
Checks to see if a solution was converged to where the points are behind the camera. This is pysically impossible
[ "Checks", "to", "see", "if", "a", "solution", "was", "converged", "to", "where", "the", "points", "are", "behind", "the", "camera", ".", "This", "is", "pysically", "impossible" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L462-L477
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java
ThreeViewEstimateMetricScene.flipAround
private static void flipAround(SceneStructureMetric structure, SceneObservations observations) { // The first view will be identity for (int i = 1; i < structure.views.length; i++) { Se3_F64 w2v = structure.views[i].worldToView; w2v.set(w2v.invert(null)); } triangulatePoints(structure,observations); }
java
private static void flipAround(SceneStructureMetric structure, SceneObservations observations) { // The first view will be identity for (int i = 1; i < structure.views.length; i++) { Se3_F64 w2v = structure.views[i].worldToView; w2v.set(w2v.invert(null)); } triangulatePoints(structure,observations); }
[ "private", "static", "void", "flipAround", "(", "SceneStructureMetric", "structure", ",", "SceneObservations", "observations", ")", "{", "// The first view will be identity", "for", "(", "int", "i", "=", "1", ";", "i", "<", "structure", ".", "views", ".", "length"...
Flip the camera pose around. This seems to help it converge to a valid solution if it got it backwards even if it's not technically something which can be inverted this way
[ "Flip", "the", "camera", "pose", "around", ".", "This", "seems", "to", "help", "it", "converge", "to", "a", "valid", "solution", "if", "it", "got", "it", "backwards", "even", "if", "it", "s", "not", "technically", "something", "which", "can", "be", "inve...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L483-L490
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurfPlanar.java
DescribePointSurfPlanar.setImage
public void setImage( II grayII , Planar<II> colorII ) { InputSanityCheck.checkSameShape(grayII,colorII); if( colorII.getNumBands() != numBands ) throw new IllegalArgumentException("Expected planar images to have " +numBands+" not "+colorII.getNumBands()); this.grayII = grayII; this.colorII = colorII; ...
java
public void setImage( II grayII , Planar<II> colorII ) { InputSanityCheck.checkSameShape(grayII,colorII); if( colorII.getNumBands() != numBands ) throw new IllegalArgumentException("Expected planar images to have " +numBands+" not "+colorII.getNumBands()); this.grayII = grayII; this.colorII = colorII; ...
[ "public", "void", "setImage", "(", "II", "grayII", ",", "Planar", "<", "II", ">", "colorII", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "grayII", ",", "colorII", ")", ";", "if", "(", "colorII", ".", "getNumBands", "(", ")", "!=", "numBands...
Specifies input image shapes. @param grayII integral image of gray scale image @param colorII integral image of color image
[ "Specifies", "input", "image", "shapes", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurfPlanar.java#L87-L95
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java
ColorHsv.hsvToRgb
public static void hsvToRgb( double h , double s , double v , double []rgb ) { if( s == 0 ) { rgb[0] = v; rgb[1] = v; rgb[2] = v; return; } h /= d60_F64; int h_int = (int)h; double remainder = h - h_int; double p = v * ( 1 - s ); double q = v * ( 1 - s * remainder ); double t = v * ( 1 - s *...
java
public static void hsvToRgb( double h , double s , double v , double []rgb ) { if( s == 0 ) { rgb[0] = v; rgb[1] = v; rgb[2] = v; return; } h /= d60_F64; int h_int = (int)h; double remainder = h - h_int; double p = v * ( 1 - s ); double q = v * ( 1 - s * remainder ); double t = v * ( 1 - s *...
[ "public", "static", "void", "hsvToRgb", "(", "double", "h", ",", "double", "s", ",", "double", "v", ",", "double", "[", "]", "rgb", ")", "{", "if", "(", "s", "==", "0", ")", "{", "rgb", "[", "0", "]", "=", "v", ";", "rgb", "[", "1", "]", "=...
Convert HSV color into RGB color @param h Hue [0,2*PI] @param s Saturation [0,1] @param v Value @param rgb (Output) RGB value
[ "Convert", "HSV", "color", "into", "RGB", "color" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java#L109-L148
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadView.java
CreateSyntheticOverheadView.configure
public void configure( CameraPinholeBrown intrinsic , Se3_F64 planeToCamera , double centerX, double centerY, double cellSize , int overheadWidth , int overheadHeight ) { this.overheadWidth = overheadWidth; this.overheadHeight = overheadHeight; Point2Transform2_F64 normToPixel = LensD...
java
public void configure( CameraPinholeBrown intrinsic , Se3_F64 planeToCamera , double centerX, double centerY, double cellSize , int overheadWidth , int overheadHeight ) { this.overheadWidth = overheadWidth; this.overheadHeight = overheadHeight; Point2Transform2_F64 normToPixel = LensD...
[ "public", "void", "configure", "(", "CameraPinholeBrown", "intrinsic", ",", "Se3_F64", "planeToCamera", ",", "double", "centerX", ",", "double", "centerY", ",", "double", "cellSize", ",", "int", "overheadWidth", ",", "int", "overheadHeight", ")", "{", "this", "....
Specifies camera configurations. @param intrinsic Intrinsic camera parameters @param planeToCamera Transform from the plane to the camera. This is the extrinsic parameters. @param centerX X-coordinate of camera center in the overhead image in world units. @param centerY Y-coordinate of camera center in the overhead im...
[ "Specifies", "camera", "configurations", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadView.java#L81-L133
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java
DetectFiducialSquareGrid.detect
public boolean detect( T input ) { detections.reset(); detector.process(input); FastQueue<FoundFiducial> found = detector.getFound(); for (int i = 0; i < found.size(); i++) { FoundFiducial fid = found.get(i); int gridIndex = isExpected(fid.id); if( gridIndex >= 0 ) { Detection d = lookupDetect...
java
public boolean detect( T input ) { detections.reset(); detector.process(input); FastQueue<FoundFiducial> found = detector.getFound(); for (int i = 0; i < found.size(); i++) { FoundFiducial fid = found.get(i); int gridIndex = isExpected(fid.id); if( gridIndex >= 0 ) { Detection d = lookupDetect...
[ "public", "boolean", "detect", "(", "T", "input", ")", "{", "detections", ".", "reset", "(", ")", ";", "detector", ".", "process", "(", "input", ")", ";", "FastQueue", "<", "FoundFiducial", ">", "found", "=", "detector", ".", "getFound", "(", ")", ";",...
Searches for the fiducial inside the image. If at least a partial match is found true is returned. @param input Input image @return true if at least one of the component fiducials is detected. False otherwise
[ "Searches", "for", "the", "fiducial", "inside", "the", "image", ".", "If", "at", "least", "a", "partial", "match", "is", "found", "true", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L87-L113
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java
DetectFiducialSquareGrid.isExpected
private int isExpected( long found ) { int bestHamming = 2; int bestNumber = -1; for (int i = 0; i < numbers.length; i++) { int hamming = DescriptorDistance.hamming((int)found^(int)numbers[i]); if( hamming < bestHamming ) { bestHamming = hamming; bestNumber = i; } } return bestNumber; }
java
private int isExpected( long found ) { int bestHamming = 2; int bestNumber = -1; for (int i = 0; i < numbers.length; i++) { int hamming = DescriptorDistance.hamming((int)found^(int)numbers[i]); if( hamming < bestHamming ) { bestHamming = hamming; bestNumber = i; } } return bestNumber; }
[ "private", "int", "isExpected", "(", "long", "found", ")", "{", "int", "bestHamming", "=", "2", ";", "int", "bestNumber", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numbers", ".", "length", ";", "i", "++", ")", "{", "...
Checks to see if the provided ID number is expected or not @param found Fiducial ID number @return true if it's looking for this ID number
[ "Checks", "to", "see", "if", "the", "provided", "ID", "number", "is", "expected", "or", "not" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L121-L135
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java
DetectFiducialSquareGrid.lookupDetection
private Detection lookupDetection( long found , int gridIndex) { for (int i = 0; i < detections.size(); i++) { Detection d = detections.get(i); if( d.id == found ) { return d; } } Detection d = detections.grow(); d.reset(); d.id = found; d.gridIndex = gridIndex; return d; }
java
private Detection lookupDetection( long found , int gridIndex) { for (int i = 0; i < detections.size(); i++) { Detection d = detections.get(i); if( d.id == found ) { return d; } } Detection d = detections.grow(); d.reset(); d.id = found; d.gridIndex = gridIndex; return d; }
[ "private", "Detection", "lookupDetection", "(", "long", "found", ",", "int", "gridIndex", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detections", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Detection", "d", "=", "detections", ...
Looks up a detection given the fiducial ID number. If not seen before the gridIndex is saved and a new instance returned.
[ "Looks", "up", "a", "detection", "given", "the", "fiducial", "ID", "number", ".", "If", "not", "seen", "before", "the", "gridIndex", "is", "saved", "and", "a", "new", "instance", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L141-L155
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java
LinearContourLabelChang2004.process
public void process(GrayU8 binary , GrayS32 labeled ) { // initialize data structures labeled.reshape(binary.width,binary.height); // ensure that the image border pixels are filled with zero by enlarging the image if( border.width != binary.width+2 || border.height != binary.height+2) { border.reshape(bina...
java
public void process(GrayU8 binary , GrayS32 labeled ) { // initialize data structures labeled.reshape(binary.width,binary.height); // ensure that the image border pixels are filled with zero by enlarging the image if( border.width != binary.width+2 || border.height != binary.height+2) { border.reshape(bina...
[ "public", "void", "process", "(", "GrayU8", "binary", ",", "GrayS32", "labeled", ")", "{", "// initialize data structures", "labeled", ".", "reshape", "(", "binary", ".", "width", ",", "binary", ".", "height", ")", ";", "// ensure that the image border pixels are fi...
Processes the binary image to find the contour of and label blobs. @param binary Input binary image. Not modified. @param labeled Output. Labeled image. Modified.
[ "Processes", "the", "binary", "image", "to", "find", "the", "contour", "of", "and", "label", "blobs", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java#L96-L152
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java
LinearContourLabelChang2004.scanForOne
private int scanForOne(byte[] data , int index , int end ) { while (index < end && data[index] != 1) { index++; } return index; }
java
private int scanForOne(byte[] data , int index , int end ) { while (index < end && data[index] != 1) { index++; } return index; }
[ "private", "int", "scanForOne", "(", "byte", "[", "]", "data", ",", "int", "index", ",", "int", "end", ")", "{", "while", "(", "index", "<", "end", "&&", "data", "[", "index", "]", "!=", "1", ")", "{", "index", "++", ";", "}", "return", "index", ...
Faster when there's a specialized function which searches for one pixels
[ "Faster", "when", "there", "s", "a", "specialized", "function", "which", "searches", "for", "one", "pixels" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java#L157-L162
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducial.java
FactoryFiducial.qrcode
public static <T extends ImageGray<T>> QrCodePreciseDetector<T> qrcode(ConfigQrCode config, Class<T> imageType) { if( config == null ) config = new ConfigQrCode(); config.checkValidity(); InputToBinary<T> inputToBinary = FactoryThresholdBinary.threshold(config.threshold,imageType); DetectPolygonBinaryGra...
java
public static <T extends ImageGray<T>> QrCodePreciseDetector<T> qrcode(ConfigQrCode config, Class<T> imageType) { if( config == null ) config = new ConfigQrCode(); config.checkValidity(); InputToBinary<T> inputToBinary = FactoryThresholdBinary.threshold(config.threshold,imageType); DetectPolygonBinaryGra...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "QrCodePreciseDetector", "<", "T", ">", "qrcode", "(", "ConfigQrCode", "config", ",", "Class", "<", "T", ">", "imageType", ")", "{", "if", "(", "config", "==", "null", ")", "conf...
Returns a QR Code detector @param config Configuration @param imageType type of input image @return the detector
[ "Returns", "a", "QR", "Code", "detector" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducial.java#L174-L188
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.initialize
public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) { if( imagePyramid == null || imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) { int minSize = (config.trackerFeatureRadius*2+1)*5; int scales[] = selectPyramidScale(image.width,image.height,...
java
public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) { if( imagePyramid == null || imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) { int minSize = (config.trackerFeatureRadius*2+1)*5; int scales[] = selectPyramidScale(image.width,image.height,...
[ "public", "void", "initialize", "(", "T", "image", ",", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "if", "(", "imagePyramid", "==", "null", "||", "imagePyramid", ".", "getInputWidth", "(", ")", "!=", "image", ".", ...
Starts tracking the rectangular region. @param image First image in the sequence. @param x0 Top-left corner of rectangle. x-axis @param y0 Top-left corner of rectangle. y-axis @param x1 Bottom-right corner of rectangle. x-axis @param y1 Bottom-right corner of rectangle. y-axis
[ "Starts", "tracking", "the", "rectangular", "region", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L148-L175
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.createCascadeRegion
private void createCascadeRegion( int imageWidth , int imageHeight ) { cascadeRegions.reset(); int rectWidth = (int)(targetRegion.getWidth()+0.5); int rectHeight = (int)(targetRegion.getHeight()+0.5); for( int scaleInt = -config.scaleSpread; scaleInt <= config.scaleSpread; scaleInt++ ) { // try several sc...
java
private void createCascadeRegion( int imageWidth , int imageHeight ) { cascadeRegions.reset(); int rectWidth = (int)(targetRegion.getWidth()+0.5); int rectHeight = (int)(targetRegion.getHeight()+0.5); for( int scaleInt = -config.scaleSpread; scaleInt <= config.scaleSpread; scaleInt++ ) { // try several sc...
[ "private", "void", "createCascadeRegion", "(", "int", "imageWidth", ",", "int", "imageHeight", ")", "{", "cascadeRegions", ".", "reset", "(", ")", ";", "int", "rectWidth", "=", "(", "int", ")", "(", "targetRegion", ".", "getWidth", "(", ")", "+", "0.5", ...
Creates a list containing all the regions which need to be tested
[ "Creates", "a", "list", "containing", "all", "the", "regions", "which", "need", "to", "be", "tested" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L205-L250
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.track
public boolean track( T image ) { boolean success = true; valid = false; imagePyramid.process(image); template.setImage(image); variance.setImage(image); fern.setImage(image); if( reacquiring ) { // It can reinitialize if there is a single detection detection.detectionCascade(cascadeRegions); ...
java
public boolean track( T image ) { boolean success = true; valid = false; imagePyramid.process(image); template.setImage(image); variance.setImage(image); fern.setImage(image); if( reacquiring ) { // It can reinitialize if there is a single detection detection.detectionCascade(cascadeRegions); ...
[ "public", "boolean", "track", "(", "T", "image", ")", "{", "boolean", "success", "=", "true", ";", "valid", "=", "false", ";", "imagePyramid", ".", "process", "(", "image", ")", ";", "template", ".", "setImage", "(", "image", ")", ";", "variance", ".",...
Updates track region. @param image Next image in the sequence. @return true if the object could be found and false if not
[ "Updates", "track", "region", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L258-L314
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.hypothesisFusion
protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) { valid = false; boolean uniqueDetection = detectionWorked && !detection.isAmbiguous(); TldRegion detectedRegion = detection.getBest(); double confidenceTarget; if( trackingWorked ) { // get the scores from tracking...
java
protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) { valid = false; boolean uniqueDetection = detectionWorked && !detection.isAmbiguous(); TldRegion detectedRegion = detection.getBest(); double confidenceTarget; if( trackingWorked ) { // get the scores from tracking...
[ "protected", "boolean", "hypothesisFusion", "(", "boolean", "trackingWorked", ",", "boolean", "detectionWorked", ")", "{", "valid", "=", "false", ";", "boolean", "uniqueDetection", "=", "detectionWorked", "&&", "!", "detection", ".", "isAmbiguous", "(", ")", ";", ...
Combines hypotheses from tracking and detection. @param trackingWorked If the sequential tracker updated the track region successfully or not @return true a hypothesis was found, false if it failed to find a hypothesis
[ "Combines", "hypotheses", "from", "tracking", "and", "detection", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L332-L385
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java
TldTracker.selectPyramidScale
public static int[] selectPyramidScale( int imageWidth , int imageHeight, int minSize ) { int w = Math.max(imageWidth,imageHeight); int maxScale = w/minSize; int n = 1; int scale = 1; while( scale*2 < maxScale ) { n++; scale *= 2; } int ret[] = new int[n]; scale = 1; for( int i = 0; i < n; i++...
java
public static int[] selectPyramidScale( int imageWidth , int imageHeight, int minSize ) { int w = Math.max(imageWidth,imageHeight); int maxScale = w/minSize; int n = 1; int scale = 1; while( scale*2 < maxScale ) { n++; scale *= 2; } int ret[] = new int[n]; scale = 1; for( int i = 0; i < n; i++...
[ "public", "static", "int", "[", "]", "selectPyramidScale", "(", "int", "imageWidth", ",", "int", "imageHeight", ",", "int", "minSize", ")", "{", "int", "w", "=", "Math", ".", "max", "(", "imageWidth", ",", "imageHeight", ")", ";", "int", "maxScale", "=",...
Selects the scale for the image pyramid based on image size and feature size @return scales for image pyramid
[ "Selects", "the", "scale", "for", "the", "image", "pyramid", "based", "on", "image", "size", "and", "feature", "size" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L391-L410
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java
QrCodeBinaryGridReader.imageToGrid
public void imageToGrid( Point2D_F64 pixel , Point2D_F64 grid ) { transformGrid.imageToGrid(pixel.x, pixel.y, grid); }
java
public void imageToGrid( Point2D_F64 pixel , Point2D_F64 grid ) { transformGrid.imageToGrid(pixel.x, pixel.y, grid); }
[ "public", "void", "imageToGrid", "(", "Point2D_F64", "pixel", ",", "Point2D_F64", "grid", ")", "{", "transformGrid", ".", "imageToGrid", "(", "pixel", ".", "x", ",", "pixel", ".", "y", ",", "grid", ")", ";", "}" ]
Converts a pixel coordinate into a grid coordinate.
[ "Converts", "a", "pixel", "coordinate", "into", "a", "grid", "coordinate", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java#L105-L107
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java
QrCodeBinaryGridReader.readBit
public int readBit( int row , int col ) { // todo use adjustments from near by alignment patterns float center = 0.5f; // if( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight ) // return -1; transformGrid.gridToImage(row+center-0.2f, col+center, pixel); float pixel01 = int...
java
public int readBit( int row , int col ) { // todo use adjustments from near by alignment patterns float center = 0.5f; // if( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight ) // return -1; transformGrid.gridToImage(row+center-0.2f, col+center, pixel); float pixel01 = int...
[ "public", "int", "readBit", "(", "int", "row", ",", "int", "col", ")", "{", "// todo use adjustments from near by alignment patterns", "float", "center", "=", "0.5f", ";", "//\t\tif( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight )", "//\t\t\tre...
Reads a bit from the qr code's data matrix while adjusting for location distortions using known feature locations. @param row grid row @param col grid column @return
[ "Reads", "a", "bit", "from", "the", "qr", "code", "s", "data", "matrix", "while", "adjusting", "for", "location", "distortions", "using", "known", "feature", "locations", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java#L132-L191
train
lessthanoptimal/BoofCV
integration/boofcv-WebcamCapture/src/main/java/boofcv/io/webcamcapture/UtilWebcamCapture.java
UtilWebcamCapture.openDefault
public static Webcam openDefault( int desiredWidth , int desiredHeight) { Webcam webcam = Webcam.getDefault(); // Webcam doesn't list all available resolutions. Just pass in a custom // resolution and hope it works adjustResolution(webcam,desiredWidth,desiredHeight); webcam.open(); return webcam; }
java
public static Webcam openDefault( int desiredWidth , int desiredHeight) { Webcam webcam = Webcam.getDefault(); // Webcam doesn't list all available resolutions. Just pass in a custom // resolution and hope it works adjustResolution(webcam,desiredWidth,desiredHeight); webcam.open(); return webcam; }
[ "public", "static", "Webcam", "openDefault", "(", "int", "desiredWidth", ",", "int", "desiredHeight", ")", "{", "Webcam", "webcam", "=", "Webcam", ".", "getDefault", "(", ")", ";", "// Webcam doesn't list all available resolutions. Just pass in a custom", "// resolution a...
Opens the default camera while adjusting its resolution
[ "Opens", "the", "default", "camera", "while", "adjusting", "its", "resolution" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-WebcamCapture/src/main/java/boofcv/io/webcamcapture/UtilWebcamCapture.java#L37-L46
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java
EllipsesIntoClusters.process
public void process(List<EllipseInfo> ellipses , List<List<Node>> output ) { init(ellipses); connect(ellipses); output.clear(); for (int i = 0; i < clusters.size(); i++) { List<Node> c = clusters.get(i); // remove noise removeSingleConnections(c); if( c.size() >= minimumClusterSize) { outpu...
java
public void process(List<EllipseInfo> ellipses , List<List<Node>> output ) { init(ellipses); connect(ellipses); output.clear(); for (int i = 0; i < clusters.size(); i++) { List<Node> c = clusters.get(i); // remove noise removeSingleConnections(c); if( c.size() >= minimumClusterSize) { outpu...
[ "public", "void", "process", "(", "List", "<", "EllipseInfo", ">", "ellipses", ",", "List", "<", "List", "<", "Node", ">", ">", "output", ")", "{", "init", "(", "ellipses", ")", ";", "connect", "(", "ellipses", ")", ";", "output", ".", "clear", "(", ...
Processes the ellipses and creates clusters. @param ellipses Set of unordered ellipses @param output Resulting found clusters. Cleared automatically. Returned lists are recycled on next call.
[ "Processes", "the", "ellipses", "and", "creates", "clusters", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L95-L112
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java
EllipsesIntoClusters.removeSingleConnections
static void removeSingleConnections( List<Node> cluster ) { List<Node> open = new ArrayList<>(); List<Node> future = new ArrayList<>(); open.addAll(cluster); while( !open.isEmpty() ) { for (int i = open.size()-1; i >= 0; i--) { Node n = open.get(i); if( n.connections.size == 1 ) { // clear it...
java
static void removeSingleConnections( List<Node> cluster ) { List<Node> open = new ArrayList<>(); List<Node> future = new ArrayList<>(); open.addAll(cluster); while( !open.isEmpty() ) { for (int i = open.size()-1; i >= 0; i--) { Node n = open.get(i); if( n.connections.size == 1 ) { // clear it...
[ "static", "void", "removeSingleConnections", "(", "List", "<", "Node", ">", "cluster", ")", "{", "List", "<", "Node", ">", "open", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "Node", ">", "future", "=", "new", "ArrayList", "<>", "(", "...
Removes stray connections that are highly likely to be noise. If a node has one connection it then removed. Then it's only connection is considered for removal.
[ "Removes", "stray", "connections", "that", "are", "highly", "likely", "to", "be", "noise", ".", "If", "a", "node", "has", "one", "connection", "it", "then", "removed", ".", "Then", "it", "s", "only", "connection", "is", "considered", "for", "removal", "." ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L221-L256
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java
EllipsesIntoClusters.init
void init(List<EllipseInfo> ellipses) { nodes.resize(ellipses.size()); clusters.reset(); for (int i = 0; i < ellipses.size(); i++) { Node n = nodes.get(i); n.connections.reset(); n.which = i; n.cluster = -1; } nn.setPoints(ellipses,true); }
java
void init(List<EllipseInfo> ellipses) { nodes.resize(ellipses.size()); clusters.reset(); for (int i = 0; i < ellipses.size(); i++) { Node n = nodes.get(i); n.connections.reset(); n.which = i; n.cluster = -1; } nn.setPoints(ellipses,true); }
[ "void", "init", "(", "List", "<", "EllipseInfo", ">", "ellipses", ")", "{", "nodes", ".", "resize", "(", "ellipses", ".", "size", "(", ")", ")", ";", "clusters", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ell...
Recycles and initializes all internal data structures
[ "Recycles", "and", "initializes", "all", "internal", "data", "structures" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L290-L302
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java
EllipsesIntoClusters.joinClusters
void joinClusters( int mouth , int food ) { List<Node> listMouth = clusters.get(mouth); List<Node> listFood = clusters.get(food); // put all members of food into mouth for (int i = 0; i < listFood.size(); i++) { listMouth.add( listFood.get(i) ); listFood.get(i).cluster = mouth; } // zero food membe...
java
void joinClusters( int mouth , int food ) { List<Node> listMouth = clusters.get(mouth); List<Node> listFood = clusters.get(food); // put all members of food into mouth for (int i = 0; i < listFood.size(); i++) { listMouth.add( listFood.get(i) ); listFood.get(i).cluster = mouth; } // zero food membe...
[ "void", "joinClusters", "(", "int", "mouth", ",", "int", "food", ")", "{", "List", "<", "Node", ">", "listMouth", "=", "clusters", ".", "get", "(", "mouth", ")", ";", "List", "<", "Node", ">", "listFood", "=", "clusters", ".", "get", "(", "food", "...
Moves all the members of 'food' into 'mouth' @param mouth The group which will not be changed. @param food All members of this group are put into mouth
[ "Moves", "all", "the", "members", "of", "food", "into", "mouth" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L309-L322
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/GrayI8.java
GrayI8.set
@Override public void set(int x, int y, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); data[getIndex(x, y)] = (byte) value; }
java
@Override public void set(int x, int y, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); data[getIndex(x, y)] = (byte) value; }
[ "@", "Override", "public", "void", "set", "(", "int", "x", ",", "int", "y", ",", "int", "value", ")", "{", "if", "(", "!", "isInBounds", "(", "x", ",", "y", ")", ")", "throw", "new", "ImageAccessException", "(", "\"Requested pixel is out of bounds: \"", ...
Sets the value of the specified pixel. @param x pixel coordinate. @param y pixel coordinate. @param value The pixel's new value.
[ "Sets", "the", "value", "of", "the", "specified", "pixel", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/GrayI8.java#L72-L78
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java
GradientSobel_Outer.process
public static void process(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) { final byte[] data = orig.data; final short[] imgX = derivX.data; final short[] imgY = derivY.data; final int width = orig.getWidth(); final int height = orig.getHeight() - 1; //CONCURRENT_BELOW BoofConcurrency.lo...
java
public static void process(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) { final byte[] data = orig.data; final short[] imgX = derivX.data; final short[] imgY = derivY.data; final int width = orig.getWidth(); final int height = orig.getHeight() - 1; //CONCURRENT_BELOW BoofConcurrency.lo...
[ "public", "static", "void", "process", "(", "GrayU8", "orig", ",", "GrayS16", "derivX", ",", "GrayS16", "derivY", ")", "{", "final", "byte", "[", "]", "data", "=", "orig", ".", "data", ";", "final", "short", "[", "]", "imgX", "=", "derivX", ".", "dat...
Computes derivative of GrayU8. None of the images can be sub-images.
[ "Computes", "derivative", "of", "GrayU8", ".", "None", "of", "the", "images", "can", "be", "sub", "-", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java#L47-L71
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java
GradientSobel_Outer.process_sub
public static void process_sub(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) { final byte[] data = orig.data; final short[] imgX = derivX.data; final short[] imgY = derivY.data; final int width = orig.getWidth(); final int height = orig.getHeight() - 1; final int strideSrc = orig.getSt...
java
public static void process_sub(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) { final byte[] data = orig.data; final short[] imgX = derivX.data; final short[] imgY = derivY.data; final int width = orig.getWidth(); final int height = orig.getHeight() - 1; final int strideSrc = orig.getSt...
[ "public", "static", "void", "process_sub", "(", "GrayU8", "orig", ",", "GrayS16", "derivX", ",", "GrayS16", "derivY", ")", "{", "final", "byte", "[", "]", "data", "=", "orig", ".", "data", ";", "final", "short", "[", "]", "imgX", "=", "derivX", ".", ...
Computes derivative of GrayU8. Inputs can be sub-images.
[ "Computes", "derivative", "of", "GrayU8", ".", "Inputs", "can", "be", "sub", "-", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java#L76-L105
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidFloat.java
PyramidFloat.setScaleFactors
public void setScaleFactors( double ...scaleFactors ) { // see if the scale factors have not changed if( scale != null && scale.length == scaleFactors.length ) { boolean theSame = true; for( int i = 0; i < scale.length; i++ ) { if( scale[i] != scaleFactors[i] ) { theSame = false; break; } ...
java
public void setScaleFactors( double ...scaleFactors ) { // see if the scale factors have not changed if( scale != null && scale.length == scaleFactors.length ) { boolean theSame = true; for( int i = 0; i < scale.length; i++ ) { if( scale[i] != scaleFactors[i] ) { theSame = false; break; } ...
[ "public", "void", "setScaleFactors", "(", "double", "...", "scaleFactors", ")", "{", "// see if the scale factors have not changed", "if", "(", "scale", "!=", "null", "&&", "scale", ".", "length", "==", "scaleFactors", ".", "length", ")", "{", "boolean", "theSame"...
Specifies the pyramid's structure. @param scaleFactors Change in scale factor for each layer in the pyramid.
[ "Specifies", "the", "pyramid", "s", "structure", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidFloat.java#L62-L81
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java
HistogramStatistics.variance
public static double variance(int[] histogram, double mean , int N ) { return variance(histogram, mean, count(histogram,N), N); }
java
public static double variance(int[] histogram, double mean , int N ) { return variance(histogram, mean, count(histogram,N), N); }
[ "public", "static", "double", "variance", "(", "int", "[", "]", "histogram", ",", "double", "mean", ",", "int", "N", ")", "{", "return", "variance", "(", "histogram", ",", "mean", ",", "count", "(", "histogram", ",", "N", ")", ",", "N", ")", ";", "...
Computes the variance of pixel intensity values for a GrayU8 image represented by the given histogram. @param histogram Histogram with N bins @param mean Mean of the image. @param N number of bins in the histogram. @return variance
[ "Computes", "the", "variance", "of", "pixel", "intensity", "values", "for", "a", "GrayU8", "image", "represented", "by", "the", "given", "histogram", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L36-L38
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java
HistogramStatistics.variance
public static double variance(int[] histogram, double mean, int counts , int N) { double sum = 0.0; for(int i=0;i<N;i++) { double d = i - mean; sum += (d*d) * histogram[i]; } return sum / counts; }
java
public static double variance(int[] histogram, double mean, int counts , int N) { double sum = 0.0; for(int i=0;i<N;i++) { double d = i - mean; sum += (d*d) * histogram[i]; } return sum / counts; }
[ "public", "static", "double", "variance", "(", "int", "[", "]", "histogram", ",", "double", "mean", ",", "int", "counts", ",", "int", "N", ")", "{", "double", "sum", "=", "0.0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i...
Computes the variance of elements in the histogram @param histogram Histogram with N bins @param mean Histogram's mean. @param counts Sum of all bins in the histogram. @param N number of bins in the histogram. @return variance of values inside the histogram
[ "Computes", "the", "variance", "of", "elements", "in", "the", "histogram" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L49-L57
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java
HistogramStatistics.count
public static int count(int[] histogram, int N) { int counts = 0; for(int i=0;i<N;i++) { counts += histogram[i]; } return counts; }
java
public static int count(int[] histogram, int N) { int counts = 0; for(int i=0;i<N;i++) { counts += histogram[i]; } return counts; }
[ "public", "static", "int", "count", "(", "int", "[", "]", "histogram", ",", "int", "N", ")", "{", "int", "counts", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "counts", "+=", "histogram", "["...
Counts sum of all the bins inside the histogram @param histogram Histogram with N bins @param N number of bins in the histogram. @return Sum of all values in the histogram array.
[ "Counts", "sum", "of", "all", "the", "bins", "inside", "the", "histogram" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L66-L72
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java
GradientReduceToSingle.maxf
public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY ) { // input and output should be the same shape InputSanityCheck.checkSameShape(inX,inY); InputSanityCheck.reshapeOneIn(inX,outX,outY); // make sure that the pixel index is the same InputSanityCheck.checkIndexin...
java
public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY ) { // input and output should be the same shape InputSanityCheck.checkSameShape(inX,inY); InputSanityCheck.reshapeOneIn(inX,outX,outY); // make sure that the pixel index is the same InputSanityCheck.checkIndexin...
[ "public", "static", "void", "maxf", "(", "Planar", "<", "GrayF32", ">", "inX", ",", "Planar", "<", "GrayF32", ">", "inY", ",", "GrayF32", "outX", ",", "GrayF32", "outY", ")", "{", "// input and output should be the same shape", "InputSanityCheck", ".", "checkSam...
Reduces the number of bands by selecting the band with the largest Frobenius norm and using its gradient to be the output gradient on a pixel-by-pixel basis @param inX Input gradient X @param inY Input gradient Y @param outX Output gradient X @param outY Output gradient Y
[ "Reduces", "the", "number", "of", "bands", "by", "selecting", "the", "band", "with", "the", "largest", "Frobenius", "norm", "and", "using", "its", "gradient", "to", "be", "the", "output", "gradient", "on", "a", "pixel", "-", "by", "-", "pixel", "basis" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java#L42-L77
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java
ExampleImageEnhancement.histogram
public static void histogram() { BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath)); GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null); GrayU8 adjusted = gray.createSameShape(); int histogram[] = new int[256]; int transform[] = new int[256]; ListDisplayPanel ...
java
public static void histogram() { BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath)); GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null); GrayU8 adjusted = gray.createSameShape(); int histogram[] = new int[256]; int transform[] = new int[256]; ListDisplayPanel ...
[ "public", "static", "void", "histogram", "(", ")", "{", "BufferedImage", "buffered", "=", "UtilImageIO", ".", "loadImage", "(", "UtilIO", ".", "pathExample", "(", "imagePath", ")", ")", ";", "GrayU8", "gray", "=", "ConvertBufferedImage", ".", "convertFrom", "(...
Histogram adjustment algorithms aim to spread out pixel intensity values uniformly across the allowed range. This if an image is dark, it will have greater contrast and be brighter.
[ "Histogram", "adjustment", "algorithms", "aim", "to", "spread", "out", "pixel", "intensity", "values", "uniformly", "across", "the", "allowed", "range", ".", "This", "if", "an", "image", "is", "dark", "it", "will", "have", "greater", "contrast", "and", "be", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java#L50-L72
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java
ExampleImageEnhancement.sharpen
public static void sharpen() { BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath)); GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null); GrayU8 adjusted = gray.createSameShape(); ListDisplayPanel panel = new ListDisplayPanel(); EnhanceImageOps.sharpen4(gray, adju...
java
public static void sharpen() { BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath)); GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null); GrayU8 adjusted = gray.createSameShape(); ListDisplayPanel panel = new ListDisplayPanel(); EnhanceImageOps.sharpen4(gray, adju...
[ "public", "static", "void", "sharpen", "(", ")", "{", "BufferedImage", "buffered", "=", "UtilImageIO", ".", "loadImage", "(", "UtilIO", ".", "pathExample", "(", "imagePath", ")", ")", ";", "GrayU8", "gray", "=", "ConvertBufferedImage", ".", "convertFrom", "(",...
When an image is sharpened the intensity of edges are made more extreme while flat regions remain unchanged.
[ "When", "an", "image", "is", "sharpened", "the", "intensity", "of", "edges", "are", "made", "more", "extreme", "while", "flat", "regions", "remain", "unchanged", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java#L77-L95
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java
VisOdomPixelDepthPnP.process
public boolean process( T image ) { tracker.process(image); tick++; inlierTracks.clear(); if( first ) { addNewTracks(); first = false; } else { if( !estimateMotion() ) { return false; } dropUnusedTracks(); int N = motionEstimator.getMatchSet().size(); if( thresholdAdd <= 0 || N < ...
java
public boolean process( T image ) { tracker.process(image); tick++; inlierTracks.clear(); if( first ) { addNewTracks(); first = false; } else { if( !estimateMotion() ) { return false; } dropUnusedTracks(); int N = motionEstimator.getMatchSet().size(); if( thresholdAdd <= 0 || N < ...
[ "public", "boolean", "process", "(", "T", "image", ")", "{", "tracker", ".", "process", "(", "image", ")", ";", "tick", "++", ";", "inlierTracks", ".", "clear", "(", ")", ";", "if", "(", "first", ")", "{", "addNewTracks", "(", ")", ";", "first", "=...
Estimates the motion given the left camera image. The latest information required by ImagePixelTo3D should be passed to the class before invoking this function. @param image Camera image. @return true if successful or false if it failed
[ "Estimates", "the", "motion", "given", "the", "left", "camera", "image", ".", "The", "latest", "information", "required", "by", "ImagePixelTo3D", "should", "be", "passed", "to", "the", "class", "before", "invoking", "this", "function", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L154-L180
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java
VisOdomPixelDepthPnP.addNewTracks
private void addNewTracks() { // System.out.println("----------- Adding new tracks ---------------"); tracker.spawnTracks(); List<PointTrack> spawned = tracker.getNewTracks(null); // estimate 3D coordinate using stereo vision for( PointTrack t : spawned ) { Point2D3DTrack p = t.getCookie(); if( p == nu...
java
private void addNewTracks() { // System.out.println("----------- Adding new tracks ---------------"); tracker.spawnTracks(); List<PointTrack> spawned = tracker.getNewTracks(null); // estimate 3D coordinate using stereo vision for( PointTrack t : spawned ) { Point2D3DTrack p = t.getCookie(); if( p == nu...
[ "private", "void", "addNewTracks", "(", ")", "{", "//\t\tSystem.out.println(\"----------- Adding new tracks ---------------\");", "tracker", ".", "spawnTracks", "(", ")", ";", "List", "<", "PointTrack", ">", "spawned", "=", "tracker", ".", "getNewTracks", "(", "null", ...
Detects new features and computes their 3D coordinates
[ "Detects", "new", "features", "and", "computes", "their", "3D", "coordinates" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L224-L254
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java
VisOdomPixelDepthPnP.estimateMotion
private boolean estimateMotion() { List<PointTrack> active = tracker.getActiveTracks(null); List<Point2D3D> obs = new ArrayList<>(); for( PointTrack t : active ) { Point2D3D p = t.getCookie(); pixelToNorm.compute( t.x , t.y , p.observation ); obs.add( p ); } // estimate the motion up to a scale fac...
java
private boolean estimateMotion() { List<PointTrack> active = tracker.getActiveTracks(null); List<Point2D3D> obs = new ArrayList<>(); for( PointTrack t : active ) { Point2D3D p = t.getCookie(); pixelToNorm.compute( t.x , t.y , p.observation ); obs.add( p ); } // estimate the motion up to a scale fac...
[ "private", "boolean", "estimateMotion", "(", ")", "{", "List", "<", "PointTrack", ">", "active", "=", "tracker", ".", "getActiveTracks", "(", "null", ")", ";", "List", "<", "Point2D3D", ">", "obs", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "...
Estimates motion from the set of tracks and their 3D location @return true if successful.
[ "Estimates", "motion", "from", "the", "set", "of", "tracks", "and", "their", "3D", "location" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L261-L302
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneUncalibrated.java
EstimateSceneUncalibrated.scoreForTriangulation
double scoreForTriangulation( Motion motion ) { DMatrixRMaj H = new DMatrixRMaj(3,3); View viewA = motion.viewSrc; View viewB = motion.viewDst; // Compute initial estimate for H pairs.reset(); for (int i = 0; i < motion.associated.size(); i++) { AssociatedIndex ai = motion.associated.get(i); pairs.g...
java
double scoreForTriangulation( Motion motion ) { DMatrixRMaj H = new DMatrixRMaj(3,3); View viewA = motion.viewSrc; View viewB = motion.viewDst; // Compute initial estimate for H pairs.reset(); for (int i = 0; i < motion.associated.size(); i++) { AssociatedIndex ai = motion.associated.get(i); pairs.g...
[ "double", "scoreForTriangulation", "(", "Motion", "motion", ")", "{", "DMatrixRMaj", "H", "=", "new", "DMatrixRMaj", "(", "3", ",", "3", ")", ";", "View", "viewA", "=", "motion", ".", "viewSrc", ";", "View", "viewB", "=", "motion", ".", "viewDst", ";", ...
Compute score to decide which motion to initialize structure from. A homography is fit to the observations and the error compute. The homography should be a poor fit if the scene had 3D structure. The 50% homography error is then scaled by the number of pairs to bias the score good matches @param motion input @return f...
[ "Compute", "score", "to", "decide", "which", "motion", "to", "initialize", "structure", "from", ".", "A", "homography", "is", "fit", "to", "the", "observations", "and", "the", "error", "compute", ".", "The", "homography", "should", "be", "a", "poor", "fit", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneUncalibrated.java#L217-L245
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java
WorldToCameraToPixel.configure
public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) { this.worldToCamera = worldToCamera; normToPixel = distortion.distort_F64(false,true); }
java
public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) { this.worldToCamera = worldToCamera; normToPixel = distortion.distort_F64(false,true); }
[ "public", "void", "configure", "(", "LensDistortionNarrowFOV", "distortion", ",", "Se3_F64", "worldToCamera", ")", "{", "this", ".", "worldToCamera", "=", "worldToCamera", ";", "normToPixel", "=", "distortion", ".", "distort_F64", "(", "false", ",", "true", ")", ...
Specifies intrinsic camera parameters and the transform from world to camera. @param distortion camera parameters @param worldToCamera transform from world to camera
[ "Specifies", "intrinsic", "camera", "parameters", "and", "the", "transform", "from", "world", "to", "camera", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L67-L71
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java
WorldToCameraToPixel.transform
public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) { SePointOps_F64.transform(worldToCamera,worldPt,cameraPt); // can't see the point if( cameraPt.z <= 0 ) return false; normToPixel.compute(cameraPt.x/cameraPt.z, cameraPt.y/cameraPt.z, pixelPt); return true; }
java
public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) { SePointOps_F64.transform(worldToCamera,worldPt,cameraPt); // can't see the point if( cameraPt.z <= 0 ) return false; normToPixel.compute(cameraPt.x/cameraPt.z, cameraPt.y/cameraPt.z, pixelPt); return true; }
[ "public", "boolean", "transform", "(", "Point3D_F64", "worldPt", ",", "Point2D_F64", "pixelPt", ")", "{", "SePointOps_F64", ".", "transform", "(", "worldToCamera", ",", "worldPt", ",", "cameraPt", ")", ";", "// can't see the point", "if", "(", "cameraPt", ".", "...
Computes the observed location of the specified point in world coordinates in the camera pixel. If the object can't be viewed because it is behind the camera then false is returned. @param worldPt Location of point in world frame @param pixelPt Pixel observation of point. @return True if visible (+z) or false if not v...
[ "Computes", "the", "observed", "location", "of", "the", "specified", "point", "in", "world", "coordinates", "in", "the", "camera", "pixel", ".", "If", "the", "object", "can", "t", "be", "viewed", "because", "it", "is", "behind", "the", "camera", "then", "f...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L80-L89
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java
WorldToCameraToPixel.transform
public Point2D_F64 transform( Point3D_F64 worldPt ) { Point2D_F64 out = new Point2D_F64(); if( transform(worldPt,out)) return out; else return null; }
java
public Point2D_F64 transform( Point3D_F64 worldPt ) { Point2D_F64 out = new Point2D_F64(); if( transform(worldPt,out)) return out; else return null; }
[ "public", "Point2D_F64", "transform", "(", "Point3D_F64", "worldPt", ")", "{", "Point2D_F64", "out", "=", "new", "Point2D_F64", "(", ")", ";", "if", "(", "transform", "(", "worldPt", ",", "out", ")", ")", "return", "out", ";", "else", "return", "null", "...
Computes location of 3D point in world as observed in the camera. Point is returned if visible or null if not visible. @param worldPt Location of point on world reference frame @return Pixel coordinate of point or null if not visible
[ "Computes", "location", "of", "3D", "point", "in", "world", "as", "observed", "in", "the", "camera", ".", "Point", "is", "returned", "if", "visible", "or", "null", "if", "not", "visible", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L112-L118
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java
SplitMergeLineFitLoop.splitPixels
protected void splitPixels(int indexStart, int length) { // too short to split if( length < minimumSideLengthPixel) return; // end points of the line int indexEnd = (indexStart+length)%N; int splitOffset = selectSplitOffset(indexStart,length); if( splitOffset >= 0 ) { // System.out.println(" splitt...
java
protected void splitPixels(int indexStart, int length) { // too short to split if( length < minimumSideLengthPixel) return; // end points of the line int indexEnd = (indexStart+length)%N; int splitOffset = selectSplitOffset(indexStart,length); if( splitOffset >= 0 ) { // System.out.println(" splitt...
[ "protected", "void", "splitPixels", "(", "int", "indexStart", ",", "int", "length", ")", "{", "// too short to split", "if", "(", "length", "<", "minimumSideLengthPixel", ")", "return", ";", "// end points of the line", "int", "indexEnd", "=", "(", "indexStart", "...
Recursively splits pixels between indexStart to indexStart+length. A split happens if there is a pixel more than the desired distance away from the two end points. Results are placed into 'splits'
[ "Recursively", "splits", "pixels", "between", "indexStart", "to", "indexStart", "+", "length", ".", "A", "split", "happens", "if", "there", "is", "a", "pixel", "more", "than", "the", "desired", "distance", "away", "from", "the", "two", "end", "points", ".", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L98-L115
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java
SplitMergeLineFitLoop.mergeSegments
protected boolean mergeSegments() { // See if merging will cause a degenerate case if( splits.size() <= 3 ) return false; boolean change = false; work.reset(); for( int i = 0; i < splits.size; i++ ) { int start = splits.data[i]; int end = splits.data[(i+2)%splits.size]; if( selectSplitOffset(s...
java
protected boolean mergeSegments() { // See if merging will cause a degenerate case if( splits.size() <= 3 ) return false; boolean change = false; work.reset(); for( int i = 0; i < splits.size; i++ ) { int start = splits.data[i]; int end = splits.data[(i+2)%splits.size]; if( selectSplitOffset(s...
[ "protected", "boolean", "mergeSegments", "(", ")", "{", "// See if merging will cause a degenerate case", "if", "(", "splits", ".", "size", "(", ")", "<=", "3", ")", "return", "false", ";", "boolean", "change", "=", "false", ";", "work", ".", "reset", "(", "...
Merges lines together if the common corner is close to a common line @return true the list being changed
[ "Merges", "lines", "together", "if", "the", "common", "corner", "is", "close", "to", "a", "common", "line" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L153-L181
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java
SplitMergeLineFitLoop.splitSegments
protected boolean splitSegments() { boolean change = false; work.reset(); for( int i = 0; i < splits.size-1; i++ ) { change |= checkSplit(change, i,i+1); } change |= checkSplit(change, splits.size - 1, 0); // swap the two lists GrowQueue_I32 tmp = work; work = splits; splits = tmp; return cha...
java
protected boolean splitSegments() { boolean change = false; work.reset(); for( int i = 0; i < splits.size-1; i++ ) { change |= checkSplit(change, i,i+1); } change |= checkSplit(change, splits.size - 1, 0); // swap the two lists GrowQueue_I32 tmp = work; work = splits; splits = tmp; return cha...
[ "protected", "boolean", "splitSegments", "(", ")", "{", "boolean", "change", "=", "false", ";", "work", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "splits", ".", "size", "-", "1", ";", "i", "++", ")", "{", "ch...
Splits a line in two if there is a point that is too far away @return true for change
[ "Splits", "a", "line", "in", "two", "if", "there", "is", "a", "point", "that", "is", "too", "far", "away" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L187-L203
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java
SplitMergeLineFitLoop.circularDistance
protected int circularDistance( int start , int end ) { if( end >= start ) return end-start; else return N-start+end; }
java
protected int circularDistance( int start , int end ) { if( end >= start ) return end-start; else return N-start+end; }
[ "protected", "int", "circularDistance", "(", "int", "start", ",", "int", "end", ")", "{", "if", "(", "end", ">=", "start", ")", "return", "end", "-", "start", ";", "else", "return", "N", "-", "start", "+", "end", ";", "}" ]
Distance the two points are apart in clockwise direction
[ "Distance", "the", "two", "points", "are", "apart", "in", "clockwise", "direction" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L260-L265
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/ImplAverageDownSample.java
ImplAverageDownSample.horizontal
public static void horizontal( GrayF32 src , GrayF32 dst ) { if( src.width < dst.width ) throw new IllegalArgumentException("src width must be >= dst width"); if( src.height != dst.height ) throw new IllegalArgumentException("src height must equal dst height"); float scale = src.width/(float)dst.width; ...
java
public static void horizontal( GrayF32 src , GrayF32 dst ) { if( src.width < dst.width ) throw new IllegalArgumentException("src width must be >= dst width"); if( src.height != dst.height ) throw new IllegalArgumentException("src height must equal dst height"); float scale = src.width/(float)dst.width; ...
[ "public", "static", "void", "horizontal", "(", "GrayF32", "src", ",", "GrayF32", "dst", ")", "{", "if", "(", "src", ".", "width", "<", "dst", ".", "width", ")", "throw", "new", "IllegalArgumentException", "(", "\"src width must be >= dst width\"", ")", ";", ...
Down samples the image along the x-axis only. Image height's must be the same. @param src Input image. Not modified. @param dst Output image. Modified.
[ "Down", "samples", "the", "image", "along", "the", "x", "-", "axis", "only", ".", "Image", "height", "s", "must", "be", "the", "same", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/ImplAverageDownSample.java#L314-L371
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/ImplAverageDownSample.java
ImplAverageDownSample.vertical
public static void vertical( GrayF32 src , GrayF32 dst ) { if( src.height < dst.height ) throw new IllegalArgumentException("src height must be >= dst height"); if( src.width != dst.width ) throw new IllegalArgumentException("src width must equal dst width"); float scale = src.height/(float)dst.height; ...
java
public static void vertical( GrayF32 src , GrayF32 dst ) { if( src.height < dst.height ) throw new IllegalArgumentException("src height must be >= dst height"); if( src.width != dst.width ) throw new IllegalArgumentException("src width must equal dst width"); float scale = src.height/(float)dst.height; ...
[ "public", "static", "void", "vertical", "(", "GrayF32", "src", ",", "GrayF32", "dst", ")", "{", "if", "(", "src", ".", "height", "<", "dst", ".", "height", ")", "throw", "new", "IllegalArgumentException", "(", "\"src height must be >= dst height\"", ")", ";", ...
Down samples the image along the y-axis only. Image width's must be the same. @param src Input image. Not modified. @param dst Output image. Modified.
[ "Down", "samples", "the", "image", "along", "the", "y", "-", "axis", "only", ".", "Image", "width", "s", "must", "be", "the", "same", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/ImplAverageDownSample.java#L378-L441
train
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/sfm/d2/Motion2DPanel.java
Motion2DPanel.drawFeatures
protected void drawFeatures( float scale , int offsetX , int offsetY , FastQueue<Point2D_F64> all, FastQueue<Point2D_F64> inliers, Homography2D_F64 currToGlobal, Graphics2D g2 ) { Point2D_F64 distPt = new Point2D_F64(); for( int i = 0; i < all.size; i++ ) { HomographyPointOps_F64.tr...
java
protected void drawFeatures( float scale , int offsetX , int offsetY , FastQueue<Point2D_F64> all, FastQueue<Point2D_F64> inliers, Homography2D_F64 currToGlobal, Graphics2D g2 ) { Point2D_F64 distPt = new Point2D_F64(); for( int i = 0; i < all.size; i++ ) { HomographyPointOps_F64.tr...
[ "protected", "void", "drawFeatures", "(", "float", "scale", ",", "int", "offsetX", ",", "int", "offsetY", ",", "FastQueue", "<", "Point2D_F64", ">", "all", ",", "FastQueue", "<", "Point2D_F64", ">", "inliers", ",", "Homography2D_F64", "currToGlobal", ",", "Gra...
Draw features after applying a homography transformation.
[ "Draw", "features", "after", "applying", "a", "homography", "transformation", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/sfm/d2/Motion2DPanel.java#L119-L143
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ImageHistogramPanel.java
ImageHistogramPanel.update
public void update( ImageGray image ) { if( approximateHistogram ) { for (int i = 0; i < bins.length; i++) bins[i] = 0; if (image instanceof GrayF32) update((GrayF32) image); else if (GrayI.class.isAssignableFrom(image.getClass())) update((GrayI) image); else throw new IllegalArgumentExce...
java
public void update( ImageGray image ) { if( approximateHistogram ) { for (int i = 0; i < bins.length; i++) bins[i] = 0; if (image instanceof GrayF32) update((GrayF32) image); else if (GrayI.class.isAssignableFrom(image.getClass())) update((GrayI) image); else throw new IllegalArgumentExce...
[ "public", "void", "update", "(", "ImageGray", "image", ")", "{", "if", "(", "approximateHistogram", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bins", ".", "length", ";", "i", "++", ")", "bins", "[", "i", "]", "=", "0", ";", "if...
Update's the histogram. Must only be called in UI thread
[ "Update", "s", "the", "histogram", ".", "Must", "only", "be", "called", "in", "UI", "thread" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ImageHistogramPanel.java#L60-L74
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ListDisplayPanel.java
ListDisplayPanel.addImage
public void addImage( BufferedImage image , String name) { addImage(image, name, ScaleOptions.DOWN); }
java
public void addImage( BufferedImage image , String name) { addImage(image, name, ScaleOptions.DOWN); }
[ "public", "void", "addImage", "(", "BufferedImage", "image", ",", "String", "name", ")", "{", "addImage", "(", "image", ",", "name", ",", "ScaleOptions", ".", "DOWN", ")", ";", "}" ]
Displays a new image in the list. @param image The image being displayed @param name Name of the image. Shown in the list.
[ "Displays", "a", "new", "image", "in", "the", "list", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ListDisplayPanel.java#L101-L103
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ListDisplayPanel.java
ListDisplayPanel.addItem
public synchronized void addItem( final JComponent panel , final String name ) { Dimension panelD = panel.getPreferredSize(); final boolean sizeChanged = bodyWidth != panelD.width || bodyHeight != panelD.height; // make the preferred size large enough to hold all the images bodyWidth = (int)Math.max(bodyWidt...
java
public synchronized void addItem( final JComponent panel , final String name ) { Dimension panelD = panel.getPreferredSize(); final boolean sizeChanged = bodyWidth != panelD.width || bodyHeight != panelD.height; // make the preferred size large enough to hold all the images bodyWidth = (int)Math.max(bodyWidt...
[ "public", "synchronized", "void", "addItem", "(", "final", "JComponent", "panel", ",", "final", "String", "name", ")", "{", "Dimension", "panelD", "=", "panel", ".", "getPreferredSize", "(", ")", ";", "final", "boolean", "sizeChanged", "=", "bodyWidth", "!=", ...
Displays a new JPanel in the list. @param panel The panel being displayed @param name Name of the image. Shown in the list.
[ "Displays", "a", "new", "JPanel", "in", "the", "list", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ListDisplayPanel.java#L115-L146
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F64.java
LensDistortionOps_F64.centerBoxInside
public static RectangleLength2D_F64 centerBoxInside(int srcWidth, int srcHeight, PixelTransform<Point2D_F64> transform , Point2D_F64 work ) { List<Point2D_F64> points = computeBoundingPoints(srcWidth, srcHeight, transform, work); Point2D_F64 center = new Point2D_F64(); UtilPoint2D_F6...
java
public static RectangleLength2D_F64 centerBoxInside(int srcWidth, int srcHeight, PixelTransform<Point2D_F64> transform , Point2D_F64 work ) { List<Point2D_F64> points = computeBoundingPoints(srcWidth, srcHeight, transform, work); Point2D_F64 center = new Point2D_F64(); UtilPoint2D_F6...
[ "public", "static", "RectangleLength2D_F64", "centerBoxInside", "(", "int", "srcWidth", ",", "int", "srcHeight", ",", "PixelTransform", "<", "Point2D_F64", ">", "transform", ",", "Point2D_F64", "work", ")", "{", "List", "<", "Point2D_F64", ">", "points", "=", "c...
Attempts to center the box inside. It will be approximately fitted too. @param srcWidth Width of the source image @param srcHeight Height of the source image @param transform Transform being applied to the image @return Bounding box
[ "Attempts", "to", "center", "the", "box", "inside", ".", "It", "will", "be", "approximately", "fitted", "too", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F64.java#L211-L261
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F64.java
LensDistortionOps_F64.roundInside
public static void roundInside( RectangleLength2D_F64 bound ) { double x0 = Math.ceil(bound.x0); double y0 = Math.ceil(bound.y0); double x1 = Math.floor(bound.x0+bound.width); double y1 = Math.floor(bound.y0+bound.height); bound.x0 = x0; bound.y0 = y0; bound.width = x1-x0; bound.height = y1-y0; }
java
public static void roundInside( RectangleLength2D_F64 bound ) { double x0 = Math.ceil(bound.x0); double y0 = Math.ceil(bound.y0); double x1 = Math.floor(bound.x0+bound.width); double y1 = Math.floor(bound.y0+bound.height); bound.x0 = x0; bound.y0 = y0; bound.width = x1-x0; bound.height = y1-y0; }
[ "public", "static", "void", "roundInside", "(", "RectangleLength2D_F64", "bound", ")", "{", "double", "x0", "=", "Math", ".", "ceil", "(", "bound", ".", "x0", ")", ";", "double", "y0", "=", "Math", ".", "ceil", "(", "bound", ".", "y0", ")", ";", "dou...
Adjust bound to ensure the entire image is contained inside, otherwise there might be single pixel wide black regions
[ "Adjust", "bound", "to", "ensure", "the", "entire", "image", "is", "contained", "inside", "otherwise", "there", "might", "be", "single", "pixel", "wide", "black", "regions" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F64.java#L288-L298
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointPixelRegionNCC.java
DescribePointPixelRegionNCC.isInBounds
public boolean isInBounds( int c_x , int c_y ) { return BoofMiscOps.checkInside(image, c_x, c_y, radiusWidth, radiusHeight); }
java
public boolean isInBounds( int c_x , int c_y ) { return BoofMiscOps.checkInside(image, c_x, c_y, radiusWidth, radiusHeight); }
[ "public", "boolean", "isInBounds", "(", "int", "c_x", ",", "int", "c_y", ")", "{", "return", "BoofMiscOps", ".", "checkInside", "(", "image", ",", "c_x", ",", "c_y", ",", "radiusWidth", ",", "radiusHeight", ")", ";", "}" ]
The entire region must be inside the image because any outside pixels will change the statistics
[ "The", "entire", "region", "must", "be", "inside", "the", "image", "because", "any", "outside", "pixels", "will", "change", "the", "statistics" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointPixelRegionNCC.java#L45-L47
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java
DoStuffFromPairwiseGraph.findCommonTracks
private GrowQueue_I32 findCommonTracks( SeedInfo target ) { // if true then it is visible in all tracks boolean visibleAll[] = new boolean[target.seed.totalFeatures]; Arrays.fill(visibleAll,true); // used to keep track of which features are visible in the current motion boolean visibleMotion[] = new boolean[t...
java
private GrowQueue_I32 findCommonTracks( SeedInfo target ) { // if true then it is visible in all tracks boolean visibleAll[] = new boolean[target.seed.totalFeatures]; Arrays.fill(visibleAll,true); // used to keep track of which features are visible in the current motion boolean visibleMotion[] = new boolean[t...
[ "private", "GrowQueue_I32", "findCommonTracks", "(", "SeedInfo", "target", ")", "{", "// if true then it is visible in all tracks", "boolean", "visibleAll", "[", "]", "=", "new", "boolean", "[", "target", ".", "seed", ".", "totalFeatures", "]", ";", "Arrays", ".", ...
Finds the indexes of tracks which are common to all views @param target The seed view @return indexes of common tracks
[ "Finds", "the", "indexes", "of", "tracks", "which", "are", "common", "to", "all", "views" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java#L75-L102
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java
DoStuffFromPairwiseGraph.score
private SeedInfo score( View target ) { SeedInfo output = new SeedInfo(); output.seed = target; scoresMotions.reset(); // score all edges for (int i = 0; i < target.connections.size; i++) { PairwiseImageGraph2.Motion m = target.connections.get(i); if( !m.is3D ) continue; scoresMotions.grow().se...
java
private SeedInfo score( View target ) { SeedInfo output = new SeedInfo(); output.seed = target; scoresMotions.reset(); // score all edges for (int i = 0; i < target.connections.size; i++) { PairwiseImageGraph2.Motion m = target.connections.get(i); if( !m.is3D ) continue; scoresMotions.grow().se...
[ "private", "SeedInfo", "score", "(", "View", "target", ")", "{", "SeedInfo", "output", "=", "new", "SeedInfo", "(", ")", ";", "output", ".", "seed", "=", "target", ";", "scoresMotions", ".", "reset", "(", ")", ";", "// score all edges", "for", "(", "int"...
Score a view for how well it could be a seed based on the the 3 best 3D motions associated with it
[ "Score", "a", "view", "for", "how", "well", "it", "could", "be", "a", "seed", "based", "on", "the", "the", "3", "best", "3D", "motions", "associated", "with", "it" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java#L145-L168
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java
DoStuffFromPairwiseGraph.score
public static double score( PairwiseImageGraph2.Motion m ) { // countF and countF will be <= totalFeatures // Prefer a scene more features from a fundamental matrix than a homography. // This can be sign that the scene has a rich 3D structure and is poorly represented by // a plane or rotational motion doubl...
java
public static double score( PairwiseImageGraph2.Motion m ) { // countF and countF will be <= totalFeatures // Prefer a scene more features from a fundamental matrix than a homography. // This can be sign that the scene has a rich 3D structure and is poorly represented by // a plane or rotational motion doubl...
[ "public", "static", "double", "score", "(", "PairwiseImageGraph2", ".", "Motion", "m", ")", "{", "// countF and countF will be <= totalFeatures", "// Prefer a scene more features from a fundamental matrix than a homography.", "// This can be sign that the scene has a rich 3D structure and ...
Scores the motion for its ability to capture 3D structure
[ "Scores", "the", "motion", "for", "its", "ability", "to", "capture", "3D", "structure" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/DoStuffFromPairwiseGraph.java#L173-L184
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java
GridRansacLineDetector.process
public void process( D derivX , D derivY , GrayU8 binaryEdges ) { InputSanityCheck.checkSameShape(derivX,derivY,binaryEdges); int w = derivX.width-regionSize+1; int h = derivY.height-regionSize+1; foundLines.reshape(derivX.width / regionSize, derivX.height / regionSize); foundLines.reset(); // avoid par...
java
public void process( D derivX , D derivY , GrayU8 binaryEdges ) { InputSanityCheck.checkSameShape(derivX,derivY,binaryEdges); int w = derivX.width-regionSize+1; int h = derivY.height-regionSize+1; foundLines.reshape(derivX.width / regionSize, derivX.height / regionSize); foundLines.reset(); // avoid par...
[ "public", "void", "process", "(", "D", "derivX", ",", "D", "derivY", ",", "GrayU8", "binaryEdges", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "derivX", ",", "derivY", ",", "binaryEdges", ")", ";", "int", "w", "=", "derivX", ".", "width", "...
Detects line segments through the image inside of grids. @param derivX Image derivative along x-axis. Not modified. @param derivY Image derivative along x-axis. Not modified. @param binaryEdges True values indicate that a pixel is an edge pixel. Not modified.
[ "Detects", "line", "segments", "through", "the", "image", "inside", "of", "grids", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java#L104-L129
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java
GridRansacLineDetector.findLinesInRegion
private void findLinesInRegion( List<LineSegment2D_F32> gridLines ) { List<Edgel> list = edgels.copyIntoList(null); int iterations = 0; // exit if not enough points or max iterations exceeded while( iterations++ < maxDetectLines) { if( !robustMatcher.process(list) ) break; // remove the found edge...
java
private void findLinesInRegion( List<LineSegment2D_F32> gridLines ) { List<Edgel> list = edgels.copyIntoList(null); int iterations = 0; // exit if not enough points or max iterations exceeded while( iterations++ < maxDetectLines) { if( !robustMatcher.process(list) ) break; // remove the found edge...
[ "private", "void", "findLinesInRegion", "(", "List", "<", "LineSegment2D_F32", ">", "gridLines", ")", "{", "List", "<", "Edgel", ">", "list", "=", "edgels", ".", "copyIntoList", "(", "null", ")", ";", "int", "iterations", "=", "0", ";", "// exit if not enoug...
Searches for lines inside inside the region.. @param gridLines Where the found lines are stored.
[ "Searches", "for", "lines", "inside", "inside", "the", "region", ".." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java#L156-L180
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java
GridRansacLineDetector.convertToLineSegment
private LineSegment2D_F32 convertToLineSegment(List<Edgel> matchSet, LinePolar2D_F32 model) { float minT = Float.MAX_VALUE; float maxT = -Float.MAX_VALUE; LineParametric2D_F32 line = UtilLine2D_F32.convert(model,(LineParametric2D_F32)null); Point2D_F32 p = new Point2D_F32(); for( Edgel e : matchSet ) { p...
java
private LineSegment2D_F32 convertToLineSegment(List<Edgel> matchSet, LinePolar2D_F32 model) { float minT = Float.MAX_VALUE; float maxT = -Float.MAX_VALUE; LineParametric2D_F32 line = UtilLine2D_F32.convert(model,(LineParametric2D_F32)null); Point2D_F32 p = new Point2D_F32(); for( Edgel e : matchSet ) { p...
[ "private", "LineSegment2D_F32", "convertToLineSegment", "(", "List", "<", "Edgel", ">", "matchSet", ",", "LinePolar2D_F32", "model", ")", "{", "float", "minT", "=", "Float", ".", "MAX_VALUE", ";", "float", "maxT", "=", "-", "Float", ".", "MAX_VALUE", ";", "L...
Lines are found in polar form and this coverts them into line segments by finding the extreme points of points on the line. @param matchSet Set of points belonging to the line. @param model Detected line. @return Line segement.
[ "Lines", "are", "found", "in", "polar", "form", "and", "this", "coverts", "them", "into", "line", "segments", "by", "finding", "the", "extreme", "points", "of", "points", "on", "the", "line", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java#L190-L214
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernManager.java
TldFernManager.lookupFern
public TldFernFeature lookupFern( int value ) { TldFernFeature found = table[value]; if( found == null ) { found = createFern(); found.init(value); table[value] = found; } return found; }
java
public TldFernFeature lookupFern( int value ) { TldFernFeature found = table[value]; if( found == null ) { found = createFern(); found.init(value); table[value] = found; } return found; }
[ "public", "TldFernFeature", "lookupFern", "(", "int", "value", ")", "{", "TldFernFeature", "found", "=", "table", "[", "value", "]", ";", "if", "(", "found", "==", "null", ")", "{", "found", "=", "createFern", "(", ")", ";", "found", ".", "init", "(", ...
Looks up the fern with the specified value. If non exist a new one is created and returned. @param value The fern's value @return The fern associated with that value
[ "Looks", "up", "the", "fern", "with", "the", "specified", "value", ".", "If", "non", "exist", "a", "new", "one", "is", "created", "and", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernManager.java#L53-L61
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernManager.java
TldFernManager.lookupPosterior
public double lookupPosterior( int value ) { TldFernFeature found = table[value]; if( found == null ) { return 0; } return found.posterior; }
java
public double lookupPosterior( int value ) { TldFernFeature found = table[value]; if( found == null ) { return 0; } return found.posterior; }
[ "public", "double", "lookupPosterior", "(", "int", "value", ")", "{", "TldFernFeature", "found", "=", "table", "[", "value", "]", ";", "if", "(", "found", "==", "null", ")", "{", "return", "0", ";", "}", "return", "found", ".", "posterior", ";", "}" ]
Looks up the posterior probability of the specified fern. If a fern is found its posterior is returned otherwise -1 is returned. NOTE: How unknown values are handled is a deviation from the paper. @param value The fern's value @return Fern's posterior probability. If the value is known then return -1
[ "Looks", "up", "the", "posterior", "probability", "of", "the", "specified", "fern", ".", "If", "a", "fern", "is", "found", "its", "posterior", "is", "returned", "otherwise", "-", "1", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernManager.java#L72-L78
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java
OpenImageSetDialog.handleAdd
void handleAdd() { BoofSwingUtil.checkGuiThread(); java.util.List<File> paths = browser.getSelectedFiles(); for (int i = 0; i < paths.size(); i++) { File f = paths.get(i); // if it's a directory add all the files in the directory if( f.isDirectory() ) { ...
java
void handleAdd() { BoofSwingUtil.checkGuiThread(); java.util.List<File> paths = browser.getSelectedFiles(); for (int i = 0; i < paths.size(); i++) { File f = paths.get(i); // if it's a directory add all the files in the directory if( f.isDirectory() ) { ...
[ "void", "handleAdd", "(", ")", "{", "BoofSwingUtil", ".", "checkGuiThread", "(", ")", ";", "java", ".", "util", ".", "List", "<", "File", ">", "paths", "=", "browser", ".", "getSelectedFiles", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "...
Add all selected files
[ "Add", "all", "selected", "files" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java#L110-L132
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java
OpenImageSetDialog.handleOK
void handleOK() { String[] selected = this.selected.paths.toArray(new String[0]); listener.selectedImages(selected); }
java
void handleOK() { String[] selected = this.selected.paths.toArray(new String[0]); listener.selectedImages(selected); }
[ "void", "handleOK", "(", ")", "{", "String", "[", "]", "selected", "=", "this", ".", "selected", ".", "paths", ".", "toArray", "(", "new", "String", "[", "0", "]", ")", ";", "listener", ".", "selectedImages", "(", "selected", ")", ";", "}" ]
OK button pressed
[ "OK", "button", "pressed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java#L137-L140
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java
OpenImageSetDialog.showPreview
void showPreview( String path ) { synchronized (lockPreview) { if( path == null ) { pendingPreview = null; } else if( previewThread == null ) { pendingPreview = path; previewThread = new PreviewThread(); previewThread.start(...
java
void showPreview( String path ) { synchronized (lockPreview) { if( path == null ) { pendingPreview = null; } else if( previewThread == null ) { pendingPreview = path; previewThread = new PreviewThread(); previewThread.start(...
[ "void", "showPreview", "(", "String", "path", ")", "{", "synchronized", "(", "lockPreview", ")", "{", "if", "(", "path", "==", "null", ")", "{", "pendingPreview", "=", "null", ";", "}", "else", "if", "(", "previewThread", "==", "null", ")", "{", "pendi...
Start a new preview thread if one isn't already running. Carefully manipulate variables due to threading
[ "Start", "a", "new", "preview", "thread", "if", "one", "isn", "t", "already", "running", ".", "Carefully", "manipulate", "variables", "due", "to", "threading" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/OpenImageSetDialog.java#L264-L276
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorSquareGrid.java
CalibrationDetectorSquareGrid.createLayout
public static List<Point2D_F64> createLayout(int numRows, int numCols, double squareWidth, double spaceWidth) { List<Point2D_F64> all = new ArrayList<>(); double width = (numCols*squareWidth + (numCols-1)*spaceWidth); double height = (numRows*squareWidth + (numRows-1)*spaceWidth); double startX = -width/2; ...
java
public static List<Point2D_F64> createLayout(int numRows, int numCols, double squareWidth, double spaceWidth) { List<Point2D_F64> all = new ArrayList<>(); double width = (numCols*squareWidth + (numCols-1)*spaceWidth); double height = (numRows*squareWidth + (numRows-1)*spaceWidth); double startX = -width/2; ...
[ "public", "static", "List", "<", "Point2D_F64", ">", "createLayout", "(", "int", "numRows", ",", "int", "numCols", ",", "double", "squareWidth", ",", "double", "spaceWidth", ")", "{", "List", "<", "Point2D_F64", ">", "all", "=", "new", "ArrayList", "<>", "...
Creates a target that is composed of squares. The squares are spaced out and each corner provides a calibration point. @param numRows Number of rows in calibration target. Must be odd. @param numCols Number of column in each calibration target. Must be odd. @param squareWidth How wide each square is. Units are targe...
[ "Creates", "a", "target", "that", "is", "composed", "of", "squares", ".", "The", "squares", "are", "spaced", "out", "and", "each", "corner", "provides", "a", "calibration", "point", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorSquareGrid.java#L92-L123
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.process
public void process(FastQueue<PositionPatternNode> pps , T gray ) { gridReader.setImage(gray); storageQR.reset(); successes.clear(); failures.clear(); for (int i = 0; i < pps.size; i++) { PositionPatternNode ppn = pps.get(i); for (int j = 3,k=0; k < 4; j=k,k++) { if( ppn.edges[j] != null && ppn.ed...
java
public void process(FastQueue<PositionPatternNode> pps , T gray ) { gridReader.setImage(gray); storageQR.reset(); successes.clear(); failures.clear(); for (int i = 0; i < pps.size; i++) { PositionPatternNode ppn = pps.get(i); for (int j = 3,k=0; k < 4; j=k,k++) { if( ppn.edges[j] != null && ppn.ed...
[ "public", "void", "process", "(", "FastQueue", "<", "PositionPatternNode", ">", "pps", ",", "T", "gray", ")", "{", "gridReader", ".", "setImage", "(", "gray", ")", ";", "storageQR", ".", "reset", "(", ")", ";", "successes", ".", "clear", "(", ")", ";",...
Detects QR Codes inside image using position pattern graph @param pps position pattern graph @param gray Gray input image
[ "Detects", "QR", "Codes", "inside", "image", "using", "position", "pattern", "graph" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L75-L102
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.computeBoundingBox
static void computeBoundingBox(QrCode qr ) { qr.bounds.get(0).set(qr.ppCorner.get(0)); qr.bounds.get(1).set(qr.ppRight.get(1)); Intersection2D_F64.intersection( qr.ppRight.get(1),qr.ppRight.get(2), qr.ppDown.get(3),qr.ppDown.get(2),qr.bounds.get(2)); qr.bounds.get(3).set(qr.ppDown.get(3)); }
java
static void computeBoundingBox(QrCode qr ) { qr.bounds.get(0).set(qr.ppCorner.get(0)); qr.bounds.get(1).set(qr.ppRight.get(1)); Intersection2D_F64.intersection( qr.ppRight.get(1),qr.ppRight.get(2), qr.ppDown.get(3),qr.ppDown.get(2),qr.bounds.get(2)); qr.bounds.get(3).set(qr.ppDown.get(3)); }
[ "static", "void", "computeBoundingBox", "(", "QrCode", "qr", ")", "{", "qr", ".", "bounds", ".", "get", "(", "0", ")", ".", "set", "(", "qr", ".", "ppCorner", ".", "get", "(", "0", ")", ")", ";", "qr", ".", "bounds", ".", "get", "(", "1", ")", ...
3 or the 4 corners are from the position patterns. The 4th is extrapolated using the position pattern sides. @param qr
[ "3", "or", "the", "4", "corners", "are", "from", "the", "position", "patterns", ".", "The", "4th", "is", "extrapolated", "using", "the", "position", "pattern", "sides", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L154-L161
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.extractFormatInfo
private boolean extractFormatInfo(QrCode qr) { for (int i = 0; i < 2; i++) { // probably a better way to do this would be to go with the region that has the smallest // hamming distance if (i == 0) readFormatRegion0(qr); else readFormatRegion1(qr); int bitField = this.bits.read(0,15,false); ...
java
private boolean extractFormatInfo(QrCode qr) { for (int i = 0; i < 2; i++) { // probably a better way to do this would be to go with the region that has the smallest // hamming distance if (i == 0) readFormatRegion0(qr); else readFormatRegion1(qr); int bitField = this.bits.read(0,15,false); ...
[ "private", "boolean", "extractFormatInfo", "(", "QrCode", "qr", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "2", ";", "i", "++", ")", "{", "// probably a better way to do this would be to go with the region that has the smallest", "// hamming distance",...
Reads format info bits from the image and saves the results in qr @return true if successful or false if it failed
[ "Reads", "format", "info", "bits", "from", "the", "image", "and", "saves", "the", "results", "in", "qr" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L228-L251
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.readFormatRegion0
private boolean readFormatRegion0(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppCorner,(float)qr.threshCorner); bits.resize(15); bits.zero(); for (int i = 0; i < 6; i++) { read(i,i,8); } read(6,7,8); read(7,8,8); read(8,8,7); fo...
java
private boolean readFormatRegion0(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppCorner,(float)qr.threshCorner); bits.resize(15); bits.zero(); for (int i = 0; i < 6; i++) { read(i,i,8); } read(6,7,8); read(7,8,8); read(8,8,7); fo...
[ "private", "boolean", "readFormatRegion0", "(", "QrCode", "qr", ")", "{", "// set the coordinate system to the closest pp to reduce position errors", "gridReader", ".", "setSquare", "(", "qr", ".", "ppCorner", ",", "(", "float", ")", "qr", ".", "threshCorner", ")", ";...
Reads the format bits near the corner position pattern
[ "Reads", "the", "format", "bits", "near", "the", "corner", "position", "pattern" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L256-L275
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.readFormatRegion1
private boolean readFormatRegion1(QrCode qr) { // if( qr.ppRight.get(0).distance(988.8,268.3) < 30 ) // System.out.println("tjere"); // System.out.println(qr.ppRight.get(0)); // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppRight,(float)qr.threshRight); bits...
java
private boolean readFormatRegion1(QrCode qr) { // if( qr.ppRight.get(0).distance(988.8,268.3) < 30 ) // System.out.println("tjere"); // System.out.println(qr.ppRight.get(0)); // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppRight,(float)qr.threshRight); bits...
[ "private", "boolean", "readFormatRegion1", "(", "QrCode", "qr", ")", "{", "//\t\tif( qr.ppRight.get(0).distance(988.8,268.3) < 30 )", "//\t\t\tSystem.out.println(\"tjere\");", "//\t\tSystem.out.println(qr.ppRight.get(0));", "// set the coordinate system to the closest pp to reduce position err...
Read the format bits on the right and bottom patterns
[ "Read", "the", "format", "bits", "on", "the", "right", "and", "bottom", "patterns" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L280-L301
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.readRawData
private boolean readRawData( QrCode qr) { QrCode.VersionInfo info = QrCode.VERSION_INFO[qr.version]; qr.rawbits = new byte[info.codewords]; // predeclare memory bits.resize(info.codewords*8); // read bits from memory List<Point2D_I32> locationBits = QrCode.LOCATION_BITS[qr.version]; // end at bits.siz...
java
private boolean readRawData( QrCode qr) { QrCode.VersionInfo info = QrCode.VERSION_INFO[qr.version]; qr.rawbits = new byte[info.codewords]; // predeclare memory bits.resize(info.codewords*8); // read bits from memory List<Point2D_I32> locationBits = QrCode.LOCATION_BITS[qr.version]; // end at bits.siz...
[ "private", "boolean", "readRawData", "(", "QrCode", "qr", ")", "{", "QrCode", ".", "VersionInfo", "info", "=", "QrCode", ".", "VERSION_INFO", "[", "qr", ".", "version", "]", ";", "qr", ".", "rawbits", "=", "new", "byte", "[", "info", ".", "codewords", ...
Read the raw data from input memory
[ "Read", "the", "raw", "data", "from", "input", "memory" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L306-L330
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.read
private void read(int bit , int row , int col ) { int value = gridReader.readBit(row,col); if( value == -1 ) { // The requested region is outside the image. A partial QR code can be read so let's just // assign it a value of zero and let error correction handle this value = 0; } bits.set(bit,value); }
java
private void read(int bit , int row , int col ) { int value = gridReader.readBit(row,col); if( value == -1 ) { // The requested region is outside the image. A partial QR code can be read so let's just // assign it a value of zero and let error correction handle this value = 0; } bits.set(bit,value); }
[ "private", "void", "read", "(", "int", "bit", ",", "int", "row", ",", "int", "col", ")", "{", "int", "value", "=", "gridReader", ".", "readBit", "(", "row", ",", "col", ")", ";", "if", "(", "value", "==", "-", "1", ")", "{", "// The requested regio...
Reads a bit from the image. @param bit Index the bit will be written to @param row row in qr code grid @param col column in qr code grid
[ "Reads", "a", "bit", "from", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L338-L346
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.extractVersionInfo
boolean extractVersionInfo(QrCode qr) { int version = estimateVersionBySize(qr); // For version 7 and beyond use the version which has been encoded into the qr code if( version >= QrCode.VERSION_ENCODED_AT) { readVersionRegion0(qr); int version0 = decodeVersion(); readVersionRegion1(qr); int version1...
java
boolean extractVersionInfo(QrCode qr) { int version = estimateVersionBySize(qr); // For version 7 and beyond use the version which has been encoded into the qr code if( version >= QrCode.VERSION_ENCODED_AT) { readVersionRegion0(qr); int version0 = decodeVersion(); readVersionRegion1(qr); int version1...
[ "boolean", "extractVersionInfo", "(", "QrCode", "qr", ")", "{", "int", "version", "=", "estimateVersionBySize", "(", "qr", ")", ";", "// For version 7 and beyond use the version which has been encoded into the qr code", "if", "(", "version", ">=", "QrCode", ".", "VERSION_...
Determine the QR code's version. For QR codes version < 7 it can be determined using the marker's size alone. Otherwise the version is read from the image itself @return true if version was successfully extracted or false if it failed
[ "Determine", "the", "QR", "code", "s", "version", ".", "For", "QR", "codes", "version", "<", "7", "it", "can", "be", "determined", "using", "the", "marker", "s", "size", "alone", ".", "Otherwise", "the", "version", "is", "read", "from", "the", "image", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L363-L390
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.decodeVersion
int decodeVersion() { int bitField = this.bits.read(0,18,false); int message; // see if there's any errors if (QrCodePolynomialMath.checkVersionBits(bitField)) { message = bitField >> 12; } else { message = QrCodePolynomialMath.correctVersionBits(bitField); } // sanity check results if( message > ...
java
int decodeVersion() { int bitField = this.bits.read(0,18,false); int message; // see if there's any errors if (QrCodePolynomialMath.checkVersionBits(bitField)) { message = bitField >> 12; } else { message = QrCodePolynomialMath.correctVersionBits(bitField); } // sanity check results if( message > ...
[ "int", "decodeVersion", "(", ")", "{", "int", "bitField", "=", "this", ".", "bits", ".", "read", "(", "0", ",", "18", ",", "false", ")", ";", "int", "message", ";", "// see if there's any errors", "if", "(", "QrCodePolynomialMath", ".", "checkVersionBits", ...
Decode version information from read in bits @return The found version or -1 if it failed
[ "Decode", "version", "information", "from", "read", "in", "bits" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L396-L410
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.estimateVersionBySize
int estimateVersionBySize( QrCode qr ) { // Just need the homography for this corner square square gridReader.setMarkerUnknownVersion(qr,0); // Compute location of position patterns relative to corner PP gridReader.imageToGrid(qr.ppRight.get(0),grid); // see if pp is miss aligned. Probably not a flat surfac...
java
int estimateVersionBySize( QrCode qr ) { // Just need the homography for this corner square square gridReader.setMarkerUnknownVersion(qr,0); // Compute location of position patterns relative to corner PP gridReader.imageToGrid(qr.ppRight.get(0),grid); // see if pp is miss aligned. Probably not a flat surfac...
[ "int", "estimateVersionBySize", "(", "QrCode", "qr", ")", "{", "// Just need the homography for this corner square square", "gridReader", ".", "setMarkerUnknownVersion", "(", "qr", ",", "0", ")", ";", "// Compute location of position patterns relative to corner PP", "gridReader",...
Attempts to estimate the qr-code's version based on distance between position patterns. If it can't estimate it based on distance return -1
[ "Attempts", "to", "estimate", "the", "qr", "-", "code", "s", "version", "based", "on", "distance", "between", "position", "patterns", ".", "If", "it", "can", "t", "estimate", "it", "based", "on", "distance", "return", "-", "1" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L416-L442
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.readVersionRegion0
private boolean readVersionRegion0(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppRight, (float) qr.threshRight); bits.resize(18); bits.zero(); for (int i = 0; i < 18; i++) { int row = i/3; int col = i%3; read(i,row,col-4); } // Sys...
java
private boolean readVersionRegion0(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppRight, (float) qr.threshRight); bits.resize(18); bits.zero(); for (int i = 0; i < 18; i++) { int row = i/3; int col = i%3; read(i,row,col-4); } // Sys...
[ "private", "boolean", "readVersionRegion0", "(", "QrCode", "qr", ")", "{", "// set the coordinate system to the closest pp to reduce position errors", "gridReader", ".", "setSquare", "(", "qr", ".", "ppRight", ",", "(", "float", ")", "qr", ".", "threshRight", ")", ";"...
Reads the version bits near the right position pattern
[ "Reads", "the", "version", "bits", "near", "the", "right", "position", "pattern" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L447-L462
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java
QrCodeDecoderImage.readVersionRegion1
private boolean readVersionRegion1(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppDown, (float) qr.threshDown); bits.resize(18); bits.zero(); for (int i = 0; i < 18; i++) { int row = i%3; int col = i/3; read(i,row-4,col); } // Syst...
java
private boolean readVersionRegion1(QrCode qr) { // set the coordinate system to the closest pp to reduce position errors gridReader.setSquare(qr.ppDown, (float) qr.threshDown); bits.resize(18); bits.zero(); for (int i = 0; i < 18; i++) { int row = i%3; int col = i/3; read(i,row-4,col); } // Syst...
[ "private", "boolean", "readVersionRegion1", "(", "QrCode", "qr", ")", "{", "// set the coordinate system to the closest pp to reduce position errors", "gridReader", ".", "setSquare", "(", "qr", ".", "ppDown", ",", "(", "float", ")", "qr", ".", "threshDown", ")", ";", ...
Reads the version bits near the bottom position pattern
[ "Reads", "the", "version", "bits", "near", "the", "bottom", "position", "pattern" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderImage.java#L467-L482
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/impl/ImplIntegralImageFeatureIntensity_MT.java
ImplIntegralImageFeatureIntensity_MT.hessianBorder
public static void hessianBorder(GrayF32 integral, int skip , int size , GrayF32 intensity) { final int w = intensity.width; final int h = intensity.height; // get convolution kernels for the second order derivatives IntegralKernel kerXX = DerivativeIntegralImage.kernelDerivXX(size,null); Integral...
java
public static void hessianBorder(GrayF32 integral, int skip , int size , GrayF32 intensity) { final int w = intensity.width; final int h = intensity.height; // get convolution kernels for the second order derivatives IntegralKernel kerXX = DerivativeIntegralImage.kernelDerivXX(size,null); Integral...
[ "public", "static", "void", "hessianBorder", "(", "GrayF32", "integral", ",", "int", "skip", ",", "int", "size", ",", "GrayF32", "intensity", ")", "{", "final", "int", "w", "=", "intensity", ".", "width", ";", "final", "int", "h", "=", "intensity", ".", ...
Only computes the fast hessian along the border using a brute force approach
[ "Only", "computes", "the", "fast", "hessian", "along", "the", "border", "using", "a", "brute", "force", "approach" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/impl/ImplIntegralImageFeatureIntensity_MT.java#L43-L84
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.logicAnd
public static GrayU8 logicAnd(GrayU8 inputA , GrayU8 inputB , GrayU8 output ) { InputSanityCheck.checkSameShape(inputA,inputB); output = InputSanityCheck.checkDeclare(inputA, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.logicAnd(inputA, inputB, output); } else { ImplBinaryImageO...
java
public static GrayU8 logicAnd(GrayU8 inputA , GrayU8 inputB , GrayU8 output ) { InputSanityCheck.checkSameShape(inputA,inputB); output = InputSanityCheck.checkDeclare(inputA, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.logicAnd(inputA, inputB, output); } else { ImplBinaryImageO...
[ "public", "static", "GrayU8", "logicAnd", "(", "GrayU8", "inputA", ",", "GrayU8", "inputB", ",", "GrayU8", "output", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "inputA", ",", "inputB", ")", ";", "output", "=", "InputSanityCheck", ".", "checkDecl...
For each pixel it applies the logical 'and' operator between two images. @param inputA First input image. Not modified. @param inputB Second input image. Not modified. @param output Output image. Can be same as either input. If null a new instance will be declared, Modified. @return Output of logical operation.
[ "For", "each", "pixel", "it", "applies", "the", "logical", "and", "operator", "between", "two", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L69-L81
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.invert
public static GrayU8 invert(GrayU8 input , GrayU8 output) { output = InputSanityCheck.checkDeclare(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.invert(input, output); } else { ImplBinaryImageOps.invert(input, output); } return output; }
java
public static GrayU8 invert(GrayU8 input , GrayU8 output) { output = InputSanityCheck.checkDeclare(input, output); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.invert(input, output); } else { ImplBinaryImageOps.invert(input, output); } return output; }
[ "public", "static", "GrayU8", "invert", "(", "GrayU8", "input", ",", "GrayU8", "output", ")", "{", "output", "=", "InputSanityCheck", ".", "checkDeclare", "(", "input", ",", "output", ")", ";", "if", "(", "BoofConcurrency", ".", "USE_CONCURRENT", ")", "{", ...
Inverts each pixel from true to false and vis-versa. @param input Input image. Not modified. @param output Output image. Can be same as input. If null a new instance will be declared, Modified. @return Output of logical operation.
[ "Inverts", "each", "pixel", "from", "true", "to", "false", "and", "vis", "-", "versa", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L134-L145
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.thin
public static GrayU8 thin(GrayU8 input , int maxIterations, GrayU8 output ) { output = InputSanityCheck.checkDeclare(input, output); output.setTo(input); BinaryThinning thinning = new BinaryThinning(); thinning.apply(output,maxIterations); return output; }
java
public static GrayU8 thin(GrayU8 input , int maxIterations, GrayU8 output ) { output = InputSanityCheck.checkDeclare(input, output); output.setTo(input); BinaryThinning thinning = new BinaryThinning(); thinning.apply(output,maxIterations); return output; }
[ "public", "static", "GrayU8", "thin", "(", "GrayU8", "input", ",", "int", "maxIterations", ",", "GrayU8", "output", ")", "{", "output", "=", "InputSanityCheck", ".", "checkDeclare", "(", "input", ",", "output", ")", ";", "output", ".", "setTo", "(", "input...
Applies a morphological thinning operation to the image. Also known as skeletonization. @see BinaryThinning @param input Input image. Not modified. @param maxIterations Maximum number of cycles it will thin for. -1 for the maximum required @param output If not null, the output image. If null a new image is declar...
[ "Applies", "a", "morphological", "thinning", "operation", "to", "the", "image", ".", "Also", "known", "as", "skeletonization", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L423-L433
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.contourExternal
public static List<Contour> contourExternal(GrayU8 input, ConnectRule rule ) { BinaryContourFinder alg = FactoryBinaryContourFinder.linearExternal(); alg.setConnectRule(rule); alg.process(input); return convertContours(alg); }
java
public static List<Contour> contourExternal(GrayU8 input, ConnectRule rule ) { BinaryContourFinder alg = FactoryBinaryContourFinder.linearExternal(); alg.setConnectRule(rule); alg.process(input); return convertContours(alg); }
[ "public", "static", "List", "<", "Contour", ">", "contourExternal", "(", "GrayU8", "input", ",", "ConnectRule", "rule", ")", "{", "BinaryContourFinder", "alg", "=", "FactoryBinaryContourFinder", ".", "linearExternal", "(", ")", ";", "alg", ".", "setConnectRule", ...
Finds the external contours only in the image @param input Input binary image. Not modified. @param rule Connectivity rule. Can be 4 or 8. 8 is more commonly used. @return List of found contours for each blob.
[ "Finds", "the", "external", "contours", "only", "in", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L477-L483
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.relabel
public static void relabel(GrayS32 input , int labels[] ) { if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.relabel(input, labels); } else { ImplBinaryImageOps.relabel(input, labels); } }
java
public static void relabel(GrayS32 input , int labels[] ) { if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.relabel(input, labels); } else { ImplBinaryImageOps.relabel(input, labels); } }
[ "public", "static", "void", "relabel", "(", "GrayS32", "input", ",", "int", "labels", "[", "]", ")", "{", "if", "(", "BoofConcurrency", ".", "USE_CONCURRENT", ")", "{", "ImplBinaryImageOps_MT", ".", "relabel", "(", "input", ",", "labels", ")", ";", "}", ...
Used to change the labels in a labeled binary image. @param input Labeled binary image. @param labels Look up table where the indexes are the current label and the value are its new value.
[ "Used", "to", "change", "the", "labels", "in", "a", "labeled", "binary", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L509-L515
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.labelToBinary
public static GrayU8 labelToBinary(GrayS32 labelImage , GrayU8 binaryImage ) { binaryImage = InputSanityCheck.checkDeclare(labelImage, binaryImage, GrayU8.class); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.labelToBinary(labelImage, binaryImage); } else { ImplBinaryImageOps.labelToBinary(l...
java
public static GrayU8 labelToBinary(GrayS32 labelImage , GrayU8 binaryImage ) { binaryImage = InputSanityCheck.checkDeclare(labelImage, binaryImage, GrayU8.class); if( BoofConcurrency.USE_CONCURRENT ) { ImplBinaryImageOps_MT.labelToBinary(labelImage, binaryImage); } else { ImplBinaryImageOps.labelToBinary(l...
[ "public", "static", "GrayU8", "labelToBinary", "(", "GrayS32", "labelImage", ",", "GrayU8", "binaryImage", ")", "{", "binaryImage", "=", "InputSanityCheck", ".", "checkDeclare", "(", "labelImage", ",", "binaryImage", ",", "GrayU8", ".", "class", ")", ";", "if", ...
Converts a labeled image into a binary image by setting any non-zero value to one. @param labelImage Input image. Not modified. @param binaryImage Output image. Modified. @return The binary image.
[ "Converts", "a", "labeled", "image", "into", "a", "binary", "image", "by", "setting", "any", "non", "-", "zero", "value", "to", "one", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L524-L534
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.labelToClusters
public static List<List<Point2D_I32>> labelToClusters( GrayS32 labelImage , int numLabels , FastQueue<Point2D_I32> queue ) { List<List<Point2D_I32>> ret = new ArrayList<>(); for( int i = 0; i < numLabels+1; i++ ) { ret.add( new ArrayList<Point2D_I32>() ); } if( queue == nul...
java
public static List<List<Point2D_I32>> labelToClusters( GrayS32 labelImage , int numLabels , FastQueue<Point2D_I32> queue ) { List<List<Point2D_I32>> ret = new ArrayList<>(); for( int i = 0; i < numLabels+1; i++ ) { ret.add( new ArrayList<Point2D_I32>() ); } if( queue == nul...
[ "public", "static", "List", "<", "List", "<", "Point2D_I32", ">", ">", "labelToClusters", "(", "GrayS32", "labelImage", ",", "int", "numLabels", ",", "FastQueue", "<", "Point2D_I32", ">", "queue", ")", "{", "List", "<", "List", "<", "Point2D_I32", ">>", "r...
Scans through the labeled image and adds the coordinate of each pixel that has been labeled to a list specific to its label. @param labelImage The labeled image. @param numLabels Number of labeled objects inside the image. @param queue (Optional) Storage for pixel coordinates. Improves runtime performance. Can be nul...
[ "Scans", "through", "the", "labeled", "image", "and", "adds", "the", "coordinate", "of", "each", "pixel", "that", "has", "been", "labeled", "to", "a", "list", "specific", "to", "its", "label", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L589-L620
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.clusterToBinary
public static void clusterToBinary( List<List<Point2D_I32>> clusters , GrayU8 binary ) { ImageMiscOps.fill(binary, 0); for( List<Point2D_I32> l : clusters ) { for( Point2D_I32 p : l ) { binary.set(p.x,p.y,1); } } }
java
public static void clusterToBinary( List<List<Point2D_I32>> clusters , GrayU8 binary ) { ImageMiscOps.fill(binary, 0); for( List<Point2D_I32> l : clusters ) { for( Point2D_I32 p : l ) { binary.set(p.x,p.y,1); } } }
[ "public", "static", "void", "clusterToBinary", "(", "List", "<", "List", "<", "Point2D_I32", ">", ">", "clusters", ",", "GrayU8", "binary", ")", "{", "ImageMiscOps", ".", "fill", "(", "binary", ",", "0", ")", ";", "for", "(", "List", "<", "Point2D_I32", ...
Sets each pixel in the list of clusters to one in the binary image. @param clusters List of all the clusters. @param binary Output
[ "Sets", "each", "pixel", "in", "the", "list", "of", "clusters", "to", "one", "in", "the", "binary", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L628-L638
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java
BinaryImageOps.selectRandomColors
public static int[] selectRandomColors( int numBlobs , Random rand ) { int colors[] = new int[ numBlobs+1 ]; colors[0] = 0; // black int B = 100; for( int i = 1; i < colors.length; i++ ) { int c; while( true ) { c = rand.nextInt(0xFFFFFF); // make sure its not too dark and can't be distriquished...
java
public static int[] selectRandomColors( int numBlobs , Random rand ) { int colors[] = new int[ numBlobs+1 ]; colors[0] = 0; // black int B = 100; for( int i = 1; i < colors.length; i++ ) { int c; while( true ) { c = rand.nextInt(0xFFFFFF); // make sure its not too dark and can't be distriquished...
[ "public", "static", "int", "[", "]", "selectRandomColors", "(", "int", "numBlobs", ",", "Random", "rand", ")", "{", "int", "colors", "[", "]", "=", "new", "int", "[", "numBlobs", "+", "1", "]", ";", "colors", "[", "0", "]", "=", "0", ";", "// black...
Several blob rending functions take in an array of colors so that the random blobs can be drawn with the same color each time. This function selects a random color for each blob and returns it in an array. @param numBlobs Number of blobs found. @param rand Random number generator @return array of RGB colors for each ...
[ "Several", "blob", "rending", "functions", "take", "in", "an", "array", "of", "colors", "so", "that", "the", "random", "blobs", "can", "be", "drawn", "with", "the", "same", "color", "each", "time", ".", "This", "function", "selects", "a", "random", "color"...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L648-L666
train
lessthanoptimal/BoofCV
integration/boofcv-openkinect/src/main/java/boofcv/openkinect/UtilOpenKinect.java
UtilOpenKinect.bufferDepthToU16
public static void bufferDepthToU16( ByteBuffer input , GrayU16 output ) { int indexIn = 0; for( int y = 0; y < output.height; y++ ) { int indexOut = output.startIndex + y*output.stride; for( int x = 0; x < output.width; x++ , indexOut++ ) { output.data[indexOut] = (short)((input.get(indexIn++) & 0xFF) | ...
java
public static void bufferDepthToU16( ByteBuffer input , GrayU16 output ) { int indexIn = 0; for( int y = 0; y < output.height; y++ ) { int indexOut = output.startIndex + y*output.stride; for( int x = 0; x < output.width; x++ , indexOut++ ) { output.data[indexOut] = (short)((input.get(indexIn++) & 0xFF) | ...
[ "public", "static", "void", "bufferDepthToU16", "(", "ByteBuffer", "input", ",", "GrayU16", "output", ")", "{", "int", "indexIn", "=", "0", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "output", ".", "height", ";", "y", "++", ")", "{", "in...
Converts data in a ByteBuffer into a 16bit depth image @param input Input buffer @param output Output depth image
[ "Converts", "data", "in", "a", "ByteBuffer", "into", "a", "16bit", "depth", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/UtilOpenKinect.java#L65-L73
train
lessthanoptimal/BoofCV
integration/boofcv-openkinect/src/main/java/boofcv/openkinect/UtilOpenKinect.java
UtilOpenKinect.bufferRgbToMsU8
public static void bufferRgbToMsU8( byte []input , Planar<GrayU8> output ) { GrayU8 band0 = output.getBand(0); GrayU8 band1 = output.getBand(1); GrayU8 band2 = output.getBand(2); int indexIn = 0; for( int y = 0; y < output.height; y++ ) { int indexOut = output.startIndex + y*output.stride; for( int x =...
java
public static void bufferRgbToMsU8( byte []input , Planar<GrayU8> output ) { GrayU8 band0 = output.getBand(0); GrayU8 band1 = output.getBand(1); GrayU8 band2 = output.getBand(2); int indexIn = 0; for( int y = 0; y < output.height; y++ ) { int indexOut = output.startIndex + y*output.stride; for( int x =...
[ "public", "static", "void", "bufferRgbToMsU8", "(", "byte", "[", "]", "input", ",", "Planar", "<", "GrayU8", ">", "output", ")", "{", "GrayU8", "band0", "=", "output", ".", "getBand", "(", "0", ")", ";", "GrayU8", "band1", "=", "output", ".", "getBand"...
Converts byte array that contains RGB data into a 3-channel Planar image @param input Input array @param output Output depth image
[ "Converts", "byte", "array", "that", "contains", "RGB", "data", "into", "a", "3", "-", "channel", "Planar", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/UtilOpenKinect.java#L116-L130
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.computeECC
public void computeECC( GrowQueue_I8 input , GrowQueue_I8 output ) { int N = generator.size-1; input.extend(input.size+N); Arrays.fill(input.data,input.size-N,input.size,(byte)0); math.polyDivide(input,generator,tmp0,output); input.size -= N; }
java
public void computeECC( GrowQueue_I8 input , GrowQueue_I8 output ) { int N = generator.size-1; input.extend(input.size+N); Arrays.fill(input.data,input.size-N,input.size,(byte)0); math.polyDivide(input,generator,tmp0,output); input.size -= N; }
[ "public", "void", "computeECC", "(", "GrowQueue_I8", "input", ",", "GrowQueue_I8", "output", ")", "{", "int", "N", "=", "generator", ".", "size", "-", "1", ";", "input", ".", "extend", "(", "input", ".", "size", "+", "N", ")", ";", "Arrays", ".", "fi...
Given the input message compute the error correction code for it @param input Input message. Modified internally then returned to its initial state @param output error correction code
[ "Given", "the", "input", "message", "compute", "the", "error", "correction", "code", "for", "it" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L62-L71
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.correct
public boolean correct(GrowQueue_I8 input , GrowQueue_I8 ecc ) { computeSyndromes(input,ecc,syndromes); findErrorLocatorPolynomialBM(syndromes,errorLocatorPoly); if( !findErrorLocations_BruteForce(errorLocatorPoly,input.size+ecc.size,errorLocations)) return false; correctErrors(input,input.size+ecc.size,sy...
java
public boolean correct(GrowQueue_I8 input , GrowQueue_I8 ecc ) { computeSyndromes(input,ecc,syndromes); findErrorLocatorPolynomialBM(syndromes,errorLocatorPoly); if( !findErrorLocations_BruteForce(errorLocatorPoly,input.size+ecc.size,errorLocations)) return false; correctErrors(input,input.size+ecc.size,sy...
[ "public", "boolean", "correct", "(", "GrowQueue_I8", "input", ",", "GrowQueue_I8", "ecc", ")", "{", "computeSyndromes", "(", "input", ",", "ecc", ",", "syndromes", ")", ";", "findErrorLocatorPolynomialBM", "(", "syndromes", ",", "errorLocatorPoly", ")", ";", "if...
Decodes the message and performs any necessary error correction @param input (Input) Corrupted Message (Output) corrected message @param ecc (Input) error correction code for the message @return true if it was successful or false if it failed
[ "Decodes", "the", "message", "and", "performs", "any", "necessary", "error", "correction" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L79-L88
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.findErrorLocatorPolynomial
void findErrorLocatorPolynomial( int messageLength , GrowQueue_I32 errorLocations , GrowQueue_I8 errorLocator ) { tmp1.resize(2); tmp1.data[1] = 1; errorLocator.resize(1); errorLocator.data[0] = 1; for (int i = 0; i < errorLocations.size; i++) { // Convert from positions in the message to coefficient degre...
java
void findErrorLocatorPolynomial( int messageLength , GrowQueue_I32 errorLocations , GrowQueue_I8 errorLocator ) { tmp1.resize(2); tmp1.data[1] = 1; errorLocator.resize(1); errorLocator.data[0] = 1; for (int i = 0; i < errorLocations.size; i++) { // Convert from positions in the message to coefficient degre...
[ "void", "findErrorLocatorPolynomial", "(", "int", "messageLength", ",", "GrowQueue_I32", "errorLocations", ",", "GrowQueue_I8", "errorLocator", ")", "{", "tmp1", ".", "resize", "(", "2", ")", ";", "tmp1", ".", "data", "[", "1", "]", "=", "1", ";", "errorLoca...
Compute the error locator polynomial when given the error locations in the message. @param messageLength (Input) Length of the message @param errorLocations (Input) List of error locations in the byte @param errorLocator (Output) Error locator polynomial. Coefficients are large to small.
[ "Compute", "the", "error", "locator", "polynomial", "when", "given", "the", "error", "locations", "in", "the", "message", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L186-L202
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.findErrorLocations_BruteForce
public boolean findErrorLocations_BruteForce(GrowQueue_I8 errorLocator , int messageLength , GrowQueue_I32 locations ) { locations.resize(0); for (int i = 0; i < messageLength; i++) { if( math.polyEval_S(errorLocator,math.power(2,i)) == 0 ) { locations.add(messageLength-i-1); } ...
java
public boolean findErrorLocations_BruteForce(GrowQueue_I8 errorLocator , int messageLength , GrowQueue_I32 locations ) { locations.resize(0); for (int i = 0; i < messageLength; i++) { if( math.polyEval_S(errorLocator,math.power(2,i)) == 0 ) { locations.add(messageLength-i-1); } ...
[ "public", "boolean", "findErrorLocations_BruteForce", "(", "GrowQueue_I8", "errorLocator", ",", "int", "messageLength", ",", "GrowQueue_I32", "locations", ")", "{", "locations", ".", "resize", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "...
Creates a list of bytes that have errors in them @param errorLocator (Input) Error locator polynomial. Coefficients from small to large. @param messageLength (Input) Length of the message + ecc. @param locations (Output) locations of bytes in message with errors.
[ "Creates", "a", "list", "of", "bytes", "that", "have", "errors", "in", "them" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L211-L224
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.correctErrors
void correctErrors( GrowQueue_I8 message , int length_msg_ecc, GrowQueue_I8 syndromes, GrowQueue_I8 errorLocator , GrowQueue_I32 errorLocations) { GrowQueue_I8 err_eval = new GrowQueue_I8(); // TODO avoid new findErrorEvaluator(syndromes,errorLocator,err_eval); // Compute error positions...
java
void correctErrors( GrowQueue_I8 message , int length_msg_ecc, GrowQueue_I8 syndromes, GrowQueue_I8 errorLocator , GrowQueue_I32 errorLocations) { GrowQueue_I8 err_eval = new GrowQueue_I8(); // TODO avoid new findErrorEvaluator(syndromes,errorLocator,err_eval); // Compute error positions...
[ "void", "correctErrors", "(", "GrowQueue_I8", "message", ",", "int", "length_msg_ecc", ",", "GrowQueue_I8", "syndromes", ",", "GrowQueue_I8", "errorLocator", ",", "GrowQueue_I32", "errorLocations", ")", "{", "GrowQueue_I8", "err_eval", "=", "new", "GrowQueue_I8", "(",...
Use Forney algorithm to compute correction values. @param message (Input/Output) The message which is to be corrected. Just the message. ECC not required. @param length_msg_ecc (Input) length of message and ecc code @param errorLocations (Input) locations of bytes in message with errors.
[ "Use", "Forney", "algorithm", "to", "compute", "correction", "values", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L233-L285
train