id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
50,400
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.blockOtsu
public static <T extends ImageGray<T>> InputToBinary<T> blockOtsu(ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, boolean otsu2, double tuning,Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockOtsu != null ) return BOverrideFactoryThresholdBinary.bloc...
java
public static <T extends ImageGray<T>> InputToBinary<T> blockOtsu(ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, boolean otsu2, double tuning,Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockOtsu != null ) return BOverrideFactoryThresholdBinary.bloc...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "blockOtsu", "(", "ConfigLength", "regionWidth", ",", "double", "scale", ",", "boolean", "down", ",", "boolean", "thresholdFromLocalBlocks", ",", "boolean...
Applies a non-overlapping block Otsu threshold @see ThresholdBlockOtsu @param regionWidth Approximate size of block region @param scale Scale factor adjust for threshold. 1.0 means no change. @param down Should it threshold up or down. @param inputType Type of input image @return Filter to binary
[ "Applies", "a", "non", "-", "overlapping", "block", "Otsu", "threshold" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L217-L234
50,401
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.threshold
public static <T extends ImageGray<T>> InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) { switch( config.type ) { case FIXED: return globalFixed(config.fixedThreshold, config.down, inputType); case GLOBAL_OTSU: return globalOtsu(config.minPixelValue, config.maxPixelValue, confi...
java
public static <T extends ImageGray<T>> InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) { switch( config.type ) { case FIXED: return globalFixed(config.fixedThreshold, config.down, inputType); case GLOBAL_OTSU: return globalOtsu(config.minPixelValue, config.maxPixelValue, confi...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "threshold", "(", "ConfigThreshold", "config", ",", "Class", "<", "T", ">", "inputType", ")", "{", "switch", "(", "config", ".", "type", ")", "{",...
Creates threshold using a config class @param config Configuration @param inputType Type of input image @return The thresholder
[ "Creates", "threshold", "using", "a", "config", "class" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L318-L372
50,402
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/JSpringPanel.java
JSpringPanel.constraintSouth
public void constraintSouth(JComponent target, JComponent top, JComponent bottom, int padV ) { if( bottom == null ) { layout.putConstraint(SpringLayout.SOUTH, target, -padV, SpringLayout.SOUTH, this); } else { Spring a = Spring.sum(Spring.constant(-padV),layout.getConstraint(Spri...
java
public void constraintSouth(JComponent target, JComponent top, JComponent bottom, int padV ) { if( bottom == null ) { layout.putConstraint(SpringLayout.SOUTH, target, -padV, SpringLayout.SOUTH, this); } else { Spring a = Spring.sum(Spring.constant(-padV),layout.getConstraint(Spri...
[ "public", "void", "constraintSouth", "(", "JComponent", "target", ",", "JComponent", "top", ",", "JComponent", "bottom", ",", "int", "padV", ")", "{", "if", "(", "bottom", "==", "null", ")", "{", "layout", ".", "putConstraint", "(", "SpringLayout", ".", "S...
Constrain it to the top of it's bottom panel and prevent it from getting crushed below it's size
[ "Constrain", "it", "to", "the", "top", "of", "it", "s", "bottom", "panel", "and", "prevent", "it", "from", "getting", "crushed", "below", "it", "s", "size" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/JSpringPanel.java#L217-L230
50,403
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.setLensDistoriton
public void setLensDistoriton(LensDistortionNarrowFOV distortion ) { pixelToNorm = distortion.undistort_F64(true,false); normToPixel = distortion.distort_F64(false, true); }
java
public void setLensDistoriton(LensDistortionNarrowFOV distortion ) { pixelToNorm = distortion.undistort_F64(true,false); normToPixel = distortion.distort_F64(false, true); }
[ "public", "void", "setLensDistoriton", "(", "LensDistortionNarrowFOV", "distortion", ")", "{", "pixelToNorm", "=", "distortion", ".", "undistort_F64", "(", "true", ",", "false", ")", ";", "normToPixel", "=", "distortion", ".", "distort_F64", "(", "false", ",", "...
Specifies the intrinsic parameters. @param distortion Intrinsic camera parameters
[ "Specifies", "the", "intrinsic", "parameters", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L133-L136
50,404
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.setFiducial
public void setFiducial( double x0 , double y0 , double x1 , double y1 , double x2 , double y2 , double x3 , double y3 ) { points.get(0).location.set(x0,y0,0); points.get(1).location.set(x1,y1,0); points.get(2).location.set(x2,y2,0); points.get(3).location.set(x3,y3,0); }
java
public void setFiducial( double x0 , double y0 , double x1 , double y1 , double x2 , double y2 , double x3 , double y3 ) { points.get(0).location.set(x0,y0,0); points.get(1).location.set(x1,y1,0); points.get(2).location.set(x2,y2,0); points.get(3).location.set(x3,y3,0); }
[ "public", "void", "setFiducial", "(", "double", "x0", ",", "double", "y0", ",", "double", "x1", ",", "double", "y1", ",", "double", "x2", ",", "double", "y2", ",", "double", "x3", ",", "double", "y3", ")", "{", "points", ".", "get", "(", "0", ")", ...
Specify the location of points on the 2D fiducial. These should be in "world coordinates"
[ "Specify", "the", "location", "of", "points", "on", "the", "2D", "fiducial", ".", "These", "should", "be", "in", "world", "coordinates" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L141-L147
50,405
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.pixelToMarker
public void pixelToMarker( double pixelX , double pixelY , Point2D_F64 marker ) { // find pointing vector in camera reference frame pixelToNorm.compute(pixelX,pixelY,marker); cameraP3.set(marker.x,marker.y,1); // rotate into marker reference frame GeometryMath_F64.multTran(outputFiducialToCamera.R,cameraP3,...
java
public void pixelToMarker( double pixelX , double pixelY , Point2D_F64 marker ) { // find pointing vector in camera reference frame pixelToNorm.compute(pixelX,pixelY,marker); cameraP3.set(marker.x,marker.y,1); // rotate into marker reference frame GeometryMath_F64.multTran(outputFiducialToCamera.R,cameraP3,...
[ "public", "void", "pixelToMarker", "(", "double", "pixelX", ",", "double", "pixelY", ",", "Point2D_F64", "marker", ")", "{", "// find pointing vector in camera reference frame", "pixelToNorm", ".", "compute", "(", "pixelX", ",", "pixelY", ",", "marker", ")", ";", ...
Given the found solution, compute the the observed pixel would appear on the marker's surface. pixel -> normalized pixel -> rotated -> projected on to plane @param pixelX (Input) pixel coordinate @param pixelY (Input) pixel coordinate @param marker (Output) location on the marker
[ "Given", "the", "found", "solution", "compute", "the", "the", "observed", "pixel", "would", "appear", "on", "the", "marker", "s", "surface", ".", "pixel", "-", ">", "normalized", "pixel", "-", ">", "rotated", "-", ">", "projected", "on", "to", "plane" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L156-L171
50,406
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.estimate
protected boolean estimate( Quadrilateral_F64 cornersPixels , Quadrilateral_F64 cornersNorm , Se3_F64 foundFiducialToCamera ) { // put it into a list to simplify algorithms listObs.clear(); listObs.add( cornersPixels.a ); listObs.add( cornersPixels.b ); listObs.add( cornersPixels.c ); listOb...
java
protected boolean estimate( Quadrilateral_F64 cornersPixels , Quadrilateral_F64 cornersNorm , Se3_F64 foundFiducialToCamera ) { // put it into a list to simplify algorithms listObs.clear(); listObs.add( cornersPixels.a ); listObs.add( cornersPixels.b ); listObs.add( cornersPixels.c ); listOb...
[ "protected", "boolean", "estimate", "(", "Quadrilateral_F64", "cornersPixels", ",", "Quadrilateral_F64", "cornersNorm", ",", "Se3_F64", "foundFiducialToCamera", ")", "{", "// put it into a list to simplify algorithms", "listObs", ".", "clear", "(", ")", ";", "listObs", "....
Given the observed corners of the quad in the image in pixels estimate and store the results of its pose
[ "Given", "the", "observed", "corners", "of", "the", "quad", "in", "the", "image", "in", "pixels", "estimate", "and", "store", "the", "results", "of", "its", "pose" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L210-L263
50,407
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.estimateP3P
protected void estimateP3P(int excluded) { // the point used to check the solutions is the last one inputP3P.clear(); for( int i = 0; i < 4; i++ ) { if( i != excluded ) { inputP3P.add( points.get(i) ); } } // initial estimate for the pose solutions.reset(); if( !p3p.process(inputP3P,solutions)...
java
protected void estimateP3P(int excluded) { // the point used to check the solutions is the last one inputP3P.clear(); for( int i = 0; i < 4; i++ ) { if( i != excluded ) { inputP3P.add( points.get(i) ); } } // initial estimate for the pose solutions.reset(); if( !p3p.process(inputP3P,solutions)...
[ "protected", "void", "estimateP3P", "(", "int", "excluded", ")", "{", "// the point used to check the solutions is the last one", "inputP3P", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "if",...
Estimates the pose using P3P from 3 out of 4 points. Then use all 4 to pick the best solution @param excluded which corner to exclude and use to check the answers from the others
[ "Estimates", "the", "pose", "using", "P3P", "from", "3", "out", "of", "4", "points", ".", "Then", "use", "all", "4", "to", "pick", "the", "best", "solution" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L270-L298
50,408
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.enlarge
protected void enlarge( Quadrilateral_F64 corners, double scale ) { UtilPolygons2D_F64.center(corners, center); extend(center,corners.a,scale); extend(center,corners.b,scale); extend(center,corners.c,scale); extend(center,corners.d,scale); }
java
protected void enlarge( Quadrilateral_F64 corners, double scale ) { UtilPolygons2D_F64.center(corners, center); extend(center,corners.a,scale); extend(center,corners.b,scale); extend(center,corners.c,scale); extend(center,corners.d,scale); }
[ "protected", "void", "enlarge", "(", "Quadrilateral_F64", "corners", ",", "double", "scale", ")", "{", "UtilPolygons2D_F64", ".", "center", "(", "corners", ",", "center", ")", ";", "extend", "(", "center", ",", "corners", ".", "a", ",", "scale", ")", ";", ...
Enlarges the quadrilateral to make it more sensitive to changes in orientation
[ "Enlarges", "the", "quadrilateral", "to", "make", "it", "more", "sensitive", "to", "changes", "in", "orientation" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L303-L311
50,409
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.computeErrors
protected double computeErrors(Se3_F64 fiducialToCamera ) { if( fiducialToCamera.T.z < 0 ) { // the low level algorithm should already filter this code, but just incase return Double.MAX_VALUE; } double maxError = 0; for( int i = 0; i < 4; i++ ) { maxError = Math.max(maxError,computePixelError(fiduci...
java
protected double computeErrors(Se3_F64 fiducialToCamera ) { if( fiducialToCamera.T.z < 0 ) { // the low level algorithm should already filter this code, but just incase return Double.MAX_VALUE; } double maxError = 0; for( int i = 0; i < 4; i++ ) { maxError = Math.max(maxError,computePixelError(fiduci...
[ "protected", "double", "computeErrors", "(", "Se3_F64", "fiducialToCamera", ")", "{", "if", "(", "fiducialToCamera", ".", "T", ".", "z", "<", "0", ")", "{", "// the low level algorithm should already filter this code, but just incase", "return", "Double", ".", "MAX_VALU...
Compute the sum of reprojection errors for all four points @param fiducialToCamera Transform being evaluated @return sum of Euclidean-squared errors
[ "Compute", "the", "sum", "of", "reprojection", "errors", "for", "all", "four", "points" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L323-L336
50,410
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java
ParamFundamentalEpipolar.encode
@Override public void encode(DMatrixRMaj F, double[] param) { // see if which columns are to be used selectColumns(F); // set the largest element in the first two columns and normalize // using that value double v[] = new double[]{F.get(0,col0),F.get(1,col0),F.get(2,col0), F.get(0,col1),F.get(1,col1),...
java
@Override public void encode(DMatrixRMaj F, double[] param) { // see if which columns are to be used selectColumns(F); // set the largest element in the first two columns and normalize // using that value double v[] = new double[]{F.get(0,col0),F.get(1,col0),F.get(2,col0), F.get(0,col1),F.get(1,col1),...
[ "@", "Override", "public", "void", "encode", "(", "DMatrixRMaj", "F", ",", "double", "[", "]", "param", ")", "{", "// see if which columns are to be used", "selectColumns", "(", "F", ")", ";", "// set the largest element in the first two columns and normalize", "// using ...
Examines the matrix structure to determine how to parameterize F.
[ "Examines", "the", "matrix", "structure", "to", "determine", "how", "to", "parameterize", "F", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java#L61-L85
50,411
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java
ParamFundamentalEpipolar.selectDivisor
private double selectDivisor( double v[] , double param[] ) { double maxValue = 0; int maxIndex = 0; for( int i = 0; i < v.length; i++ ) { if( Math.abs(v[i]) > maxValue ) { maxValue = Math.abs(v[i]); maxIndex = i; } } double divisor = v[maxIndex]; int index = 0; for( int i = 0; i < v.leng...
java
private double selectDivisor( double v[] , double param[] ) { double maxValue = 0; int maxIndex = 0; for( int i = 0; i < v.length; i++ ) { if( Math.abs(v[i]) > maxValue ) { maxValue = Math.abs(v[i]); maxIndex = i; } } double divisor = v[maxIndex]; int index = 0; for( int i = 0; i < v.leng...
[ "private", "double", "selectDivisor", "(", "double", "v", "[", "]", ",", "double", "param", "[", "]", ")", "{", "double", "maxValue", "=", "0", ";", "int", "maxIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "v", ".", "l...
The divisor is the element in the first two columns that has the largest absolute value. Finds this element, sets col0 to be the row which contains it, and specifies which elements in that column are to be used. @return Value of the divisor
[ "The", "divisor", "is", "the", "element", "in", "the", "first", "two", "columns", "that", "has", "the", "largest", "absolute", "value", ".", "Finds", "this", "element", "sets", "col0", "to", "be", "the", "row", "which", "contains", "it", "and", "specifies"...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java#L94-L125
50,412
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java
GeneratePairwiseImageGraph.createEdge
protected void createEdge( String src , String dst , FastQueue<AssociatedPair> pairs , FastQueue<AssociatedIndex> matches ) { // Fitting Essential/Fundamental works when the scene is not planar and not pure rotation int countF = 0; if( ransac3D.process(pairs.toList()) ) { countF = ransac3D.getMatchSe...
java
protected void createEdge( String src , String dst , FastQueue<AssociatedPair> pairs , FastQueue<AssociatedIndex> matches ) { // Fitting Essential/Fundamental works when the scene is not planar and not pure rotation int countF = 0; if( ransac3D.process(pairs.toList()) ) { countF = ransac3D.getMatchSe...
[ "protected", "void", "createEdge", "(", "String", "src", ",", "String", "dst", ",", "FastQueue", "<", "AssociatedPair", ">", "pairs", ",", "FastQueue", "<", "AssociatedIndex", ">", "matches", ")", "{", "// Fitting Essential/Fundamental works when the scene is not planar...
Connects two views together if they meet a minimal set of geometric requirements. Determines if there is strong evidence that there is 3D information present and not just a homography @param src ID of src image @param dst ID of dst image @param pairs Associated features pixels @param matches Associated features featur...
[ "Connects", "two", "views", "together", "if", "they", "meet", "a", "minimal", "set", "of", "geometric", "requirements", ".", "Determines", "if", "there", "is", "strong", "evidence", "that", "there", "is", "3D", "information", "present", "and", "not", "just", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java#L155-L195
50,413
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java
GeneratePairwiseImageGraph.saveInlierMatches
private void saveInlierMatches(ModelMatcher<?, ?> ransac, FastQueue<AssociatedIndex> matches, PairwiseImageGraph2.Motion edge) { int N = ransac.getMatchSet().size(); edge.inliers.reset(); for (int i = 0; i < N; i++) { int idx = ransac.getInputIndex(i); edge.inliers.grow().set(matches.get(idx)); ...
java
private void saveInlierMatches(ModelMatcher<?, ?> ransac, FastQueue<AssociatedIndex> matches, PairwiseImageGraph2.Motion edge) { int N = ransac.getMatchSet().size(); edge.inliers.reset(); for (int i = 0; i < N; i++) { int idx = ransac.getInputIndex(i); edge.inliers.grow().set(matches.get(idx)); ...
[ "private", "void", "saveInlierMatches", "(", "ModelMatcher", "<", "?", ",", "?", ">", "ransac", ",", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "PairwiseImageGraph2", ".", "Motion", "edge", ")", "{", "int", "N", "=", "ransac", ".", "getMatchSe...
Puts the inliers from RANSAC into the edge's list of associated features @param ransac RANSAC @param matches List of matches from feature association @param edge The edge that the inliers are to be saved to
[ "Puts", "the", "inliers", "from", "RANSAC", "into", "the", "edge", "s", "list", "of", "associated", "features" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java#L203-L212
50,414
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.recycleData
protected void recycleData() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int j = 0; j < n.edges.length; j++) { if( n.edges[j] != null ) { graph.detachEdge(n.edges[j]); } } } for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int ...
java
protected void recycleData() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int j = 0; j < n.edges.length; j++) { if( n.edges[j] != null ) { graph.detachEdge(n.edges[j]); } } } for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int ...
[ "protected", "void", "recycleData", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "SquareNode", "n", "=", "nodes", ".", "get", "(", "i", ")", ";", "for", "(", "int", ...
Reset and recycle data structures from the previous run
[ "Reset", "and", "recycle", "data", "structures", "from", "the", "previous", "run" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L46-L69
50,415
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.findClusters
protected void findClusters() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); if( n.graph < 0 ) { n.graph = clusters.size(); List<SquareNode> graph = clusters.grow(); graph.add(n); addToCluster(n, graph); } } }
java
protected void findClusters() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); if( n.graph < 0 ) { n.graph = clusters.size(); List<SquareNode> graph = clusters.grow(); graph.add(n); addToCluster(n, graph); } } }
[ "protected", "void", "findClusters", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "SquareNode", "n", "=", "nodes", ".", "get", "(", "i", ")", ";", "if", "(", "n", ...
Put sets of nodes into the same list if they are some how connected
[ "Put", "sets", "of", "nodes", "into", "the", "same", "list", "if", "they", "are", "some", "how", "connected" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L74-L86
50,416
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.addToCluster
void addToCluster(SquareNode seed, List<SquareNode> graph) { open.clear(); open.add(seed); while( !open.isEmpty() ) { SquareNode n = open.remove( open.size() - 1 ); for (int i = 0; i < n.square.size(); i++) { SquareEdge edge = n.edges[i]; if( edge == null ) continue; SquareNode other; ...
java
void addToCluster(SquareNode seed, List<SquareNode> graph) { open.clear(); open.add(seed); while( !open.isEmpty() ) { SquareNode n = open.remove( open.size() - 1 ); for (int i = 0; i < n.square.size(); i++) { SquareEdge edge = n.edges[i]; if( edge == null ) continue; SquareNode other; ...
[ "void", "addToCluster", "(", "SquareNode", "seed", ",", "List", "<", "SquareNode", ">", "graph", ")", "{", "open", ".", "clear", "(", ")", ";", "open", ".", "add", "(", "seed", ")", ";", "while", "(", "!", "open", ".", "isEmpty", "(", ")", ")", "...
Finds all neighbors and adds them to the graph. Repeated until there are no more nodes to add to the graph
[ "Finds", "all", "neighbors", "and", "adds", "them", "to", "the", "graph", ".", "Repeated", "until", "there", "are", "no", "more", "nodes", "to", "add", "to", "the", "graph" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L91-L119
50,417
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java
ExampleSegmentColor.printClickedColor
public static void printClickedColor( final BufferedImage image ) { ImagePanel gui = new ImagePanel(image); gui.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { float[] color = new float[3]; int rgb = image.getRGB(e.getX(),e.getY()); ColorHsv.rgbToHsv((rgb >...
java
public static void printClickedColor( final BufferedImage image ) { ImagePanel gui = new ImagePanel(image); gui.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { float[] color = new float[3]; int rgb = image.getRGB(e.getX(),e.getY()); ColorHsv.rgbToHsv((rgb >...
[ "public", "static", "void", "printClickedColor", "(", "final", "BufferedImage", "image", ")", "{", "ImagePanel", "gui", "=", "new", "ImagePanel", "(", "image", ")", ";", "gui", ".", "addMouseListener", "(", "new", "MouseAdapter", "(", ")", "{", "@", "Overrid...
Shows a color image and allows the user to select a pixel, convert it to HSV, print the HSV values, and calls the function below to display similar pixels.
[ "Shows", "a", "color", "image", "and", "allows", "the", "user", "to", "select", "a", "pixel", "convert", "it", "to", "HSV", "print", "the", "HSV", "values", "and", "calls", "the", "function", "below", "to", "display", "similar", "pixels", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java#L48-L63
50,418
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java
ExampleSegmentColor.showSelectedColor
public static void showSelectedColor( String name , BufferedImage image , float hue , float saturation ) { Planar<GrayF32> input = ConvertBufferedImage.convertFromPlanar(image,null,true,GrayF32.class); Planar<GrayF32> hsv = input.createSameShape(); // Convert into HSV ColorHsv.rgbToHsv(input,hsv); // Euclid...
java
public static void showSelectedColor( String name , BufferedImage image , float hue , float saturation ) { Planar<GrayF32> input = ConvertBufferedImage.convertFromPlanar(image,null,true,GrayF32.class); Planar<GrayF32> hsv = input.createSameShape(); // Convert into HSV ColorHsv.rgbToHsv(input,hsv); // Euclid...
[ "public", "static", "void", "showSelectedColor", "(", "String", "name", ",", "BufferedImage", "image", ",", "float", "hue", ",", "float", "saturation", ")", "{", "Planar", "<", "GrayF32", ">", "input", "=", "ConvertBufferedImage", ".", "convertFromPlanar", "(", ...
Selectively displays only pixels which have a similar hue and saturation values to what is provided. This is intended to be a simple example of color based segmentation. Color based segmentation can be done in RGB color, but is more problematic due to it not being intensity invariant. More robust techniques can use G...
[ "Selectively", "displays", "only", "pixels", "which", "have", "a", "similar", "hue", "and", "saturation", "values", "to", "what", "is", "provided", ".", "This", "is", "intended", "to", "be", "a", "simple", "example", "of", "color", "based", "segmentation", "...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java#L71-L106
50,419
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.transformDimension
public static ImageDimension transformDimension( ImageBase orig , int level ) { return transformDimension(orig.width,orig.height,level); }
java
public static ImageDimension transformDimension( ImageBase orig , int level ) { return transformDimension(orig.width,orig.height,level); }
[ "public", "static", "ImageDimension", "transformDimension", "(", "ImageBase", "orig", ",", "int", "level", ")", "{", "return", "transformDimension", "(", "orig", ".", "width", ",", "orig", ".", "height", ",", "level", ")", ";", "}" ]
Returns dimension which is required for the transformed image in a multilevel wavelet transform.
[ "Returns", "dimension", "which", "is", "required", "for", "the", "transformed", "image", "in", "a", "multilevel", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L93-L96
50,420
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.borderForwardLower
public static int borderForwardLower( WlCoef desc ) { int ret = -Math.min(desc.offsetScaling,desc.offsetWavelet); return ret + (ret % 2); }
java
public static int borderForwardLower( WlCoef desc ) { int ret = -Math.min(desc.offsetScaling,desc.offsetWavelet); return ret + (ret % 2); }
[ "public", "static", "int", "borderForwardLower", "(", "WlCoef", "desc", ")", "{", "int", "ret", "=", "-", "Math", ".", "min", "(", "desc", ".", "offsetScaling", ",", "desc", ".", "offsetWavelet", ")", ";", "return", "ret", "+", "(", "ret", "%", "2", ...
Returns the lower border for a forward wavelet transform.
[ "Returns", "the", "lower", "border", "for", "a", "forward", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L172-L176
50,421
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.borderInverseLower
public static int borderInverseLower( WlBorderCoef<?> desc, BorderIndex1D border ) { WlCoef inner = desc.getInnerCoefficients(); int borderSize = borderForwardLower(inner); WlCoef ll = borderSize > 0 ? inner : null; WlCoef lu = ll; WlCoef uu = inner; int indexLU = 0; if( desc.getLowerLength() > 0 ) { ...
java
public static int borderInverseLower( WlBorderCoef<?> desc, BorderIndex1D border ) { WlCoef inner = desc.getInnerCoefficients(); int borderSize = borderForwardLower(inner); WlCoef ll = borderSize > 0 ? inner : null; WlCoef lu = ll; WlCoef uu = inner; int indexLU = 0; if( desc.getLowerLength() > 0 ) { ...
[ "public", "static", "int", "borderInverseLower", "(", "WlBorderCoef", "<", "?", ">", "desc", ",", "BorderIndex1D", "border", ")", "{", "WlCoef", "inner", "=", "desc", ".", "getInnerCoefficients", "(", ")", ";", "int", "borderSize", "=", "borderForwardLower", "...
Returns the lower border for an inverse wavelet transform.
[ "Returns", "the", "lower", "border", "for", "an", "inverse", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L193-L219
50,422
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.round
public static int round( int top , int div2 , int divisor ) { if( top > 0 ) return (top + div2)/divisor; else return (top - div2)/divisor; }
java
public static int round( int top , int div2 , int divisor ) { if( top > 0 ) return (top + div2)/divisor; else return (top - div2)/divisor; }
[ "public", "static", "int", "round", "(", "int", "top", ",", "int", "div2", ",", "int", "divisor", ")", "{", "if", "(", "top", ">", "0", ")", "return", "(", "top", "+", "div2", ")", "/", "divisor", ";", "else", "return", "(", "top", "-", "div2", ...
Specialized rounding for use with integer wavelet transform. return (top +- div2) / divisor; @param top Top part of the equation. @param div2 The divisor divided by two. @param divisor The divisor. @return
[ "Specialized", "rounding", "for", "use", "with", "integer", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L308-L313
50,423
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.adjustForDisplay
public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) { if( transform instanceof GrayF32) adjustForDisplay((GrayF32)transform,numLevels,(float)valueRange); else adjustForDisplay((GrayI)transform,numLevels,(int)valueRange); }
java
public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) { if( transform instanceof GrayF32) adjustForDisplay((GrayF32)transform,numLevels,(float)valueRange); else adjustForDisplay((GrayI)transform,numLevels,(int)valueRange); }
[ "public", "static", "void", "adjustForDisplay", "(", "ImageGray", "transform", ",", "int", "numLevels", ",", "double", "valueRange", ")", "{", "if", "(", "transform", "instanceof", "GrayF32", ")", "adjustForDisplay", "(", "(", "GrayF32", ")", "transform", ",", ...
Adjusts the values inside a wavelet transform to make it easier to view. @param transform @param numLevels Number of levels in the transform
[ "Adjusts", "the", "values", "inside", "a", "wavelet", "transform", "to", "make", "it", "easier", "to", "view", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L332-L337
50,424
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.equalizeLocalNaive
public static void equalizeLocalNaive( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,input.height,(idx0,idx1)->{ int idx0 = 0, idx1 = input.height; int[] histog...
java
public static void equalizeLocalNaive( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,input.height,(idx0,idx1)->{ int idx0 = 0, idx1 = input.height; int[] histog...
[ "public", "static", "void", "equalizeLocalNaive", "(", "GrayU8", "input", ",", "int", "radius", ",", "GrayU8", "output", ",", "IWorkArrays", "workArrays", ")", "{", "int", "width", "=", "2", "*", "radius", "+", "1", ";", "int", "maxValue", "=", "workArrays...
Inefficiently computes the local histogram, but can handle every possible case for image size and local region size
[ "Inefficiently", "computes", "the", "local", "histogram", "but", "can", "handle", "every", "possible", "case", "for", "image", "size", "and", "local", "region", "size" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L111-L170
50,425
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.equalizeLocalInner
public static void equalizeLocalInner( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int area = width*width; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius,input.height-radius,(y0,y1)->{ int y0 = radius, ...
java
public static void equalizeLocalInner( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int area = width*width; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius,input.height-radius,(y0,y1)->{ int y0 = radius, ...
[ "public", "static", "void", "equalizeLocalInner", "(", "GrayU8", "input", ",", "int", "radius", ",", "GrayU8", "output", ",", "IWorkArrays", "workArrays", ")", "{", "int", "width", "=", "2", "*", "radius", "+", "1", ";", "int", "area", "=", "width", "*",...
Performs local histogram equalization just on the inner portion of the image
[ "Performs", "local", "histogram", "equalization", "just", "on", "the", "inner", "portion", "of", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L175-L232
50,426
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.localHistogram
public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) { for( int i = 0; i < histogram.length; i++ ) histogram[i] = 0; for( int i = y0; i < y1; i++ ) { int index = input.startIndex + i*input.stride + x0; int end = index + x1-x0; for( ; index < end; index...
java
public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) { for( int i = 0; i < histogram.length; i++ ) histogram[i] = 0; for( int i = y0; i < y1; i++ ) { int index = input.startIndex + i*input.stride + x0; int end = index + x1-x0; for( ; index < end; index...
[ "public", "static", "void", "localHistogram", "(", "GrayU16", "input", ",", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ",", "int", "histogram", "[", "]", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "histogra...
Computes the local histogram just for the specified inner region
[ "Computes", "the", "local", "histogram", "just", "for", "the", "specified", "inner", "region" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L718-L729
50,427
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/image/ImageZoomPanel.java
ImageZoomPanel.setBufferedImage
public synchronized void setBufferedImage(BufferedImage image) { // assume the image was initially set before the GUI was invoked if( checkEventDispatch && this.img != null ) { if( !SwingUtilities.isEventDispatchThread() ) throw new RuntimeException("Changed image when not in GUI thread?"); } this.img =...
java
public synchronized void setBufferedImage(BufferedImage image) { // assume the image was initially set before the GUI was invoked if( checkEventDispatch && this.img != null ) { if( !SwingUtilities.isEventDispatchThread() ) throw new RuntimeException("Changed image when not in GUI thread?"); } this.img =...
[ "public", "synchronized", "void", "setBufferedImage", "(", "BufferedImage", "image", ")", "{", "// assume the image was initially set before the GUI was invoked", "if", "(", "checkEventDispatch", "&&", "this", ".", "img", "!=", "null", ")", "{", "if", "(", "!", "Swing...
Change the image being displayed. @param image The new image which will be displayed.
[ "Change", "the", "image", "being", "displayed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ImageZoomPanel.java#L127-L137
50,428
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.initialize
public void initialize( T image , RectangleLength2D_I32 initial ) { if( !image.isInBounds(initial.x0,initial.y0) ) throw new IllegalArgumentException("Initial rectangle is out of bounds!"); if( !image.isInBounds(initial.x0+initial.width,initial.y0+initial.height) ) throw new IllegalArgumentException("Initial ...
java
public void initialize( T image , RectangleLength2D_I32 initial ) { if( !image.isInBounds(initial.x0,initial.y0) ) throw new IllegalArgumentException("Initial rectangle is out of bounds!"); if( !image.isInBounds(initial.x0+initial.width,initial.y0+initial.height) ) throw new IllegalArgumentException("Initial ...
[ "public", "void", "initialize", "(", "T", "image", ",", "RectangleLength2D_I32", "initial", ")", "{", "if", "(", "!", "image", ".", "isInBounds", "(", "initial", ".", "x0", ",", "initial", ".", "y0", ")", ")", "throw", "new", "IllegalArgumentException", "(...
Specifies the initial target location so that it can learn its description @param image Image @param initial Initial target location and the mean-shift bandwidth
[ "Specifies", "the", "initial", "target", "location", "so", "that", "it", "can", "learn", "its", "description" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L93-L117
50,429
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.process
public boolean process( T image ) { if( failed ) return false; targetModel.setImage(image); // mark the region where the pdf has been modified as dirty dirty.set(location.x0, location.y0, location.x0 + location.width, location.y0 + location.height); // compute the pdf inside the initial rectangle upda...
java
public boolean process( T image ) { if( failed ) return false; targetModel.setImage(image); // mark the region where the pdf has been modified as dirty dirty.set(location.x0, location.y0, location.x0 + location.width, location.y0 + location.height); // compute the pdf inside the initial rectangle upda...
[ "public", "boolean", "process", "(", "T", "image", ")", "{", "if", "(", "failed", ")", "return", "false", ";", "targetModel", ".", "setImage", "(", "image", ")", ";", "// mark the region where the pdf has been modified as dirty", "dirty", ".", "set", "(", "locat...
Updates the target's location in the image by performing a mean-shift search. Returns if it was successful at finding the target or not. If it fails once it will need to be re-initialized @param image Most recent image in the sequence @return true for success or false if it failed
[ "Updates", "the", "target", "s", "location", "in", "the", "image", "by", "performing", "a", "mean", "-", "shift", "search", ".", "Returns", "if", "it", "was", "successful", "at", "finding", "the", "target", "or", "not", ".", "If", "it", "fails", "once", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L141-L221
50,430
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.updatePdfImage
protected void updatePdfImage( int x0 , int y0 , int x1 , int y1 ) { for( int y = y0; y < y1; y++ ) { int indexOut = pdf.startIndex + pdf.stride*y + x0; for( int x = x0; x < x1; x++ , indexOut++ ) { if( pdf.data[indexOut] < 0 ) pdf.data[indexOut] = targetModel.compute(x, y); } } // update th...
java
protected void updatePdfImage( int x0 , int y0 , int x1 , int y1 ) { for( int y = y0; y < y1; y++ ) { int indexOut = pdf.startIndex + pdf.stride*y + x0; for( int x = x0; x < x1; x++ , indexOut++ ) { if( pdf.data[indexOut] < 0 ) pdf.data[indexOut] = targetModel.compute(x, y); } } // update th...
[ "protected", "void", "updatePdfImage", "(", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "for", "(", "int", "y", "=", "y0", ";", "y", "<", "y1", ";", "y", "++", ")", "{", "int", "indexOut", "=", "pdf", ".", "st...
Computes the PDF only inside the image as needed amd update the dirty rectangle
[ "Computes", "the", "PDF", "only", "inside", "the", "image", "as", "needed", "amd", "update", "the", "dirty", "rectangle" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L226-L246
50,431
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearchGray.java
SegmentMeanShiftSearchGray.process
@Override public void process( T image ) { // initialize data structures this.image = image; this.stopRequested = false; modeLocation.reset(); modeColor.reset(); modeMemberCount.reset(); interpolate.setImage(image); pixelToMode.reshape(image.width, image.height); quickMode.reshape(image.width, ima...
java
@Override public void process( T image ) { // initialize data structures this.image = image; this.stopRequested = false; modeLocation.reset(); modeColor.reset(); modeMemberCount.reset(); interpolate.setImage(image); pixelToMode.reshape(image.width, image.height); quickMode.reshape(image.width, ima...
[ "@", "Override", "public", "void", "process", "(", "T", "image", ")", "{", "// initialize data structures", "this", ".", "image", "=", "image", ";", "this", ".", "stopRequested", "=", "false", ";", "modeLocation", ".", "reset", "(", ")", ";", "modeColor", ...
Performs mean-shift clustering on the input image @param image Input image
[ "Performs", "mean", "-", "shift", "clustering", "on", "the", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearchGray.java#L62-L131
50,432
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/struct/geo/Point2D3D.java
Point2D3D.set
public void set( Point2D3D src ) { observation.set(src.observation); location.set(src.location); }
java
public void set( Point2D3D src ) { observation.set(src.observation); location.set(src.location); }
[ "public", "void", "set", "(", "Point2D3D", "src", ")", "{", "observation", ".", "set", "(", "src", ".", "observation", ")", ";", "location", ".", "set", "(", "src", ".", "location", ")", ";", "}" ]
Sets 'this' to be identical to 'src'.
[ "Sets", "this", "to", "be", "identical", "to", "src", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/geo/Point2D3D.java#L52-L55
50,433
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.clearLensDistortion
public void clearLensDistortion() { detector.clearLensDistortion(); if( refineGray != null ) refineGray.clearLensDistortion(); edgeIntensity.setTransform(null); }
java
public void clearLensDistortion() { detector.clearLensDistortion(); if( refineGray != null ) refineGray.clearLensDistortion(); edgeIntensity.setTransform(null); }
[ "public", "void", "clearLensDistortion", "(", ")", "{", "detector", ".", "clearLensDistortion", "(", ")", ";", "if", "(", "refineGray", "!=", "null", ")", "refineGray", ".", "clearLensDistortion", "(", ")", ";", "edgeIntensity", ".", "setTransform", "(", "null...
Discard previously set lens distortion models
[ "Discard", "previously", "set", "lens", "distortion", "models" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L132-L137
50,434
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.process
public void process(T gray , GrayU8 binary ) { detector.process(gray,binary); if( refineGray != null ) refineGray.setImage(gray); edgeIntensity.setImage(gray); long time0 = System.nanoTime(); FastQueue<DetectPolygonFromContour.Info> detections = detector.getFound(); if( adjustForBias != null ) { int...
java
public void process(T gray , GrayU8 binary ) { detector.process(gray,binary); if( refineGray != null ) refineGray.setImage(gray); edgeIntensity.setImage(gray); long time0 = System.nanoTime(); FastQueue<DetectPolygonFromContour.Info> detections = detector.getFound(); if( adjustForBias != null ) { int...
[ "public", "void", "process", "(", "T", "gray", ",", "GrayU8", "binary", ")", "{", "detector", ".", "process", "(", "gray", ",", "binary", ")", ";", "if", "(", "refineGray", "!=", "null", ")", "refineGray", ".", "setImage", "(", "gray", ")", ";", "edg...
Detects polygons inside the grayscale image and its thresholded version @param gray Gray scale image @param binary Binary version of grayscale image
[ "Detects", "polygons", "inside", "the", "grayscale", "image", "and", "its", "thresholded", "version" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L149-L177
50,435
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.refine
public boolean refine( DetectPolygonFromContour.Info info ) { double before,after; if( edgeIntensity.computeEdge(info.polygon,!detector.isOutputClockwise()) ) { before = edgeIntensity.getAverageOutside() - edgeIntensity.getAverageInside(); } else { return false; } boolean success = false; if( refine...
java
public boolean refine( DetectPolygonFromContour.Info info ) { double before,after; if( edgeIntensity.computeEdge(info.polygon,!detector.isOutputClockwise()) ) { before = edgeIntensity.getAverageOutside() - edgeIntensity.getAverageInside(); } else { return false; } boolean success = false; if( refine...
[ "public", "boolean", "refine", "(", "DetectPolygonFromContour", ".", "Info", "info", ")", "{", "double", "before", ",", "after", ";", "if", "(", "edgeIntensity", ".", "computeEdge", "(", "info", ".", "polygon", ",", "!", "detector", ".", "isOutputClockwise", ...
Refines the fit to the specified polygon. Only info.polygon is modified @param info The polygon and related info @return true if successful or false if not
[ "Refines", "the", "fit", "to", "the", "specified", "polygon", ".", "Only", "info", ".", "polygon", "is", "modified" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L184-L236
50,436
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.refineAll
public void refineAll() { List<DetectPolygonFromContour.Info> detections = detector.getFound().toList(); for (int i = 0; i < detections.size(); i++) { refine(detections.get(i)); } }
java
public void refineAll() { List<DetectPolygonFromContour.Info> detections = detector.getFound().toList(); for (int i = 0; i < detections.size(); i++) { refine(detections.get(i)); } }
[ "public", "void", "refineAll", "(", ")", "{", "List", "<", "DetectPolygonFromContour", ".", "Info", ">", "detections", "=", "detector", ".", "getFound", "(", ")", ".", "toList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detecti...
Refines all the detected polygons and places them into the provided list. Polygons which fail the refinement step are not added.
[ "Refines", "all", "the", "detected", "polygons", "and", "places", "them", "into", "the", "provided", "list", ".", "Polygons", "which", "fail", "the", "refinement", "step", "are", "not", "added", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L242-L248
50,437
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java
InputSanityCheck.checkReshape
public static <T extends ImageGray<T>> T checkReshape(T target , ImageGray testImage , Class<T> targetType ) { if( target == null ) { return GeneralizedImageOps.createSingleBand(targetType, testImage.width, testImage.height); } else if( target.width != testImage.width || target.height != testImage.height ) { ...
java
public static <T extends ImageGray<T>> T checkReshape(T target , ImageGray testImage , Class<T> targetType ) { if( target == null ) { return GeneralizedImageOps.createSingleBand(targetType, testImage.width, testImage.height); } else if( target.width != testImage.width || target.height != testImage.height ) { ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "checkReshape", "(", "T", "target", ",", "ImageGray", "testImage", ",", "Class", "<", "T", ">", "targetType", ")", "{", "if", "(", "target", "==", "null", ")", "{", "retur...
Checks to see if the target image is null or if it is a different size than the test image. If it is null then a new image is returned, otherwise target is reshaped and returned. @param target @param testImage @param targetType @param <T> @return
[ "Checks", "to", "see", "if", "the", "target", "image", "is", "null", "or", "if", "it", "is", "a", "different", "size", "than", "the", "test", "image", ".", "If", "it", "is", "null", "then", "a", "new", "image", "is", "returned", "otherwise", "target", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java#L44-L52
50,438
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeaturePyramid.java
FeaturePyramid.findLocalScaleSpaceMax
protected void findLocalScaleSpaceMax(PyramidFloat<T> ss, int layerID) { int index0 = spaceIndex; int index1 = (spaceIndex + 1) % 3; int index2 = (spaceIndex + 2) % 3; List<Point2D_I16> candidates = maximums[index1]; ImageBorder_F32 inten0 = (ImageBorder_F32) FactoryImageBorderAlgs.value(intensities[index0],...
java
protected void findLocalScaleSpaceMax(PyramidFloat<T> ss, int layerID) { int index0 = spaceIndex; int index1 = (spaceIndex + 1) % 3; int index2 = (spaceIndex + 2) % 3; List<Point2D_I16> candidates = maximums[index1]; ImageBorder_F32 inten0 = (ImageBorder_F32) FactoryImageBorderAlgs.value(intensities[index0],...
[ "protected", "void", "findLocalScaleSpaceMax", "(", "PyramidFloat", "<", "T", ">", "ss", ",", "int", "layerID", ")", "{", "int", "index0", "=", "spaceIndex", ";", "int", "index1", "=", "(", "spaceIndex", "+", "1", ")", "%", "3", ";", "int", "index2", "...
Searches the pyramid layers up and down to see if the found 2D features are also scale space maximums.
[ "Searches", "the", "pyramid", "layers", "up", "and", "down", "to", "see", "if", "the", "found", "2D", "features", "are", "also", "scale", "space", "maximums", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeaturePyramid.java#L168-L206
50,439
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java
SquaresIntoCrossClusters.getCornerIndex
int getCornerIndex( SquareNode node , double x , double y ) { for (int i = 0; i < node.square.size(); i++) { Point2D_F64 c = node.square.get(i); if( c.x == x && c.y == y ) return i; } throw new RuntimeException("BUG!"); }
java
int getCornerIndex( SquareNode node , double x , double y ) { for (int i = 0; i < node.square.size(); i++) { Point2D_F64 c = node.square.get(i); if( c.x == x && c.y == y ) return i; } throw new RuntimeException("BUG!"); }
[ "int", "getCornerIndex", "(", "SquareNode", "node", ",", "double", "x", ",", "double", "y", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "square", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Point2D_F64", "c", "...
Returns the corner index of the specified coordinate
[ "Returns", "the", "corner", "index", "of", "the", "specified", "coordinate" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java#L173-L181
50,440
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java
SquaresIntoCrossClusters.candidateIsMuchCloser
boolean candidateIsMuchCloser( SquareNode node0 , SquareNode node1 , double distance2 ) { double length = Math.max(node0.largestSide,node1.largestSide)*tooFarFraction; length *= length; if( distance2 > length) return false; return distance2 <= length; }
java
boolean candidateIsMuchCloser( SquareNode node0 , SquareNode node1 , double distance2 ) { double length = Math.max(node0.largestSide,node1.largestSide)*tooFarFraction; length *= length; if( distance2 > length) return false; return distance2 <= length; }
[ "boolean", "candidateIsMuchCloser", "(", "SquareNode", "node0", ",", "SquareNode", "node1", ",", "double", "distance2", ")", "{", "double", "length", "=", "Math", ".", "max", "(", "node0", ".", "largestSide", ",", "node1", ".", "largestSide", ")", "*", "tooF...
Checks to see if the two corners which are to be connected are by far the two closest corners between the two squares
[ "Checks", "to", "see", "if", "the", "two", "corners", "which", "are", "to", "be", "connected", "are", "by", "far", "the", "two", "closest", "corners", "between", "the", "two", "squares" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java#L209-L219
50,441
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.handleContextMenu
private void handleContextMenu(JTree tree, int x, int y) { TreePath path = tree.getPathForLocation(x, y); tree.setSelectionPath(path); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (!node.isLeaf()) { tree.setSelectionPath(null);...
java
private void handleContextMenu(JTree tree, int x, int y) { TreePath path = tree.getPathForLocation(x, y); tree.setSelectionPath(path); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (!node.isLeaf()) { tree.setSelectionPath(null);...
[ "private", "void", "handleContextMenu", "(", "JTree", "tree", ",", "int", "x", ",", "int", "y", ")", "{", "TreePath", "path", "=", "tree", ".", "getPathForLocation", "(", "x", ",", "y", ")", ";", "tree", ".", "setSelectionPath", "(", "path", ")", ";", ...
Displays a context menu for a class leaf node Allows copying of the name and the path to the source
[ "Displays", "a", "context", "menu", "for", "a", "class", "leaf", "node", "Allows", "copying", "of", "the", "name", "and", "the", "path", "to", "the", "source" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L337-L371
50,442
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.openInGitHub
private void openInGitHub( AppInfo info ) { if (Desktop.isDesktopSupported()) { try { URI uri = new URI(UtilIO.getGithubURL(info.app.getPackage().getName(), info.app.getSimpleName())); if (!uri.getPath().isEmpty()) Desktop.getDesktop().browse(uri); else System.err.println("Bad URL received")...
java
private void openInGitHub( AppInfo info ) { if (Desktop.isDesktopSupported()) { try { URI uri = new URI(UtilIO.getGithubURL(info.app.getPackage().getName(), info.app.getSimpleName())); if (!uri.getPath().isEmpty()) Desktop.getDesktop().browse(uri); else System.err.println("Bad URL received")...
[ "private", "void", "openInGitHub", "(", "AppInfo", "info", ")", "{", "if", "(", "Desktop", ".", "isDesktopSupported", "(", ")", ")", "{", "try", "{", "URI", "uri", "=", "new", "URI", "(", "UtilIO", ".", "getGithubURL", "(", "info", ".", "app", ".", "...
Opens github page of source code up in a browser window
[ "Opens", "github", "page", "of", "source", "code", "up", "in", "a", "browser", "window" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L376-L391
50,443
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.killAllProcesses
public void killAllProcesses( long blockTimeMS ) { // remove already dead processes from the GUI SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DefaultListModel model = (DefaultListModel)processList.getModel(); for (int i = model.size()-1; i >= 0; i--) { ActiveProcess p...
java
public void killAllProcesses( long blockTimeMS ) { // remove already dead processes from the GUI SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DefaultListModel model = (DefaultListModel)processList.getModel(); for (int i = model.size()-1; i >= 0; i--) { ActiveProcess p...
[ "public", "void", "killAllProcesses", "(", "long", "blockTimeMS", ")", "{", "// remove already dead processes from the GUI", "SwingUtilities", ".", "invokeLater", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "Defa...
Requests that all active processes be killed. @param blockTimeMS If &gt; 0 then it will block until all processes are killed for the specified number of milliseconds
[ "Requests", "that", "all", "active", "processes", "be", "killed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L415-L452
50,444
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.intervalAdded
@Override public void intervalAdded(ListDataEvent e) { //retrieve the most recently added process and display it DefaultListModel listModel = (DefaultListModel) e.getSource(); ActiveProcess process = (ActiveProcess) listModel.get(listModel.getSize() - 1); addProcessTab(process, outputPanel); }
java
@Override public void intervalAdded(ListDataEvent e) { //retrieve the most recently added process and display it DefaultListModel listModel = (DefaultListModel) e.getSource(); ActiveProcess process = (ActiveProcess) listModel.get(listModel.getSize() - 1); addProcessTab(process, outputPanel); }
[ "@", "Override", "public", "void", "intervalAdded", "(", "ListDataEvent", "e", ")", "{", "//retrieve the most recently added process and display it", "DefaultListModel", "listModel", "=", "(", "DefaultListModel", ")", "e", ".", "getSource", "(", ")", ";", "ActiveProcess...
Called after a new process is added to the process list @param e
[ "Called", "after", "a", "new", "process", "is", "added", "to", "the", "process", "list" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L459-L465
50,445
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.setUpEdges
protected void setUpEdges(GrayS32 input , GrayS32 output ) { if( connectRule == ConnectRule.EIGHT ) { setUpEdges8(input,edgesIn); setUpEdges8(output,edgesOut); edges[0].set( 1, 0); edges[1].set( 1, 1); edges[2].set( 0, 1); edges[3].set(-1, 0); } else { setUpEdges4(input,edgesIn); setUpEdge...
java
protected void setUpEdges(GrayS32 input , GrayS32 output ) { if( connectRule == ConnectRule.EIGHT ) { setUpEdges8(input,edgesIn); setUpEdges8(output,edgesOut); edges[0].set( 1, 0); edges[1].set( 1, 1); edges[2].set( 0, 1); edges[3].set(-1, 0); } else { setUpEdges4(input,edgesIn); setUpEdge...
[ "protected", "void", "setUpEdges", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "if", "(", "connectRule", "==", "ConnectRule", ".", "EIGHT", ")", "{", "setUpEdges8", "(", "input", ",", "edgesIn", ")", ";", "setUpEdges8", "(", "output", ",",...
Declares lookup tables for neighbors
[ "Declares", "lookup", "tables", "for", "neighbors" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L88-L104
50,446
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.process
public void process(GrayS32 input , GrayS32 output , GrowQueue_I32 regionMemberCount ) { // initialize data structures this.regionMemberCount = regionMemberCount; regionMemberCount.reset(); setUpEdges(input,output); ImageMiscOps.fill(output,-1); // this is a bit of a hack here. Normally you call the pare...
java
public void process(GrayS32 input , GrayS32 output , GrowQueue_I32 regionMemberCount ) { // initialize data structures this.regionMemberCount = regionMemberCount; regionMemberCount.reset(); setUpEdges(input,output); ImageMiscOps.fill(output,-1); // this is a bit of a hack here. Normally you call the pare...
[ "public", "void", "process", "(", "GrayS32", "input", ",", "GrayS32", "output", ",", "GrowQueue_I32", "regionMemberCount", ")", "{", "// initialize data structures", "this", ".", "regionMemberCount", "=", "regionMemberCount", ";", "regionMemberCount", ".", "reset", "(...
Relabels the image such that all pixels with the same label are a member of the same graph. @param input Labeled input image. @param output Labeled output image. @param regionMemberCount (Input/Output) Number of pixels which belong to each group.
[ "Relabels", "the", "image", "such", "that", "all", "pixels", "with", "the", "same", "label", "are", "a", "member", "of", "the", "same", "graph", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L125-L143
50,447
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectInner
protected void connectInner(GrayS32 input, GrayS32 output) { int startX = connectRule == ConnectRule.EIGHT ? 1 : 0; for( int y = 0; y < input.height-1; y++ ) { int indexIn = input.startIndex + y*input.stride + startX; int indexOut = output.startIndex + y*output.stride + startX; for( int x = startX; x < ...
java
protected void connectInner(GrayS32 input, GrayS32 output) { int startX = connectRule == ConnectRule.EIGHT ? 1 : 0; for( int y = 0; y < input.height-1; y++ ) { int indexIn = input.startIndex + y*input.stride + startX; int indexOut = output.startIndex + y*output.stride + startX; for( int x = startX; x < ...
[ "protected", "void", "connectInner", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "int", "startX", "=", "connectRule", "==", "ConnectRule", ".", "EIGHT", "?", "1", ":", "0", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input...
Examines pixels inside the image without the need for bounds checking
[ "Examines", "pixels", "inside", "the", "image", "without", "the", "need", "for", "bounds", "checking" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L148-L178
50,448
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectLeftRight
protected void connectLeftRight(GrayS32 input, GrayS32 output) { for( int y = 0; y < input.height; y++ ) { int x = input.width-1; int inputLabel = input.unsafe_get(x, y); int outputLabel = output.unsafe_get(x, y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabe...
java
protected void connectLeftRight(GrayS32 input, GrayS32 output) { for( int y = 0; y < input.height; y++ ) { int x = input.width-1; int inputLabel = input.unsafe_get(x, y); int outputLabel = output.unsafe_get(x, y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabe...
[ "protected", "void", "connectLeftRight", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input", ".", "height", ";", "y", "++", ")", "{", "int", "x", "=", "input", ".", "width", "-", ...
Examines pixels along the left and right border
[ "Examines", "pixels", "along", "the", "left", "and", "right", "border" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L183-L251
50,449
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectBottom
protected void connectBottom(GrayS32 input, GrayS32 output) { for( int x = 0; x < input.width-1; x++ ) { int y = input.height-1; int inputLabel = input.unsafe_get(x,y); int outputLabel = output.unsafe_get(x,y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabel =...
java
protected void connectBottom(GrayS32 input, GrayS32 output) { for( int x = 0; x < input.width-1; x++ ) { int y = input.height-1; int inputLabel = input.unsafe_get(x,y); int outputLabel = output.unsafe_get(x,y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabel =...
[ "protected", "void", "connectBottom", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "for", "(", "int", "x", "=", "0", ";", "x", "<", "input", ".", "width", "-", "1", ";", "x", "++", ")", "{", "int", "y", "=", "input", ".", "height"...
Examines pixels along the bottom border
[ "Examines", "pixels", "along", "the", "bottom", "border" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L256-L281
50,450
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.setImage
public void setImage(I image, D derivX, D derivY) { InputSanityCheck.checkSameShape(image, derivX, derivY); this.image = image; this.interpInput.setImage(image); this.derivX = derivX; this.derivY = derivY; }
java
public void setImage(I image, D derivX, D derivY) { InputSanityCheck.checkSameShape(image, derivX, derivY); this.image = image; this.interpInput.setImage(image); this.derivX = derivX; this.derivY = derivY; }
[ "public", "void", "setImage", "(", "I", "image", ",", "D", "derivX", ",", "D", "derivY", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "image", ",", "derivX", ",", "derivY", ")", ";", "this", ".", "image", "=", "image", ";", "this", ".", ...
Sets the current image it should be tracking with. @param image Original input image. @param derivX Image derivative along the x-axis @param derivY Image derivative along the y-axis
[ "Sets", "the", "current", "image", "it", "should", "be", "tracking", "with", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L119-L127
50,451
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.setDescription
@SuppressWarnings({"SuspiciousNameCombination"}) public boolean setDescription(KltFeature feature) { setAllowedBounds(feature); if (!isFullyInside(feature.x, feature.y)) { if( isFullyOutside(feature.x,feature.y)) return false; else return internalSetDescriptionBorder(feature); } return internal...
java
@SuppressWarnings({"SuspiciousNameCombination"}) public boolean setDescription(KltFeature feature) { setAllowedBounds(feature); if (!isFullyInside(feature.x, feature.y)) { if( isFullyOutside(feature.x,feature.y)) return false; else return internalSetDescriptionBorder(feature); } return internal...
[ "@", "SuppressWarnings", "(", "{", "\"SuspiciousNameCombination\"", "}", ")", "public", "boolean", "setDescription", "(", "KltFeature", "feature", ")", "{", "setAllowedBounds", "(", "feature", ")", ";", "if", "(", "!", "isFullyInside", "(", "feature", ".", "x", ...
Sets the features description using the current image and the location of the feature stored in the feature. If the feature is an illegal location and cannot be set then false is returned. @param feature Feature description which is to be set. Location must be specified. @return true if the feature's description was m...
[ "Sets", "the", "features", "description", "using", "the", "current", "image", "and", "the", "location", "of", "the", "feature", "stored", "in", "the", "feature", ".", "If", "the", "feature", "is", "an", "illegal", "location", "and", "cannot", "be", "set", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L146-L158
50,452
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.internalSetDescriptionBorder
protected boolean internalSetDescriptionBorder(KltFeature feature) { computeSubImageBounds(feature, feature.x, feature.y); ImageMiscOps.fill(feature.desc, Float.NaN); feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); feat...
java
protected boolean internalSetDescriptionBorder(KltFeature feature) { computeSubImageBounds(feature, feature.x, feature.y); ImageMiscOps.fill(feature.desc, Float.NaN); feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); feat...
[ "protected", "boolean", "internalSetDescriptionBorder", "(", "KltFeature", "feature", ")", "{", "computeSubImageBounds", "(", "feature", ",", "feature", ".", "x", ",", "feature", ".", "y", ")", ";", "ImageMiscOps", ".", "fill", "(", "feature", ".", "desc", ","...
Computes the descriptor for border features. All it needs to do is save the pixel value, but derivative information is also computed so that it can reject bad features immediately.
[ "Computes", "the", "descriptor", "for", "border", "features", ".", "All", "it", "needs", "to", "do", "is", "save", "the", "pixel", "value", "but", "derivative", "information", "is", "also", "computed", "so", "that", "it", "can", "reject", "bad", "features", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L198-L240
50,453
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.setAllowedBounds
protected void setAllowedBounds(KltFeature feature) { // compute the feature's width and temporary storage related to it widthFeature = feature.radius * 2 + 1; lengthFeature = widthFeature * widthFeature; allowedLeft = feature.radius; allowedTop = feature.radius; allowedRight = image.width - feature.radius...
java
protected void setAllowedBounds(KltFeature feature) { // compute the feature's width and temporary storage related to it widthFeature = feature.radius * 2 + 1; lengthFeature = widthFeature * widthFeature; allowedLeft = feature.radius; allowedTop = feature.radius; allowedRight = image.width - feature.radius...
[ "protected", "void", "setAllowedBounds", "(", "KltFeature", "feature", ")", "{", "// compute the feature's width and temporary storage related to it", "widthFeature", "=", "feature", ".", "radius", "*", "2", "+", "1", ";", "lengthFeature", "=", "widthFeature", "*", "wid...
Precompute image bounds that the feature is allowed inside of
[ "Precompute", "image", "bounds", "that", "the", "feature", "is", "allowed", "inside", "of" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L330-L344
50,454
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.computeGandE_border
protected int computeGandE_border(KltFeature feature, float cx, float cy) { computeSubImageBounds(feature, cx, cy); ImageMiscOps.fill(currDesc, Float.NaN); currDesc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); int total = 0; G...
java
protected int computeGandE_border(KltFeature feature, float cx, float cy) { computeSubImageBounds(feature, cx, cy); ImageMiscOps.fill(currDesc, Float.NaN); currDesc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); int total = 0; G...
[ "protected", "int", "computeGandE_border", "(", "KltFeature", "feature", ",", "float", "cx", ",", "float", "cy", ")", "{", "computeSubImageBounds", "(", "feature", ",", "cx", ",", "cy", ")", ";", "ImageMiscOps", ".", "fill", "(", "currDesc", ",", "Float", ...
When part of the region is outside the image G and E need to be recomputed
[ "When", "part", "of", "the", "region", "is", "outside", "the", "image", "G", "and", "E", "need", "to", "be", "recomputed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L379-L419
50,455
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.isDescriptionComplete
public boolean isDescriptionComplete( KltFeature feature ) { for( int i = 0; i < lengthFeature; i++ ) { if( Float.isNaN(feature.desc.data[i]) ) return false; } return true; }
java
public boolean isDescriptionComplete( KltFeature feature ) { for( int i = 0; i < lengthFeature; i++ ) { if( Float.isNaN(feature.desc.data[i]) ) return false; } return true; }
[ "public", "boolean", "isDescriptionComplete", "(", "KltFeature", "feature", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "lengthFeature", ";", "i", "++", ")", "{", "if", "(", "Float", ".", "isNaN", "(", "feature", ".", "desc", ".", "dat...
Checks to see if the feature description is complete or if it was created by a feature partially outside the image
[ "Checks", "to", "see", "if", "the", "feature", "description", "is", "complete", "or", "if", "it", "was", "created", "by", "a", "feature", "partially", "outside", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L463-L469
50,456
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.isFullyInside
public boolean isFullyInside(float x, float y) { if (x < allowedLeft || x > allowedRight) return false; if (y < allowedTop || y > allowedBottom) return false; return true; }
java
public boolean isFullyInside(float x, float y) { if (x < allowedLeft || x > allowedRight) return false; if (y < allowedTop || y > allowedBottom) return false; return true; }
[ "public", "boolean", "isFullyInside", "(", "float", "x", ",", "float", "y", ")", "{", "if", "(", "x", "<", "allowedLeft", "||", "x", ">", "allowedRight", ")", "return", "false", ";", "if", "(", "y", "<", "allowedTop", "||", "y", ">", "allowedBottom", ...
Returns true if the features is entirely enclosed inside of the image.
[ "Returns", "true", "if", "the", "features", "is", "entirely", "enclosed", "inside", "of", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L474-L481
50,457
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.isFullyOutside
public boolean isFullyOutside(float x, float y) { if (x < outsideLeft || x > outsideRight) return true; if (y < outsideTop || y > outsideBottom) return true; return false; }
java
public boolean isFullyOutside(float x, float y) { if (x < outsideLeft || x > outsideRight) return true; if (y < outsideTop || y > outsideBottom) return true; return false; }
[ "public", "boolean", "isFullyOutside", "(", "float", "x", ",", "float", "y", ")", "{", "if", "(", "x", "<", "outsideLeft", "||", "x", ">", "outsideRight", ")", "return", "true", ";", "if", "(", "y", "<", "outsideTop", "||", "y", ">", "outsideBottom", ...
Returns true if the features is entirely outside of the image. A region is entirely outside if not an entire pixel is contained inside the image. So if only 0.999 of a pixel is inside then the whole region is considered to be outside. Can't interpolate nothing...
[ "Returns", "true", "if", "the", "features", "is", "entirely", "outside", "of", "the", "image", ".", "A", "region", "is", "entirely", "outside", "if", "not", "an", "entire", "pixel", "is", "contained", "inside", "the", "image", ".", "So", "if", "only", "0...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L488-L495
50,458
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java
FeatureLaplacePyramid.checkMax
private boolean checkMax(T image, double adj, double bestScore, int c_x, int c_y) { sparseLaplace.setImage(image); boolean isMax = true; beginLoop: for (int i = c_y - 1; i <= c_y + 1; i++) { for (int j = c_x - 1; j <= c_x + 1; j++) { double value = adj*sparseLaplace.compute(j, i); if (value >= bestSc...
java
private boolean checkMax(T image, double adj, double bestScore, int c_x, int c_y) { sparseLaplace.setImage(image); boolean isMax = true; beginLoop: for (int i = c_y - 1; i <= c_y + 1; i++) { for (int j = c_x - 1; j <= c_x + 1; j++) { double value = adj*sparseLaplace.compute(j, i); if (value >= bestSc...
[ "private", "boolean", "checkMax", "(", "T", "image", ",", "double", "adj", ",", "double", "bestScore", ",", "int", "c_x", ",", "int", "c_y", ")", "{", "sparseLaplace", ".", "setImage", "(", "image", ")", ";", "boolean", "isMax", "=", "true", ";", "begi...
See if the best score is better than the local adjusted scores at this scale
[ "See", "if", "the", "best", "score", "is", "better", "than", "the", "local", "adjusted", "scores", "at", "this", "scale" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java#L244-L258
50,459
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardPatterns.java
DetectChessboardPatterns.findPatterns
public void findPatterns(GrayF32 input) { found.reset(); detector.process(input); clusterFinder.process(detector.getCorners().toList()); FastQueue<ChessboardCornerGraph> clusters = clusterFinder.getOutputClusters(); for (int clusterIdx = 0; clusterIdx < clusters.size; clusterIdx++) { ChessboardCornerGraph...
java
public void findPatterns(GrayF32 input) { found.reset(); detector.process(input); clusterFinder.process(detector.getCorners().toList()); FastQueue<ChessboardCornerGraph> clusters = clusterFinder.getOutputClusters(); for (int clusterIdx = 0; clusterIdx < clusters.size; clusterIdx++) { ChessboardCornerGraph...
[ "public", "void", "findPatterns", "(", "GrayF32", "input", ")", "{", "found", ".", "reset", "(", ")", ";", "detector", ".", "process", "(", "input", ")", ";", "clusterFinder", ".", "process", "(", "detector", ".", "getCorners", "(", ")", ".", "toList", ...
Processes the image and searches for all chessboard patterns.
[ "Processes", "the", "image", "and", "searches", "for", "all", "chessboard", "patterns", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardPatterns.java#L74-L87
50,460
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.configure
public void configure( int width , int height , int gridRows , int gridCols ) { // need to maintain the same ratio of pixels in the grid as in the regular image for similarity and rigid // to work correctly int s = Math.max(width,height); scaleX = s/(float)(gridCols-1); scaleY = s/(float)(gridRows-1); if( ...
java
public void configure( int width , int height , int gridRows , int gridCols ) { // need to maintain the same ratio of pixels in the grid as in the regular image for similarity and rigid // to work correctly int s = Math.max(width,height); scaleX = s/(float)(gridCols-1); scaleY = s/(float)(gridRows-1); if( ...
[ "public", "void", "configure", "(", "int", "width", ",", "int", "height", ",", "int", "gridRows", ",", "int", "gridCols", ")", "{", "// need to maintain the same ratio of pixels in the grid as in the regular image for similarity and rigid", "// to work correctly", "int", "s",...
Specifies the input image size and the size of the grid it will use to approximate the idea solution. All control points are discarded @param width Image width @param height Image height @param gridRows grid rows @param gridCols grid columns
[ "Specifies", "the", "input", "image", "size", "and", "the", "size", "of", "the", "grid", "it", "will", "use", "to", "approximate", "the", "idea", "solution", ".", "All", "control", "points", "are", "discarded" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L109-L127
50,461
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.addControl
public int addControl( float x , float y ) { Control c = controls.grow(); c.q.set(x,y); setUndistorted(controls.size()-1,x,y); return controls.size()-1; }
java
public int addControl( float x , float y ) { Control c = controls.grow(); c.q.set(x,y); setUndistorted(controls.size()-1,x,y); return controls.size()-1; }
[ "public", "int", "addControl", "(", "float", "x", ",", "float", "y", ")", "{", "Control", "c", "=", "controls", ".", "grow", "(", ")", ";", "c", ".", "q", ".", "set", "(", "x", ",", "y", ")", ";", "setUndistorted", "(", "controls", ".", "size", ...
Adds a new control point at the specified location. Initially the distorted and undistorted location will be set to the same @param x coordinate x-axis in image pixels @param y coordinate y-axis in image pixels @return Index of control point
[ "Adds", "a", "new", "control", "point", "at", "the", "specified", "location", ".", "Initially", "the", "distorted", "and", "undistorted", "location", "will", "be", "set", "to", "the", "same" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L137-L142
50,462
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.setUndistorted
public void setUndistorted(int which, float x, float y) { if( scaleX <= 0 || scaleY <= 0 ) throw new IllegalArgumentException("Must call configure first"); controls.get(which).p.set(x/scaleX,y/scaleY); }
java
public void setUndistorted(int which, float x, float y) { if( scaleX <= 0 || scaleY <= 0 ) throw new IllegalArgumentException("Must call configure first"); controls.get(which).p.set(x/scaleX,y/scaleY); }
[ "public", "void", "setUndistorted", "(", "int", "which", ",", "float", "x", ",", "float", "y", ")", "{", "if", "(", "scaleX", "<=", "0", "||", "scaleY", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Must call configure first\"", ")", ...
Sets the location of a control point. @param x coordinate x-axis in image pixels @param y coordinate y-axis in image pixels
[ "Sets", "the", "location", "of", "a", "control", "point", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L149-L154
50,463
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.add
public int add( float srcX , float srcY , float dstX , float dstY ) { int which = addControl(srcX,srcY); setUndistorted(which,dstX,dstY); return which; }
java
public int add( float srcX , float srcY , float dstX , float dstY ) { int which = addControl(srcX,srcY); setUndistorted(which,dstX,dstY); return which; }
[ "public", "int", "add", "(", "float", "srcX", ",", "float", "srcY", ",", "float", "dstX", ",", "float", "dstY", ")", "{", "int", "which", "=", "addControl", "(", "srcX", ",", "srcY", ")", ";", "setUndistorted", "(", "which", ",", "dstX", ",", "dstY",...
Function that let's you set control and undistorted points at the same time @param srcX distorted coordinate @param srcY distorted coordinate @param dstX undistorted coordinate @param dstY undistorted coordinate @return Index of control point
[ "Function", "that", "let", "s", "you", "set", "control", "and", "undistorted", "points", "at", "the", "same", "time" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L164-L169
50,464
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.setDistorted
public void setDistorted( int which , float x , float y ) { controls.get(which).q.set(x,y); }
java
public void setDistorted( int which , float x , float y ) { controls.get(which).q.set(x,y); }
[ "public", "void", "setDistorted", "(", "int", "which", ",", "float", "x", ",", "float", "y", ")", "{", "controls", ".", "get", "(", "which", ")", ".", "q", ".", "set", "(", "x", ",", "y", ")", ";", "}" ]
Sets the distorted location of a specific control point @param which Which control point @param x distorted coordinate x-axis in image pixels @param y distorted coordinate y-axis in image pixels
[ "Sets", "the", "distorted", "location", "of", "a", "specific", "control", "point" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L177-L179
50,465
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.fixateUndistorted
public void fixateUndistorted() { if( controls.size() < 2 ) throw new RuntimeException("Not enough control points specified. Found "+controls.size()); for (int row = 0; row < gridRows; row++) { for (int col = 0; col < gridCols; col++) { Cache cache = getGrid(row,col); cache.weights.resize(controls.si...
java
public void fixateUndistorted() { if( controls.size() < 2 ) throw new RuntimeException("Not enough control points specified. Found "+controls.size()); for (int row = 0; row < gridRows; row++) { for (int col = 0; col < gridCols; col++) { Cache cache = getGrid(row,col); cache.weights.resize(controls.si...
[ "public", "void", "fixateUndistorted", "(", ")", "{", "if", "(", "controls", ".", "size", "(", ")", "<", "2", ")", "throw", "new", "RuntimeException", "(", "\"Not enough control points specified. Found \"", "+", "controls", ".", "size", "(", ")", ")", ";", ...
Precompute the portion of the equation which only concerns the undistorted location of each point on the grid even the current undistorted location of each control point.
[ "Precompute", "the", "portion", "of", "the", "equation", "which", "only", "concerns", "the", "undistorted", "location", "of", "each", "point", "on", "the", "grid", "even", "the", "current", "undistorted", "location", "of", "each", "control", "point", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L185-L203
50,466
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.computeAverageP
void computeAverageP(Cache cache) { float[] weights = cache.weights.data; cache.aveP.set(0,0); for (int i = 0; i < controls.size(); i++) { Control c = controls.get(i); float w = weights[i]; cache.aveP.x += c.p.x * w; cache.aveP.y += c.p.y * w; } cache.aveP.x /= cache.totalWeight; cache.aveP.y /...
java
void computeAverageP(Cache cache) { float[] weights = cache.weights.data; cache.aveP.set(0,0); for (int i = 0; i < controls.size(); i++) { Control c = controls.get(i); float w = weights[i]; cache.aveP.x += c.p.x * w; cache.aveP.y += c.p.y * w; } cache.aveP.x /= cache.totalWeight; cache.aveP.y /...
[ "void", "computeAverageP", "(", "Cache", "cache", ")", "{", "float", "[", "]", "weights", "=", "cache", ".", "weights", ".", "data", ";", "cache", ".", "aveP", ".", "set", "(", "0", ",", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
Computes the average P given the weights at this cached point
[ "Computes", "the", "average", "P", "given", "the", "weights", "at", "this", "cached", "point" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L222-L234
50,467
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.computeAverageQ
void computeAverageQ(Cache cache) { float[] weights = cache.weights.data; cache.aveQ.set(0,0); for (int i = 0; i < controls.size(); i++) { Control c = controls.get(i); float w = weights[i]; cache.aveQ.x += c.q.x * w; cache.aveQ.y += c.q.y * w; } cache.aveQ.x /= cache.totalWeight; cache.aveQ.y /...
java
void computeAverageQ(Cache cache) { float[] weights = cache.weights.data; cache.aveQ.set(0,0); for (int i = 0; i < controls.size(); i++) { Control c = controls.get(i); float w = weights[i]; cache.aveQ.x += c.q.x * w; cache.aveQ.y += c.q.y * w; } cache.aveQ.x /= cache.totalWeight; cache.aveQ.y /...
[ "void", "computeAverageQ", "(", "Cache", "cache", ")", "{", "float", "[", "]", "weights", "=", "cache", ".", "weights", ".", "data", ";", "cache", ".", "aveQ", ".", "set", "(", "0", ",", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i"...
Computes the average Q given the weights at this cached point
[ "Computes", "the", "average", "Q", "given", "the", "weights", "at", "this", "cached", "point" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L239-L251
50,468
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java
ImageDeformPointMLS_F32.interpolateDeformedPoint
void interpolateDeformedPoint(float v_x , float v_y , Point2D_F32 deformed ) { // sample the closest point and x+1,y+1 int x0 = (int)v_x; int y0 = (int)v_y; int x1 = x0+1; int y1 = y0+1; // make sure the 4 sample points are in bounds if( x1 >= gridCols ) x1 = gridCols-1; if( y1 >= gridRows ) y1 ...
java
void interpolateDeformedPoint(float v_x , float v_y , Point2D_F32 deformed ) { // sample the closest point and x+1,y+1 int x0 = (int)v_x; int y0 = (int)v_y; int x1 = x0+1; int y1 = y0+1; // make sure the 4 sample points are in bounds if( x1 >= gridCols ) x1 = gridCols-1; if( y1 >= gridRows ) y1 ...
[ "void", "interpolateDeformedPoint", "(", "float", "v_x", ",", "float", "v_y", ",", "Point2D_F32", "deformed", ")", "{", "// sample the closest point and x+1,y+1", "int", "x0", "=", "(", "int", ")", "v_x", ";", "int", "y0", "=", "(", "int", ")", "v_y", ";", ...
Samples the 4 grid points around v and performs bilinear interpolation @param v_x Grid coordinate x-axis, undistorted @param v_y Grid coordinate y-axis, undistorted @param deformed Distorted grid coordinate in image pixels
[ "Samples", "the", "4", "grid", "points", "around", "v", "and", "performs", "bilinear", "interpolation" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L298-L338
50,469
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/RadialDistortionEstimateLinear.java
RadialDistortionEstimateLinear.process
public void process( DMatrixRMaj cameraCalibration , List<DMatrixRMaj> homographies , List<CalibrationObservation> observations ) { init( observations ); setupA_and_B(cameraCalibration,homographies,observations); if( !solver.setA(A) ) throw new RuntimeException("Solver had problems"); solve...
java
public void process( DMatrixRMaj cameraCalibration , List<DMatrixRMaj> homographies , List<CalibrationObservation> observations ) { init( observations ); setupA_and_B(cameraCalibration,homographies,observations); if( !solver.setA(A) ) throw new RuntimeException("Solver had problems"); solve...
[ "public", "void", "process", "(", "DMatrixRMaj", "cameraCalibration", ",", "List", "<", "DMatrixRMaj", ">", "homographies", ",", "List", "<", "CalibrationObservation", ">", "observations", ")", "{", "init", "(", "observations", ")", ";", "setupA_and_B", "(", "ca...
Computes radial distortion using a linear method. @param cameraCalibration Camera calibration matrix. Not modified. @param observations Observations of calibration grid. Not modified.
[ "Computes", "radial", "distortion", "using", "a", "linear", "method", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/RadialDistortionEstimateLinear.java#L93-L105
50,470
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/RadialDistortionEstimateLinear.java
RadialDistortionEstimateLinear.init
private void init( List<CalibrationObservation> observations ) { int totalPoints = 0; for (int i = 0; i < observations.size(); i++) { totalPoints += observations.get(i).size(); } A.reshape(2*totalPoints,X.numRows,false); B.reshape(A.numRows,1,false); }
java
private void init( List<CalibrationObservation> observations ) { int totalPoints = 0; for (int i = 0; i < observations.size(); i++) { totalPoints += observations.get(i).size(); } A.reshape(2*totalPoints,X.numRows,false); B.reshape(A.numRows,1,false); }
[ "private", "void", "init", "(", "List", "<", "CalibrationObservation", ">", "observations", ")", "{", "int", "totalPoints", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "observations", ".", "size", "(", ")", ";", "i", "++", ")", ...
Declares and sets up data structures
[ "Declares", "and", "sets", "up", "data", "structures" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/RadialDistortionEstimateLinear.java#L110-L119
50,471
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoSparse3D.java
StereoSparse3D.process
@Override public boolean process(double x, double y) { leftPixelToRect.compute(x,y,pixelRect); // round to the nearest pixel if( !disparity.process((int)(pixelRect.x+0.5),(int)(pixelRect.y+0.5)) ) return false; // Compute coordinate in camera frame this.w = disparity.getDisparity(); computeHomo3D(pix...
java
@Override public boolean process(double x, double y) { leftPixelToRect.compute(x,y,pixelRect); // round to the nearest pixel if( !disparity.process((int)(pixelRect.x+0.5),(int)(pixelRect.y+0.5)) ) return false; // Compute coordinate in camera frame this.w = disparity.getDisparity(); computeHomo3D(pix...
[ "@", "Override", "public", "boolean", "process", "(", "double", "x", ",", "double", "y", ")", "{", "leftPixelToRect", ".", "compute", "(", "x", ",", "y", ",", "pixelRect", ")", ";", "// round to the nearest pixel", "if", "(", "!", "disparity", ".", "proces...
Takes in pixel coordinates from the left camera in the original image coordinate system @param x x-coordinate of the pixel @param y y-coordinate of the pixel @return true if successful
[ "Takes", "in", "pixel", "coordinates", "from", "the", "left", "camera", "in", "the", "original", "image", "coordinate", "system" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoSparse3D.java#L81-L95
50,472
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java
SquareGraph.detachEdge
public void detachEdge(SquareEdge edge) { edge.a.edges[edge.sideA] = null; edge.b.edges[edge.sideB] = null; edge.distance = 0; edgeManager.recycleInstance(edge); }
java
public void detachEdge(SquareEdge edge) { edge.a.edges[edge.sideA] = null; edge.b.edges[edge.sideB] = null; edge.distance = 0; edgeManager.recycleInstance(edge); }
[ "public", "void", "detachEdge", "(", "SquareEdge", "edge", ")", "{", "edge", ".", "a", ".", "edges", "[", "edge", ".", "sideA", "]", "=", "null", ";", "edge", ".", "b", ".", "edges", "[", "edge", ".", "sideB", "]", "=", "null", ";", "edge", ".", ...
Removes the edge from the two nodes and recycles the data structure
[ "Removes", "the", "edge", "from", "the", "two", "nodes", "and", "recycles", "the", "data", "structure" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L66-L73
50,473
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java
SquareGraph.findSideIntersect
public int findSideIntersect(SquareNode n , LineSegment2D_F64 line , Point2D_F64 intersection, LineSegment2D_F64 storage ) { for (int j = 0,i=3; j < 4; i=j,j++) { storage.a = n.square.get(i); storage.b = n.square.get(j); if( Intersection2D_F64.intersection(line,storage,intersection) != null ) { return i...
java
public int findSideIntersect(SquareNode n , LineSegment2D_F64 line , Point2D_F64 intersection, LineSegment2D_F64 storage ) { for (int j = 0,i=3; j < 4; i=j,j++) { storage.a = n.square.get(i); storage.b = n.square.get(j); if( Intersection2D_F64.intersection(line,storage,intersection) != null ) { return i...
[ "public", "int", "findSideIntersect", "(", "SquareNode", "n", ",", "LineSegment2D_F64", "line", ",", "Point2D_F64", "intersection", ",", "LineSegment2D_F64", "storage", ")", "{", "for", "(", "int", "j", "=", "0", ",", "i", "=", "3", ";", "j", "<", "4", "...
Finds the side which intersects the line on the shape. The line is assumed to pass through the shape so if there is no intersection it is considered a bug
[ "Finds", "the", "side", "which", "intersects", "the", "line", "on", "the", "shape", ".", "The", "line", "is", "assumed", "to", "pass", "through", "the", "shape", "so", "if", "there", "is", "no", "intersection", "it", "is", "considered", "a", "bug" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L79-L91
50,474
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java
SquareGraph.checkConnect
public void checkConnect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) { if( a.edges[indexA] != null && a.edges[indexA].distance > distance ) { detachEdge(a.edges[indexA]); } if( b.edges[indexB] != null && b.edges[indexB].distance > distance ) { detachEdge(b.edges[indexB]); }...
java
public void checkConnect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) { if( a.edges[indexA] != null && a.edges[indexA].distance > distance ) { detachEdge(a.edges[indexA]); } if( b.edges[indexB] != null && b.edges[indexB].distance > distance ) { detachEdge(b.edges[indexB]); }...
[ "public", "void", "checkConnect", "(", "SquareNode", "a", ",", "int", "indexA", ",", "SquareNode", "b", ",", "int", "indexB", ",", "double", "distance", ")", "{", "if", "(", "a", ".", "edges", "[", "indexA", "]", "!=", "null", "&&", "a", ".", "edges"...
Checks to see if the two nodes can be connected. If one of the nodes is already connected to another it then checks to see if the proposed connection is more desirable. If it is the old connection is removed and a new one created. Otherwise nothing happens.
[ "Checks", "to", "see", "if", "the", "two", "nodes", "can", "be", "connected", ".", "If", "one", "of", "the", "nodes", "is", "already", "connected", "to", "another", "it", "then", "checks", "to", "see", "if", "the", "proposed", "connection", "is", "more",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L98-L110
50,475
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java
SquareGraph.connect
void connect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) { SquareEdge edge = edgeManager.requestInstance(); edge.reset(); edge.a = a; edge.sideA = indexA; edge.b = b; edge.sideB = indexB; edge.distance = distance; a.edges[indexA] = edge; b.edges[indexB] = edge; }
java
void connect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) { SquareEdge edge = edgeManager.requestInstance(); edge.reset(); edge.a = a; edge.sideA = indexA; edge.b = b; edge.sideB = indexB; edge.distance = distance; a.edges[indexA] = edge; b.edges[indexB] = edge; }
[ "void", "connect", "(", "SquareNode", "a", ",", "int", "indexA", ",", "SquareNode", "b", ",", "int", "indexB", ",", "double", "distance", ")", "{", "SquareEdge", "edge", "=", "edgeManager", ".", "requestInstance", "(", ")", ";", "edge", ".", "reset", "("...
Creates a new edge which will connect the two nodes. The side on each node which is connected is specified by the indexes. @param a First node @param indexA side on node 'a' @param b Second node @param indexB side on node 'b' @param distance distance apart the center of the two nodes
[ "Creates", "a", "new", "edge", "which", "will", "connect", "the", "two", "nodes", ".", "The", "side", "on", "each", "node", "which", "is", "connected", "is", "specified", "by", "the", "indexes", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L121-L133
50,476
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java
SquareGraph.almostParallel
public boolean almostParallel(SquareNode a , int sideA , SquareNode b , int sideB ) { double selected = acuteAngle(a,sideA,b,sideB); if( selected > parallelThreshold ) return false; // see if the two sides are about parallel too // double left = acuteAngle(a,add(sideA,-1),b,add(sideB,1)); // double right =...
java
public boolean almostParallel(SquareNode a , int sideA , SquareNode b , int sideB ) { double selected = acuteAngle(a,sideA,b,sideB); if( selected > parallelThreshold ) return false; // see if the two sides are about parallel too // double left = acuteAngle(a,add(sideA,-1),b,add(sideB,1)); // double right =...
[ "public", "boolean", "almostParallel", "(", "SquareNode", "a", ",", "int", "sideA", ",", "SquareNode", "b", ",", "int", "sideB", ")", "{", "double", "selected", "=", "acuteAngle", "(", "a", ",", "sideA", ",", "b", ",", "sideB", ")", ";", "if", "(", "...
Checks to see if the two sides are almost parallel to each other by looking at their acute angle.
[ "Checks", "to", "see", "if", "the", "two", "sides", "are", "almost", "parallel", "to", "each", "other", "by", "looking", "at", "their", "acute", "angle", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L139-L160
50,477
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.setImageGradient
public void setImageGradient(Deriv derivX, Deriv derivY ) { this.derivX.wrap(derivX); this.derivY.wrap(derivY); }
java
public void setImageGradient(Deriv derivX, Deriv derivY ) { this.derivX.wrap(derivX); this.derivY.wrap(derivY); }
[ "public", "void", "setImageGradient", "(", "Deriv", "derivX", ",", "Deriv", "derivY", ")", "{", "this", ".", "derivX", ".", "wrap", "(", "derivX", ")", ";", "this", ".", "derivY", ".", "wrap", "(", "derivY", ")", ";", "}" ]
Specify the input image
[ "Specify", "the", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L123-L126
50,478
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.computeHistogram
void computeHistogram(int c_x, int c_y, double sigma) { int r = (int)Math.ceil(sigma * sigmaEnlarge); // specify the area being sampled bound.x0 = c_x - r; bound.y0 = c_y - r; bound.x1 = c_x + r + 1; bound.y1 = c_y + r + 1; ImageGray rawDX = derivX.getImage(); ImageGray rawDY = derivY.getImage(); /...
java
void computeHistogram(int c_x, int c_y, double sigma) { int r = (int)Math.ceil(sigma * sigmaEnlarge); // specify the area being sampled bound.x0 = c_x - r; bound.y0 = c_y - r; bound.x1 = c_x + r + 1; bound.y1 = c_y + r + 1; ImageGray rawDX = derivX.getImage(); ImageGray rawDY = derivY.getImage(); /...
[ "void", "computeHistogram", "(", "int", "c_x", ",", "int", "c_y", ",", "double", "sigma", ")", "{", "int", "r", "=", "(", "int", ")", "Math", ".", "ceil", "(", "sigma", "*", "sigmaEnlarge", ")", ";", "// specify the area being sampled", "bound", ".", "x0...
Constructs the histogram around the specified point. @param c_x Center x-axis @param c_y Center y-axis @param sigma Scale of feature, adjusted for local octave
[ "Constructs", "the", "histogram", "around", "the", "specified", "point", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L155-L201
50,479
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.findHistogramPeaks
void findHistogramPeaks() { // reset data structures peaks.reset(); angles.reset(); peakAngle = 0; // identify peaks and find the highest peak double largest = 0; int largestIndex = -1; double before = histogramMag[ histogramMag.length-2 ]; double current = histogramMag[ histogramMag.length-1 ]; fo...
java
void findHistogramPeaks() { // reset data structures peaks.reset(); angles.reset(); peakAngle = 0; // identify peaks and find the highest peak double largest = 0; int largestIndex = -1; double before = histogramMag[ histogramMag.length-2 ]; double current = histogramMag[ histogramMag.length-1 ]; fo...
[ "void", "findHistogramPeaks", "(", ")", "{", "// reset data structures", "peaks", ".", "reset", "(", ")", ";", "angles", ".", "reset", "(", ")", ";", "peakAngle", "=", "0", ";", "// identify peaks and find the highest peak", "double", "largest", "=", "0", ";", ...
Finds local peaks in histogram and selects orientations. Location of peaks is interpolated.
[ "Finds", "local", "peaks", "in", "histogram", "and", "selects", "orientations", ".", "Location", "of", "peaks", "is", "interpolated", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L206-L249
50,480
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.computeAngle
double computeAngle( int index1 ) { int index0 = CircularIndex.addOffset(index1,-1, histogramMag.length); int index2 = CircularIndex.addOffset(index1, 1, histogramMag.length); // compute the peak location using a second order polygon double v0 = histogramMag[index0]; double v1 = histogramMag[index1]; doub...
java
double computeAngle( int index1 ) { int index0 = CircularIndex.addOffset(index1,-1, histogramMag.length); int index2 = CircularIndex.addOffset(index1, 1, histogramMag.length); // compute the peak location using a second order polygon double v0 = histogramMag[index0]; double v1 = histogramMag[index1]; doub...
[ "double", "computeAngle", "(", "int", "index1", ")", "{", "int", "index0", "=", "CircularIndex", ".", "addOffset", "(", "index1", ",", "-", "1", ",", "histogramMag", ".", "length", ")", ";", "int", "index2", "=", "CircularIndex", ".", "addOffset", "(", "...
Compute the angle. The angle for each neighbor bin is found using the weighted sum of the derivative. Then the peak index is found by 2nd order polygon interpolation. These two bits of information are combined and used to return the final angle output. @param index1 Histogram index of the peak @return angle of the ...
[ "Compute", "the", "angle", ".", "The", "angle", "for", "each", "neighbor", "bin", "is", "found", "using", "the", "weighted", "sum", "of", "the", "derivative", ".", "Then", "the", "peak", "index", "is", "found", "by", "2nd", "order", "polygon", "interpolati...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L259-L273
50,481
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.interpolateAngle
double interpolateAngle(int index0, int index1, int index2, double offset) { double angle1 = Math.atan2(histogramY[index1],histogramX[index1]); double deltaAngle; if( offset < 0 ) { double angle0 = Math.atan2(histogramY[index0],histogramX[index0]); deltaAngle = UtilAngle.dist(angle0,angle1); } else { ...
java
double interpolateAngle(int index0, int index1, int index2, double offset) { double angle1 = Math.atan2(histogramY[index1],histogramX[index1]); double deltaAngle; if( offset < 0 ) { double angle0 = Math.atan2(histogramY[index0],histogramX[index0]); deltaAngle = UtilAngle.dist(angle0,angle1); } else { ...
[ "double", "interpolateAngle", "(", "int", "index0", ",", "int", "index1", ",", "int", "index2", ",", "double", "offset", ")", "{", "double", "angle1", "=", "Math", ".", "atan2", "(", "histogramY", "[", "index1", "]", ",", "histogramX", "[", "index1", "]"...
Given the interpolated index, compute the angle from the 3 indexes. The angle for each index is computed from the weighted gradients. @param offset Interpolated index offset relative to index0. range -1 to 1 @return Interpolated angle.
[ "Given", "the", "interpolated", "index", "compute", "the", "angle", "from", "the", "3", "indexes", ".", "The", "angle", "for", "each", "index", "is", "computed", "from", "the", "weighted", "gradients", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L281-L293
50,482
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.computeWeight
double computeWeight( double deltaX , double deltaY , double sigma ) { // the exact equation // return Math.exp(-0.5 * ((deltaX * deltaX + deltaY * deltaY) / (sigma * sigma))); // approximation below. when validating this approach it produced results that were within // floating point tolerance of the exact so...
java
double computeWeight( double deltaX , double deltaY , double sigma ) { // the exact equation // return Math.exp(-0.5 * ((deltaX * deltaX + deltaY * deltaY) / (sigma * sigma))); // approximation below. when validating this approach it produced results that were within // floating point tolerance of the exact so...
[ "double", "computeWeight", "(", "double", "deltaX", ",", "double", "deltaY", ",", "double", "sigma", ")", "{", "// the exact equation", "//\t\treturn Math.exp(-0.5 * ((deltaX * deltaX + deltaY * deltaY) / (sigma * sigma)));", "// approximation below. when validating this approach it p...
Computes the weight based on a centered Gaussian shaped function. Interpolation is used to speed up the process
[ "Computes", "the", "weight", "based", "on", "a", "centered", "Gaussian", "shaped", "function", ".", "Interpolation", "is", "used", "to", "speed", "up", "the", "process" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L298-L309
50,483
lessthanoptimal/BoofCV
integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java
GradientActivity.onCameraResolutionChange
@Override protected void onCameraResolutionChange( int width , int height, int sensorOrientation ) { super.onCameraResolutionChange(width, height,sensorOrientation); derivX.reshape(width, height); derivY.reshape(width, height); }
java
@Override protected void onCameraResolutionChange( int width , int height, int sensorOrientation ) { super.onCameraResolutionChange(width, height,sensorOrientation); derivX.reshape(width, height); derivY.reshape(width, height); }
[ "@", "Override", "protected", "void", "onCameraResolutionChange", "(", "int", "width", ",", "int", "height", ",", "int", "sensorOrientation", ")", "{", "super", ".", "onCameraResolutionChange", "(", "width", ",", "height", ",", "sensorOrientation", ")", ";", "de...
During camera initialization this function is called once after the resolution is known. This is a good function to override and predeclare data structres which are dependent on the video feeds resolution.
[ "During", "camera", "initialization", "this", "function", "is", "called", "once", "after", "the", "resolution", "is", "known", ".", "This", "is", "a", "good", "function", "to", "override", "and", "predeclare", "data", "structres", "which", "are", "dependent", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java#L121-L127
50,484
lessthanoptimal/BoofCV
integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java
GradientActivity.renderBitmapImage
@Override protected void renderBitmapImage(BitmapMode mode, ImageBase image) { switch( mode ) { case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmap, bitmapTmp); } break; case DOUBLE_BUFFER:...
java
@Override protected void renderBitmapImage(BitmapMode mode, ImageBase image) { switch( mode ) { case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmap, bitmapTmp); } break; case DOUBLE_BUFFER:...
[ "@", "Override", "protected", "void", "renderBitmapImage", "(", "BitmapMode", "mode", ",", "ImageBase", "image", ")", "{", "switch", "(", "mode", ")", "{", "case", "UNSAFE", ":", "{", "// this application is configured to use double buffer and could ignore all other modes...
Override the default behavior and colorize gradient instead of converting input image.
[ "Override", "the", "default", "behavior", "and", "colorize", "gradient", "instead", "of", "converting", "input", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java#L143-L164
50,485
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/FastCornerDetector.java
FastCornerDetector.process
public void process( T image , GrayF32 intensity ) { int maxFeatures = (int)(maxFeaturesFraction*image.width*image.height); candidatesLow.reset(); candidatesHigh.reset(); this.image = image; if( stride != image.stride ) { stride = image.stride; offsets = DiscretizedCircle.imageOffsets(radius, image.str...
java
public void process( T image , GrayF32 intensity ) { int maxFeatures = (int)(maxFeaturesFraction*image.width*image.height); candidatesLow.reset(); candidatesHigh.reset(); this.image = image; if( stride != image.stride ) { stride = image.stride; offsets = DiscretizedCircle.imageOffsets(radius, image.str...
[ "public", "void", "process", "(", "T", "image", ",", "GrayF32", "intensity", ")", "{", "int", "maxFeatures", "=", "(", "int", ")", "(", "maxFeaturesFraction", "*", "image", ".", "width", "*", "image", ".", "height", ")", ";", "candidatesLow", ".", "reset...
Computes fast corner features and their intensity. The intensity is needed if non-max suppression is used
[ "Computes", "fast", "corner", "features", "and", "their", "intensity", ".", "The", "intensity", "is", "needed", "if", "non", "-", "max", "suppression", "is", "used" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/FastCornerDetector.java#L123-L156
50,486
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java
BoofSwingUtil.selectZoomToShowAll
public static double selectZoomToShowAll(JComponent panel , int width , int height ) { int w = panel.getWidth(); int h = panel.getHeight(); if( w == 0 ) { w = panel.getPreferredSize().width; h = panel.getPreferredSize().height; } double scale = Math.max(width/(double)w,height/(double)h); if( scale > ...
java
public static double selectZoomToShowAll(JComponent panel , int width , int height ) { int w = panel.getWidth(); int h = panel.getHeight(); if( w == 0 ) { w = panel.getPreferredSize().width; h = panel.getPreferredSize().height; } double scale = Math.max(width/(double)w,height/(double)h); if( scale > ...
[ "public", "static", "double", "selectZoomToShowAll", "(", "JComponent", "panel", ",", "int", "width", ",", "int", "height", ")", "{", "int", "w", "=", "panel", ".", "getWidth", "(", ")", ";", "int", "h", "=", "panel", ".", "getHeight", "(", ")", ";", ...
Select a zoom which will allow the entire image to be shown in the panel
[ "Select", "a", "zoom", "which", "will", "allow", "the", "entire", "image", "to", "be", "shown", "in", "the", "panel" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java#L209-L223
50,487
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java
BoofSwingUtil.selectZoomToFitInDisplay
public static double selectZoomToFitInDisplay( int width , int height ) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); double w = screenSize.getWidth(); double h = screenSize.getHeight(); double scale = Math.max(width/w,height/h); if( scale > 1.0 ) { return 1.0/scale; } else { ...
java
public static double selectZoomToFitInDisplay( int width , int height ) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); double w = screenSize.getWidth(); double h = screenSize.getHeight(); double scale = Math.max(width/w,height/h); if( scale > 1.0 ) { return 1.0/scale; } else { ...
[ "public", "static", "double", "selectZoomToFitInDisplay", "(", "int", "width", ",", "int", "height", ")", "{", "Dimension", "screenSize", "=", "Toolkit", ".", "getDefaultToolkit", "(", ")", ".", "getScreenSize", "(", ")", ";", "double", "w", "=", "screenSize",...
Figures out what the scale should be to fit the window inside the default display
[ "Figures", "out", "what", "the", "scale", "should", "be", "to", "fit", "the", "window", "inside", "the", "default", "display" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java#L228-L240
50,488
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java
BoofSwingUtil.antialiasing
public static void antialiasing( Graphics2D g2 ) { g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); }
java
public static void antialiasing( Graphics2D g2 ) { g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); }
[ "public", "static", "void", "antialiasing", "(", "Graphics2D", "g2", ")", "{", "g2", ".", "setRenderingHint", "(", "RenderingHints", ".", "KEY_STROKE_CONTROL", ",", "RenderingHints", ".", "VALUE_STROKE_PURE", ")", ";", "g2", ".", "setRenderingHint", "(", "Renderin...
Sets rendering hints that will enable antialiasing and make sub pixel rendering look good @param g2
[ "Sets", "rendering", "hints", "that", "will", "enable", "antialiasing", "and", "make", "sub", "pixel", "rendering", "look", "good" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java#L287-L290
50,489
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java
BoofSwingUtil.isImage
public static boolean isImage( File file ){ try { String mimeType = Files.probeContentType(file.toPath()); if( mimeType == null ) { // In some OS there is a bug where it always returns null/ String extension = FilenameUtils.getExtension(file.getName()).toLowerCase(); String[] suffixes = ImageIO.getR...
java
public static boolean isImage( File file ){ try { String mimeType = Files.probeContentType(file.toPath()); if( mimeType == null ) { // In some OS there is a bug where it always returns null/ String extension = FilenameUtils.getExtension(file.getName()).toLowerCase(); String[] suffixes = ImageIO.getR...
[ "public", "static", "boolean", "isImage", "(", "File", "file", ")", "{", "try", "{", "String", "mimeType", "=", "Files", ".", "probeContentType", "(", "file", ".", "toPath", "(", ")", ")", ";", "if", "(", "mimeType", "==", "null", ")", "{", "// In some...
Uses mime type to determine if it's an image or not. If mime fails it will look at the suffix. This isn't 100% correct.
[ "Uses", "mime", "type", "to", "determine", "if", "it", "s", "an", "image", "or", "not", ".", "If", "mime", "fails", "it", "will", "look", "at", "the", "suffix", ".", "This", "isn", "t", "100%", "correct", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java#L369-L386
50,490
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java
IntegralImageOps.print
public static void print( IntegralKernel kernel ) { int x0 = 0,x1=0,y0=0,y1=0; for( ImageRectangle k : kernel.blocks) { if( k.x0 < x0 ) x0 = k.x0; if( k.y0 < y0 ) y0 = k.y0; if( k.x1 > x1 ) x1 = k.x1; if( k.y1 > y1 ) y1 = k.y1; } int w = x1-x0; int h = y1-y0; int sum[] = new i...
java
public static void print( IntegralKernel kernel ) { int x0 = 0,x1=0,y0=0,y1=0; for( ImageRectangle k : kernel.blocks) { if( k.x0 < x0 ) x0 = k.x0; if( k.y0 < y0 ) y0 = k.y0; if( k.x1 > x1 ) x1 = k.x1; if( k.y1 > y1 ) y1 = k.y1; } int w = x1-x0; int h = y1-y0; int sum[] = new i...
[ "public", "static", "void", "print", "(", "IntegralKernel", "kernel", ")", "{", "int", "x0", "=", "0", ",", "x1", "=", "0", ",", "y0", "=", "0", ",", "y1", "=", "0", ";", "for", "(", "ImageRectangle", "k", ":", "kernel", ".", "blocks", ")", "{", ...
Prints out the kernel. @param kernel THe kernel which is to be printed.
[ "Prints", "out", "the", "kernel", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L508-L547
50,491
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java
IntegralImageOps.isInBounds
public static boolean isInBounds( int x , int y , IntegralKernel kernel , int width , int height ) { for(ImageRectangle r : kernel.blocks ) { if( x+r.x0 < 0 || y+r.y0 < 0 ) return false; if( x+r.x1 >= width || y+r.y1 >= height ) return false; } return true; }
java
public static boolean isInBounds( int x , int y , IntegralKernel kernel , int width , int height ) { for(ImageRectangle r : kernel.blocks ) { if( x+r.x0 < 0 || y+r.y0 < 0 ) return false; if( x+r.x1 >= width || y+r.y1 >= height ) return false; } return true; }
[ "public", "static", "boolean", "isInBounds", "(", "int", "x", ",", "int", "y", ",", "IntegralKernel", "kernel", ",", "int", "width", ",", "int", "height", ")", "{", "for", "(", "ImageRectangle", "r", ":", "kernel", ".", "blocks", ")", "{", "if", "(", ...
Checks to see if the kernel is applied at this specific spot if all the pixels would be inside the image bounds or not @param x location where the kernel is applied. x-axis @param y location where the kernel is applied. y-axis @param kernel The kernel @param width Image's width @param height Image's height @return tru...
[ "Checks", "to", "see", "if", "the", "kernel", "is", "applied", "at", "this", "specific", "spot", "if", "all", "the", "pixels", "would", "be", "inside", "the", "image", "bounds", "or", "not" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L560-L570
50,492
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidDiscrete.java
PyramidDiscrete.setScaleFactors
public void setScaleFactors( int ...scaleFactors ) { for( int i = 1; i < scaleFactors.length; i++ ){ if( scaleFactors[i] % scaleFactors[i-1] != 0 ) { throw new IllegalArgumentException("Layer "+i+" is not evenly divisible by its lower layer."); } } // set width/height to zero to force the image to be r...
java
public void setScaleFactors( int ...scaleFactors ) { for( int i = 1; i < scaleFactors.length; i++ ){ if( scaleFactors[i] % scaleFactors[i-1] != 0 ) { throw new IllegalArgumentException("Layer "+i+" is not evenly divisible by its lower layer."); } } // set width/height to zero to force the image to be r...
[ "public", "void", "setScaleFactors", "(", "int", "...", "scaleFactors", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "scaleFactors", ".", "length", ";", "i", "++", ")", "{", "if", "(", "scaleFactors", "[", "i", "]", "%", "scaleFactors",...
Specifies the pyramid's structure. Scale factors are in relative to the input image. @param scaleFactors Change in scale factor for each layer in the pyramid.
[ "Specifies", "the", "pyramid", "s", "structure", ".", "Scale", "factors", "are", "in", "relative", "to", "the", "input", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidDiscrete.java#L60-L71
50,493
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFit.java
SplitMergeLineFit.process
public boolean process( List<Point2D_I32> list , GrowQueue_I32 vertexes ) { this.contour = list; this.minimumSideLengthPixel = minimumSideLength.computeI(contour.size()); splits.reset(); boolean result = _process(list); // remove reference so that it can be freed this.contour = null; vertexes.setTo(spli...
java
public boolean process( List<Point2D_I32> list , GrowQueue_I32 vertexes ) { this.contour = list; this.minimumSideLengthPixel = minimumSideLength.computeI(contour.size()); splits.reset(); boolean result = _process(list); // remove reference so that it can be freed this.contour = null; vertexes.setTo(spli...
[ "public", "boolean", "process", "(", "List", "<", "Point2D_I32", ">", "list", ",", "GrowQueue_I32", "vertexes", ")", "{", "this", ".", "contour", "=", "list", ";", "this", ".", "minimumSideLengthPixel", "=", "minimumSideLength", ".", "computeI", "(", "contour"...
Approximates the input list with a set of line segments @param list (Input) Ordered list of connected points. @param vertexes (Output) Indexes in the input list which are corners in the polyline @return true if it could fit a polygon to the points or false if not
[ "Approximates", "the", "input", "list", "with", "a", "set", "of", "line", "segments" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFit.java#L102-L113
50,494
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFit.java
SplitMergeLineFit.splitThresholdSq
protected double splitThresholdSq( Point2D_I32 a , Point2D_I32 b ) { return Math.max(2,a.distance2(b)* toleranceFractionSq); }
java
protected double splitThresholdSq( Point2D_I32 a , Point2D_I32 b ) { return Math.max(2,a.distance2(b)* toleranceFractionSq); }
[ "protected", "double", "splitThresholdSq", "(", "Point2D_I32", "a", ",", "Point2D_I32", "b", ")", "{", "return", "Math", ".", "max", "(", "2", ",", "a", ".", "distance2", "(", "b", ")", "*", "toleranceFractionSq", ")", ";", "}" ]
Computes the split threshold from the end point of two lines
[ "Computes", "the", "split", "threshold", "from", "the", "end", "point", "of", "two", "lines" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFit.java#L120-L122
50,495
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/ImageInterleaved.java
ImageInterleaved.setTo
@SuppressWarnings({"SuspiciousSystemArraycopy"}) @Override public void setTo(T orig) { if (orig.width != width || orig.height != height || orig.numBands != numBands ) reshape(orig.width,orig.height,orig.numBands); if (!orig.isSubimage() && !isSubimage()) { System.arraycopy(orig._getData(), orig.startIndex,...
java
@SuppressWarnings({"SuspiciousSystemArraycopy"}) @Override public void setTo(T orig) { if (orig.width != width || orig.height != height || orig.numBands != numBands ) reshape(orig.width,orig.height,orig.numBands); if (!orig.isSubimage() && !isSubimage()) { System.arraycopy(orig._getData(), orig.startIndex,...
[ "@", "SuppressWarnings", "(", "{", "\"SuspiciousSystemArraycopy\"", "}", ")", "@", "Override", "public", "void", "setTo", "(", "T", "orig", ")", "{", "if", "(", "orig", ".", "width", "!=", "width", "||", "orig", ".", "height", "!=", "height", "||", "orig...
Sets this image equal to the specified image. Automatically resized to match the input image. @param orig The original image whose value is to be copied into this one
[ "Sets", "this", "image", "equal", "to", "the", "specified", "image", ".", "Automatically", "resized", "to", "match", "the", "input", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageInterleaved.java#L143-L160
50,496
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/HessianBlobIntensity.java
HessianBlobIntensity.determinant
public static void determinant(GrayF32 featureIntensity , GrayF32 hessianXX, GrayF32 hessianYY , GrayF32 hessianXY ) { InputSanityCheck.checkSameShape(featureIntensity,hessianXX,hessianYY,hessianXY); ImplHessianBlobIntensity.determinant(featureIntensity,hessianXX,hessianYY,hessianXY); }
java
public static void determinant(GrayF32 featureIntensity , GrayF32 hessianXX, GrayF32 hessianYY , GrayF32 hessianXY ) { InputSanityCheck.checkSameShape(featureIntensity,hessianXX,hessianYY,hessianXY); ImplHessianBlobIntensity.determinant(featureIntensity,hessianXX,hessianYY,hessianXY); }
[ "public", "static", "void", "determinant", "(", "GrayF32", "featureIntensity", ",", "GrayF32", "hessianXX", ",", "GrayF32", "hessianYY", ",", "GrayF32", "hessianXY", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "featureIntensity", ",", "hessianXX", ",",...
Feature intensity using the Hessian matrix's determinant. @param featureIntensity Output feature intensity. Modified. @param hessianXX Second derivative along x-axis. Not modified. @param hessianYY Second derivative along y-axis. Not modified. @param hessianXY Second derivative along x-axis and y-axis. Not modified.
[ "Feature", "intensity", "using", "the", "Hessian", "matrix", "s", "determinant", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/HessianBlobIntensity.java#L69-L74
50,497
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/HessianBlobIntensity.java
HessianBlobIntensity.trace
public static void trace(GrayF32 featureIntensity , GrayF32 hessianXX, GrayF32 hessianYY ) { InputSanityCheck.checkSameShape(featureIntensity,hessianXX,hessianYY); ImplHessianBlobIntensity.trace(featureIntensity,hessianXX,hessianYY); }
java
public static void trace(GrayF32 featureIntensity , GrayF32 hessianXX, GrayF32 hessianYY ) { InputSanityCheck.checkSameShape(featureIntensity,hessianXX,hessianYY); ImplHessianBlobIntensity.trace(featureIntensity,hessianXX,hessianYY); }
[ "public", "static", "void", "trace", "(", "GrayF32", "featureIntensity", ",", "GrayF32", "hessianXX", ",", "GrayF32", "hessianYY", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "featureIntensity", ",", "hessianXX", ",", "hessianYY", ")", ";", "ImplHess...
Feature intensity using the trace of the Hessian matrix. This is also known as the Laplacian. @param featureIntensity Output feature intensity. Modified. @param hessianXX Second derivative along x-axis. Not modified. @param hessianYY Second derivative along y-axis. Not modified.
[ "Feature", "intensity", "using", "the", "trace", "of", "the", "Hessian", "matrix", ".", "This", "is", "also", "known", "as", "the", "Laplacian", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/intensity/HessianBlobIntensity.java#L83-L88
50,498
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/filter/binary/BinaryContourHelper.java
BinaryContourHelper.reshape
public void reshape(int width , int height ) { if( padded == null ) { binary.reshape(width, height); } else { binary.reshape(width + 2, height + 2); binary.subimage(1, 1, width + 1, height + 1, subimage); } }
java
public void reshape(int width , int height ) { if( padded == null ) { binary.reshape(width, height); } else { binary.reshape(width + 2, height + 2); binary.subimage(1, 1, width + 1, height + 1, subimage); } }
[ "public", "void", "reshape", "(", "int", "width", ",", "int", "height", ")", "{", "if", "(", "padded", "==", "null", ")", "{", "binary", ".", "reshape", "(", "width", ",", "height", ")", ";", "}", "else", "{", "binary", ".", "reshape", "(", "width"...
Reshapes data so that the un-padded image has the specified shape.
[ "Reshapes", "data", "so", "that", "the", "un", "-", "padded", "image", "has", "the", "specified", "shape", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/filter/binary/BinaryContourHelper.java#L49-L56
50,499
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java
EdgeIntensityPolygon.computeEdge
public boolean computeEdge(Polygon2D_F64 polygon , boolean ccw ) { averageInside = 0; averageOutside = 0; double tangentSign = ccw ? 1 : -1; int totalSides = 0; for (int i = polygon.size()-1,j=0; j < polygon.size(); i=j,j++) { Point2D_F64 a = polygon.get(i); Point2D_F64 b = polygon.get(j); double...
java
public boolean computeEdge(Polygon2D_F64 polygon , boolean ccw ) { averageInside = 0; averageOutside = 0; double tangentSign = ccw ? 1 : -1; int totalSides = 0; for (int i = polygon.size()-1,j=0; j < polygon.size(); i=j,j++) { Point2D_F64 a = polygon.get(i); Point2D_F64 b = polygon.get(j); double...
[ "public", "boolean", "computeEdge", "(", "Polygon2D_F64", "polygon", ",", "boolean", "ccw", ")", "{", "averageInside", "=", "0", ";", "averageOutside", "=", "0", ";", "double", "tangentSign", "=", "ccw", "?", "1", ":", "-", "1", ";", "int", "totalSides", ...
Checks to see if its a valid polygon or a false positive by looking at edge intensity @param polygon The polygon being tested @param ccw True if the polygon is counter clockwise @return true if it could compute the edge intensity, otherwise false
[ "Checks", "to", "see", "if", "its", "a", "valid", "polygon", "or", "a", "false", "positive", "by", "looking", "at", "edge", "intensity" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java#L95-L146