id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
49,700
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.computeSideError
double computeSideError(List<Point2D_I32> contour , int indexA , int indexB ) { assignLine(contour, indexA, indexB, line); // don't sample the end points because the error will be zero by definition int numSamples; double sumOfDistances = 0; int length; if( indexB >= indexA ) { length = indexB-indexA-1;...
java
double computeSideError(List<Point2D_I32> contour , int indexA , int indexB ) { assignLine(contour, indexA, indexB, line); // don't sample the end points because the error will be zero by definition int numSamples; double sumOfDistances = 0; int length; if( indexB >= indexA ) { length = indexB-indexA-1;...
[ "double", "computeSideError", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "int", "indexA", ",", "int", "indexB", ")", "{", "assignLine", "(", "contour", ",", "indexA", ",", "indexB", ",", "line", ")", ";", "// don't sample the end points because the er...
Scores a side based on the sum of Euclidean distance squared of each point along the line. Euclidean squared is used because its fast to compute @param indexA first index. Inclusive @param indexB last index. Exclusive
[ "Scores", "a", "side", "based", "on", "the", "sum", "of", "Euclidean", "distance", "squared", "of", "each", "point", "along", "the", "line", ".", "Euclidean", "squared", "is", "used", "because", "its", "fast", "to", "compute" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L625-L658
49,701
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.computePotentialSplitScore
void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); e0.object.splitable = canBeSplit(contour,e0,mustSplit); if( e0.object.splitable ) { setSplitVariables(contour, e0, e1); } }
java
void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); e0.object.splitable = canBeSplit(contour,e0,mustSplit); if( e0.object.splitable ) { setSplitVariables(contour, e0, e1); } }
[ "void", "computePotentialSplitScore", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "Element", "<", "Corner", ">", "e0", ",", "boolean", "mustSplit", ")", "{", "Element", "<", "Corner", ">", "e1", "=", "next", "(", "e0", ")", ";", "e0", ".", "o...
Computes the split location and the score of the two new sides if it's split there
[ "Computes", "the", "split", "location", "and", "the", "score", "of", "the", "two", "new", "sides", "if", "it", "s", "split", "there" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L663-L672
49,702
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.setSplitVariables
void setSplitVariables(List<Point2D_I32> contour, Element<Corner> e0, Element<Corner> e1) { int distance0 = CircularIndex.distanceP(e0.object.index, e1.object.index, contour.size()); int index0 = CircularIndex.plusPOffset(e0.object.index,minimumSideLength,contour.size()); int index1 = CircularIndex.minusPOffset...
java
void setSplitVariables(List<Point2D_I32> contour, Element<Corner> e0, Element<Corner> e1) { int distance0 = CircularIndex.distanceP(e0.object.index, e1.object.index, contour.size()); int index0 = CircularIndex.plusPOffset(e0.object.index,minimumSideLength,contour.size()); int index1 = CircularIndex.minusPOffset...
[ "void", "setSplitVariables", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "Element", "<", "Corner", ">", "e0", ",", "Element", "<", "Corner", ">", "e1", ")", "{", "int", "distance0", "=", "CircularIndex", ".", "distanceP", "(", "e0", ".", "objec...
Selects and splits the side defined by the e0 corner. If convex a check is performed to ensure that the polyline will be convex still.
[ "Selects", "and", "splits", "the", "side", "defined", "by", "the", "e0", "corner", ".", "If", "convex", "a", "check", "is", "performed", "to", "ensure", "that", "the", "polyline", "will", "be", "convex", "still", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L678-L712
49,703
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.canBeSplit
boolean canBeSplit( List<Point2D_I32> contour, Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); // NOTE: The contour is passed in but only the size of the contour matters. This was done to prevent // changing the signature if the algorithm was changed later on. int length = Circu...
java
boolean canBeSplit( List<Point2D_I32> contour, Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); // NOTE: The contour is passed in but only the size of the contour matters. This was done to prevent // changing the signature if the algorithm was changed later on. int length = Circu...
[ "boolean", "canBeSplit", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "Element", "<", "Corner", ">", "e0", ",", "boolean", "mustSplit", ")", "{", "Element", "<", "Corner", ">", "e1", "=", "next", "(", "e0", ")", ";", "// NOTE: The contour is passe...
Determines if the side can be split again. A side can always be split as long as it's &ge; the minimum length or that the side score is larger the the split threshold @param e0 The side which is to be tested to see if it can be split @param mustSplit if true this will force it to split even if the error would prevent ...
[ "Determines", "if", "the", "side", "can", "be", "split", "again", ".", "A", "side", "can", "always", "be", "split", "as", "long", "as", "it", "s", "&ge", ";", "the", "minimum", "length", "or", "that", "the", "side", "score", "is", "larger", "the", "t...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L722-L737
49,704
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.next
Element<Corner> next( Element<Corner> e ) { if( e.next == null ) { return list.getHead(); } else { return e.next; } }
java
Element<Corner> next( Element<Corner> e ) { if( e.next == null ) { return list.getHead(); } else { return e.next; } }
[ "Element", "<", "Corner", ">", "next", "(", "Element", "<", "Corner", ">", "e", ")", "{", "if", "(", "e", ".", "next", "==", "null", ")", "{", "return", "list", ".", "getHead", "(", ")", ";", "}", "else", "{", "return", "e", ".", "next", ";", ...
Returns the next corner in the list
[ "Returns", "the", "next", "corner", "in", "the", "list" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L742-L748
49,705
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.previous
Element<Corner> previous( Element<Corner> e ) { if( e.previous == null ) { return list.getTail(); } else { return e.previous; } }
java
Element<Corner> previous( Element<Corner> e ) { if( e.previous == null ) { return list.getTail(); } else { return e.previous; } }
[ "Element", "<", "Corner", ">", "previous", "(", "Element", "<", "Corner", ">", "e", ")", "{", "if", "(", "e", ".", "previous", "==", "null", ")", "{", "return", "list", ".", "getTail", "(", ")", ";", "}", "else", "{", "return", "e", ".", "previou...
Returns the previous corner in the list
[ "Returns", "the", "previous", "corner", "in", "the", "list" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L753-L759
49,706
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.distanceSq
static double distanceSq( Point2D_I32 a , Point2D_I32 b ) { double dx = b.x-a.x; double dy = b.y-a.y; return dx*dx + dy*dy; }
java
static double distanceSq( Point2D_I32 a , Point2D_I32 b ) { double dx = b.x-a.x; double dy = b.y-a.y; return dx*dx + dy*dy; }
[ "static", "double", "distanceSq", "(", "Point2D_I32", "a", ",", "Point2D_I32", "b", ")", "{", "double", "dx", "=", "b", ".", "x", "-", "a", ".", "x", ";", "double", "dy", "=", "b", ".", "y", "-", "a", ".", "y", ";", "return", "dx", "*", "dx", ...
Using double prevision here instead of int due to fear of overflow in very large images
[ "Using", "double", "prevision", "here", "instead", "of", "int", "due", "to", "fear", "of", "overflow", "in", "very", "large", "images" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L791-L796
49,707
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java
PolylineSplitMerge.assignLine
public static void assignLine(List<Point2D_I32> contour, int indexA, int indexB, LineParametric2D_F64 line) { Point2D_I32 endA = contour.get(indexA); Point2D_I32 endB = contour.get(indexB); line.p.x = endA.x; line.p.y = endA.y; line.slope.x = endB.x-endA.x; line.slope.y = endB.y-endA.y; }
java
public static void assignLine(List<Point2D_I32> contour, int indexA, int indexB, LineParametric2D_F64 line) { Point2D_I32 endA = contour.get(indexA); Point2D_I32 endB = contour.get(indexB); line.p.x = endA.x; line.p.y = endA.y; line.slope.x = endB.x-endA.x; line.slope.y = endB.y-endA.y; }
[ "public", "static", "void", "assignLine", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "int", "indexA", ",", "int", "indexB", ",", "LineParametric2D_F64", "line", ")", "{", "Point2D_I32", "endA", "=", "contour", ".", "get", "(", "indexA", ")", ";"...
Assigns the line so that it passes through points A and B.
[ "Assigns", "the", "line", "so", "that", "it", "passes", "through", "points", "A", "and", "B", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L808-L816
49,708
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java
SplitMergeLineFitSegment.splitPixels
protected void splitPixels( int indexStart , int indexStop ) { // too short to split if( indexStart+1 >= indexStop ) return; int indexSplit = selectSplitBetween(indexStart, indexStop); if( indexSplit >= 0 ) { splitPixels(indexStart, indexSplit); splits.add(indexSplit); splitPixels(indexSplit, inde...
java
protected void splitPixels( int indexStart , int indexStop ) { // too short to split if( indexStart+1 >= indexStop ) return; int indexSplit = selectSplitBetween(indexStart, indexStop); if( indexSplit >= 0 ) { splitPixels(indexStart, indexSplit); splits.add(indexSplit); splitPixels(indexSplit, inde...
[ "protected", "void", "splitPixels", "(", "int", "indexStart", ",", "int", "indexStop", ")", "{", "// too short to split", "if", "(", "indexStart", "+", "1", ">=", "indexStop", ")", "return", ";", "int", "indexSplit", "=", "selectSplitBetween", "(", "indexStart",...
Recursively splits pixels. Used in the initial segmentation. Only split points between the two ends are added
[ "Recursively", "splits", "pixels", ".", "Used", "in", "the", "initial", "segmentation", ".", "Only", "split", "points", "between", "the", "two", "ends", "are", "added" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java#L70-L82
49,709
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java
SplitMergeLineFitSegment.splitSegments
protected boolean splitSegments() { boolean change = false; work.reset(); for( int i = 0; i < splits.size-1; i++ ) { int start = splits.data[i]; int end = splits.data[i+1]; int bestIndex = selectSplitBetween(start, end); if( bestIndex >= 0 ) { change |= true; work.add(start); work.add(be...
java
protected boolean splitSegments() { boolean change = false; work.reset(); for( int i = 0; i < splits.size-1; i++ ) { int start = splits.data[i]; int end = splits.data[i+1]; int bestIndex = selectSplitBetween(start, end); if( bestIndex >= 0 ) { change |= true; work.add(start); work.add(be...
[ "protected", "boolean", "splitSegments", "(", ")", "{", "boolean", "change", "=", "false", ";", "work", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "splits", ".", "size", "-", "1", ";", "i", "++", ")", "{", "in...
Splits a line in two if there is a paint that is too far away @return true for change
[ "Splits", "a", "line", "in", "two", "if", "there", "is", "a", "paint", "that", "is", "too", "far", "away" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java#L88-L113
49,710
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java
SplitMergeLineFitSegment.mergeSegments
protected boolean mergeSegments() { // can't merge a single line if( splits.size <= 2 ) return false; boolean change = false; work.reset(); // first point is always at the start work.add(splits.data[0]); for( int i = 0; i < splits.size-2; i++ ) { if( selectSplitBetween(splits.data[i],splits.data[...
java
protected boolean mergeSegments() { // can't merge a single line if( splits.size <= 2 ) return false; boolean change = false; work.reset(); // first point is always at the start work.add(splits.data[0]); for( int i = 0; i < splits.size-2; i++ ) { if( selectSplitBetween(splits.data[i],splits.data[...
[ "protected", "boolean", "mergeSegments", "(", ")", "{", "// can't merge a single line", "if", "(", "splits", ".", "size", "<=", "2", ")", "return", "false", ";", "boolean", "change", "=", "false", ";", "work", ".", "reset", "(", ")", ";", "// first point is ...
Merges lines together which have an acute angle less than the threshold. @return true the list being changed
[ "Merges", "lines", "together", "which", "have", "an", "acute", "angle", "less", "than", "the", "threshold", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitSegment.java#L153-L182
49,711
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java
TldRegionTracker.initialize
public void initialize(PyramidDiscrete<I> image ) { if( previousDerivX == null || previousDerivX.length != image.getNumLayers() || previousImage.getInputWidth() != image.getInputWidth() || previousImage.getInputHeight() != image.getInputHeight() ) { declareDataStructures(image); } for( int i = 0; i < imag...
java
public void initialize(PyramidDiscrete<I> image ) { if( previousDerivX == null || previousDerivX.length != image.getNumLayers() || previousImage.getInputWidth() != image.getInputWidth() || previousImage.getInputHeight() != image.getInputHeight() ) { declareDataStructures(image); } for( int i = 0; i < imag...
[ "public", "void", "initialize", "(", "PyramidDiscrete", "<", "I", ">", "image", ")", "{", "if", "(", "previousDerivX", "==", "null", "||", "previousDerivX", ".", "length", "!=", "image", ".", "getNumLayers", "(", ")", "||", "previousImage", ".", "getInputWid...
Call for the first image being tracked @param image Most recent video image.
[ "Call", "for", "the", "first", "image", "being", "tracked" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L124-L135
49,712
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java
TldRegionTracker.declareDataStructures
protected void declareDataStructures(PyramidDiscrete<I> image) { numPyramidLayers = image.getNumLayers(); previousDerivX = (D[])Array.newInstance(derivType,image.getNumLayers()); previousDerivY = (D[])Array.newInstance(derivType,image.getNumLayers()); currentDerivX = (D[])Array.newInstance(derivType,image.getN...
java
protected void declareDataStructures(PyramidDiscrete<I> image) { numPyramidLayers = image.getNumLayers(); previousDerivX = (D[])Array.newInstance(derivType,image.getNumLayers()); previousDerivY = (D[])Array.newInstance(derivType,image.getNumLayers()); currentDerivX = (D[])Array.newInstance(derivType,image.getN...
[ "protected", "void", "declareDataStructures", "(", "PyramidDiscrete", "<", "I", ">", "image", ")", "{", "numPyramidLayers", "=", "image", ".", "getNumLayers", "(", ")", ";", "previousDerivX", "=", "(", "D", "[", "]", ")", "Array", ".", "newInstance", "(", ...
Declares internal data structures based on the input image pyramid
[ "Declares", "internal", "data", "structures", "based", "on", "the", "input", "image", "pyramid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L140-L167
49,713
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java
TldRegionTracker.process
public boolean process(ImagePyramid<I> image , Rectangle2D_F64 targetRectangle ) { boolean success = true; updateCurrent(image); // create feature tracks spawnGrid(targetRectangle); // track features while computing forward/backward error and NCC error if( !trackFeature() ) success = false; // make...
java
public boolean process(ImagePyramid<I> image , Rectangle2D_F64 targetRectangle ) { boolean success = true; updateCurrent(image); // create feature tracks spawnGrid(targetRectangle); // track features while computing forward/backward error and NCC error if( !trackFeature() ) success = false; // make...
[ "public", "boolean", "process", "(", "ImagePyramid", "<", "I", ">", "image", ",", "Rectangle2D_F64", "targetRectangle", ")", "{", "boolean", "success", "=", "true", ";", "updateCurrent", "(", "image", ")", ";", "// create feature tracks", "spawnGrid", "(", "targ...
Creates several tracks inside the target rectangle and compuets their motion @param image Most recent video image. @param targetRectangle Location of target in previous frame. Not modified. @return true if tracking was successful or false if not
[ "Creates", "several", "tracks", "inside", "the", "target", "rectangle", "and", "compuets", "their", "motion" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L176-L192
49,714
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java
TldRegionTracker.updateCurrent
protected void updateCurrent(ImagePyramid<I> image) { this.currentImage = image; for( int i = 0; i < image.getNumLayers(); i++ ) { gradient.process(image.getLayer(i), currentDerivX[i], currentDerivY[i]); } }
java
protected void updateCurrent(ImagePyramid<I> image) { this.currentImage = image; for( int i = 0; i < image.getNumLayers(); i++ ) { gradient.process(image.getLayer(i), currentDerivX[i], currentDerivY[i]); } }
[ "protected", "void", "updateCurrent", "(", "ImagePyramid", "<", "I", ">", "image", ")", "{", "this", ".", "currentImage", "=", "image", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "image", ".", "getNumLayers", "(", ")", ";", "i", "++", ")...
Computes the gradient and changes the reference to the current pyramid
[ "Computes", "the", "gradient", "and", "changes", "the", "reference", "to", "the", "current", "pyramid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L197-L202
49,715
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java
TldRegionTracker.spawnGrid
protected void spawnGrid(Rectangle2D_F64 prevRect ) { // Shrink the rectangle to ensure that all features are entirely contained inside spawnRect.p0.x = prevRect.p0.x + featureRadius; spawnRect.p0.y = prevRect.p0.y + featureRadius; spawnRect.p1.x = prevRect.p1.x - featureRadius; spawnRect.p1.y = prevRect.p1.y...
java
protected void spawnGrid(Rectangle2D_F64 prevRect ) { // Shrink the rectangle to ensure that all features are entirely contained inside spawnRect.p0.x = prevRect.p0.x + featureRadius; spawnRect.p0.y = prevRect.p0.y + featureRadius; spawnRect.p1.x = prevRect.p1.x - featureRadius; spawnRect.p1.y = prevRect.p1.y...
[ "protected", "void", "spawnGrid", "(", "Rectangle2D_F64", "prevRect", ")", "{", "// Shrink the rectangle to ensure that all features are entirely contained inside", "spawnRect", ".", "p0", ".", "x", "=", "prevRect", ".", "p0", ".", "x", "+", "featureRadius", ";", "spawn...
Spawn KLT tracks at evenly spaced points inside a grid
[ "Spawn", "KLT", "tracks", "at", "evenly", "spaced", "points", "inside", "a", "grid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldRegionTracker.java#L290-L321
49,716
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.process
public boolean process( T left , T right ) { if( first ) { associateL2R(left, right); first = false; } else { // long time0 = System.currentTimeMillis(); associateL2R(left, right); // long time1 = System.currentTimeMillis(); associateF2F(); // long time2 = System.currentTimeMillis(); cyclicCon...
java
public boolean process( T left , T right ) { if( first ) { associateL2R(left, right); first = false; } else { // long time0 = System.currentTimeMillis(); associateL2R(left, right); // long time1 = System.currentTimeMillis(); associateF2F(); // long time2 = System.currentTimeMillis(); cyclicCon...
[ "public", "boolean", "process", "(", "T", "left", ",", "T", "right", ")", "{", "if", "(", "first", ")", "{", "associateL2R", "(", "left", ",", "right", ")", ";", "first", "=", "false", ";", "}", "else", "{", "//\t\t\tlong time0 = System.currentTimeMillis()...
Estimates camera egomotion from the stereo pair @param left Image from left camera @param right Image from right camera @return true if motion was estimated and false if not
[ "Estimates", "camera", "egomotion", "from", "the", "stereo", "pair" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L173-L195
49,717
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.associateL2R
private void associateL2R( T left , T right ) { // make the previous new observations into the new old ones ImageInfo<TD> tmp = featsLeft1; featsLeft1 = featsLeft0; featsLeft0 = tmp; tmp = featsRight1; featsRight1 = featsRight0; featsRight0 = tmp; // detect and associate features in the two images featsL...
java
private void associateL2R( T left , T right ) { // make the previous new observations into the new old ones ImageInfo<TD> tmp = featsLeft1; featsLeft1 = featsLeft0; featsLeft0 = tmp; tmp = featsRight1; featsRight1 = featsRight0; featsRight0 = tmp; // detect and associate features in the two images featsL...
[ "private", "void", "associateL2R", "(", "T", "left", ",", "T", "right", ")", "{", "// make the previous new observations into the new old ones", "ImageInfo", "<", "TD", ">", "tmp", "=", "featsLeft1", ";", "featsLeft1", "=", "featsLeft0", ";", "featsLeft0", "=", "t...
Associates image features from the left and right camera together while applying epipolar constraints. @param left Image from left camera @param right Image from right camera
[ "Associates", "image", "features", "from", "the", "left", "and", "right", "camera", "together", "while", "applying", "epipolar", "constraints", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L203-L239
49,718
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.associateF2F
private void associateF2F() { quadViews.reset(); for( int i = 0; i < detector.getNumberOfSets(); i++ ) { SetMatches matches = setMatches[i]; // old left to new left assocSame.setSource(featsLeft0.location[i],featsLeft0.description[i]); assocSame.setDestination(featsLeft1.location[i], featsLeft1.descr...
java
private void associateF2F() { quadViews.reset(); for( int i = 0; i < detector.getNumberOfSets(); i++ ) { SetMatches matches = setMatches[i]; // old left to new left assocSame.setSource(featsLeft0.location[i],featsLeft0.description[i]); assocSame.setDestination(featsLeft1.location[i], featsLeft1.descr...
[ "private", "void", "associateF2F", "(", ")", "{", "quadViews", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detector", ".", "getNumberOfSets", "(", ")", ";", "i", "++", ")", "{", "SetMatches", "matches", "=", "setM...
Associates images between left and left and right and right images
[ "Associates", "images", "between", "left", "and", "left", "and", "right", "and", "right", "images" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L300-L321
49,719
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.cyclicConsistency
private void cyclicConsistency() { for( int i = 0; i < detector.getNumberOfSets(); i++ ) { FastQueue<Point2D_F64> obs0 = featsLeft0.location[i]; FastQueue<Point2D_F64> obs1 = featsRight0.location[i]; FastQueue<Point2D_F64> obs2 = featsLeft1.location[i]; FastQueue<Point2D_F64> obs3 = featsRight1.location[i...
java
private void cyclicConsistency() { for( int i = 0; i < detector.getNumberOfSets(); i++ ) { FastQueue<Point2D_F64> obs0 = featsLeft0.location[i]; FastQueue<Point2D_F64> obs1 = featsRight0.location[i]; FastQueue<Point2D_F64> obs2 = featsLeft1.location[i]; FastQueue<Point2D_F64> obs3 = featsRight1.location[i...
[ "private", "void", "cyclicConsistency", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detector", ".", "getNumberOfSets", "(", ")", ";", "i", "++", ")", "{", "FastQueue", "<", "Point2D_F64", ">", "obs0", "=", "featsLeft0", ".", "loc...
Create a list of features which have a consistent cycle of matches 0 -> 1 -> 3 and 0 -> 2 -> 3
[ "Create", "a", "list", "of", "features", "which", "have", "a", "consistent", "cycle", "of", "matches", "0", "-", ">", "1", "-", ">", "3", "and", "0", "-", ">", "2", "-", ">", "3" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L327-L362
49,720
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.describeImage
private void describeImage(T left , ImageInfo<TD> info ) { detector.process(left); for( int i = 0; i < detector.getNumberOfSets(); i++ ) { PointDescSet<TD> set = detector.getFeatureSet(i); FastQueue<Point2D_F64> l = info.location[i]; FastQueue<TD> d = info.description[i]; for( int j = 0; j < set.getNum...
java
private void describeImage(T left , ImageInfo<TD> info ) { detector.process(left); for( int i = 0; i < detector.getNumberOfSets(); i++ ) { PointDescSet<TD> set = detector.getFeatureSet(i); FastQueue<Point2D_F64> l = info.location[i]; FastQueue<TD> d = info.description[i]; for( int j = 0; j < set.getNum...
[ "private", "void", "describeImage", "(", "T", "left", ",", "ImageInfo", "<", "TD", ">", "info", ")", "{", "detector", ".", "process", "(", "left", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detector", ".", "getNumberOfSets", "(", "...
Computes image features and stores the results in info
[ "Computes", "image", "features", "and", "stores", "the", "results", "in", "info" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L380-L392
49,721
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java
VisOdomQuadPnP.estimateMotion
private boolean estimateMotion() { modelFitData.reset(); Point2D_F64 normLeft = new Point2D_F64(); Point2D_F64 normRight = new Point2D_F64(); // use 0 -> 1 stereo associations to estimate each feature's 3D position for( int i = 0; i < quadViews.size; i++ ) { QuadView obs = quadViews.get(i); // conver...
java
private boolean estimateMotion() { modelFitData.reset(); Point2D_F64 normLeft = new Point2D_F64(); Point2D_F64 normRight = new Point2D_F64(); // use 0 -> 1 stereo associations to estimate each feature's 3D position for( int i = 0; i < quadViews.size; i++ ) { QuadView obs = quadViews.get(i); // conver...
[ "private", "boolean", "estimateMotion", "(", ")", "{", "modelFitData", ".", "reset", "(", ")", ";", "Point2D_F64", "normLeft", "=", "new", "Point2D_F64", "(", ")", ";", "Point2D_F64", "normRight", "=", "new", "Point2D_F64", "(", ")", ";", "// use 0 -> 1 stereo...
Estimates camera egomotion between the two most recent image frames @return
[ "Estimates", "camera", "egomotion", "between", "the", "two", "most", "recent", "image", "frames" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomQuadPnP.java#L398-L451
49,722
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularRotate_F64.java
EquirectangularRotate_F64.setEquirectangularShape
@Override public void setEquirectangularShape( int width , int height ) { super.setEquirectangularShape(width, height); declareVectors(width, height); // precompute vectors for each pixel for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { tools.equiToNormFV(x,y,vectors[y*width+x]); ...
java
@Override public void setEquirectangularShape( int width , int height ) { super.setEquirectangularShape(width, height); declareVectors(width, height); // precompute vectors for each pixel for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { tools.equiToNormFV(x,y,vectors[y*width+x]); ...
[ "@", "Override", "public", "void", "setEquirectangularShape", "(", "int", "width", ",", "int", "height", ")", "{", "super", ".", "setEquirectangularShape", "(", "width", ",", "height", ")", ";", "declareVectors", "(", "width", ",", "height", ")", ";", "// pr...
Specifies the image's width and height @param width Image width @param height Image height
[ "Specifies", "the", "image", "s", "width", "and", "height" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularRotate_F64.java#L35-L46
49,723
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/factory/tracker/FactoryTrackerObjectQuad.java
FactoryTrackerObjectQuad.meanShiftLikelihood
public static <T extends ImageBase<T>> TrackerObjectQuad<T> meanShiftLikelihood(int maxIterations, int numBins, double maxPixelValue, MeanShiftLikelihoodType modelType, ImageType<T> imageType) { PixelLikelihood<T> likelihood; switch( modelType ) { case HISTOGRAM:...
java
public static <T extends ImageBase<T>> TrackerObjectQuad<T> meanShiftLikelihood(int maxIterations, int numBins, double maxPixelValue, MeanShiftLikelihoodType modelType, ImageType<T> imageType) { PixelLikelihood<T> likelihood; switch( modelType ) { case HISTOGRAM:...
[ "public", "static", "<", "T", "extends", "ImageBase", "<", "T", ">", ">", "TrackerObjectQuad", "<", "T", ">", "meanShiftLikelihood", "(", "int", "maxIterations", ",", "int", "numBins", ",", "double", "maxPixelValue", ",", "MeanShiftLikelihoodType", "modelType", ...
Very basic and very fast implementation of mean-shift which uses a fixed sized rectangle for its region. Works best when the target is composed of a single color. @see TrackerMeanShiftLikelihood @param maxIterations Maximum number of mean-shift iterations. Try 30. @param numBins Number of bins in the histogram color...
[ "Very", "basic", "and", "very", "fast", "implementation", "of", "mean", "-", "shift", "which", "uses", "a", "fixed", "sized", "rectangle", "for", "its", "region", ".", "Works", "best", "when", "the", "target", "is", "composed", "of", "a", "single", "color"...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/tracker/FactoryTrackerObjectQuad.java#L108-L142
49,724
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/factory/tracker/FactoryTrackerObjectQuad.java
FactoryTrackerObjectQuad.meanShiftComaniciu2003
public static <T extends ImageBase<T>> TrackerObjectQuad<T> meanShiftComaniciu2003(ConfigComaniciu2003 config, ImageType<T> imageType ) { TrackerMeanShiftComaniciu2003<T> alg = FactoryTrackerObjectAlgs.meanShiftComaniciu2003(config,imageType); return new Comaniciu2003_to_TrackerObjectQuad<>(alg, imageType); }
java
public static <T extends ImageBase<T>> TrackerObjectQuad<T> meanShiftComaniciu2003(ConfigComaniciu2003 config, ImageType<T> imageType ) { TrackerMeanShiftComaniciu2003<T> alg = FactoryTrackerObjectAlgs.meanShiftComaniciu2003(config,imageType); return new Comaniciu2003_to_TrackerObjectQuad<>(alg, imageType); }
[ "public", "static", "<", "T", "extends", "ImageBase", "<", "T", ">", ">", "TrackerObjectQuad", "<", "T", ">", "meanShiftComaniciu2003", "(", "ConfigComaniciu2003", "config", ",", "ImageType", "<", "T", ">", "imageType", ")", "{", "TrackerMeanShiftComaniciu2003", ...
Implementation of mean-shift which matches the histogram and can handle targets composed of multiple colors. The tracker can also be configured to estimate gradual changes in scale. The track region is composed of a rotated rectangle. @see TrackerMeanShiftComaniciu2003 @param config Tracker configuration @param <T> ...
[ "Implementation", "of", "mean", "-", "shift", "which", "matches", "the", "histogram", "and", "can", "handle", "targets", "composed", "of", "multiple", "colors", ".", "The", "tracker", "can", "also", "be", "configured", "to", "estimate", "gradual", "changes", "...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/tracker/FactoryTrackerObjectQuad.java#L155-L161
49,725
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelStationary.java
BackgroundModelStationary.updateBackground
public void updateBackground( T frame , GrayU8 segment ) { updateBackground(frame); segment(frame,segment); }
java
public void updateBackground( T frame , GrayU8 segment ) { updateBackground(frame); segment(frame,segment); }
[ "public", "void", "updateBackground", "(", "T", "frame", ",", "GrayU8", "segment", ")", "{", "updateBackground", "(", "frame", ")", ";", "segment", "(", "frame", ",", "segment", ")", ";", "}" ]
Updates the background and segments it at the same time. In some implementations this can be significantly faster than doing it with separate function calls. Segmentation is performed using the model which it has prior to the update.
[ "Updates", "the", "background", "and", "segments", "it", "at", "the", "same", "time", ".", "In", "some", "implementations", "this", "can", "be", "significantly", "faster", "than", "doing", "it", "with", "separate", "function", "calls", ".", "Segmentation", "is...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelStationary.java#L48-L51
49,726
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java
PackedBits8.append
public void append( int bits , int numberOfBits , boolean swapOrder ) { if( numberOfBits > 32 ) throw new IllegalArgumentException("Number of bits exceeds the size of bits"); int indexTail = size; growArray(numberOfBits,true); if( swapOrder ) { for (int i = 0; i < numberOfBits; i++) { set( indexTail ...
java
public void append( int bits , int numberOfBits , boolean swapOrder ) { if( numberOfBits > 32 ) throw new IllegalArgumentException("Number of bits exceeds the size of bits"); int indexTail = size; growArray(numberOfBits,true); if( swapOrder ) { for (int i = 0; i < numberOfBits; i++) { set( indexTail ...
[ "public", "void", "append", "(", "int", "bits", ",", "int", "numberOfBits", ",", "boolean", "swapOrder", ")", "{", "if", "(", "numberOfBits", ">", "32", ")", "throw", "new", "IllegalArgumentException", "(", "\"Number of bits exceeds the size of bits\"", ")", ";", ...
Appends bits on to the end of the stack. @param bits Storage for bits. Relevant bits start at the front. @param numberOfBits Number of relevant bits in 'bits' @param swapOrder If true then the first bit in 'bits' will be the last bit in this array.
[ "Appends", "bits", "on", "to", "the", "end", "of", "the", "stack", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java#L72-L87
49,727
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java
PackedBits8.read
public int read( int location , int length , boolean swapOrder ) { if( length < 0 || length > 32 ) throw new IllegalArgumentException("Length can't exceed 32"); if( location + length > size ) throw new IllegalArgumentException("Attempting to read past the end"); // TODO speed up by reading in byte chunks ...
java
public int read( int location , int length , boolean swapOrder ) { if( length < 0 || length > 32 ) throw new IllegalArgumentException("Length can't exceed 32"); if( location + length > size ) throw new IllegalArgumentException("Attempting to read past the end"); // TODO speed up by reading in byte chunks ...
[ "public", "int", "read", "(", "int", "location", ",", "int", "length", ",", "boolean", "swapOrder", ")", "{", "if", "(", "length", "<", "0", "||", "length", ">", "32", ")", "throw", "new", "IllegalArgumentException", "(", "\"Length can't exceed 32\"", ")", ...
Read bits from the array and store them in an int @param location The index of the first bit @param length Number of bits to real up to 32 @param swapOrder Should the order be swapped? @return The read in data
[ "Read", "bits", "from", "the", "array", "and", "store", "them", "in", "an", "int" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java#L96-L114
49,728
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java
PackedBits8.growArray
public void growArray( int amountBits , boolean saveValue ) { size = size+amountBits; int N = size/8 + (size%8==0?0:1); if( N > data.length ) { // add in some buffer to avoid lots of calls to new int extra = Math.min(1024,N+10); byte[] tmp = new byte[N+extra]; if( saveValue ) System.arraycopy(dat...
java
public void growArray( int amountBits , boolean saveValue ) { size = size+amountBits; int N = size/8 + (size%8==0?0:1); if( N > data.length ) { // add in some buffer to avoid lots of calls to new int extra = Math.min(1024,N+10); byte[] tmp = new byte[N+extra]; if( saveValue ) System.arraycopy(dat...
[ "public", "void", "growArray", "(", "int", "amountBits", ",", "boolean", "saveValue", ")", "{", "size", "=", "size", "+", "amountBits", ";", "int", "N", "=", "size", "/", "8", "+", "(", "size", "%", "8", "==", "0", "?", "0", ":", "1", ")", ";", ...
Increases the size of the data array so that it can store an addition number of bits @param amountBits Number of bits beyond 'size' that you wish the array to be able to store @param saveValue if true it will save the value of the array. If false it will not copy it
[ "Increases", "the", "size", "of", "the", "data", "array", "so", "that", "it", "can", "store", "an", "addition", "number", "of", "bits" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/PackedBits8.java#L133-L146
49,729
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java
HomographyDirectLinearTransform.computeH
protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) { if( !solverNullspace.process(A.copy(),1,H) ) return true; H.numRows = 3; H.numCols = 3; return false; }
java
protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) { if( !solverNullspace.process(A.copy(),1,H) ) return true; H.numRows = 3; H.numCols = 3; return false; }
[ "protected", "boolean", "computeH", "(", "DMatrixRMaj", "A", ",", "DMatrixRMaj", "H", ")", "{", "if", "(", "!", "solverNullspace", ".", "process", "(", "A", ".", "copy", "(", ")", ",", "1", ",", "H", ")", ")", "return", "true", ";", "H", ".", "numR...
Computes the SVD of A and extracts the homography matrix from its null space
[ "Computes", "the", "SVD", "of", "A", "and", "extracts", "the", "homography", "matrix", "from", "its", "null", "space" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L189-L198
49,730
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java
HomographyDirectLinearTransform.undoNormalizationH
public static void undoNormalizationH(DMatrixRMaj M, NormalizationPoint2D N1, NormalizationPoint2D N2) { SimpleMatrix a = SimpleMatrix.wrap(M); SimpleMatrix b = SimpleMatrix.wrap(N1.matrix()); SimpleMatrix c_inv = SimpleMatrix.wrap(N2.matrixInv()); SimpleMatrix result = c_inv.mult(a).mult(b); M.set(result.g...
java
public static void undoNormalizationH(DMatrixRMaj M, NormalizationPoint2D N1, NormalizationPoint2D N2) { SimpleMatrix a = SimpleMatrix.wrap(M); SimpleMatrix b = SimpleMatrix.wrap(N1.matrix()); SimpleMatrix c_inv = SimpleMatrix.wrap(N2.matrixInv()); SimpleMatrix result = c_inv.mult(a).mult(b); M.set(result.g...
[ "public", "static", "void", "undoNormalizationH", "(", "DMatrixRMaj", "M", ",", "NormalizationPoint2D", "N1", ",", "NormalizationPoint2D", "N2", ")", "{", "SimpleMatrix", "a", "=", "SimpleMatrix", ".", "wrap", "(", "M", ")", ";", "SimpleMatrix", "b", "=", "Sim...
Undoes normalization for a homography matrix.
[ "Undoes", "normalization", "for", "a", "homography", "matrix", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L203-L211
49,731
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java
HomographyDirectLinearTransform.addConicPairConstraints
protected int addConicPairConstraints( AssociatedPairConic a , AssociatedPairConic b , DMatrixRMaj A , int rowA ) { // s*C[i] = H^T*V[i]*H // C[i] = a, C[j] = b // Conic in view 1 is C and view 2 is V, e.g. x' = H*x. x' is in view 2 and x in view 1 UtilCurves_F64.convert(a.p1, C1); UtilCurves_F64.convert(a.p...
java
protected int addConicPairConstraints( AssociatedPairConic a , AssociatedPairConic b , DMatrixRMaj A , int rowA ) { // s*C[i] = H^T*V[i]*H // C[i] = a, C[j] = b // Conic in view 1 is C and view 2 is V, e.g. x' = H*x. x' is in view 2 and x in view 1 UtilCurves_F64.convert(a.p1, C1); UtilCurves_F64.convert(a.p...
[ "protected", "int", "addConicPairConstraints", "(", "AssociatedPairConic", "a", ",", "AssociatedPairConic", "b", ",", "DMatrixRMaj", "A", ",", "int", "rowA", ")", "{", "// s*C[i] = H^T*V[i]*H", "// C[i] = a, C[j] = b", "// Conic in view 1 is C and view 2 is V, e.g. x' = H*x. x...
Add constraint for a pair of conics
[ "Add", "constraint", "for", "a", "pair", "of", "conics" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L334-L371
49,732
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.initalize
protected void initalize(T input) { this.input = input; pixels.resize(input.width * input.height); initialSegments.reshape(input.width, input.height); // number of usable pixels that cluster centers can be placed in int numberOfUsable = (input.width-2*BORDER)*(input.height-2*BORDER); gridInterval = (int)Ma...
java
protected void initalize(T input) { this.input = input; pixels.resize(input.width * input.height); initialSegments.reshape(input.width, input.height); // number of usable pixels that cluster centers can be placed in int numberOfUsable = (input.width-2*BORDER)*(input.height-2*BORDER); gridInterval = (int)Ma...
[ "protected", "void", "initalize", "(", "T", "input", ")", "{", "this", ".", "input", "=", "input", ";", "pixels", ".", "resize", "(", "input", ".", "width", "*", "input", ".", "height", ")", ";", "initialSegments", ".", "reshape", "(", "input", ".", ...
prepares all data structures
[ "prepares", "all", "data", "structures" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L177-L191
49,733
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.initializeClusters
protected void initializeClusters() { int offsetX = Math.max(BORDER,((input.width-1) % gridInterval)/2); int offsetY = Math.max(BORDER,((input.height-1) % gridInterval)/2); int clusterId = 0; clusters.reset(); for( int y = offsetY; y < input.height-BORDER; y += gridInterval ) { for( int x = offsetX; x < ...
java
protected void initializeClusters() { int offsetX = Math.max(BORDER,((input.width-1) % gridInterval)/2); int offsetY = Math.max(BORDER,((input.height-1) % gridInterval)/2); int clusterId = 0; clusters.reset(); for( int y = offsetY; y < input.height-BORDER; y += gridInterval ) { for( int x = offsetX; x < ...
[ "protected", "void", "initializeClusters", "(", ")", "{", "int", "offsetX", "=", "Math", ".", "max", "(", "BORDER", ",", "(", "(", "input", ".", "width", "-", "1", ")", "%", "gridInterval", ")", "/", "2", ")", ";", "int", "offsetY", "=", "Math", "....
initialize all the clusters at regularly spaced intervals. Their locations are perturbed a bit to reduce the likelihood of a bad location. Initial color is set to the image color at the location
[ "initialize", "all", "the", "clusters", "at", "regularly", "spaced", "intervals", ".", "Their", "locations", "are", "perturbed", "a", "bit", "to", "reduce", "the", "likelihood", "of", "a", "bad", "location", ".", "Initial", "color", "is", "set", "to", "the",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L197-L215
49,734
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.perturbCenter
protected void perturbCenter( Cluster c , int x , int y ) { float best = Float.MAX_VALUE; int bestX=0,bestY=0; for( int dy = -1; dy <= 1; dy++ ) { for( int dx = -1; dx <= 1; dx++ ) { float d = gradient(x + dx, y + dy); if( d < best ) { best = d; bestX = dx; bestY = dy; } } } ...
java
protected void perturbCenter( Cluster c , int x , int y ) { float best = Float.MAX_VALUE; int bestX=0,bestY=0; for( int dy = -1; dy <= 1; dy++ ) { for( int dx = -1; dx <= 1; dx++ ) { float d = gradient(x + dx, y + dy); if( d < best ) { best = d; bestX = dx; bestY = dy; } } } ...
[ "protected", "void", "perturbCenter", "(", "Cluster", "c", ",", "int", "x", ",", "int", "y", ")", "{", "float", "best", "=", "Float", ".", "MAX_VALUE", ";", "int", "bestX", "=", "0", ",", "bestY", "=", "0", ";", "for", "(", "int", "dy", "=", "-",...
Set the cluster's center to be the pixel in a 3x3 neighborhood with the smallest gradient
[ "Set", "the", "cluster", "s", "center", "to", "be", "the", "pixel", "in", "a", "3x3", "neighborhood", "with", "the", "smallest", "gradient" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L220-L238
49,735
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.gradient
protected float gradient(int x, int y) { float dx = getIntensity(x+1,y) - getIntensity(x-1,y); float dy = getIntensity(x,y+1) - getIntensity(x,y-1); return dx*dx + dy*dy; }
java
protected float gradient(int x, int y) { float dx = getIntensity(x+1,y) - getIntensity(x-1,y); float dy = getIntensity(x,y+1) - getIntensity(x,y-1); return dx*dx + dy*dy; }
[ "protected", "float", "gradient", "(", "int", "x", ",", "int", "y", ")", "{", "float", "dx", "=", "getIntensity", "(", "x", "+", "1", ",", "y", ")", "-", "getIntensity", "(", "x", "-", "1", ",", "y", ")", ";", "float", "dy", "=", "getIntensity", ...
Computes the gradient at the specified pixel
[ "Computes", "the", "gradient", "at", "the", "specified", "pixel" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L243-L248
49,736
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.computeClusterDistance
protected void computeClusterDistance() { for( int i = 0; i < pixels.size; i++ ) { pixels.data[i].reset(); } for( int i = 0; i < clusters.size && !stopRequested; i++ ) { Cluster c = clusters.data[i]; // compute search bounds int centerX = (int)(c.x + 0.5f); int centerY = (int)(c.y + 0.5f); in...
java
protected void computeClusterDistance() { for( int i = 0; i < pixels.size; i++ ) { pixels.data[i].reset(); } for( int i = 0; i < clusters.size && !stopRequested; i++ ) { Cluster c = clusters.data[i]; // compute search bounds int centerX = (int)(c.x + 0.5f); int centerY = (int)(c.y + 0.5f); in...
[ "protected", "void", "computeClusterDistance", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pixels", ".", "size", ";", "i", "++", ")", "{", "pixels", ".", "data", "[", "i", "]", ".", "reset", "(", ")", ";", "}", "for", "(", ...
Computes how far away each cluster is from each pixel. Expectation step.
[ "Computes", "how", "far", "away", "each", "cluster", "is", "from", "each", "pixel", ".", "Expectation", "step", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L273-L308
49,737
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.updateClusters
protected void updateClusters() { for( int i = 0; i < clusters.size; i++ ) { clusters.data[i].reset(); } int indexPixel = 0; for( int y = 0; y < input.height&& !stopRequested; y++ ) { int indexInput = input.startIndex + y*input.stride; for( int x =0; x < input.width; x++ , indexPixel++ , indexInput++)...
java
protected void updateClusters() { for( int i = 0; i < clusters.size; i++ ) { clusters.data[i].reset(); } int indexPixel = 0; for( int y = 0; y < input.height&& !stopRequested; y++ ) { int indexInput = input.startIndex + y*input.stride; for( int x =0; x < input.width; x++ , indexPixel++ , indexInput++)...
[ "protected", "void", "updateClusters", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "clusters", ".", "size", ";", "i", "++", ")", "{", "clusters", ".", "data", "[", "i", "]", ".", "reset", "(", ")", ";", "}", "int", "indexPix...
Update the value of each cluster using Maximization step.
[ "Update", "the", "value", "of", "each", "cluster", "using", "Maximization", "step", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L313-L341
49,738
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java
SegmentSlic.assignLabelsToPixels
public void assignLabelsToPixels( GrayS32 pixelToRegions , GrowQueue_I32 regionMemberCount , FastQueue<float[]> regionColor ) { regionColor.reset(); for( int i = 0; i < clusters.size(); i++ ) { float[] r = regionColor.grow(); float[] c = clusters.get(i).color; for( int j = 0; j < num...
java
public void assignLabelsToPixels( GrayS32 pixelToRegions , GrowQueue_I32 regionMemberCount , FastQueue<float[]> regionColor ) { regionColor.reset(); for( int i = 0; i < clusters.size(); i++ ) { float[] r = regionColor.grow(); float[] c = clusters.get(i).color; for( int j = 0; j < num...
[ "public", "void", "assignLabelsToPixels", "(", "GrayS32", "pixelToRegions", ",", "GrowQueue_I32", "regionMemberCount", ",", "FastQueue", "<", "float", "[", "]", ">", "regionColor", ")", "{", "regionColor", ".", "reset", "(", ")", ";", "for", "(", "int", "i", ...
Selects which region each pixel belongs to based on which cluster it is the closest to
[ "Selects", "which", "region", "each", "pixel", "belongs", "to", "based", "on", "which", "cluster", "it", "is", "the", "closest", "to" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/slic/SegmentSlic.java#L346-L390
49,739
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java
RectifyFundamental.process
public void process( DMatrixRMaj F , List<AssociatedPair> observations , int width , int height ) { int centerX = width/2; int centerY = height/2; MultiViewOps.extractEpipoles(F, epipole1, epipole2); checkEpipoleInside(width, height); // compute the transform H which will send epipole2 to infinity ...
java
public void process( DMatrixRMaj F , List<AssociatedPair> observations , int width , int height ) { int centerX = width/2; int centerY = height/2; MultiViewOps.extractEpipoles(F, epipole1, epipole2); checkEpipoleInside(width, height); // compute the transform H which will send epipole2 to infinity ...
[ "public", "void", "process", "(", "DMatrixRMaj", "F", ",", "List", "<", "AssociatedPair", ">", "observations", ",", "int", "width", ",", "int", "height", ")", "{", "int", "centerX", "=", "width", "/", "2", ";", "int", "centerY", "=", "height", "/", "2"...
Compute rectification transforms for the stereo pair given a fundamental matrix and its observations. @param F Fundamental matrix @param observations Observations used to compute F @param width Width of first image. @param height Height of first image.
[ "Compute", "rectification", "transforms", "for", "the", "stereo", "pair", "given", "a", "fundamental", "matrix", "and", "its", "observations", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java#L73-L97
49,740
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java
RectifyFundamental.checkEpipoleInside
private void checkEpipoleInside(int width, int height) { double x1 = epipole1.x/epipole1.z; double y1 = epipole1.y/epipole1.z; double x2 = epipole2.x/epipole2.z; double y2 = epipole2.y/epipole2.z; if( x1 >= 0 && x1 < width && y1 >= 0 && y1 < height ) throw new IllegalArgumentException("First epipole is i...
java
private void checkEpipoleInside(int width, int height) { double x1 = epipole1.x/epipole1.z; double y1 = epipole1.y/epipole1.z; double x2 = epipole2.x/epipole2.z; double y2 = epipole2.y/epipole2.z; if( x1 >= 0 && x1 < width && y1 >= 0 && y1 < height ) throw new IllegalArgumentException("First epipole is i...
[ "private", "void", "checkEpipoleInside", "(", "int", "width", ",", "int", "height", ")", "{", "double", "x1", "=", "epipole1", ".", "x", "/", "epipole1", ".", "z", ";", "double", "y1", "=", "epipole1", ".", "y", "/", "epipole1", ".", "z", ";", "doubl...
The epipoles need to be outside the image
[ "The", "epipoles", "need", "to", "be", "outside", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java#L102-L113
49,741
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java
RectifyFundamental.translateToOrigin
private SimpleMatrix translateToOrigin( int x0 , int y0 ) { SimpleMatrix T = SimpleMatrix.identity(3); T.set(0, 2, -x0); T.set(1, 2, -y0); return T; }
java
private SimpleMatrix translateToOrigin( int x0 , int y0 ) { SimpleMatrix T = SimpleMatrix.identity(3); T.set(0, 2, -x0); T.set(1, 2, -y0); return T; }
[ "private", "SimpleMatrix", "translateToOrigin", "(", "int", "x0", ",", "int", "y0", ")", "{", "SimpleMatrix", "T", "=", "SimpleMatrix", ".", "identity", "(", "3", ")", ";", "T", ".", "set", "(", "0", ",", "2", ",", "-", "x0", ")", ";", "T", ".", ...
Create a transform which will move the specified point to the origin
[ "Create", "a", "transform", "which", "will", "move", "the", "specified", "point", "to", "the", "origin" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java#L118-L126
49,742
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java
RectifyFundamental.computeAffineH
private SimpleMatrix computeAffineH( List<AssociatedPair> observations , DMatrixRMaj H , DMatrixRMaj Hzero ) { SimpleMatrix A = new SimpleMatrix(observations.size(),3); SimpleMatrix b = new SimpleMatrix(A.numRows(),1); Point2D_F64 c = new Point2D_F64(); Point2D_F64 k = new Point2D_F64(); for( in...
java
private SimpleMatrix computeAffineH( List<AssociatedPair> observations , DMatrixRMaj H , DMatrixRMaj Hzero ) { SimpleMatrix A = new SimpleMatrix(observations.size(),3); SimpleMatrix b = new SimpleMatrix(A.numRows(),1); Point2D_F64 c = new Point2D_F64(); Point2D_F64 k = new Point2D_F64(); for( in...
[ "private", "SimpleMatrix", "computeAffineH", "(", "List", "<", "AssociatedPair", ">", "observations", ",", "DMatrixRMaj", "H", ",", "DMatrixRMaj", "Hzero", ")", "{", "SimpleMatrix", "A", "=", "new", "SimpleMatrix", "(", "observations", ".", "size", "(", ")", "...
Finds the values of a,b,c which minimize sum (a*x(+)_i + b*y(+)_i + c - x(-)_i)^2 See page 306 @return Affine transform
[ "Finds", "the", "values", "of", "a", "b", "c", "which", "minimize" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyFundamental.java#L171-L196
49,743
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.pathExampleURL
public static URL pathExampleURL( String path ) { try { File fpath = new File(path); if (fpath.isAbsolute()) return fpath.toURI().toURL(); // Assume we are running inside of the project come String pathToBase = getPathToBase(); if( pathToBase != null ) { File pathExample = new File(pathToBase, ...
java
public static URL pathExampleURL( String path ) { try { File fpath = new File(path); if (fpath.isAbsolute()) return fpath.toURI().toURL(); // Assume we are running inside of the project come String pathToBase = getPathToBase(); if( pathToBase != null ) { File pathExample = new File(pathToBase, ...
[ "public", "static", "URL", "pathExampleURL", "(", "String", "path", ")", "{", "try", "{", "File", "fpath", "=", "new", "File", "(", "path", ")", ";", "if", "(", "fpath", ".", "isAbsolute", "(", ")", ")", "return", "fpath", ".", "toURI", "(", ")", "...
Returns an absolute path to the file that is relative to the example directory @param path File path relative to root directory @return Absolute path to file
[ "Returns", "an", "absolute", "path", "to", "the", "file", "that", "is", "relative", "to", "the", "example", "directory" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L44-L81
49,744
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.ensureURL
public static URL ensureURL(String path ) { path = systemToUnix(path); URL url; try { url = new URL(path); if( url.getProtocol().equals("jar")) { return simplifyJarPath(url); } } catch (MalformedURLException e) { // might just be a file reference. try { url = new File(path).toURI().toURL(...
java
public static URL ensureURL(String path ) { path = systemToUnix(path); URL url; try { url = new URL(path); if( url.getProtocol().equals("jar")) { return simplifyJarPath(url); } } catch (MalformedURLException e) { // might just be a file reference. try { url = new File(path).toURI().toURL(...
[ "public", "static", "URL", "ensureURL", "(", "String", "path", ")", "{", "path", "=", "systemToUnix", "(", "path", ")", ";", "URL", "url", ";", "try", "{", "url", "=", "new", "URL", "(", "path", ")", ";", "if", "(", "url", ".", "getProtocol", "(", ...
Given a path which may or may not be a URL return a URL
[ "Given", "a", "path", "which", "may", "or", "may", "not", "be", "a", "URL", "return", "a", "URL" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L93-L110
49,745
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.simplifyJarPath
public static URL simplifyJarPath( URL url ) { try { String segments[] = url.toString().split(".jar!/"); String path = simplifyJarPath(segments[1]); return new URL(segments[0]+".jar!/"+path); } catch (IOException e) { return url; } }
java
public static URL simplifyJarPath( URL url ) { try { String segments[] = url.toString().split(".jar!/"); String path = simplifyJarPath(segments[1]); return new URL(segments[0]+".jar!/"+path); } catch (IOException e) { return url; } }
[ "public", "static", "URL", "simplifyJarPath", "(", "URL", "url", ")", "{", "try", "{", "String", "segments", "[", "]", "=", "url", ".", "toString", "(", ")", ".", "split", "(", "\".jar!/\"", ")", ";", "String", "path", "=", "simplifyJarPath", "(", "seg...
Jar paths don't work if they include up directory. this wills trip those out.
[ "Jar", "paths", "don", "t", "work", "if", "they", "include", "up", "directory", ".", "this", "wills", "trip", "those", "out", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L115-L123
49,746
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.path
public static String path( String path ) { String pathToBase = getPathToBase(); if( pathToBase == null ) return path; return new File(pathToBase,path).getAbsolutePath(); }
java
public static String path( String path ) { String pathToBase = getPathToBase(); if( pathToBase == null ) return path; return new File(pathToBase,path).getAbsolutePath(); }
[ "public", "static", "String", "path", "(", "String", "path", ")", "{", "String", "pathToBase", "=", "getPathToBase", "(", ")", ";", "if", "(", "pathToBase", "==", "null", ")", "return", "path", ";", "return", "new", "File", "(", "pathToBase", ",", "path"...
Searches for the root BoofCV directory and returns an absolute path from it. @param path File path relative to root directory @return Absolute path to file
[ "Searches", "for", "the", "root", "BoofCV", "directory", "and", "returns", "an", "absolute", "path", "from", "it", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L194-L199
49,747
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.getPathToBase
public static String getPathToBase() { String path = new File(".").getAbsoluteFile().getParent(); while( path != null ) { File f = new File(path); if( !f.exists() ) break; String[] files = f.list(); if( files == null ) break; boolean foundMain = false; boolean foundExamples = false; ...
java
public static String getPathToBase() { String path = new File(".").getAbsoluteFile().getParent(); while( path != null ) { File f = new File(path); if( !f.exists() ) break; String[] files = f.list(); if( files == null ) break; boolean foundMain = false; boolean foundExamples = false; ...
[ "public", "static", "String", "getPathToBase", "(", ")", "{", "String", "path", "=", "new", "File", "(", "\".\"", ")", ".", "getAbsoluteFile", "(", ")", ".", "getParent", "(", ")", ";", "while", "(", "path", "!=", "null", ")", "{", "File", "f", "=", ...
Steps back until it finds the base BoofCV directory. @return Path to the base directory.
[ "Steps", "back", "until", "it", "finds", "the", "base", "BoofCV", "directory", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L210-L241
49,748
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.selectFile
public static String selectFile(boolean exitOnCancel) { String fileName = null; JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { fileName = fc.getSelectedFile().getAbsolutePath(); } else if (exitOnCancel) { System.exit(0); ...
java
public static String selectFile(boolean exitOnCancel) { String fileName = null; JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { fileName = fc.getSelectedFile().getAbsolutePath(); } else if (exitOnCancel) { System.exit(0); ...
[ "public", "static", "String", "selectFile", "(", "boolean", "exitOnCancel", ")", "{", "String", "fileName", "=", "null", ";", "JFileChooser", "fc", "=", "new", "JFileChooser", "(", ")", ";", "int", "returnVal", "=", "fc", ".", "showOpenDialog", "(", "null", ...
Opens up a dialog box asking the user to select a file. If the user cancels it either returns null or quits the program. @param exitOnCancel If it should quit on cancel or not. @return Name of the selected file or null if nothing was selected.
[ "Opens", "up", "a", "dialog", "box", "asking", "the", "user", "to", "select", "a", "file", ".", "If", "the", "user", "cancels", "it", "either", "returns", "null", "or", "quits", "the", "program", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L250-L263
49,749
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.listByPrefix
public static List<String> listByPrefix(String directory, String prefix, String suffix) { List<String> ret = new ArrayList<>(); File d = new File(directory); if( !d.isDirectory() ) { try { URL url = new URL(directory); if( url.getProtocol().equals("file")) { d = new File(url.getFile()); } el...
java
public static List<String> listByPrefix(String directory, String prefix, String suffix) { List<String> ret = new ArrayList<>(); File d = new File(directory); if( !d.isDirectory() ) { try { URL url = new URL(directory); if( url.getProtocol().equals("file")) { d = new File(url.getFile()); } el...
[ "public", "static", "List", "<", "String", ">", "listByPrefix", "(", "String", "directory", ",", "String", "prefix", ",", "String", "suffix", ")", "{", "List", "<", "String", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "File", "d", "=", ...
Loads a list of files with the specified prefix. @param directory Directory it looks inside of @param prefix Prefix that the file must have @param suffix @return List of files that are in the directory and match the prefix.
[ "Loads", "a", "list", "of", "files", "with", "the", "specified", "prefix", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L506-L538
49,750
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/UtilIO.java
UtilIO.listAllMime
public static List<String> listAllMime( String directory , String type ) { List<String> ret = new ArrayList<>(); try { // see if it's a URL or not URL url = new URL(directory); if( url.getProtocol().equals("file") ) { directory = url.getFile(); } else if( url.getProtocol().equals("jar") ) { ret...
java
public static List<String> listAllMime( String directory , String type ) { List<String> ret = new ArrayList<>(); try { // see if it's a URL or not URL url = new URL(directory); if( url.getProtocol().equals("file") ) { directory = url.getFile(); } else if( url.getProtocol().equals("jar") ) { ret...
[ "public", "static", "List", "<", "String", ">", "listAllMime", "(", "String", "directory", ",", "String", "type", ")", "{", "List", "<", "String", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "// see if it's a URL or not", "URL", ...
Lists all files in the directory with an MIME type that contains the string "type"
[ "Lists", "all", "files", "in", "the", "directory", "with", "an", "MIME", "type", "that", "contains", "the", "string", "type" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L608-L646
49,751
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/SelectOverheadParameters.java
SelectOverheadParameters.process
public boolean process(CameraPinholeBrown intrinsic , Se3_F64 planeToCamera ) { proj.setPlaneToCamera(planeToCamera,true); proj.setIntrinsic(intrinsic); // find a bounding rectangle on the ground which is visible to the camera and at a high enough resolution double x0 = Double.MAX_VALUE; double y0 = Double....
java
public boolean process(CameraPinholeBrown intrinsic , Se3_F64 planeToCamera ) { proj.setPlaneToCamera(planeToCamera,true); proj.setIntrinsic(intrinsic); // find a bounding rectangle on the ground which is visible to the camera and at a high enough resolution double x0 = Double.MAX_VALUE; double y0 = Double....
[ "public", "boolean", "process", "(", "CameraPinholeBrown", "intrinsic", ",", "Se3_F64", "planeToCamera", ")", "{", "proj", ".", "setPlaneToCamera", "(", "planeToCamera", ",", "true", ")", ";", "proj", ".", "setIntrinsic", "(", "intrinsic", ")", ";", "// find a b...
Computes the view's characteristics @param intrinsic Intrinsic camera parameters @param planeToCamera Extrinsic camera parameters which specify the plane @return true if successful or false if it failed
[ "Computes", "the", "view", "s", "characteristics" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/SelectOverheadParameters.java#L81-L120
49,752
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/SelectOverheadParameters.java
SelectOverheadParameters.createOverhead
public <T extends ImageBase<T>> OverheadView createOverhead( ImageType<T> imageType ) { OverheadView ret = new OverheadView(); ret.image = imageType.createImage(overheadWidth,overheadHeight); ret.cellSize = cellSize; ret.centerX = centerX; ret.centerY = centerY; return ret; }
java
public <T extends ImageBase<T>> OverheadView createOverhead( ImageType<T> imageType ) { OverheadView ret = new OverheadView(); ret.image = imageType.createImage(overheadWidth,overheadHeight); ret.cellSize = cellSize; ret.centerX = centerX; ret.centerY = centerY; return ret; }
[ "public", "<", "T", "extends", "ImageBase", "<", "T", ">", ">", "OverheadView", "createOverhead", "(", "ImageType", "<", "T", ">", "imageType", ")", "{", "OverheadView", "ret", "=", "new", "OverheadView", "(", ")", ";", "ret", ".", "image", "=", "imageTy...
Creates a new instance of the overhead view
[ "Creates", "a", "new", "instance", "of", "the", "overhead", "view" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/SelectOverheadParameters.java#L125-L133
49,753
lessthanoptimal/BoofCV
integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java
StreamOpenKinectRgbDepth.start
public void start( Device device , Resolution resolution , Listener listener ) { if( resolution != Resolution.MEDIUM ) { throw new IllegalArgumentException("Depth image is always at medium resolution. Possible bug in kinect driver"); } this.device = device; this.listener = listener; // Configure the ki...
java
public void start( Device device , Resolution resolution , Listener listener ) { if( resolution != Resolution.MEDIUM ) { throw new IllegalArgumentException("Depth image is always at medium resolution. Possible bug in kinect driver"); } this.device = device; this.listener = listener; // Configure the ki...
[ "public", "void", "start", "(", "Device", "device", ",", "Resolution", "resolution", ",", "Listener", "listener", ")", "{", "if", "(", "resolution", "!=", "Resolution", ".", "MEDIUM", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Depth image is a...
Adds listeners to the device and sets its resolutions. @param device Kinect device @param resolution Resolution that images are being processed at. Must be medium for now @param listener Listener for data
[ "Adds", "listeners", "to", "the", "device", "and", "sets", "its", "resolutions", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java#L66-L108
49,754
lessthanoptimal/BoofCV
integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java
StreamOpenKinectRgbDepth.stop
public void stop() { thread.requestStop = true; long start = System.currentTimeMillis()+timeout; while( start > System.currentTimeMillis() && thread.running ) Thread.yield(); device.stopDepth(); device.stopVideo(); device.close(); }
java
public void stop() { thread.requestStop = true; long start = System.currentTimeMillis()+timeout; while( start > System.currentTimeMillis() && thread.running ) Thread.yield(); device.stopDepth(); device.stopVideo(); device.close(); }
[ "public", "void", "stop", "(", ")", "{", "thread", ".", "requestStop", "=", "true", ";", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", "+", "timeout", ";", "while", "(", "start", ">", "System", ".", "currentTimeMillis", "(", ")", ...
Stops all the threads from running and closes the video channels and video device
[ "Stops", "all", "the", "threads", "from", "running", "and", "closes", "the", "video", "channels", "and", "video", "device" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java#L113-L122
49,755
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java
RefineDualQuadraticAlgebra.refine
public boolean refine(List<CameraPinhole> calibration , DMatrix4x4 Q ) { if( calibration.size() != cameras.size ) throw new RuntimeException("Calibration and cameras do not match"); computeNumberOfCalibrationParameters(); func = new ResidualK(); if( func.getNumOfInputsN() > 6*calibration.size() ) throw ...
java
public boolean refine(List<CameraPinhole> calibration , DMatrix4x4 Q ) { if( calibration.size() != cameras.size ) throw new RuntimeException("Calibration and cameras do not match"); computeNumberOfCalibrationParameters(); func = new ResidualK(); if( func.getNumOfInputsN() > 6*calibration.size() ) throw ...
[ "public", "boolean", "refine", "(", "List", "<", "CameraPinhole", ">", "calibration", ",", "DMatrix4x4", "Q", ")", "{", "if", "(", "calibration", ".", "size", "(", ")", "!=", "cameras", ".", "size", ")", "throw", "new", "RuntimeException", "(", "\"Calibrat...
Refine calibration matrix K given the dual absolute quadratic Q. @param calibration (Input) Initial estimates of K. (Output) Refined estimate. @param Q (Input) Initial estimate of absolute quadratic (Output) refined estimate.
[ "Refine", "calibration", "matrix", "K", "given", "the", "dual", "absolute", "quadratic", "Q", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L99-L135
49,756
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java
RefineDualQuadraticAlgebra.recomputeQ
void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) { Equation eq = new Equation(); DMatrix3x3 K = new DMatrix3x3(); encodeK(K,0,3,param.data); eq.alias(p,"p",K,"K"); eq.process("w=K*K'"); eq.process("Q=[w , -w*p;-p'*w , p'*w*p]"); DMatrixRMaj _Q = eq.lookupDDRM("Q"); CommonOps_DDRM.divide(_Q, NormOps_DDRM....
java
void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) { Equation eq = new Equation(); DMatrix3x3 K = new DMatrix3x3(); encodeK(K,0,3,param.data); eq.alias(p,"p",K,"K"); eq.process("w=K*K'"); eq.process("Q=[w , -w*p;-p'*w , p'*w*p]"); DMatrixRMaj _Q = eq.lookupDDRM("Q"); CommonOps_DDRM.divide(_Q, NormOps_DDRM....
[ "void", "recomputeQ", "(", "DMatrixRMaj", "p", ",", "DMatrix4x4", "Q", ")", "{", "Equation", "eq", "=", "new", "Equation", "(", ")", ";", "DMatrix3x3", "K", "=", "new", "DMatrix3x3", "(", ")", ";", "encodeK", "(", "K", ",", "0", ",", "3", ",", "par...
Compuets the absolute dual quadratic from the first camera parameters and plane at infinity @param p plane at infinity @param Q (Output) ABQ
[ "Compuets", "the", "absolute", "dual", "quadratic", "from", "the", "first", "camera", "parameters", "and", "plane", "at", "infinity" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L155-L165
49,757
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java
RefineDualQuadraticAlgebra.encodeK
public int encodeK( DMatrix3x3 K , int which, int offset, double params[] ) { if( fixedAspectRatio ) { K.a11 = params[offset++]; K.a22 = aspect.data[which]*K.a11; } else { K.a11 = params[offset++]; K.a22 = params[offset++]; } if( !zeroSkew ) { K.a12 = params[offset++]; } if( !zeroPrinciple...
java
public int encodeK( DMatrix3x3 K , int which, int offset, double params[] ) { if( fixedAspectRatio ) { K.a11 = params[offset++]; K.a22 = aspect.data[which]*K.a11; } else { K.a11 = params[offset++]; K.a22 = params[offset++]; } if( !zeroSkew ) { K.a12 = params[offset++]; } if( !zeroPrinciple...
[ "public", "int", "encodeK", "(", "DMatrix3x3", "K", ",", "int", "which", ",", "int", "offset", ",", "double", "params", "[", "]", ")", "{", "if", "(", "fixedAspectRatio", ")", "{", "K", ".", "a11", "=", "params", "[", "offset", "++", "]", ";", "K",...
Encode the calibration as a 3x3 matrix. K is assumed to zero initially or at least all non-zero elements will align with values that are written to.
[ "Encode", "the", "calibration", "as", "a", "3x3", "matrix", ".", "K", "is", "assumed", "to", "zero", "initially", "or", "at", "least", "all", "non", "-", "zero", "elements", "will", "align", "with", "values", "that", "are", "written", "to", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L230-L250
49,758
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java
RegionMergeTree.initializeMerge
public void initializeMerge(int numRegions) { mergeList.resize(numRegions); for( int i = 0; i < numRegions; i++ ) mergeList.data[i] = i; }
java
public void initializeMerge(int numRegions) { mergeList.resize(numRegions); for( int i = 0; i < numRegions; i++ ) mergeList.data[i] = i; }
[ "public", "void", "initializeMerge", "(", "int", "numRegions", ")", "{", "mergeList", ".", "resize", "(", "numRegions", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numRegions", ";", "i", "++", ")", "mergeList", ".", "data", "[", "i", ...
Must call before any other functions. @param numRegions Total number of regions.
[ "Must", "call", "before", "any", "other", "functions", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L57-L61
49,759
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java
RegionMergeTree.performMerge
public void performMerge( GrayS32 pixelToRegion , GrowQueue_I32 regionMemberCount ) { // update member counts flowIntoRootNode(regionMemberCount); // re-assign the number of the root node and trim excessive nodes from the lists setToRootNodeNewID(regionMemberCount); // change the labels in the pixe...
java
public void performMerge( GrayS32 pixelToRegion , GrowQueue_I32 regionMemberCount ) { // update member counts flowIntoRootNode(regionMemberCount); // re-assign the number of the root node and trim excessive nodes from the lists setToRootNodeNewID(regionMemberCount); // change the labels in the pixe...
[ "public", "void", "performMerge", "(", "GrayS32", "pixelToRegion", ",", "GrowQueue_I32", "regionMemberCount", ")", "{", "// update member counts", "flowIntoRootNode", "(", "regionMemberCount", ")", ";", "// re-assign the number of the root node and trim excessive nodes from the lis...
Merges regions together and updates the provided data structures for said changes. @param pixelToRegion (Input/Output) Image used to convert pixel location in region ID. Modified. @param regionMemberCount (Input/Output) List containing how many pixels belong to each region. Modified.
[ "Merges", "regions", "together", "and", "updates", "the", "provided", "data", "structures", "for", "said", "changes", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L69-L79
49,760
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java
RegionMergeTree.flowIntoRootNode
protected void flowIntoRootNode(GrowQueue_I32 regionMemberCount) { rootID.resize(regionMemberCount.size); int count = 0; for( int i = 0; i < mergeList.size; i++ ) { int p = mergeList.data[i]; // see if it is a root note if( p == i ) { // mark the root nodes new ID rootID.data[i] = count++; ...
java
protected void flowIntoRootNode(GrowQueue_I32 regionMemberCount) { rootID.resize(regionMemberCount.size); int count = 0; for( int i = 0; i < mergeList.size; i++ ) { int p = mergeList.data[i]; // see if it is a root note if( p == i ) { // mark the root nodes new ID rootID.data[i] = count++; ...
[ "protected", "void", "flowIntoRootNode", "(", "GrowQueue_I32", "regionMemberCount", ")", "{", "rootID", ".", "resize", "(", "regionMemberCount", ".", "size", ")", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "merge...
For each region in the merge list which is not a root node, find its root node and add to the root node its member count and set the index in mergeList to the root node. If a node is a root node just note what its new ID will be after all the other segments are removed.
[ "For", "each", "region", "in", "the", "merge", "list", "which", "is", "not", "a", "root", "node", "find", "its", "root", "node", "and", "add", "to", "the", "root", "node", "its", "member", "count", "and", "set", "the", "index", "in", "mergeList", "to",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L86-L111
49,761
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java
RegionMergeTree.setToRootNodeNewID
protected void setToRootNodeNewID( GrowQueue_I32 regionMemberCount ) { tmpMemberCount.reset(); for( int i = 0; i < mergeList.size; i++ ) { int p = mergeList.data[i]; if( p == i ) { mergeList.data[i] = rootID.data[i]; tmpMemberCount.add( regionMemberCount.data[i] ); } else { mergeList.data[i]...
java
protected void setToRootNodeNewID( GrowQueue_I32 regionMemberCount ) { tmpMemberCount.reset(); for( int i = 0; i < mergeList.size; i++ ) { int p = mergeList.data[i]; if( p == i ) { mergeList.data[i] = rootID.data[i]; tmpMemberCount.add( regionMemberCount.data[i] ); } else { mergeList.data[i]...
[ "protected", "void", "setToRootNodeNewID", "(", "GrowQueue_I32", "regionMemberCount", ")", "{", "tmpMemberCount", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mergeList", ".", "size", ";", "i", "++", ")", "{", "int", "...
Does much of the work needed to remove the redundant segments that are being merged into their root node. The list of member count is updated. mergeList is updated with the new segment IDs.
[ "Does", "much", "of", "the", "work", "needed", "to", "remove", "the", "redundant", "segments", "that", "are", "being", "merged", "into", "their", "root", "node", ".", "The", "list", "of", "member", "count", "is", "updated", ".", "mergeList", "is", "updated...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/RegionMergeTree.java#L117-L134
49,762
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java
FactoryMultiView.homographyRefine
public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) { ModelObservationResidualN residuals; switch( type ) { case SIMPLE: residuals = new HomographyResidualTransfer(); break; case SAMPSON: residuals = new HomographyResidualSampson(); break; d...
java
public static RefineEpipolar homographyRefine(double tol , int maxIterations , EpipolarError type ) { ModelObservationResidualN residuals; switch( type ) { case SIMPLE: residuals = new HomographyResidualTransfer(); break; case SAMPSON: residuals = new HomographyResidualSampson(); break; d...
[ "public", "static", "RefineEpipolar", "homographyRefine", "(", "double", "tol", ",", "int", "maxIterations", ",", "EpipolarError", "type", ")", "{", "ModelObservationResidualN", "residuals", ";", "switch", "(", "type", ")", "{", "case", "SIMPLE", ":", "residuals",...
Creates a non-linear optimizer for refining estimates of homography matrices. @see HomographyResidualSampson @see HomographyResidualTransfer @param tol Tolerance for convergence. Try 1e-8 @param maxIterations Maximum number of iterations it will perform. Try 100 or more. @return Homography refinement
[ "Creates", "a", "non", "-", "linear", "optimizer", "for", "refining", "estimates", "of", "homography", "matrices", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L211-L227
49,763
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java
FactoryMultiView.fundamentalRefine
public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type ) { switch( type ) { case SAMPSON: return new LeastSquaresFundamental(tol,maxIterations,true); case SIMPLE: return new LeastSquaresFundamental(tol,maxIterations,false); } throw new IllegalArgumentExc...
java
public static RefineEpipolar fundamentalRefine(double tol , int maxIterations , EpipolarError type ) { switch( type ) { case SAMPSON: return new LeastSquaresFundamental(tol,maxIterations,true); case SIMPLE: return new LeastSquaresFundamental(tol,maxIterations,false); } throw new IllegalArgumentExc...
[ "public", "static", "RefineEpipolar", "fundamentalRefine", "(", "double", "tol", ",", "int", "maxIterations", ",", "EpipolarError", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "SAMPSON", ":", "return", "new", "LeastSquaresFundamental", "(", "tol",...
Creates a non-linear optimizer for refining estimates of fundamental or essential matrices. @see boofcv.alg.geo.f.FundamentalResidualSampson @see boofcv.alg.geo.f.FundamentalResidualSimple @param tol Tolerance for convergence. Try 1e-8 @param maxIterations Maximum number of iterations it will perform. Try 100 or mo...
[ "Creates", "a", "non", "-", "linear", "optimizer", "for", "refining", "estimates", "of", "fundamental", "or", "essential", "matrices", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L370-L380
49,764
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java
FactoryMultiView.pnp_N
public static EstimateNofPnP pnp_N(EnumPNP which , int numIterations ) { MotionTransformPoint<Se3_F64, Point3D_F64> motionFit = FitSpecialEuclideanOps_F64.fitPoints3D(); switch( which ) { case P3P_GRUNERT: P3PGrunert grunert = new P3PGrunert(PolynomialOps.createRootFinder(5, RootFinderType.STURM)); ret...
java
public static EstimateNofPnP pnp_N(EnumPNP which , int numIterations ) { MotionTransformPoint<Se3_F64, Point3D_F64> motionFit = FitSpecialEuclideanOps_F64.fitPoints3D(); switch( which ) { case P3P_GRUNERT: P3PGrunert grunert = new P3PGrunert(PolynomialOps.createRootFinder(5, RootFinderType.STURM)); ret...
[ "public", "static", "EstimateNofPnP", "pnp_N", "(", "EnumPNP", "which", ",", "int", "numIterations", ")", "{", "MotionTransformPoint", "<", "Se3_F64", ",", "Point3D_F64", ">", "motionFit", "=", "FitSpecialEuclideanOps_F64", ".", "fitPoints3D", "(", ")", ";", "swit...
Creates an estimator for the PnP problem that uses only three observations, which is the minimal case and known as P3P. <p>NOTE: Observations are in normalized image coordinates NOT pixels.</p> @param which The algorithm which is to be returned. @param numIterations Number of iterations. Only used by some algorithms ...
[ "Creates", "an", "estimator", "for", "the", "PnP", "problem", "that", "uses", "only", "three", "observations", "which", "is", "the", "minimal", "case", "and", "known", "as", "P3P", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L440-L463
49,765
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java
FactoryMultiView.pnp_1
public static Estimate1ofPnP pnp_1(EnumPNP which, int numIterations , int numTest) { if( which == EnumPNP.EPNP ) { PnPLepetitEPnP alg = new PnPLepetitEPnP(0.1); alg.setNumIterations(numIterations); return new WrapPnPLepetitEPnP(alg); } else if( which == EnumPNP.IPPE ) { Estimate1ofEpipolar H = FactoryM...
java
public static Estimate1ofPnP pnp_1(EnumPNP which, int numIterations , int numTest) { if( which == EnumPNP.EPNP ) { PnPLepetitEPnP alg = new PnPLepetitEPnP(0.1); alg.setNumIterations(numIterations); return new WrapPnPLepetitEPnP(alg); } else if( which == EnumPNP.IPPE ) { Estimate1ofEpipolar H = FactoryM...
[ "public", "static", "Estimate1ofPnP", "pnp_1", "(", "EnumPNP", "which", ",", "int", "numIterations", ",", "int", "numTest", ")", "{", "if", "(", "which", "==", "EnumPNP", ".", "EPNP", ")", "{", "PnPLepetitEPnP", "alg", "=", "new", "PnPLepetitEPnP", "(", "0...
Created an estimator for the P3P problem that selects a single solution by considering additional observations. <p>NOTE: Observations are in normalized image coordinates NOT pixels.</p> <p> NOTE: EPnP has several tuning parameters and the defaults here might not be the best for your situation. Use {@link #computePnPw...
[ "Created", "an", "estimator", "for", "the", "P3P", "problem", "that", "selects", "a", "single", "solution", "by", "considering", "additional", "observations", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L483-L497
49,766
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java
FactoryMultiView.computePnPwithEPnP
public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) { PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber); alg.setNumIterations(numIterations); return new WrapPnPLepetitEPnP(alg); }
java
public static Estimate1ofPnP computePnPwithEPnP(int numIterations, double magicNumber) { PnPLepetitEPnP alg = new PnPLepetitEPnP(magicNumber); alg.setNumIterations(numIterations); return new WrapPnPLepetitEPnP(alg); }
[ "public", "static", "Estimate1ofPnP", "computePnPwithEPnP", "(", "int", "numIterations", ",", "double", "magicNumber", ")", "{", "PnPLepetitEPnP", "alg", "=", "new", "PnPLepetitEPnP", "(", "magicNumber", ")", ";", "alg", ".", "setNumIterations", "(", "numIterations"...
Returns a solution to the PnP problem for 4 or more points using EPnP. Fast and fairly accurate algorithm. Can handle general and planar scenario automatically. <p>NOTE: Observations are in normalized image coordinates NOT pixels.</p> @see PnPLepetitEPnP @param numIterations If more then zero then non-linear optimi...
[ "Returns", "a", "solution", "to", "the", "PnP", "problem", "for", "4", "or", "more", "points", "using", "EPnP", ".", "Fast", "and", "fairly", "accurate", "algorithm", ".", "Can", "handle", "general", "and", "planar", "scenario", "automatically", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L511-L515
49,767
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerable.java
FactorySteerable.gaussian
public static <K extends Kernel2D> SteerableKernel<K> gaussian(Class<K> kernelType, int orderX, int orderY, double sigma, int radius) { if( orderX < 0 || orderX > 4 ) throw new IllegalArgumentException("derivX must be from 0 to 4 inclusive."); if( orderY < 0 || orderY > 4 ) throw new IllegalArgumentException(...
java
public static <K extends Kernel2D> SteerableKernel<K> gaussian(Class<K> kernelType, int orderX, int orderY, double sigma, int radius) { if( orderX < 0 || orderX > 4 ) throw new IllegalArgumentException("derivX must be from 0 to 4 inclusive."); if( orderY < 0 || orderY > 4 ) throw new IllegalArgumentException(...
[ "public", "static", "<", "K", "extends", "Kernel2D", ">", "SteerableKernel", "<", "K", ">", "gaussian", "(", "Class", "<", "K", ">", "kernelType", ",", "int", "orderX", ",", "int", "orderY", ",", "double", "sigma", ",", "int", "radius", ")", "{", "if",...
Steerable filter for 2D Gaussian derivatives. The basis is composed of a set of rotated kernels. @param kernelType Specifies which type of 2D kernel should be generated. @param orderX Order of the derivative in the x-axis. @param orderY Order of the derivative in the y-axis. @param sigma @param radius Radius of the ...
[ "Steerable", "filter", "for", "2D", "Gaussian", "derivatives", ".", "The", "basis", "is", "composed", "of", "a", "set", "of", "rotated", "kernels", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerable.java#L54-L107
49,768
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java
WatershedVincentSoille1991.process
public void process( GrayU8 input ) { // input = im_0 removedWatersheds = false; output.reshape(input.width+2,input.height+2); distance.reshape(input.width+2,input.height+2); ImageMiscOps.fill(output, INIT); ImageMiscOps.fill(distance, 0); fifo.reset(); // sort pixels sortPixels(input); currentL...
java
public void process( GrayU8 input ) { // input = im_0 removedWatersheds = false; output.reshape(input.width+2,input.height+2); distance.reshape(input.width+2,input.height+2); ImageMiscOps.fill(output, INIT); ImageMiscOps.fill(distance, 0); fifo.reset(); // sort pixels sortPixels(input); currentL...
[ "public", "void", "process", "(", "GrayU8", "input", ")", "{", "// input = im_0", "removedWatersheds", "=", "false", ";", "output", ".", "reshape", "(", "input", ".", "width", "+", "2", ",", "input", ".", "height", "+", "2", ")", ";", "distance", ".", ...
Perform watershed segmentation on the provided input image. New basins are created at each local minima. @param input Input gray-scale image.
[ "Perform", "watershed", "segmentation", "on", "the", "provided", "input", "image", ".", "New", "basins", "are", "created", "at", "each", "local", "minima", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java#L119-L189
49,769
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java
WatershedVincentSoille1991.sortPixels
protected void sortPixels(GrayU8 input) { // initialize histogram for( int i = 0; i < histogram.length; i++ ) { histogram[i].reset(); } // sort by creating a histogram for( int y = 0; y < input.height; y++ ) { int index = input.startIndex + y*input.stride; int indexOut = (y+1)*output.stride + 1; f...
java
protected void sortPixels(GrayU8 input) { // initialize histogram for( int i = 0; i < histogram.length; i++ ) { histogram[i].reset(); } // sort by creating a histogram for( int y = 0; y < input.height; y++ ) { int index = input.startIndex + y*input.stride; int indexOut = (y+1)*output.stride + 1; f...
[ "protected", "void", "sortPixels", "(", "GrayU8", "input", ")", "{", "// initialize histogram", "for", "(", "int", "i", "=", "0", ";", "i", "<", "histogram", ".", "length", ";", "i", "++", ")", "{", "histogram", "[", "i", "]", ".", "reset", "(", ")",...
Very fast histogram based sorting. Index of each pixel is placed inside a list for its intensity level.
[ "Very", "fast", "histogram", "based", "sorting", ".", "Index", "of", "each", "pixel", "is", "placed", "inside", "a", "list", "for", "its", "intensity", "level", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/watershed/WatershedVincentSoille1991.java#L341-L355
49,770
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java
BoofMiscOps.numDigits
public static int numDigits(int number) { if( number == 0 ) return 1; int adjustment = 0; if( number < 0 ) { adjustment = 1; number = -number; } return adjustment + (int)Math.log10(number)+1; }
java
public static int numDigits(int number) { if( number == 0 ) return 1; int adjustment = 0; if( number < 0 ) { adjustment = 1; number = -number; } return adjustment + (int)Math.log10(number)+1; }
[ "public", "static", "int", "numDigits", "(", "int", "number", ")", "{", "if", "(", "number", "==", "0", ")", "return", "1", ";", "int", "adjustment", "=", "0", ";", "if", "(", "number", "<", "0", ")", "{", "adjustment", "=", "1", ";", "number", "...
Returns the number of digits in a number. E.g. 345 = 3, -345 = 4, 0 = 1
[ "Returns", "the", "number", "of", "digits", "in", "a", "number", ".", "E", ".", "g", ".", "345", "=", "3", "-", "345", "=", "4", "0", "=", "1" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L49-L58
49,771
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java
BoofMiscOps.boundRectangleInside
public static void boundRectangleInside( ImageBase b , ImageRectangle r ) { if( r.x0 < 0 ) r.x0 = 0; if( r.x1 > b.width ) r.x1 = b.width; if( r.y0 < 0 ) r.y0 = 0; if( r.y1 > b.height ) r.y1 = b.height; }
java
public static void boundRectangleInside( ImageBase b , ImageRectangle r ) { if( r.x0 < 0 ) r.x0 = 0; if( r.x1 > b.width ) r.x1 = b.width; if( r.y0 < 0 ) r.y0 = 0; if( r.y1 > b.height ) r.y1 = b.height; }
[ "public", "static", "void", "boundRectangleInside", "(", "ImageBase", "b", ",", "ImageRectangle", "r", ")", "{", "if", "(", "r", ".", "x0", "<", "0", ")", "r", ".", "x0", "=", "0", ";", "if", "(", "r", ".", "x1", ">", "b", ".", "width", ")", "r...
Bounds the provided rectangle to be inside the image. @param b An image. @param r Rectangle
[ "Bounds", "the", "provided", "rectangle", "to", "be", "inside", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L149-L160
49,772
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java
BoofMiscOps.checkInside
public static boolean checkInside(ImageBase b, int x , int y , int radius ) { if( x-radius < 0 ) return false; if( x+radius >= b.width ) return false; if( y-radius < 0 ) return false; if( y+radius >= b.height ) return false; return true; }
java
public static boolean checkInside(ImageBase b, int x , int y , int radius ) { if( x-radius < 0 ) return false; if( x+radius >= b.width ) return false; if( y-radius < 0 ) return false; if( y+radius >= b.height ) return false; return true; }
[ "public", "static", "boolean", "checkInside", "(", "ImageBase", "b", ",", "int", "x", ",", "int", "y", ",", "int", "radius", ")", "{", "if", "(", "x", "-", "radius", "<", "0", ")", "return", "false", ";", "if", "(", "x", "+", "radius", ">=", "b",...
Returns true if the point is contained inside the image and 'radius' away from the image border. @param b Image @param x x-coordinate of point @param y y-coordinate of point @param radius How many pixels away from the border it needs to be to be considered inside @return true if the point is inside and false if it is ...
[ "Returns", "true", "if", "the", "point", "is", "contained", "inside", "the", "image", "and", "radius", "away", "from", "the", "image", "border", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L184-L195
49,773
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java
BoofMiscOps.pause
public static void pause(long milli) { final Thread t = Thread.currentThread(); long start = System.currentTimeMillis(); while( System.currentTimeMillis() - start < milli ) { synchronized( t ) { try { long target = milli - (System.currentTimeMillis() - start); if( target > 0 ) t.wait(targe...
java
public static void pause(long milli) { final Thread t = Thread.currentThread(); long start = System.currentTimeMillis(); while( System.currentTimeMillis() - start < milli ) { synchronized( t ) { try { long target = milli - (System.currentTimeMillis() - start); if( target > 0 ) t.wait(targe...
[ "public", "static", "void", "pause", "(", "long", "milli", ")", "{", "final", "Thread", "t", "=", "Thread", ".", "currentThread", "(", ")", ";", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "while", "(", "System", ".", "curr...
Invokes wait until the elapsed time has passed. In the thread is interrupted, the interrupt is ignored. @param milli Length of desired pause in milliseconds.
[ "Invokes", "wait", "until", "the", "elapsed", "time", "has", "passed", ".", "In", "the", "thread", "is", "interrupted", "the", "interrupt", "is", "ignored", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/misc/BoofMiscOps.java#L300-L313
49,774
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/FiducialDetection.java
FiducialDetection.processStream
private void processStream(CameraPinholeBrown intrinsic , SimpleImageSequence<GrayU8> sequence , ImagePanel gui , long pauseMilli) { Font font = new Font("Serif", Font.BOLD, 24); Se3_F64 fiducialToCamera = new Se3_F64(); int frameNumber = 0; while( sequence.hasNext() ) { long before = System.currentTimeMil...
java
private void processStream(CameraPinholeBrown intrinsic , SimpleImageSequence<GrayU8> sequence , ImagePanel gui , long pauseMilli) { Font font = new Font("Serif", Font.BOLD, 24); Se3_F64 fiducialToCamera = new Se3_F64(); int frameNumber = 0; while( sequence.hasNext() ) { long before = System.currentTimeMil...
[ "private", "void", "processStream", "(", "CameraPinholeBrown", "intrinsic", ",", "SimpleImageSequence", "<", "GrayU8", ">", "sequence", ",", "ImagePanel", "gui", ",", "long", "pauseMilli", ")", "{", "Font", "font", "=", "new", "Font", "(", "\"Serif\"", ",", "F...
Displays a continuous stream of images
[ "Displays", "a", "continuous", "stream", "of", "images" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/FiducialDetection.java#L395-L439
49,775
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/FiducialDetection.java
FiducialDetection.processImage
private void processImage(CameraPinholeBrown intrinsic , BufferedImage buffered , ImagePanel gui ) { Font font = new Font("Serif", Font.BOLD, 24); GrayU8 gray = new GrayU8(buffered.getWidth(),buffered.getHeight()); ConvertBufferedImage.convertFrom(buffered,gray); Se3_F64 fiducialToCamera = new Se3_F64(); t...
java
private void processImage(CameraPinholeBrown intrinsic , BufferedImage buffered , ImagePanel gui ) { Font font = new Font("Serif", Font.BOLD, 24); GrayU8 gray = new GrayU8(buffered.getWidth(),buffered.getHeight()); ConvertBufferedImage.convertFrom(buffered,gray); Se3_F64 fiducialToCamera = new Se3_F64(); t...
[ "private", "void", "processImage", "(", "CameraPinholeBrown", "intrinsic", ",", "BufferedImage", "buffered", ",", "ImagePanel", "gui", ")", "{", "Font", "font", "=", "new", "Font", "(", "\"Serif\"", ",", "Font", ".", "BOLD", ",", "24", ")", ";", "GrayU8", ...
Displays a simple image
[ "Displays", "a", "simple", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/FiducialDetection.java#L444-L479
49,776
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/video/VideoMjpegCodec.java
VideoMjpegCodec.readFrame
public byte[] readFrame( DataInputStream in ) { try { if( findMarker(in,SOI) && in.available() > 0 ) { return readJpegData(in, EOI); } } catch (IOException e) {} return null; }
java
public byte[] readFrame( DataInputStream in ) { try { if( findMarker(in,SOI) && in.available() > 0 ) { return readJpegData(in, EOI); } } catch (IOException e) {} return null; }
[ "public", "byte", "[", "]", "readFrame", "(", "DataInputStream", "in", ")", "{", "try", "{", "if", "(", "findMarker", "(", "in", ",", "SOI", ")", "&&", "in", ".", "available", "(", ")", ">", "0", ")", "{", "return", "readJpegData", "(", "in", ",", ...
Read a single frame at a time
[ "Read", "a", "single", "frame", "at", "a", "time" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/video/VideoMjpegCodec.java#L59-L66
49,777
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdLocalOtsu.java
ThresholdLocalOtsu.applyToBorder
void applyToBorder(GrayU8 input, GrayU8 output, int y0, int y1, int x0, int x1, ApplyHelper h) { // top-left corner h.computeHistogram(0,0,input); h.applyToBlock(0,0,x0+1,y0+1,input,output); // top-middle for (int x = x0+1; x < x1; x++) { h.updateHistogramX(x-x0,0,input); h.applyToBlock(x,0,x+1,y0,input...
java
void applyToBorder(GrayU8 input, GrayU8 output, int y0, int y1, int x0, int x1, ApplyHelper h) { // top-left corner h.computeHistogram(0,0,input); h.applyToBlock(0,0,x0+1,y0+1,input,output); // top-middle for (int x = x0+1; x < x1; x++) { h.updateHistogramX(x-x0,0,input); h.applyToBlock(x,0,x+1,y0,input...
[ "void", "applyToBorder", "(", "GrayU8", "input", ",", "GrayU8", "output", ",", "int", "y0", ",", "int", "y1", ",", "int", "x0", ",", "int", "x1", ",", "ApplyHelper", "h", ")", "{", "// top-left corner", "h", ".", "computeHistogram", "(", "0", ",", "0",...
Apply around the image border. Use a region that's the full size but apply to all pixels that the region would go outside of it was centered on them.
[ "Apply", "around", "the", "image", "border", ".", "Use", "a", "region", "that", "s", "the", "full", "size", "but", "apply", "to", "all", "pixels", "that", "the", "region", "would", "go", "outside", "of", "it", "was", "centered", "on", "them", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdLocalOtsu.java#L132-L174
49,778
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/UtilImageMotion.java
UtilImageMotion.createPixelTransform
public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) { PixelTransform<Point2D_F32> pixelTran; if( transform instanceof Homography2D_F64) { Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null); pixelTran = new PixelTransformHomography_F32(t)...
java
public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) { PixelTransform<Point2D_F32> pixelTran; if( transform instanceof Homography2D_F64) { Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null); pixelTran = new PixelTransformHomography_F32(t)...
[ "public", "static", "PixelTransform", "<", "Point2D_F32", ">", "createPixelTransform", "(", "InvertibleTransform", "transform", ")", "{", "PixelTransform", "<", "Point2D_F32", ">", "pixelTran", ";", "if", "(", "transform", "instanceof", "Homography2D_F64", ")", "{", ...
Given a motion model create a PixelTransform used to distort the image @param transform Motion transform @return PixelTransform_F32 used to distort the image
[ "Given", "a", "motion", "model", "create", "a", "PixelTransform", "used", "to", "distort", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/UtilImageMotion.java#L44-L60
49,779
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/factory/feature/orientation/FactoryOrientation.java
FactoryOrientation.sift
public static <T extends ImageGray<T>> OrientationImage<T> sift(ConfigSiftScaleSpace configSS , ConfigSiftOrientation configOri, Class<T> imageType ) { if( configSS == null ) configSS = new ConfigSiftScaleSpace(); configSS.checkValidity(); OrientationHistogramSift<GrayF32> ori = FactoryOrientationAlgs.sift(c...
java
public static <T extends ImageGray<T>> OrientationImage<T> sift(ConfigSiftScaleSpace configSS , ConfigSiftOrientation configOri, Class<T> imageType ) { if( configSS == null ) configSS = new ConfigSiftScaleSpace(); configSS.checkValidity(); OrientationHistogramSift<GrayF32> ori = FactoryOrientationAlgs.sift(c...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "OrientationImage", "<", "T", ">", "sift", "(", "ConfigSiftScaleSpace", "configSS", ",", "ConfigSiftOrientation", "configOri", ",", "Class", "<", "T", ">", "imageType", ")", "{", "if",...
Creates an implementation of the SIFT orientation estimation algorithm @param configSS Configuration of the scale-space. null for default @param configOri Orientation configuration. null for default @param imageType Type of input image @return SIFT orientation image
[ "Creates", "an", "implementation", "of", "the", "SIFT", "orientation", "estimation", "algorithm" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/orientation/FactoryOrientation.java#L69-L80
49,780
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java
CalibrationDetectorChessboard2.gridChess
public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth) { List<Point2D_F64> all = new ArrayList<>(); // convert it into the number of calibration points numCols = numCols - 1; numRows = numRows - 1; // center the grid around the origin. length of a size divided by two doub...
java
public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth) { List<Point2D_F64> all = new ArrayList<>(); // convert it into the number of calibration points numCols = numCols - 1; numRows = numRows - 1; // center the grid around the origin. length of a size divided by two doub...
[ "public", "static", "List", "<", "Point2D_F64", ">", "gridChess", "(", "int", "numRows", ",", "int", "numCols", ",", "double", "squareWidth", ")", "{", "List", "<", "Point2D_F64", ">", "all", "=", "new", "ArrayList", "<>", "(", ")", ";", "// convert it int...
This target is composed of a checkered chess board like squares. Each corner of an interior square touches an adjacent square, but the sides are separated. Only interior square corners provide calibration points. @param numRows Number of grid rows in the calibration target @param numCols Number of grid columns in th...
[ "This", "target", "is", "composed", "of", "a", "checkered", "chess", "board", "like", "squares", ".", "Each", "corner", "of", "an", "interior", "square", "touches", "an", "adjacent", "square", "but", "the", "sides", "are", "separated", ".", "Only", "interior...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java#L143-L164
49,781
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/impl/ImplSurfDescribeOps.java
ImplSurfDescribeOps.naiveGradient
public static <T extends ImageGray<T>> void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod , int regionSize, double kernelSize, boolean useHaar, double[] derivX, double derivY[]) { SparseScaleGradient<T,?> gg = SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass()); gg...
java
public static <T extends ImageGray<T>> void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod , int regionSize, double kernelSize, boolean useHaar, double[] derivX, double derivY[]) { SparseScaleGradient<T,?> gg = SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass()); gg...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "naiveGradient", "(", "T", "ii", ",", "double", "tl_x", ",", "double", "tl_y", ",", "double", "samplePeriod", ",", "int", "regionSize", ",", "double", "kernelSize", ",", "b...
Simple algorithm for computing the gradient of a region. Can handle image borders
[ "Simple", "algorithm", "for", "computing", "the", "gradient", "of", "a", "region", ".", "Can", "handle", "image", "borders" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/impl/ImplSurfDescribeOps.java#L161-L188
49,782
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java
DescribeDenseSiftAlg.setImageGradient
public void setImageGradient(D derivX , D derivY ) { InputSanityCheck.checkSameShape(derivX,derivY); if( derivX.stride != derivY.stride || derivX.startIndex != derivY.startIndex ) throw new IllegalArgumentException("stride and start index must be the same"); savedAngle.reshape(derivX.width,derivX.height); s...
java
public void setImageGradient(D derivX , D derivY ) { InputSanityCheck.checkSameShape(derivX,derivY); if( derivX.stride != derivY.stride || derivX.startIndex != derivY.startIndex ) throw new IllegalArgumentException("stride and start index must be the same"); savedAngle.reshape(derivX.width,derivX.height); s...
[ "public", "void", "setImageGradient", "(", "D", "derivX", ",", "D", "derivY", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "derivX", ",", "derivY", ")", ";", "if", "(", "derivX", ".", "stride", "!=", "derivY", ".", "stride", "||", "derivX", ...
Sets the gradient and precomputes pixel orientation and magnitude @param derivX image derivative x-axis @param derivY image derivative y-axis
[ "Sets", "the", "gradient", "and", "precomputes", "pixel", "orientation", "and", "magnitude" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L103-L115
49,783
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java
DescribeDenseSiftAlg.process
public void process() { int width = widthSubregion*widthGrid; int radius = width/2; int X0 = radius,X1 = savedAngle.width-radius; int Y0 = radius,Y1 = savedAngle.height-radius; int numX = (int)((X1-X0)/periodColumns); int numY = (int)((Y1-Y0)/periodRows); descriptors.reset(); sampleLocations.reset()...
java
public void process() { int width = widthSubregion*widthGrid; int radius = width/2; int X0 = radius,X1 = savedAngle.width-radius; int Y0 = radius,Y1 = savedAngle.height-radius; int numX = (int)((X1-X0)/periodColumns); int numY = (int)((Y1-Y0)/periodRows); descriptors.reset(); sampleLocations.reset()...
[ "public", "void", "process", "(", ")", "{", "int", "width", "=", "widthSubregion", "*", "widthGrid", ";", "int", "radius", "=", "width", "/", "2", ";", "int", "X0", "=", "radius", ",", "X1", "=", "savedAngle", ".", "width", "-", "radius", ";", "int",...
Computes SIFT descriptors across the entire image
[ "Computes", "SIFT", "descriptors", "across", "the", "entire", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L120-L146
49,784
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java
DescribeDenseSiftAlg.precomputeAngles
void precomputeAngles(D image) { int savecIndex = 0; for (int y = 0; y < image.height; y++) { int pixelIndex = y*image.stride + image.startIndex; for (int x = 0; x < image.width; x++, pixelIndex++, savecIndex++ ) { float spacialDX = imageDerivX.getF(pixelIndex); float spacialDY = imageDerivY.getF(pix...
java
void precomputeAngles(D image) { int savecIndex = 0; for (int y = 0; y < image.height; y++) { int pixelIndex = y*image.stride + image.startIndex; for (int x = 0; x < image.width; x++, pixelIndex++, savecIndex++ ) { float spacialDX = imageDerivX.getF(pixelIndex); float spacialDY = imageDerivY.getF(pix...
[ "void", "precomputeAngles", "(", "D", "image", ")", "{", "int", "savecIndex", "=", "0", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "image", ".", "height", ";", "y", "++", ")", "{", "int", "pixelIndex", "=", "y", "*", "image", ".", "s...
Computes the angle of each pixel and its gradient magnitude
[ "Computes", "the", "angle", "of", "each", "pixel", "and", "its", "gradient", "magnitude" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L151-L164
49,785
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java
DescribeDenseSiftAlg.computeDescriptor
public void computeDescriptor( int cx , int cy , TupleDesc_F64 desc ) { desc.fill(0); int widthPixels = widthSubregion*widthGrid; int radius = widthPixels/2; for (int i = 0; i < widthPixels; i++) { int angleIndex = (cy-radius+i)*savedAngle.width + (cx-radius); float subY = i/(float)widthSubregion; ...
java
public void computeDescriptor( int cx , int cy , TupleDesc_F64 desc ) { desc.fill(0); int widthPixels = widthSubregion*widthGrid; int radius = widthPixels/2; for (int i = 0; i < widthPixels; i++) { int angleIndex = (cy-radius+i)*savedAngle.width + (cx-radius); float subY = i/(float)widthSubregion; ...
[ "public", "void", "computeDescriptor", "(", "int", "cx", ",", "int", "cy", ",", "TupleDesc_F64", "desc", ")", "{", "desc", ".", "fill", "(", "0", ")", ";", "int", "widthPixels", "=", "widthSubregion", "*", "widthGrid", ";", "int", "radius", "=", "widthPi...
Computes the descriptor centered at the specified coordinate @param cx center of region x-axis @param cy center of region y-axis @param desc The descriptor
[ "Computes", "the", "descriptor", "centered", "at", "the", "specified", "coordinate" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseSiftAlg.java#L172-L198
49,786
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/impl/ImplEdgeNonMaxSuppression_MT.java
ImplEdgeNonMaxSuppression_MT.naive4
static public void naive4(GrayF32 _intensity , GrayS8 direction , GrayF32 output ) { final int w = _intensity.width; final int h = _intensity.height; ImageBorder_F32 intensity = (ImageBorder_F32)FactoryImageBorderAlgs.value(_intensity, 0); BoofConcurrency.loopFor(0,h,y->{ for( int x = 0; x < w; x++ ) { ...
java
static public void naive4(GrayF32 _intensity , GrayS8 direction , GrayF32 output ) { final int w = _intensity.width; final int h = _intensity.height; ImageBorder_F32 intensity = (ImageBorder_F32)FactoryImageBorderAlgs.value(_intensity, 0); BoofConcurrency.loopFor(0,h,y->{ for( int x = 0; x < w; x++ ) { ...
[ "static", "public", "void", "naive4", "(", "GrayF32", "_intensity", ",", "GrayS8", "direction", ",", "GrayF32", "output", ")", "{", "final", "int", "w", "=", "_intensity", ".", "width", ";", "final", "int", "h", "=", "_intensity", ".", "height", ";", "Im...
Slow algorithm which processes the whole image.
[ "Slow", "algorithm", "which", "processes", "the", "whole", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/impl/ImplEdgeNonMaxSuppression_MT.java#L83-L118
49,787
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java
QrCode.reset
public void reset() { for (int i = 0; i < 4; i++) { ppCorner.get(i).set(0,0); ppDown.get(i).set(0,0); ppRight.get(i).set(0,0); } this.threshCorner = 0; this.threshDown = 0; this.threshRight = 0; version = -1; error = L; mask = QrCodeMaskPattern.M111; alignment.reset(); mode = Mode.UNKNOWN; ...
java
public void reset() { for (int i = 0; i < 4; i++) { ppCorner.get(i).set(0,0); ppDown.get(i).set(0,0); ppRight.get(i).set(0,0); } this.threshCorner = 0; this.threshDown = 0; this.threshRight = 0; version = -1; error = L; mask = QrCodeMaskPattern.M111; alignment.reset(); mode = Mode.UNKNOWN; ...
[ "public", "void", "reset", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "ppCorner", ".", "get", "(", "i", ")", ".", "set", "(", "0", ",", "0", ")", ";", "ppDown", ".", "get", "(", "i", "...
Resets the QR-Code so that it's in its initial state.
[ "Resets", "the", "QR", "-", "Code", "so", "that", "it", "s", "in", "its", "initial", "state", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java#L398-L416
49,788
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java
QrCode.set
public void set( QrCode o ) { this.version = o.version; this.error = o.error; this.mask = o.mask; this.mode = o.mode; this.rawbits = o.rawbits == null ? null : o.rawbits.clone(); this.corrected = o.corrected == null ? null : o.corrected.clone(); this.message = o.message; this.threshCorner = o.threshCorn...
java
public void set( QrCode o ) { this.version = o.version; this.error = o.error; this.mask = o.mask; this.mode = o.mode; this.rawbits = o.rawbits == null ? null : o.rawbits.clone(); this.corrected = o.corrected == null ? null : o.corrected.clone(); this.message = o.message; this.threshCorner = o.threshCorn...
[ "public", "void", "set", "(", "QrCode", "o", ")", "{", "this", ".", "version", "=", "o", ".", "version", ";", "this", ".", "error", "=", "o", ".", "error", ";", "this", ".", "mask", "=", "o", ".", "mask", ";", "this", ".", "mode", "=", "o", "...
Sets 'this' so that it's equivalent to 'o'. @param o The target object
[ "Sets", "this", "so", "that", "it", "s", "equivalent", "to", "o", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCode.java#L429-L450
49,789
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java
SelfCalibrationLinearRotationSingle.ensureDeterminantOfOne
public static void ensureDeterminantOfOne(List<Homography2D_F64> homography0toI) { int N = homography0toI.size(); for (int i = 0; i < N; i++) { Homography2D_F64 H = homography0toI.get(i); double d = CommonOps_DDF3.det(H); // System.out.println("Before = "+d); if( d < 0 ) CommonOps_DDF3.divide(H,-Math...
java
public static void ensureDeterminantOfOne(List<Homography2D_F64> homography0toI) { int N = homography0toI.size(); for (int i = 0; i < N; i++) { Homography2D_F64 H = homography0toI.get(i); double d = CommonOps_DDF3.det(H); // System.out.println("Before = "+d); if( d < 0 ) CommonOps_DDF3.divide(H,-Math...
[ "public", "static", "void", "ensureDeterminantOfOne", "(", "List", "<", "Homography2D_F64", ">", "homography0toI", ")", "{", "int", "N", "=", "homography0toI", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", ...
Scales all homographies so that their determinants are equal to one @param homography0toI
[ "Scales", "all", "homographies", "so", "that", "their", "determinants", "are", "equal", "to", "one" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L107-L119
49,790
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java
SelfCalibrationLinearRotationSingle.extractCalibration
private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) { double s = x.data[5]; double cx = calibration.cx = x.data[2]/s; double cy = calibration.cy = x.data[4]/s; double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy); double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy; calibra...
java
private boolean extractCalibration(DMatrixRMaj x , CameraPinhole calibration) { double s = x.data[5]; double cx = calibration.cx = x.data[2]/s; double cy = calibration.cy = x.data[4]/s; double fy = calibration.fy = Math.sqrt(x.data[3]/s-cy*cy); double sk = calibration.skew = (x.data[1]/s-cx*cy)/fy; calibra...
[ "private", "boolean", "extractCalibration", "(", "DMatrixRMaj", "x", ",", "CameraPinhole", "calibration", ")", "{", "double", "s", "=", "x", ".", "data", "[", "5", "]", ";", "double", "cx", "=", "calibration", ".", "cx", "=", "x", ".", "data", "[", "2"...
Extracts camera parameters from the solution. Checks for errors
[ "Extracts", "camera", "parameters", "from", "the", "solution", ".", "Checks", "for", "errors" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationSingle.java#L123-L139
49,791
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java
FactoryWaveletDaub.computeBorderCoefficients
private static WlBorderCoef<WlCoef_F32> computeBorderCoefficients( BorderIndex1D border , WlCoef_F32 forward , WlCoef_F32 inverse ) { int N = Math.max(forward.getScalingLength(),forward.getWaveletLength()); N += N%2; N *= 2; border.setLength(N); // Because the wavelet ...
java
private static WlBorderCoef<WlCoef_F32> computeBorderCoefficients( BorderIndex1D border , WlCoef_F32 forward , WlCoef_F32 inverse ) { int N = Math.max(forward.getScalingLength(),forward.getWaveletLength()); N += N%2; N *= 2; border.setLength(N); // Because the wavelet ...
[ "private", "static", "WlBorderCoef", "<", "WlCoef_F32", ">", "computeBorderCoefficients", "(", "BorderIndex1D", "border", ",", "WlCoef_F32", "forward", ",", "WlCoef_F32", "inverse", ")", "{", "int", "N", "=", "Math", ".", "max", "(", "forward", ".", "getScalingL...
Computes inverse coefficients @param border @param forward Forward coefficients. @param inverse Inverse used in the inner portion of the data stream. @return
[ "Computes", "inverse", "coefficients" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java#L182-L231
49,792
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java
FactoryWaveletDaub.convertToInt
public static WlBorderCoefFixed<WlCoef_I32> convertToInt( WlBorderCoefFixed<WlCoef_F32> orig , WlCoef_I32 inner ) { WlBorderCoefFixed<WlCoef_I32> ret = new WlBorderCoefFixed<>(orig.getLowerLength(), orig.getUpperLength()); for( int i = 0; i < orig.getLowerLength(); i++ ) { WlCoef_F32 o = or...
java
public static WlBorderCoefFixed<WlCoef_I32> convertToInt( WlBorderCoefFixed<WlCoef_F32> orig , WlCoef_I32 inner ) { WlBorderCoefFixed<WlCoef_I32> ret = new WlBorderCoefFixed<>(orig.getLowerLength(), orig.getUpperLength()); for( int i = 0; i < orig.getLowerLength(); i++ ) { WlCoef_F32 o = or...
[ "public", "static", "WlBorderCoefFixed", "<", "WlCoef_I32", ">", "convertToInt", "(", "WlBorderCoefFixed", "<", "WlCoef_F32", ">", "orig", ",", "WlCoef_I32", "inner", ")", "{", "WlBorderCoefFixed", "<", "WlCoef_I32", ">", "ret", "=", "new", "WlBorderCoefFixed", "<...
todo rename and move to a utility function?
[ "todo", "rename", "and", "move", "to", "a", "utility", "function?" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletDaub.java#L351-L372
49,793
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java
BackgroundGmmCommon.updateMixture
public int updateMixture( float[] pixelValue , float[] dataRow , int modelIndex ) { // see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex; float bestDistance = maxDistance*numBands; int bestIndex=-1; int ng; // number of gaussians in use for (ng = 0; ng < maxGaussians;...
java
public int updateMixture( float[] pixelValue , float[] dataRow , int modelIndex ) { // see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex; float bestDistance = maxDistance*numBands; int bestIndex=-1; int ng; // number of gaussians in use for (ng = 0; ng < maxGaussians;...
[ "public", "int", "updateMixture", "(", "float", "[", "]", "pixelValue", ",", "float", "[", "]", "dataRow", ",", "int", "modelIndex", ")", "{", "// see which gaussian is the best fit based on Mahalanobis distance", "int", "index", "=", "modelIndex", ";", "float", "be...
Updates the mixtures of gaussian and determines if the pixel matches the background model @return true if it matches the background or false if not
[ "Updates", "the", "mixtures", "of", "gaussian", "and", "determines", "if", "the", "pixel", "matches", "the", "background", "model" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L112-L183
49,794
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java
BackgroundGmmCommon.updateWeightAndPrune
public void updateWeightAndPrune(float[] dataRow, int modelIndex, int ng, int bestIndex, float bestWeight) { int index = modelIndex; float weightTotal = 0; for (int i = 0; i < ng; ) { float weight = dataRow[index]; // if( ng > 1 ) // System.out.println("["+i+"] = "+ng+" weight "+weight); weight = wei...
java
public void updateWeightAndPrune(float[] dataRow, int modelIndex, int ng, int bestIndex, float bestWeight) { int index = modelIndex; float weightTotal = 0; for (int i = 0; i < ng; ) { float weight = dataRow[index]; // if( ng > 1 ) // System.out.println("["+i+"] = "+ng+" weight "+weight); weight = wei...
[ "public", "void", "updateWeightAndPrune", "(", "float", "[", "]", "dataRow", ",", "int", "modelIndex", ",", "int", "ng", ",", "int", "bestIndex", ",", "float", "bestWeight", ")", "{", "int", "index", "=", "modelIndex", ";", "float", "weightTotal", "=", "0"...
Updates the weight of each Gaussian and prunes one which have a negative weight after the update.
[ "Updates", "the", "weight", "of", "each", "Gaussian", "and", "prunes", "one", "which", "have", "a", "negative", "weight", "after", "the", "update", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L188-L234
49,795
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java
BackgroundGmmCommon.checkBackground
public int checkBackground( float[] pixelValue , float[] dataRow , int modelIndex ) { // see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex; float bestDistance = maxDistance*numBands; float bestWeight = 0; int ng; // number of gaussians in use for (ng = 0; ng < maxGaus...
java
public int checkBackground( float[] pixelValue , float[] dataRow , int modelIndex ) { // see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex; float bestDistance = maxDistance*numBands; float bestWeight = 0; int ng; // number of gaussians in use for (ng = 0; ng < maxGaus...
[ "public", "int", "checkBackground", "(", "float", "[", "]", "pixelValue", ",", "float", "[", "]", "dataRow", ",", "int", "modelIndex", ")", "{", "// see which gaussian is the best fit based on Mahalanobis distance", "int", "index", "=", "modelIndex", ";", "float", "...
Checks to see if the the pivel value refers to the background or foreground @return true for background or false for foreground
[ "Checks", "to", "see", "if", "the", "the", "pivel", "value", "refers", "to", "the", "background", "or", "foreground" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundGmmCommon.java#L311-L341
49,796
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java
ConvertYuv420_888.yuvToGray
public static <T extends ImageGray<T>> T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType ) { if( outputType == GrayU8.class ) { return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output); } else if( outputType == GrayF32.cla...
java
public static <T extends ImageGray<T>> T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType ) { if( outputType == GrayU8.class ) { return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output); } else if( outputType == GrayF32.cla...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "yuvToGray", "(", "ByteBuffer", "bufferY", ",", "int", "width", ",", "int", "height", ",", "int", "strideRow", ",", "T", "output", ",", "BWorkArrays", "workArrays", ",", "Clas...
Converts an YUV 420 888 into gray @param output Output: Optional storage for output image. Can be null. @param outputType Output: Type of output image @param <T> Output image type @return Gray scale image
[ "Converts", "an", "YUV", "420", "888", "into", "gray" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java#L111-L121
49,797
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/shapes/DetectBlackShapeAppBase.java
DetectBlackShapeAppBase.requestSaveInputImage
public void requestSaveInputImage() { saveRequested = false; switch( inputMethod ) { case IMAGE: new Thread(() -> saveInputImage()).start(); break; case VIDEO: case WEBCAM: if( streamPaused ) { saveInputImage(); } else { saveRequested = true; } break; } }
java
public void requestSaveInputImage() { saveRequested = false; switch( inputMethod ) { case IMAGE: new Thread(() -> saveInputImage()).start(); break; case VIDEO: case WEBCAM: if( streamPaused ) { saveInputImage(); } else { saveRequested = true; } break; } }
[ "public", "void", "requestSaveInputImage", "(", ")", "{", "saveRequested", "=", "false", ";", "switch", "(", "inputMethod", ")", "{", "case", "IMAGE", ":", "new", "Thread", "(", "(", ")", "->", "saveInputImage", "(", ")", ")", ".", "start", "(", ")", "...
Makes a request that the input image be saved. This request might be carried out immediately or when then next image is processed.
[ "Makes", "a", "request", "that", "the", "input", "image", "be", "saved", ".", "This", "request", "might", "be", "carried", "out", "immediately", "or", "when", "then", "next", "image", "is", "processed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/shapes/DetectBlackShapeAppBase.java#L170-L186
49,798
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/Se3FromEssentialGenerator.java
Se3FromEssentialGenerator.generate
@Override public boolean generate(List<AssociatedPair> dataSet, Se3_F64 model ) { if( !computeEssential.process(dataSet,E) ) return false; // extract the possible motions decomposeE.decompose(E); selectBest.select(decomposeE.getSolutions(),dataSet,model); return true; }
java
@Override public boolean generate(List<AssociatedPair> dataSet, Se3_F64 model ) { if( !computeEssential.process(dataSet,E) ) return false; // extract the possible motions decomposeE.decompose(E); selectBest.select(decomposeE.getSolutions(),dataSet,model); return true; }
[ "@", "Override", "public", "boolean", "generate", "(", "List", "<", "AssociatedPair", ">", "dataSet", ",", "Se3_F64", "model", ")", "{", "if", "(", "!", "computeEssential", ".", "process", "(", "dataSet", ",", "E", ")", ")", "return", "false", ";", "// e...
Computes the camera motion from the set of observations. The motion is from the first into the second camera frame. @param dataSet Associated pairs in normalized camera coordinates. @param model The best pose according to the positive depth constraint.
[ "Computes", "the", "camera", "motion", "from", "the", "set", "of", "observations", ".", "The", "motion", "is", "from", "the", "first", "into", "the", "second", "camera", "frame", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/robust/Se3FromEssentialGenerator.java#L69-L79
49,799
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java
VisOdomDirectColorDepth.setCameraParameters
public void setCameraParameters( float fx , float fy , float cx , float cy , int width , int height ) { this.fx = fx; this.fy = fy; this.cx = cx; this.cy = cy; derivX.reshape(width, height); derivY.reshape(width, height); // set these to the maximum possible size int N = width*height*imageTy...
java
public void setCameraParameters( float fx , float fy , float cx , float cy , int width , int height ) { this.fx = fx; this.fy = fy; this.cx = cx; this.cy = cy; derivX.reshape(width, height); derivY.reshape(width, height); // set these to the maximum possible size int N = width*height*imageTy...
[ "public", "void", "setCameraParameters", "(", "float", "fx", ",", "float", "fy", ",", "float", "cx", ",", "float", "cy", ",", "int", "width", ",", "int", "height", ")", "{", "this", ".", "fx", "=", "fx", ";", "this", ".", "fy", "=", "fy", ";", "t...
Specifies intrinsic camera parameters. Must be called. @param fx focal length x (pixels) @param fy focal length y (pixels) @param cx principle point x (pixels) @param cy principle point y (pixels) @param width Width of the image @param height Height of the image
[ "Specifies", "intrinsic", "camera", "parameters", ".", "Must", "be", "called", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/VisOdomDirectColorDepth.java#L143-L157