id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
50,800
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
50,801
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
50,802
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
50,803
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
50,804
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
50,805
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
50,806
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
50,807
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
50,808
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
50,809
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
50,810
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
50,811
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
50,812
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
50,813
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
50,814
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
50,815
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
50,816
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
50,817
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
50,818
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
50,819
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
50,820
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
50,821
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
50,822
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
50,823
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
50,824
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
50,825
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
50,826
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
50,827
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
50,828
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
50,829
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
50,830
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
50,831
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
50,832
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
50,833
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
50,834
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
50,835
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
50,836
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
50,837
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
50,838
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
50,839
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
50,840
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
50,841
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
50,842
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
50,843
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
50,844
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
50,845
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
50,846
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
50,847
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
50,848
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
50,849
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
50,850
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
50,851
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
50,852
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
50,853
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.findErrorEvaluator
void findErrorEvaluator( GrowQueue_I8 syndromes , GrowQueue_I8 errorLocator , GrowQueue_I8 evaluator ) { math.polyMult_flipA(syndromes,errorLocator,evaluator); int N = errorLocator.size-1; int offset = evaluator.size-N; for (int i = 0; i < N; i++) { evaluator.data[i] = evaluator.data[i+offset]; } ...
java
void findErrorEvaluator( GrowQueue_I8 syndromes , GrowQueue_I8 errorLocator , GrowQueue_I8 evaluator ) { math.polyMult_flipA(syndromes,errorLocator,evaluator); int N = errorLocator.size-1; int offset = evaluator.size-N; for (int i = 0; i < N; i++) { evaluator.data[i] = evaluator.data[i+offset]; } ...
[ "void", "findErrorEvaluator", "(", "GrowQueue_I8", "syndromes", ",", "GrowQueue_I8", "errorLocator", ",", "GrowQueue_I8", "evaluator", ")", "{", "math", ".", "polyMult_flipA", "(", "syndromes", ",", "errorLocator", ",", "evaluator", ")", ";", "int", "N", "=", "e...
Compute the error evaluator polynomial Omega. @param syndromes (Input) syndromes @param errorLocator (Input) error locator polynomial. @param evaluator (Output) error evaluator polynomial. large to small coef
[ "Compute", "the", "error", "evaluator", "polynomial", "Omega", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L294-L313
50,854
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java
PyramidOps.declareOutput
public static <O extends ImageGray<O>> O[] declareOutput( ImagePyramid<?> pyramid , Class<O> outputType ) { O[] ret = (O[])Array.newInstance(outputType,pyramid.getNumLayers()); for( int i = 0; i < ret.length; i++ ) { int w = pyramid.getWidth(i); int h = pyramid.getHeight(i); ret[i] = GeneralizedImageOps....
java
public static <O extends ImageGray<O>> O[] declareOutput( ImagePyramid<?> pyramid , Class<O> outputType ) { O[] ret = (O[])Array.newInstance(outputType,pyramid.getNumLayers()); for( int i = 0; i < ret.length; i++ ) { int w = pyramid.getWidth(i); int h = pyramid.getHeight(i); ret[i] = GeneralizedImageOps....
[ "public", "static", "<", "O", "extends", "ImageGray", "<", "O", ">", ">", "O", "[", "]", "declareOutput", "(", "ImagePyramid", "<", "?", ">", "pyramid", ",", "Class", "<", "O", ">", "outputType", ")", "{", "O", "[", "]", "ret", "=", "(", "O", "["...
Creates an array of single band images for each layer in the provided pyramid. Each image will be the same size as the corresponding layer in the pyramid. @param pyramid (Input) Image pyramid @param outputType (Input) Output image type @param <O> Output image type @return An array of images
[ "Creates", "an", "array", "of", "single", "band", "images", "for", "each", "layer", "in", "the", "provided", "pyramid", ".", "Each", "image", "will", "be", "the", "same", "size", "as", "the", "corresponding", "layer", "in", "the", "pyramid", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java#L51-L62
50,855
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java
PyramidOps.reshapeOutput
public static <O extends ImageGray<O>> void reshapeOutput( ImagePyramid<?> pyramid , O[] output ) { for( int i = 0; i < output.length; i++ ) { int w = pyramid.getWidth(i); int h = pyramid.getHeight(i); output[i].reshape(w, h); } }
java
public static <O extends ImageGray<O>> void reshapeOutput( ImagePyramid<?> pyramid , O[] output ) { for( int i = 0; i < output.length; i++ ) { int w = pyramid.getWidth(i); int h = pyramid.getHeight(i); output[i].reshape(w, h); } }
[ "public", "static", "<", "O", "extends", "ImageGray", "<", "O", ">", ">", "void", "reshapeOutput", "(", "ImagePyramid", "<", "?", ">", "pyramid", ",", "O", "[", "]", "output", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "output", "...
Reshapes each image in the array to match the layers in the pyramid @param pyramid (Input) Image pyramid @param output (Output) List of images which is to be resized @param <O> Image type
[ "Reshapes", "each", "image", "in", "the", "array", "to", "match", "the", "layers", "in", "the", "pyramid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java#L70-L78
50,856
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/color/HistogramFeatureOps.java
HistogramFeatureOps.histogram
public static void histogram(GrayU8 image , int maxPixelValue , TupleDesc_F64 histogram ) { int numBins = histogram.size(); int divisor = maxPixelValue+1; histogram.fill(0); for( int y = 0; y < image.height; y++ ) { int index = image.startIndex + y*image.stride; for( int x = 0; x < image.width; x++ , ...
java
public static void histogram(GrayU8 image , int maxPixelValue , TupleDesc_F64 histogram ) { int numBins = histogram.size(); int divisor = maxPixelValue+1; histogram.fill(0); for( int y = 0; y < image.height; y++ ) { int index = image.startIndex + y*image.stride; for( int x = 0; x < image.width; x++ , ...
[ "public", "static", "void", "histogram", "(", "GrayU8", "image", ",", "int", "maxPixelValue", ",", "TupleDesc_F64", "histogram", ")", "{", "int", "numBins", "=", "histogram", ".", "size", "(", ")", ";", "int", "divisor", "=", "maxPixelValue", "+", "1", ";"...
Computes a single-band normalized histogram from an integer image.. @param image Input image. Not modified. @param maxPixelValue Maximum possible value for a pixel for all bands. @param histogram Output histogram. Must have same number of bands as input image. Modified.
[ "Computes", "a", "single", "-", "band", "normalized", "histogram", "from", "an", "integer", "image", ".." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/HistogramFeatureOps.java#L52-L69
50,857
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/core/image/GeneralizedImageOps.java
GeneralizedImageOps.convertGenericToSpecificType
public static <T> T convertGenericToSpecificType(Class<?> type) { if (type == GrayI8.class) return (T) GrayU8.class; if (type == GrayI16.class) return (T) GrayS16.class; if (type == InterleavedI8.class) return (T) InterleavedU8.class; if (type == InterleavedI16.class) return (T) InterleavedS16.class...
java
public static <T> T convertGenericToSpecificType(Class<?> type) { if (type == GrayI8.class) return (T) GrayU8.class; if (type == GrayI16.class) return (T) GrayS16.class; if (type == InterleavedI8.class) return (T) InterleavedU8.class; if (type == InterleavedI16.class) return (T) InterleavedS16.class...
[ "public", "static", "<", "T", ">", "T", "convertGenericToSpecificType", "(", "Class", "<", "?", ">", "type", ")", "{", "if", "(", "type", "==", "GrayI8", ".", "class", ")", "return", "(", "T", ")", "GrayU8", ".", "class", ";", "if", "(", "type", "=...
If an image is to be created then the generic type can't be used a specific one needs to be. An arbitrary specific image type is returned here.
[ "If", "an", "image", "is", "to", "be", "created", "then", "the", "generic", "type", "can", "t", "be", "used", "a", "specific", "one", "needs", "to", "be", ".", "An", "arbitrary", "specific", "image", "type", "is", "returned", "here", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/core/image/GeneralizedImageOps.java#L293-L303
50,858
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/LineImageOps.java
LineImageOps.pruneSimilarLines
public static List<LineParametric2D_F32> pruneSimilarLines( List<LineParametric2D_F32> lines , float intensity[] , float toleranceAngle , float toleranceDist , int imgWidth , int imgHeight ) { int indexSort[] = new int[ intensity.length ]; QuickSort_F32 sort = new QuickSor...
java
public static List<LineParametric2D_F32> pruneSimilarLines( List<LineParametric2D_F32> lines , float intensity[] , float toleranceAngle , float toleranceDist , int imgWidth , int imgHeight ) { int indexSort[] = new int[ intensity.length ]; QuickSort_F32 sort = new QuickSor...
[ "public", "static", "List", "<", "LineParametric2D_F32", ">", "pruneSimilarLines", "(", "List", "<", "LineParametric2D_F32", ">", "lines", ",", "float", "intensity", "[", "]", ",", "float", "toleranceAngle", ",", "float", "toleranceDist", ",", "int", "imgWidth", ...
Prunes similar looking lines, but keeps the lines with the most intensity. @param lines @param intensity @param toleranceAngle @return
[ "Prunes", "similar", "looking", "lines", "but", "keeps", "the", "lines", "with", "the", "most", "intensity", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/LineImageOps.java#L73-L130
50,859
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/LineImageOps.java
LineImageOps.convert
public static LineSegment2D_F32 convert(LineParametric2D_F32 l, int width, int height) { double t0 = (0-l.p.x)/l.getSlopeX(); double t1 = (0-l.p.y)/l.getSlopeY(); double t2 = (width-l.p.x)/l.getSlopeX(); double t3 = (height-l.p.y)/l.getSlopeY(); Point2D_F32 a = computePoint(l, t0); Point2D_F32 b ...
java
public static LineSegment2D_F32 convert(LineParametric2D_F32 l, int width, int height) { double t0 = (0-l.p.x)/l.getSlopeX(); double t1 = (0-l.p.y)/l.getSlopeY(); double t2 = (width-l.p.x)/l.getSlopeX(); double t3 = (height-l.p.y)/l.getSlopeY(); Point2D_F32 a = computePoint(l, t0); Point2D_F32 b ...
[ "public", "static", "LineSegment2D_F32", "convert", "(", "LineParametric2D_F32", "l", ",", "int", "width", ",", "int", "height", ")", "{", "double", "t0", "=", "(", "0", "-", "l", ".", "p", ".", "x", ")", "/", "l", ".", "getSlopeX", "(", ")", ";", ...
Find the point in which the line intersects the image border and create a line segment at those points
[ "Find", "the", "point", "in", "which", "the", "line", "intersects", "the", "image", "border", "and", "create", "a", "line", "segment", "at", "those", "points" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/LineImageOps.java#L234-L257
50,860
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/RectifyImageOps.java
RectifyImageOps.applyMask
public static void applyMask(GrayF32 disparity , GrayU8 mask , int radius ) { if( disparity.isSubimage() || mask.isSubimage() ) throw new RuntimeException("Input is subimage. Currently not support but no reason why it can't be. Ask for it"); int N = disparity.width*disparity.height; for (int i = 0; i < N; i++...
java
public static void applyMask(GrayF32 disparity , GrayU8 mask , int radius ) { if( disparity.isSubimage() || mask.isSubimage() ) throw new RuntimeException("Input is subimage. Currently not support but no reason why it can't be. Ask for it"); int N = disparity.width*disparity.height; for (int i = 0; i < N; i++...
[ "public", "static", "void", "applyMask", "(", "GrayF32", "disparity", ",", "GrayU8", "mask", ",", "int", "radius", ")", "{", "if", "(", "disparity", ".", "isSubimage", "(", ")", "||", "mask", ".", "isSubimage", "(", ")", ")", "throw", "new", "RuntimeExce...
Applies a mask which indicates which pixels had mappings to the unrectified image. Pixels which were outside of the original image will be set to 255. The border is extended because the sharp edge in the rectified image can cause in incorrect match between image features. @param disparity (Input) disparity @param mask...
[ "Applies", "a", "mask", "which", "indicates", "which", "pixels", "had", "mappings", "to", "the", "unrectified", "image", ".", "Pixels", "which", "were", "outside", "of", "the", "original", "image", "will", "be", "set", "to", "255", ".", "The", "border", "i...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/RectifyImageOps.java#L437-L472
50,861
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java
FitLinesToContour.fitAnchored
public boolean fitAnchored( int anchor0 , int anchor1 , GrowQueue_I32 corners , GrowQueue_I32 output ) { this.anchor0 = anchor0; this.anchor1 = anchor1; int numLines = anchor0==anchor1? corners.size() : CircularIndex.distanceP(anchor0,anchor1,corners.size); if( numLines < 2 ) { throw new RuntimeException("...
java
public boolean fitAnchored( int anchor0 , int anchor1 , GrowQueue_I32 corners , GrowQueue_I32 output ) { this.anchor0 = anchor0; this.anchor1 = anchor1; int numLines = anchor0==anchor1? corners.size() : CircularIndex.distanceP(anchor0,anchor1,corners.size); if( numLines < 2 ) { throw new RuntimeException("...
[ "public", "boolean", "fitAnchored", "(", "int", "anchor0", ",", "int", "anchor1", ",", "GrowQueue_I32", "corners", ",", "GrowQueue_I32", "output", ")", "{", "this", ".", "anchor0", "=", "anchor0", ";", "this", ".", "anchor1", "=", "anchor1", ";", "int", "n...
Fits line segments along the contour with the first and last corner fixed at the original corners. The output will be a new set of corner indexes. Since the corner list is circular, it is assumed that anchor1 comes after anchor0. The same index can be specified for an anchor, it will just go around the entire circle...
[ "Fits", "line", "segments", "along", "the", "contour", "with", "the", "first", "and", "last", "corner", "fixed", "at", "the", "original", "corners", ".", "The", "output", "will", "be", "a", "new", "set", "of", "corner", "indexes", ".", "Since", "the", "c...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L91-L132
50,862
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java
FitLinesToContour.sanityCheckCornerOrder
boolean sanityCheckCornerOrder( int numLines, GrowQueue_I32 corners ) { int contourAnchor0 = corners.get(anchor0); int previous = 0; for (int i = 1; i < numLines; i++) { int contourIndex = corners.get(CircularIndex.addOffset(anchor0, i, corners.size())); int pixelsFromAnchor0 = CircularIndex.distanceP(conto...
java
boolean sanityCheckCornerOrder( int numLines, GrowQueue_I32 corners ) { int contourAnchor0 = corners.get(anchor0); int previous = 0; for (int i = 1; i < numLines; i++) { int contourIndex = corners.get(CircularIndex.addOffset(anchor0, i, corners.size())); int pixelsFromAnchor0 = CircularIndex.distanceP(conto...
[ "boolean", "sanityCheckCornerOrder", "(", "int", "numLines", ",", "GrowQueue_I32", "corners", ")", "{", "int", "contourAnchor0", "=", "corners", ".", "get", "(", "anchor0", ")", ";", "int", "previous", "=", "0", ";", "for", "(", "int", "i", "=", "1", ";"...
All the corners should be in increasing order from the first anchor.
[ "All", "the", "corners", "should", "be", "in", "increasing", "order", "from", "the", "first", "anchor", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L157-L171
50,863
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java
FitLinesToContour.fitLinesUsingCorners
boolean fitLinesUsingCorners( int numLines , GrowQueue_I32 cornerIndexes) { for (int i = 1; i <= numLines; i++) { int index0 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i - 1, cornerIndexes.size)); int index1 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i, cornerIndexes.size)); if( index0 =...
java
boolean fitLinesUsingCorners( int numLines , GrowQueue_I32 cornerIndexes) { for (int i = 1; i <= numLines; i++) { int index0 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i - 1, cornerIndexes.size)); int index1 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i, cornerIndexes.size)); if( index0 =...
[ "boolean", "fitLinesUsingCorners", "(", "int", "numLines", ",", "GrowQueue_I32", "cornerIndexes", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "numLines", ";", "i", "++", ")", "{", "int", "index0", "=", "cornerIndexes", ".", "get", "(", ...
Fits lines across the sequence of corners @param numLines number of lines it will fit
[ "Fits", "lines", "across", "the", "sequence", "of", "corners" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L270-L288
50,864
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java
FitLinesToContour.fitLine
boolean fitLine( int contourIndex0 , int contourIndex1 , LineGeneral2D_F64 line ) { int numPixels = CircularIndex.distanceP(contourIndex0,contourIndex1,contour.size()); // if its too small if( numPixels < minimumLineLength ) return false; Point2D_I32 c0 = contour.get(contourIndex0); Point2D_I32 c1 = cont...
java
boolean fitLine( int contourIndex0 , int contourIndex1 , LineGeneral2D_F64 line ) { int numPixels = CircularIndex.distanceP(contourIndex0,contourIndex1,contour.size()); // if its too small if( numPixels < minimumLineLength ) return false; Point2D_I32 c0 = contour.get(contourIndex0); Point2D_I32 c1 = cont...
[ "boolean", "fitLine", "(", "int", "contourIndex0", ",", "int", "contourIndex1", ",", "LineGeneral2D_F64", "line", ")", "{", "int", "numPixels", "=", "CircularIndex", ".", "distanceP", "(", "contourIndex0", ",", "contourIndex1", ",", "contour", ".", "size", "(", ...
Given a sequence of points on the contour find the best fit line. @param contourIndex0 contour index of first point in the sequence @param contourIndex1 contour index of last point (exclusive) in the sequence @param line storage for the found line @return true if successful or false if it failed
[ "Given", "a", "sequence", "of", "points", "on", "the", "contour", "find", "the", "best", "fit", "line", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L298-L335
50,865
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java
FitLinesToContour.closestPoint
int closestPoint( Point2D_F64 target ) { double bestDistance = Double.MAX_VALUE; int bestIndex = -1; for (int i = 0; i < contour.size(); i++) { Point2D_I32 c = contour.get(i); double d = UtilPoint2D_F64.distanceSq(target.x,target.y,c.x,c.y); if( d < bestDistance ) { bestDistance = d; bestIndex =...
java
int closestPoint( Point2D_F64 target ) { double bestDistance = Double.MAX_VALUE; int bestIndex = -1; for (int i = 0; i < contour.size(); i++) { Point2D_I32 c = contour.get(i); double d = UtilPoint2D_F64.distanceSq(target.x,target.y,c.x,c.y); if( d < bestDistance ) { bestDistance = d; bestIndex =...
[ "int", "closestPoint", "(", "Point2D_F64", "target", ")", "{", "double", "bestDistance", "=", "Double", ".", "MAX_VALUE", ";", "int", "bestIndex", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "contour", ".", "size", "(", ")", ...
Returns the closest point on the contour to the provided point in space @return index of closest point
[ "Returns", "the", "closest", "point", "on", "the", "contour", "to", "the", "provided", "point", "in", "space" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L341-L354
50,866
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridToPixel.java
QrCodeBinaryGridToPixel.setTransformFromLinesSquare
public void setTransformFromLinesSquare( QrCode qr ) { // clear old points storagePairs2D.reset(); storagePairs3D.reset(); // use 3 of the corners to set the coordinate system // set(0, 0, qr.ppCorner,0); <-- prone to damage. Significantly degrades results if used set(0, 7, qr.ppCorner,1); set(7, 7, qr.pp...
java
public void setTransformFromLinesSquare( QrCode qr ) { // clear old points storagePairs2D.reset(); storagePairs3D.reset(); // use 3 of the corners to set the coordinate system // set(0, 0, qr.ppCorner,0); <-- prone to damage. Significantly degrades results if used set(0, 7, qr.ppCorner,1); set(7, 7, qr.pp...
[ "public", "void", "setTransformFromLinesSquare", "(", "QrCode", "qr", ")", "{", "// clear old points", "storagePairs2D", ".", "reset", "(", ")", ";", "storagePairs3D", ".", "reset", "(", ")", ";", "// use 3 of the corners to set the coordinate system", "//\t\tset(0, 0, qr...
Used to estimate the image to grid coordinate system before the version is known. The top left square is used to fix the coordinate system. Then 4 lines between corners going to other QR codes is used to make it less suspectable to errors in the first 4 corners
[ "Used", "to", "estimate", "the", "image", "to", "grid", "coordinate", "system", "before", "the", "version", "is", "known", ".", "The", "top", "left", "square", "is", "used", "to", "fix", "the", "coordinate", "system", ".", "Then", "4", "lines", "between", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridToPixel.java#L83-L107
50,867
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridToPixel.java
QrCodeBinaryGridToPixel.removeOutsideCornerFeatures
public void removeOutsideCornerFeatures() { if( pairs2D.size() != storagePairs2D.size ) throw new RuntimeException("This can only be called when all the features have been added"); pairs2D.remove(11); pairs2D.remove(5); pairs2D.remove(0); }
java
public void removeOutsideCornerFeatures() { if( pairs2D.size() != storagePairs2D.size ) throw new RuntimeException("This can only be called when all the features have been added"); pairs2D.remove(11); pairs2D.remove(5); pairs2D.remove(0); }
[ "public", "void", "removeOutsideCornerFeatures", "(", ")", "{", "if", "(", "pairs2D", ".", "size", "(", ")", "!=", "storagePairs2D", ".", "size", ")", "throw", "new", "RuntimeException", "(", "\"This can only be called when all the features have been added\"", ")", ";...
Outside corners on position patterns are more likely to be damaged, so remove them
[ "Outside", "corners", "on", "position", "patterns", "are", "more", "likely", "to", "be", "damaged", "so", "remove", "them" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridToPixel.java#L142-L149
50,868
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/peak/FactorySearchLocalPeak.java
FactorySearchLocalPeak.meanShiftUniform
public static <T extends ImageGray<T>> SearchLocalPeak<T> meanShiftUniform( int maxIterations, float convergenceTol , Class<T> imageType ) { WeightPixel_F32 weights = new WeightPixelUniform_F32(); MeanShiftPeak<T> alg = new MeanShiftPeak<>(maxIterations, convergenceTol, weights, imageType); return new MeanShiftP...
java
public static <T extends ImageGray<T>> SearchLocalPeak<T> meanShiftUniform( int maxIterations, float convergenceTol , Class<T> imageType ) { WeightPixel_F32 weights = new WeightPixelUniform_F32(); MeanShiftPeak<T> alg = new MeanShiftPeak<>(maxIterations, convergenceTol, weights, imageType); return new MeanShiftP...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "SearchLocalPeak", "<", "T", ">", "meanShiftUniform", "(", "int", "maxIterations", ",", "float", "convergenceTol", ",", "Class", "<", "T", ">", "imageType", ")", "{", "WeightPixel_F32"...
Mean-shift based search with a uniform kernel @param maxIterations Maximum number of iterations. Try 15 @param convergenceTol Convergence tolerance. try 1e-3 @param imageType Type of input image @return mean-shift search
[ "Mean", "-", "shift", "based", "search", "with", "a", "uniform", "kernel" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/peak/FactorySearchLocalPeak.java#L43-L48
50,869
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/peak/FactorySearchLocalPeak.java
FactorySearchLocalPeak.meanShiftGaussian
public static <T extends ImageGray<T>> SearchLocalPeak<T> meanShiftGaussian( int maxIterations, float convergenceTol , Class<T> imageType) { WeightPixel_F32 weights = new WeightPixelGaussian_F32(); MeanShiftPeak<T> alg = new MeanShiftPeak<>(maxIterations, convergenceTol, weights, imageType); return new MeanShift...
java
public static <T extends ImageGray<T>> SearchLocalPeak<T> meanShiftGaussian( int maxIterations, float convergenceTol , Class<T> imageType) { WeightPixel_F32 weights = new WeightPixelGaussian_F32(); MeanShiftPeak<T> alg = new MeanShiftPeak<>(maxIterations, convergenceTol, weights, imageType); return new MeanShift...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "SearchLocalPeak", "<", "T", ">", "meanShiftGaussian", "(", "int", "maxIterations", ",", "float", "convergenceTol", ",", "Class", "<", "T", ">", "imageType", ")", "{", "WeightPixel_F32...
Mean-shift based search with a Gaussian kernel @param maxIterations Maximum number of iterations. Try 15 @param convergenceTol Convergence tolerance. try 1e-3 @param imageType Type of input image @return mean-shift search
[ "Mean", "-", "shift", "based", "search", "with", "a", "Gaussian", "kernel" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/peak/FactorySearchLocalPeak.java#L57-L62
50,870
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java
BoofConcurrency.loopBlocks
public static void loopBlocks(int start , int endExclusive , int minBlock, IntRangeConsumer consumer ) { final ForkJoinPool pool = BoofConcurrency.pool; int numThreads = pool.getParallelism(); int range = endExclusive-start; if( range == 0 ) // nothing to do here! return; if( range < 0 ) thro...
java
public static void loopBlocks(int start , int endExclusive , int minBlock, IntRangeConsumer consumer ) { final ForkJoinPool pool = BoofConcurrency.pool; int numThreads = pool.getParallelism(); int range = endExclusive-start; if( range == 0 ) // nothing to do here! return; if( range < 0 ) thro...
[ "public", "static", "void", "loopBlocks", "(", "int", "start", ",", "int", "endExclusive", ",", "int", "minBlock", ",", "IntRangeConsumer", "consumer", ")", "{", "final", "ForkJoinPool", "pool", "=", "BoofConcurrency", ".", "pool", ";", "int", "numThreads", "=...
Automatically breaks the problem up into blocks based on the number of threads available. It is assumed that there is some cost associated with processing a block and the number of blocks is minimized. Examples: <ul> <li>Given a range of 0 to 100, and minBlock is 5, and 10 threads. Blocks will be size 10.</li> <li>Giv...
[ "Automatically", "breaks", "the", "problem", "up", "into", "blocks", "based", "on", "the", "number", "of", "threads", "available", ".", "It", "is", "assumed", "that", "there", "is", "some", "cost", "associated", "with", "processing", "a", "block", "and", "th...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L101-L119
50,871
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java
BoofConcurrency.loopBlocks
public static void loopBlocks(int start , int endExclusive , IntRangeConsumer consumer ) { final ForkJoinPool pool = BoofConcurrency.pool; int numThreads = pool.getParallelism(); int range = endExclusive-start; if( range == 0 ) // nothing to do here! return; if( range < 0 ) throw new IllegalArgumentExc...
java
public static void loopBlocks(int start , int endExclusive , IntRangeConsumer consumer ) { final ForkJoinPool pool = BoofConcurrency.pool; int numThreads = pool.getParallelism(); int range = endExclusive-start; if( range == 0 ) // nothing to do here! return; if( range < 0 ) throw new IllegalArgumentExc...
[ "public", "static", "void", "loopBlocks", "(", "int", "start", ",", "int", "endExclusive", ",", "IntRangeConsumer", "consumer", ")", "{", "final", "ForkJoinPool", "pool", "=", "BoofConcurrency", ".", "pool", ";", "int", "numThreads", "=", "pool", ".", "getPara...
Splits the range of values up into blocks. It's assumed the cost to process a block is small so more can be created. @param start First index, inclusive @param endExclusive Last index, exclusive @param consumer The consumer
[ "Splits", "the", "range", "of", "values", "up", "into", "blocks", ".", "It", "s", "assumed", "the", "cost", "to", "process", "a", "block", "is", "small", "so", "more", "can", "be", "created", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L136-L155
50,872
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java
BoofConcurrency.sum
public static Number sum(int start , int endExclusive , Class type, IntProducerNumber producer ) { try { return pool.submit(new IntOperatorTask.Sum(start,endExclusive,type,producer)).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }
java
public static Number sum(int start , int endExclusive , Class type, IntProducerNumber producer ) { try { return pool.submit(new IntOperatorTask.Sum(start,endExclusive,type,producer)).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } }
[ "public", "static", "Number", "sum", "(", "int", "start", ",", "int", "endExclusive", ",", "Class", "type", ",", "IntProducerNumber", "producer", ")", "{", "try", "{", "return", "pool", ".", "submit", "(", "new", "IntOperatorTask", ".", "Sum", "(", "start"...
Computes sums up the results using the specified primitive type @param start First index, inclusive @param endExclusive Last index, exclusive @param type Primtive data type, e.g. int.class, float.class, double.class @param producer Given an integer input produce a Number output @return The sum
[ "Computes", "sums", "up", "the", "results", "using", "the", "specified", "primitive", "type" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L166-L172
50,873
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/lists/RecycleStack.java
RecycleStack.pop
public synchronized T pop() { if( list.isEmpty() ) { return factory.newInstance(); } else { return list.remove(list.size()-1); } }
java
public synchronized T pop() { if( list.isEmpty() ) { return factory.newInstance(); } else { return list.remove(list.size()-1); } }
[ "public", "synchronized", "T", "pop", "(", ")", "{", "if", "(", "list", ".", "isEmpty", "(", ")", ")", "{", "return", "factory", ".", "newInstance", "(", ")", ";", "}", "else", "{", "return", "list", ".", "remove", "(", "list", ".", "size", "(", ...
Returns an instance. If there are instances queued up internally one of those is returned. Otherwise a new instance is created. @return object instance
[ "Returns", "an", "instance", ".", "If", "there", "are", "instances", "queued", "up", "internally", "one", "of", "those", "is", "returned", ".", "Otherwise", "a", "new", "instance", "is", "created", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/lists/RecycleStack.java#L49-L55
50,874
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/fiducials/CreateFiducialDocumentPDF.java
CreateFiducialDocumentPDF.printGrid
private void printGrid(PDPageContentStream pcs, float offsetX , float offsetY, int numRows, int numCols , float sizeBox ) throws IOException { float pageWidth = (float)paper.convertWidth(units)*UNIT_TO_POINTS; float pageHeight = (float)paper.convertHeight(units)*UNIT_TO_POINTS; // pcs.setLineCapStyle(1);...
java
private void printGrid(PDPageContentStream pcs, float offsetX , float offsetY, int numRows, int numCols , float sizeBox ) throws IOException { float pageWidth = (float)paper.convertWidth(units)*UNIT_TO_POINTS; float pageHeight = (float)paper.convertHeight(units)*UNIT_TO_POINTS; // pcs.setLineCapStyle(1);...
[ "private", "void", "printGrid", "(", "PDPageContentStream", "pcs", ",", "float", "offsetX", ",", "float", "offsetY", ",", "int", "numRows", ",", "int", "numCols", ",", "float", "sizeBox", ")", "throws", "IOException", "{", "float", "pageWidth", "=", "(", "fl...
Draws the grid in light grey on the document
[ "Draws", "the", "grid", "in", "light", "grey", "on", "the", "document" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/fiducials/CreateFiducialDocumentPDF.java#L191-L210
50,875
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/filter/derivative/AnyImageDerivative.java
AnyImageDerivative.setInput
public void setInput( I input ) { this.inputImage = input; // reset the state flag so that everything need sto be computed if( stale != null ) { for( int i = 0; i < stale.length; i++) { boolean a[] = stale[i]; for( int j = 0; j < a.length; j++ ) { a[j] = true; } } } }
java
public void setInput( I input ) { this.inputImage = input; // reset the state flag so that everything need sto be computed if( stale != null ) { for( int i = 0; i < stale.length; i++) { boolean a[] = stale[i]; for( int j = 0; j < a.length; j++ ) { a[j] = true; } } } }
[ "public", "void", "setInput", "(", "I", "input", ")", "{", "this", ".", "inputImage", "=", "input", ";", "// reset the state flag so that everything need sto be computed", "if", "(", "stale", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i"...
Sets the new input image from which the image derivatives are computed from. @param input Input image.
[ "Sets", "the", "new", "input", "image", "from", "which", "the", "image", "derivatives", "are", "computed", "from", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/filter/derivative/AnyImageDerivative.java#L131-L143
50,876
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/abst/feature/dense/GenericDenseDescribeImageDense.java
GenericDenseDescribeImageDense.configure
public void configure( double descriptorRegionScale , double periodX, double periodY) { this.radius = descriptorRegionScale*scaleToRadius; this.periodX = (int)(periodX+0.5); this.periodY = (int)(periodY+0.5); this.featureWidth = (int)(alg.getCanonicalWidth()*descriptorRegionScale + 0.5); descriptions = new F...
java
public void configure( double descriptorRegionScale , double periodX, double periodY) { this.radius = descriptorRegionScale*scaleToRadius; this.periodX = (int)(periodX+0.5); this.periodY = (int)(periodY+0.5); this.featureWidth = (int)(alg.getCanonicalWidth()*descriptorRegionScale + 0.5); descriptions = new F...
[ "public", "void", "configure", "(", "double", "descriptorRegionScale", ",", "double", "periodX", ",", "double", "periodY", ")", "{", "this", ".", "radius", "=", "descriptorRegionScale", "*", "scaleToRadius", ";", "this", ".", "periodX", "=", "(", "int", ")", ...
Configures size of the descriptor and the frequency at which it's computed @param descriptorRegionScale Relative size of the descriptor region to its canonical size @param periodX Period in pixels along x-axis of samples @param periodY Period in pixels along y-axis of samples
[ "Configures", "size", "of", "the", "descriptor", "and", "the", "frequency", "at", "which", "it", "s", "computed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/abst/feature/dense/GenericDenseDescribeImageDense.java#L80-L92
50,877
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java
SceneStructureCommon.setPoint
public void setPoint( int which , double x , double y , double z ) { points[which].set(x,y,z); }
java
public void setPoint( int which , double x , double y , double z ) { points[which].set(x,y,z); }
[ "public", "void", "setPoint", "(", "int", "which", ",", "double", "x", ",", "double", "y", ",", "double", "z", ")", "{", "points", "[", "which", "]", ".", "set", "(", "x", ",", "y", ",", "z", ")", ";", "}" ]
Specifies the location of a point in 3D space @param which Which point is being specified @param x coordinate along x-axis @param y coordinate along y-axis @param z coordinate along z-axis
[ "Specifies", "the", "location", "of", "a", "point", "in", "3D", "space" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java#L52-L54
50,878
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java
SceneStructureCommon.connectPointToView
public void connectPointToView( int pointIndex , int viewIndex ) { SceneStructureMetric.Point p = points[pointIndex]; for (int i = 0; i < p.views.size; i++) { if( p.views.data[i] == viewIndex ) throw new IllegalArgumentException("Tried to add the same view twice. viewIndex="+viewIndex); } p.views.add(vi...
java
public void connectPointToView( int pointIndex , int viewIndex ) { SceneStructureMetric.Point p = points[pointIndex]; for (int i = 0; i < p.views.size; i++) { if( p.views.data[i] == viewIndex ) throw new IllegalArgumentException("Tried to add the same view twice. viewIndex="+viewIndex); } p.views.add(vi...
[ "public", "void", "connectPointToView", "(", "int", "pointIndex", ",", "int", "viewIndex", ")", "{", "SceneStructureMetric", ".", "Point", "p", "=", "points", "[", "pointIndex", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p", ".", "view...
Specifies that the point was observed in this view. @param pointIndex index of point @param viewIndex index of view
[ "Specifies", "that", "the", "point", "was", "observed", "in", "this", "view", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java#L73-L81
50,879
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java
SceneStructureCommon.removePoints
public void removePoints( GrowQueue_I32 which ) { SceneStructureMetric.Point results[] = new SceneStructureMetric.Point[points.length-which.size]; int indexWhich = 0; for (int i = 0; i < points.length ; i++) { if( indexWhich < which.size && which.data[indexWhich] == i ) { indexWhich++; } else { res...
java
public void removePoints( GrowQueue_I32 which ) { SceneStructureMetric.Point results[] = new SceneStructureMetric.Point[points.length-which.size]; int indexWhich = 0; for (int i = 0; i < points.length ; i++) { if( indexWhich < which.size && which.data[indexWhich] == i ) { indexWhich++; } else { res...
[ "public", "void", "removePoints", "(", "GrowQueue_I32", "which", ")", "{", "SceneStructureMetric", ".", "Point", "results", "[", "]", "=", "new", "SceneStructureMetric", ".", "Point", "[", "points", ".", "length", "-", "which", ".", "size", "]", ";", "int", ...
Removes the points specified in 'which' from the list of points. 'which' must be ordered from lowest to highest index. @param which Ordered list of point indexes to remove
[ "Removes", "the", "points", "specified", "in", "which", "from", "the", "list", "of", "points", ".", "which", "must", "be", "ordered", "from", "lowest", "to", "highest", "index", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java#L93-L106
50,880
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/SelectBestStereoTransform.java
SelectBestStereoTransform.select
public void select(List<Se3_F64> candidatesAtoB, List<AssociatedPair> observations , Se3_F64 model ) { // use positive depth constraint to select the best one Se3_F64 bestModel = null; int bestCount = -1; for( int i = 0; i < candidatesAtoB.size(); i++ ) { Se3_F64 s = candidatesAtoB.get(i); ...
java
public void select(List<Se3_F64> candidatesAtoB, List<AssociatedPair> observations , Se3_F64 model ) { // use positive depth constraint to select the best one Se3_F64 bestModel = null; int bestCount = -1; for( int i = 0; i < candidatesAtoB.size(); i++ ) { Se3_F64 s = candidatesAtoB.get(i); ...
[ "public", "void", "select", "(", "List", "<", "Se3_F64", ">", "candidatesAtoB", ",", "List", "<", "AssociatedPair", ">", "observations", ",", "Se3_F64", "model", ")", "{", "// use positive depth constraint to select the best one", "Se3_F64", "bestModel", "=", "null", ...
Selects the transform which describes a view where observations appear in front of the camera the most @param candidatesAtoB List of possible transforms @param observations observations in both stereo cameras in normalized image coordinates @param model (Output) the selected transform from a to b
[ "Selects", "the", "transform", "which", "describes", "a", "view", "where", "observations", "appear", "in", "front", "of", "the", "camera", "the", "most" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/SelectBestStereoTransform.java#L60-L86
50,881
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/GrayF32.java
GrayF32.get
public float get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: ( " + x + " , " + y + " )"); return unsafe_get(x,y); }
java
public float get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: ( " + x + " , " + y + " )"); return unsafe_get(x,y); }
[ "public", "float", "get", "(", "int", "x", ",", "int", "y", ")", "{", "if", "(", "!", "isInBounds", "(", "x", ",", "y", ")", ")", "throw", "new", "ImageAccessException", "(", "\"Requested pixel is out of bounds: ( \"", "+", "x", "+", "\" , \"", "+", "y",...
Returns the value of the specified pixel. @param x pixel coordinate. @param y pixel coordinate. @return Pixel intensity value.
[ "Returns", "the", "value", "of", "the", "specified", "pixel", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/GrayF32.java#L55-L60
50,882
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/BinaryThinning.java
BinaryThinning.apply
public void apply(GrayU8 binary , int maxLoops) { this.binary = binary; inputBorder.setImage(binary); ones0.reset(); zerosOut.reset(); findOnePixels(ones0); for (int loop = 0; (loop < maxLoops || maxLoops == -1) && ones0.size > 0; loop++) { boolean changed = false; // do one cycle through all the...
java
public void apply(GrayU8 binary , int maxLoops) { this.binary = binary; inputBorder.setImage(binary); ones0.reset(); zerosOut.reset(); findOnePixels(ones0); for (int loop = 0; (loop < maxLoops || maxLoops == -1) && ones0.size > 0; loop++) { boolean changed = false; // do one cycle through all the...
[ "public", "void", "apply", "(", "GrayU8", "binary", ",", "int", "maxLoops", ")", "{", "this", ".", "binary", "=", "binary", ";", "inputBorder", ".", "setImage", "(", "binary", ")", ";", "ones0", ".", "reset", "(", ")", ";", "zerosOut", ".", "reset", ...
Applies the thinning algorithm. Runs for the specified number of loops or until no change is detected. @param binary Input binary image which is to be thinned. This is modified @param maxLoops Maximum number of thinning loops. Set to -1 to run until the image is no longer modified.
[ "Applies", "the", "thinning", "algorithm", ".", "Runs", "for", "the", "specified", "number", "of", "loops", "or", "until", "no", "change", "is", "detected", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/BinaryThinning.java#L99-L136
50,883
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/BinaryThinning.java
BinaryThinning.findOnePixels
protected void findOnePixels(GrowQueue_I32 ones) { for (int y = 0; y < binary.height; y++) { int index = binary.startIndex + y* binary.stride; for (int x = 0; x < binary.width; x++, index++) { if( binary.data[index] != 0 ) { ones.add(index); } } } }
java
protected void findOnePixels(GrowQueue_I32 ones) { for (int y = 0; y < binary.height; y++) { int index = binary.startIndex + y* binary.stride; for (int x = 0; x < binary.width; x++, index++) { if( binary.data[index] != 0 ) { ones.add(index); } } } }
[ "protected", "void", "findOnePixels", "(", "GrowQueue_I32", "ones", ")", "{", "for", "(", "int", "y", "=", "0", ";", "y", "<", "binary", ".", "height", ";", "y", "++", ")", "{", "int", "index", "=", "binary", ".", "startIndex", "+", "y", "*", "bina...
Scans through the image and record the array index of all marked pixels
[ "Scans", "through", "the", "image", "and", "record", "the", "array", "index", "of", "all", "marked", "pixels" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/BinaryThinning.java#L141-L150
50,884
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java
PruneStructureFromSceneMetric.pruneObservationsBehindCamera
public void pruneObservationsBehindCamera() { Point3D_F64 X = new Point3D_F64(); for (int viewIndex = 0; viewIndex < observations.views.length; viewIndex++) { SceneObservations.View v = observations.views[viewIndex]; SceneStructureMetric.View view = structure.views[viewIndex]; for (int pointIndex = 0; po...
java
public void pruneObservationsBehindCamera() { Point3D_F64 X = new Point3D_F64(); for (int viewIndex = 0; viewIndex < observations.views.length; viewIndex++) { SceneObservations.View v = observations.views[viewIndex]; SceneStructureMetric.View view = structure.views[viewIndex]; for (int pointIndex = 0; po...
[ "public", "void", "pruneObservationsBehindCamera", "(", ")", "{", "Point3D_F64", "X", "=", "new", "Point3D_F64", "(", ")", ";", "for", "(", "int", "viewIndex", "=", "0", ";", "viewIndex", "<", "observations", ".", "views", ".", "length", ";", "viewIndex", ...
Check to see if a point is behind the camera which is viewing it. If it is remove that observation since it can't possibly be observed.
[ "Check", "to", "see", "if", "a", "point", "is", "behind", "the", "camera", "which", "is", "viewing", "it", ".", "If", "it", "is", "remove", "that", "observation", "since", "it", "can", "t", "possibly", "be", "observed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java#L143-L170
50,885
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java
PruneStructureFromSceneMetric.prunePoints
public void prunePoints(int neighbors , double distance ) { // Use a nearest neighbor search to find near by points Point3D_F64 worldX = new Point3D_F64(); List<Point3D_F64> cloud = new ArrayList<>(); for (int i = 0; i < structure.points.length; i++) { SceneStructureMetric.Point structureP = structure.point...
java
public void prunePoints(int neighbors , double distance ) { // Use a nearest neighbor search to find near by points Point3D_F64 worldX = new Point3D_F64(); List<Point3D_F64> cloud = new ArrayList<>(); for (int i = 0; i < structure.points.length; i++) { SceneStructureMetric.Point structureP = structure.point...
[ "public", "void", "prunePoints", "(", "int", "neighbors", ",", "double", "distance", ")", "{", "// Use a nearest neighbor search to find near by points", "Point3D_F64", "worldX", "=", "new", "Point3D_F64", "(", ")", ";", "List", "<", "Point3D_F64", ">", "cloud", "="...
Prune a feature it has fewer than X neighbors within Y distance. Observations associated with this feature are also pruned. Call {@link #pruneViews(int)} to makes sure the graph is valid. @param neighbors Number of other features which need to be near by @param distance Maximum distance a point can be to be considere...
[ "Prune", "a", "feature", "it", "has", "fewer", "than", "X", "neighbors", "within", "Y", "distance", ".", "Observations", "associated", "with", "this", "feature", "are", "also", "pruned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java#L235-L286
50,886
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java
PruneStructureFromSceneMetric.pruneViews
public void pruneViews( int count ) { List<SceneStructureMetric.View> remainingS = new ArrayList<>(); List<SceneObservations.View> remainingO = new ArrayList<>(); for (int viewId = 0; viewId < structure.views.length; viewId++) { SceneObservations.View view = observations.views[viewId]; // See if has enoug...
java
public void pruneViews( int count ) { List<SceneStructureMetric.View> remainingS = new ArrayList<>(); List<SceneObservations.View> remainingO = new ArrayList<>(); for (int viewId = 0; viewId < structure.views.length; viewId++) { SceneObservations.View view = observations.views[viewId]; // See if has enoug...
[ "public", "void", "pruneViews", "(", "int", "count", ")", "{", "List", "<", "SceneStructureMetric", ".", "View", ">", "remainingS", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "SceneObservations", ".", "View", ">", "remainingO", "=", "new", ...
Removes views with less than 'count' features visible. Observations of features in removed views are also removed. @param count Prune if it has this number of views or less
[ "Removes", "views", "with", "less", "than", "count", "features", "visible", ".", "Observations", "of", "features", "in", "removed", "views", "are", "also", "removed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java#L294-L327
50,887
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java
PruneStructureFromSceneMetric.pruneUnusedCameras
public void pruneUnusedCameras() { // Count how many views are used by each camera int histogram[] = new int[structure.cameras.length]; for (int i = 0; i < structure.views.length; i++) { histogram[structure.views[i].camera]++; } // See which cameras need to be removed and create a look up table from old ...
java
public void pruneUnusedCameras() { // Count how many views are used by each camera int histogram[] = new int[structure.cameras.length]; for (int i = 0; i < structure.views.length; i++) { histogram[structure.views[i].camera]++; } // See which cameras need to be removed and create a look up table from old ...
[ "public", "void", "pruneUnusedCameras", "(", ")", "{", "// Count how many views are used by each camera", "int", "histogram", "[", "]", "=", "new", "int", "[", "structure", ".", "cameras", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", ...
Prunes cameras that are not referenced by any views.
[ "Prunes", "cameras", "that", "are", "not", "referenced", "by", "any", "views", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneMetric.java#L332-L361
50,888
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.setIntrinsic
public void setIntrinsic(CameraPinholeBrown intrinsic) { planeProjection.setIntrinsic(intrinsic); normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false,true); pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true,false); // Find the change in angle caused by a pixel error i...
java
public void setIntrinsic(CameraPinholeBrown intrinsic) { planeProjection.setIntrinsic(intrinsic); normToPixel = LensDistortionFactory.narrow(intrinsic).distort_F64(false,true); pixelToNorm = LensDistortionFactory.narrow(intrinsic).undistort_F64(true,false); // Find the change in angle caused by a pixel error i...
[ "public", "void", "setIntrinsic", "(", "CameraPinholeBrown", "intrinsic", ")", "{", "planeProjection", ".", "setIntrinsic", "(", "intrinsic", ")", ";", "normToPixel", "=", "LensDistortionFactory", ".", "narrow", "(", "intrinsic", ")", ".", "distort_F64", "(", "fal...
Camera the camera's intrinsic parameters. Can be called at any time. @param intrinsic Intrinsic camera parameters
[ "Camera", "the", "camera", "s", "intrinsic", "parameters", ".", "Can", "be", "called", "at", "any", "time", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L174-L183
50,889
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.setExtrinsic
public void setExtrinsic(Se3_F64 planeToCamera) { this.planeToCamera = planeToCamera; planeToCamera.invert(cameraToPlane); planeProjection.setPlaneToCamera(planeToCamera, true); }
java
public void setExtrinsic(Se3_F64 planeToCamera) { this.planeToCamera = planeToCamera; planeToCamera.invert(cameraToPlane); planeProjection.setPlaneToCamera(planeToCamera, true); }
[ "public", "void", "setExtrinsic", "(", "Se3_F64", "planeToCamera", ")", "{", "this", ".", "planeToCamera", "=", "planeToCamera", ";", "planeToCamera", ".", "invert", "(", "cameraToPlane", ")", ";", "planeProjection", ".", "setPlaneToCamera", "(", "planeToCamera", ...
Camera the camera's extrinsic parameters. Can be called at any time. @param planeToCamera Transform from the plane to camera.
[ "Camera", "the", "camera", "s", "extrinsic", "parameters", ".", "Can", "be", "called", "at", "any", "time", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L190-L195
50,890
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.reset
public void reset() { tick = 0; first = true; tracker.reset(); keyToWorld.reset(); currToKey.reset(); currToWorld.reset(); worldToCurrCam3D.reset(); }
java
public void reset() { tick = 0; first = true; tracker.reset(); keyToWorld.reset(); currToKey.reset(); currToWorld.reset(); worldToCurrCam3D.reset(); }
[ "public", "void", "reset", "(", ")", "{", "tick", "=", "0", ";", "first", "=", "true", ";", "tracker", ".", "reset", "(", ")", ";", "keyToWorld", ".", "reset", "(", ")", ";", "currToKey", ".", "reset", "(", ")", ";", "currToWorld", ".", "reset", ...
Resets the algorithm into its initial state
[ "Resets", "the", "algorithm", "into", "its", "initial", "state" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L200-L208
50,891
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.addNewTracks
private void addNewTracks() { tracker.spawnTracks(); List<PointTrack> spawned = tracker.getNewTracks(null); // estimate 3D coordinate using stereo vision for (PointTrack t : spawned) { // System.out.println("track spawn "+t.x+" "+t.y); VoTrack p = t.getCookie(); if (p == null) { t.cookie = p = new ...
java
private void addNewTracks() { tracker.spawnTracks(); List<PointTrack> spawned = tracker.getNewTracks(null); // estimate 3D coordinate using stereo vision for (PointTrack t : spawned) { // System.out.println("track spawn "+t.x+" "+t.y); VoTrack p = t.getCookie(); if (p == null) { t.cookie = p = new ...
[ "private", "void", "addNewTracks", "(", ")", "{", "tracker", ".", "spawnTracks", "(", ")", ";", "List", "<", "PointTrack", ">", "spawned", "=", "tracker", ".", "getNewTracks", "(", "null", ")", ";", "// estimate 3D coordinate using stereo vision", "for", "(", ...
Requests that new tracks are spawned, determines if they are on the plane or not, and computes other required data structures.
[ "Requests", "that", "new", "tracks", "are", "spawned", "determines", "if", "they", "are", "on", "the", "plane", "or", "not", "and", "computes", "other", "required", "data", "structures", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L261-L306
50,892
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.sortTracksForEstimation
private void sortTracksForEstimation() { // reset data structures planeSamples.reset(); farAngles.reset(); tracksOnPlane.clear(); tracksFar.clear(); // list of active tracks List<PointTrack> active = tracker.getActiveTracks(null); for (PointTrack t : active) { VoTrack p = t.getCookie(); // comp...
java
private void sortTracksForEstimation() { // reset data structures planeSamples.reset(); farAngles.reset(); tracksOnPlane.clear(); tracksFar.clear(); // list of active tracks List<PointTrack> active = tracker.getActiveTracks(null); for (PointTrack t : active) { VoTrack p = t.getCookie(); // comp...
[ "private", "void", "sortTracksForEstimation", "(", ")", "{", "// reset data structures", "planeSamples", ".", "reset", "(", ")", ";", "farAngles", ".", "reset", "(", ")", ";", "tracksOnPlane", ".", "clear", "(", ")", ";", "tracksFar", ".", "clear", "(", ")",...
Splits the set of active tracks into on plane and infinity sets. For each set also perform specific sanity checks to make sure basic constraints are still being meet. If not then the track will not be considered for motion estimation.
[ "Splits", "the", "set", "of", "active", "tracks", "into", "on", "plane", "and", "infinity", "sets", ".", "For", "each", "set", "also", "perform", "specific", "sanity", "checks", "to", "make", "sure", "basic", "constraints", "are", "still", "being", "meet", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L335-L380
50,893
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.isRotationFromAxisY
protected boolean isRotationFromAxisY(PointTrack t, Vector3D_F64 pointing) { VoTrack p = t.getCookie(); // remove rotations not along x-z plane double normXZ = Math.sqrt(pointing.x * pointing.x + pointing.z * pointing.z); pointingAdj.set(pointing.x / normXZ, p.pointingY, pointing.z / normXZ); // Put pointin...
java
protected boolean isRotationFromAxisY(PointTrack t, Vector3D_F64 pointing) { VoTrack p = t.getCookie(); // remove rotations not along x-z plane double normXZ = Math.sqrt(pointing.x * pointing.x + pointing.z * pointing.z); pointingAdj.set(pointing.x / normXZ, p.pointingY, pointing.z / normXZ); // Put pointin...
[ "protected", "boolean", "isRotationFromAxisY", "(", "PointTrack", "t", ",", "Vector3D_F64", "pointing", ")", "{", "VoTrack", "p", "=", "t", ".", "getCookie", "(", ")", ";", "// remove rotations not along x-z plane", "double", "normXZ", "=", "Math", ".", "sqrt", ...
Checks for motion which can't be caused by rotations along the y-axis alone. This is done by adjusting the pointing vector in the plane reference frame such that it has the same y component as when the track was spawned and that the x-z components are normalized to one, to ensure consistent units. That pointing vecto...
[ "Checks", "for", "motion", "which", "can", "t", "be", "caused", "by", "rotations", "along", "the", "y", "-", "axis", "alone", ".", "This", "is", "done", "by", "adjusting", "the", "pointing", "vector", "in", "the", "plane", "reference", "frame", "such", "...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L390-L411
50,894
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.computeAngleOfRotation
private void computeAngleOfRotation(PointTrack t, Vector3D_F64 pointingPlane) { VoTrack p = t.getCookie(); // Compute ground pointing vector groundCurr.x = pointingPlane.z; groundCurr.y = -pointingPlane.x; double norm = groundCurr.norm(); groundCurr.x /= norm; groundCurr.y /= norm; // dot product. ve...
java
private void computeAngleOfRotation(PointTrack t, Vector3D_F64 pointingPlane) { VoTrack p = t.getCookie(); // Compute ground pointing vector groundCurr.x = pointingPlane.z; groundCurr.y = -pointingPlane.x; double norm = groundCurr.norm(); groundCurr.x /= norm; groundCurr.y /= norm; // dot product. ve...
[ "private", "void", "computeAngleOfRotation", "(", "PointTrack", "t", ",", "Vector3D_F64", "pointingPlane", ")", "{", "VoTrack", "p", "=", "t", ".", "getCookie", "(", ")", ";", "// Compute ground pointing vector", "groundCurr", ".", "x", "=", "pointingPlane", ".", ...
Computes the angle of rotation between two pointing vectors on the ground plane and adds it to a list. @param pointingPlane Pointing vector of observation in plane reference frame
[ "Computes", "the", "angle", "of", "rotation", "between", "two", "pointing", "vectors", "on", "the", "ground", "plane", "and", "adds", "it", "to", "a", "list", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L418-L440
50,895
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.estimateFar
private void estimateFar() { // do nothing if there are objects at infinity farInlierCount = 0; if (farAngles.size == 0) return; farAnglesCopy.reset(); farAnglesCopy.addAll(farAngles); // find angle which maximizes inlier set farAngle = maximizeCountInSpread(farAnglesCopy.data, farAngles.size, 2 * t...
java
private void estimateFar() { // do nothing if there are objects at infinity farInlierCount = 0; if (farAngles.size == 0) return; farAnglesCopy.reset(); farAnglesCopy.addAll(farAngles); // find angle which maximizes inlier set farAngle = maximizeCountInSpread(farAnglesCopy.data, farAngles.size, 2 * t...
[ "private", "void", "estimateFar", "(", ")", "{", "// do nothing if there are objects at infinity", "farInlierCount", "=", "0", ";", "if", "(", "farAngles", ".", "size", "==", "0", ")", "return", ";", "farAnglesCopy", ".", "reset", "(", ")", ";", "farAnglesCopy",...
Estimates only rotation using points at infinity. A robust estimation algorithm is used which finds an angle which maximizes the inlier set, like RANSAC does. Unlike RANSAC this will produce an optimal result.
[ "Estimates", "only", "rotation", "using", "points", "at", "infinity", ".", "A", "robust", "estimation", "algorithm", "is", "used", "which", "finds", "an", "angle", "which", "maximizes", "the", "inlier", "set", "like", "RANSAC", "does", ".", "Unlike", "RANSAC",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L446-L469
50,896
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.fuseEstimates
private void fuseEstimates() { // weighted average for angle double x = closeMotionKeyToCurr.c * closeInlierCount + Math.cos(farAngle) * farInlierCount; double y = closeMotionKeyToCurr.s * closeInlierCount + Math.sin(farAngle) * farInlierCount; // update the motion estimate closeMotionKeyToCurr.setYaw(Math....
java
private void fuseEstimates() { // weighted average for angle double x = closeMotionKeyToCurr.c * closeInlierCount + Math.cos(farAngle) * farInlierCount; double y = closeMotionKeyToCurr.s * closeInlierCount + Math.sin(farAngle) * farInlierCount; // update the motion estimate closeMotionKeyToCurr.setYaw(Math....
[ "private", "void", "fuseEstimates", "(", ")", "{", "// weighted average for angle", "double", "x", "=", "closeMotionKeyToCurr", ".", "c", "*", "closeInlierCount", "+", "Math", ".", "cos", "(", "farAngle", ")", "*", "farInlierCount", ";", "double", "y", "=", "c...
Fuse the estimates for yaw from both sets of points using a weighted vector average and save the results into currToKey
[ "Fuse", "the", "estimates", "for", "yaw", "from", "both", "sets", "of", "points", "using", "a", "weighted", "vector", "average", "and", "save", "the", "results", "into", "currToKey" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L500-L511
50,897
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.getWorldToCurr3D
public Se3_F64 getWorldToCurr3D() { // compute transform in 2D space Se2_F64 currToWorld = getCurrToWorld2D(); // 2D to 3D coordinates currPlaneToWorld3D.getT().set(-currToWorld.T.y, 0, currToWorld.T.x); DMatrixRMaj R = currPlaneToWorld3D.getR(); // set rotation around Y axis. // Transpose the 2D trans...
java
public Se3_F64 getWorldToCurr3D() { // compute transform in 2D space Se2_F64 currToWorld = getCurrToWorld2D(); // 2D to 3D coordinates currPlaneToWorld3D.getT().set(-currToWorld.T.y, 0, currToWorld.T.x); DMatrixRMaj R = currPlaneToWorld3D.getR(); // set rotation around Y axis. // Transpose the 2D trans...
[ "public", "Se3_F64", "getWorldToCurr3D", "(", ")", "{", "// compute transform in 2D space", "Se2_F64", "currToWorld", "=", "getCurrToWorld2D", "(", ")", ";", "// 2D to 3D coordinates", "currPlaneToWorld3D", ".", "getT", "(", ")", ".", "set", "(", "-", "currToWorld", ...
Converts 2D motion estimate into a 3D motion estimate @return from world to current frame.
[ "Converts", "2D", "motion", "estimate", "into", "a", "3D", "motion", "estimate" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L566-L588
50,898
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java
VisOdomMonoPlaneInfinity.maximizeCountInSpread
public static double maximizeCountInSpread(double[] data, int size, double maxSpread) { if (size <= 0) return 0; Arrays.sort(data, 0, size); int length = 0; for (; length < size; length++) { double s = UtilAngle.dist(data[0], data[length]); if (s > maxSpread) { break; } } int bestStart = ...
java
public static double maximizeCountInSpread(double[] data, int size, double maxSpread) { if (size <= 0) return 0; Arrays.sort(data, 0, size); int length = 0; for (; length < size; length++) { double s = UtilAngle.dist(data[0], data[length]); if (s > maxSpread) { break; } } int bestStart = ...
[ "public", "static", "double", "maximizeCountInSpread", "(", "double", "[", "]", "data", ",", "int", "size", ",", "double", "maxSpread", ")", "{", "if", "(", "size", "<=", "0", ")", "return", "0", ";", "Arrays", ".", "sort", "(", "data", ",", "0", ","...
Finds the value which has the largest number of points above and below it within the specified spread @param data Input data. Is modified by sort @param size number of elements in data @param maxSpread the spread it's going after @return best value
[ "Finds", "the", "value", "which", "has", "the", "largest", "number", "of", "points", "above", "and", "below", "it", "within", "the", "specified", "spread" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L599-L635
50,899
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftScaleSpace.java
SiftScaleSpace.computeNextOctave
public boolean computeNextOctave() { currentOctave += 1; if( currentOctave > lastOctave ) { return false; } if( octaveImages[numScales].width <= 5 || octaveImages[numScales].height <= 5) return false; // the 2nd image from the top of the stack has 2x the sigma as the first PyramidOps.scaleDown2(octa...
java
public boolean computeNextOctave() { currentOctave += 1; if( currentOctave > lastOctave ) { return false; } if( octaveImages[numScales].width <= 5 || octaveImages[numScales].height <= 5) return false; // the 2nd image from the top of the stack has 2x the sigma as the first PyramidOps.scaleDown2(octa...
[ "public", "boolean", "computeNextOctave", "(", ")", "{", "currentOctave", "+=", "1", ";", "if", "(", "currentOctave", ">", "lastOctave", ")", "{", "return", "false", ";", "}", "if", "(", "octaveImages", "[", "numScales", "]", ".", "width", "<=", "5", "||...
Computes the next octave. If the last octave has already been computed false is returned. @return true if an octave was computed or false if the last one was already reached
[ "Computes", "the", "next", "octave", ".", "If", "the", "last", "octave", "has", "already", "been", "computed", "false", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftScaleSpace.java#L199-L212