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,500
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java
EdgeIntensityPolygon.checkIntensity
public boolean checkIntensity( boolean insideDark , double threshold ) { if( insideDark ) return averageOutside-averageInside >= threshold; else return averageInside-averageOutside >= threshold; }
java
public boolean checkIntensity( boolean insideDark , double threshold ) { if( insideDark ) return averageOutside-averageInside >= threshold; else return averageInside-averageOutside >= threshold; }
[ "public", "boolean", "checkIntensity", "(", "boolean", "insideDark", ",", "double", "threshold", ")", "{", "if", "(", "insideDark", ")", "return", "averageOutside", "-", "averageInside", ">=", "threshold", ";", "else", "return", "averageInside", "-", "averageOutsi...
Checks the edge intensity against a threshold. dark: outside-inside ≥ threshold light: inside-outside ≥ threshold @param insideDark is the inside of the polygon supposed to be dark or light? @param threshold threshold for average difference @return true if the edge intensity is significant enough
[ "Checks", "the", "edge", "intensity", "against", "a", "threshold", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/EdgeIntensityPolygon.java#L158-L163
50,501
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java
SelfCalibrationGuessAndCheckFocus.setCamera
public void setCamera( double skew , double cx , double cy , int width , int height ) { // Define normalization matrix // center points, remove skew, scale coordinates double d = Math.sqrt(width*width + height*height); V.zero(); V.set(0,0,d/2); V.set(0,1,skew); V.set(0,2,cx); V.set(1,1,d/2); V.set(1,2,cy);...
java
public void setCamera( double skew , double cx , double cy , int width , int height ) { // Define normalization matrix // center points, remove skew, scale coordinates double d = Math.sqrt(width*width + height*height); V.zero(); V.set(0,0,d/2); V.set(0,1,skew); V.set(0,2,cx); V.set(1,1,d/2); V.set(1,2,cy);...
[ "public", "void", "setCamera", "(", "double", "skew", ",", "double", "cx", ",", "double", "cy", ",", "int", "width", ",", "int", "height", ")", "{", "// Define normalization matrix", "// center points, remove skew, scale coordinates", "double", "d", "=", "Math", "...
Specifies known portions of camera intrinsic parameters @param skew skew @param cx image center x @param cy image center y @param width Image width @param height Image height
[ "Specifies", "known", "portions", "of", "camera", "intrinsic", "parameters" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java#L134-L145
50,502
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java
SelfCalibrationGuessAndCheckFocus.setSampling
public void setSampling( double min , double max , int total ) { this.sampleMin = min; this.sampleMax = max; this.numSamples = total; this.scores = new double[numSamples]; }
java
public void setSampling( double min , double max , int total ) { this.sampleMin = min; this.sampleMax = max; this.numSamples = total; this.scores = new double[numSamples]; }
[ "public", "void", "setSampling", "(", "double", "min", ",", "double", "max", ",", "int", "total", ")", "{", "this", ".", "sampleMin", "=", "min", ";", "this", ".", "sampleMax", "=", "max", ";", "this", ".", "numSamples", "=", "total", ";", "this", "....
Specifies how focal lengths are sampled on a log scale. Remember 1.0 = nominal length @param min min value. 0.3 is default @param max max value. 3.0 is default @param total Number of sample points. 50 is default
[ "Specifies", "how", "focal", "lengths", "are", "sampled", "on", "a", "log", "scale", ".", "Remember", "1", ".", "0", "=", "nominal", "length" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java#L154-L159
50,503
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java
SelfCalibrationGuessAndCheckFocus.computeRectifyH
boolean computeRectifyH( double f1 , double f2 , DMatrixRMaj P2, DMatrixRMaj H ) { estimatePlaneInf.setCamera1(f1,f1,0,0,0); estimatePlaneInf.setCamera2(f2,f2,0,0,0); if( !estimatePlaneInf.estimatePlaneAtInfinity(P2,planeInf) ) return false; // TODO add a cost for distance from nominal and scale other cos...
java
boolean computeRectifyH( double f1 , double f2 , DMatrixRMaj P2, DMatrixRMaj H ) { estimatePlaneInf.setCamera1(f1,f1,0,0,0); estimatePlaneInf.setCamera2(f2,f2,0,0,0); if( !estimatePlaneInf.estimatePlaneAtInfinity(P2,planeInf) ) return false; // TODO add a cost for distance from nominal and scale other cos...
[ "boolean", "computeRectifyH", "(", "double", "f1", ",", "double", "f2", ",", "DMatrixRMaj", "P2", ",", "DMatrixRMaj", "H", ")", "{", "estimatePlaneInf", ".", "setCamera1", "(", "f1", ",", "f1", ",", "0", ",", "0", ",", "0", ")", ";", "estimatePlaneInf", ...
Given the focal lengths for the first two views compute homography H @param f1 view 1 focal length @param f2 view 2 focal length @param P2 projective camera matrix for view 2 @param H (Output) homography @return true if successful
[ "Given", "the", "focal", "lengths", "for", "the", "first", "two", "views", "compute", "homography", "H" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java#L302-L329
50,504
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.findLine
protected static List<NodeInfo> findLine(NodeInfo seed, NodeInfo next, int clusterSize, List<NodeInfo> line, boolean ccw ) { if( next == null ) return null; if( line == null ) line = new ArrayList<>(); else line.clear(); next.marked = true; double anglePrev = direction(next, seed); double prevDis...
java
protected static List<NodeInfo> findLine(NodeInfo seed, NodeInfo next, int clusterSize, List<NodeInfo> line, boolean ccw ) { if( next == null ) return null; if( line == null ) line = new ArrayList<>(); else line.clear(); next.marked = true; double anglePrev = direction(next, seed); double prevDis...
[ "protected", "static", "List", "<", "NodeInfo", ">", "findLine", "(", "NodeInfo", "seed", ",", "NodeInfo", "next", ",", "int", "clusterSize", ",", "List", "<", "NodeInfo", ">", "line", ",", "boolean", "ccw", ")", "{", "if", "(", "next", "==", "null", "...
Finds all the nodes which form an approximate line @param seed First ellipse @param next Second ellipse, specified direction of line relative to seed @param line @return All the nodes along the line
[ "Finds", "all", "the", "nodes", "which", "form", "an", "approximate", "line" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L88-L168
50,505
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.findClosestEdge
protected static NodeInfo findClosestEdge( NodeInfo n , Point2D_F64 p ) { double bestDistance = Double.MAX_VALUE; NodeInfo best = null; for (int i = 0; i < n.edges.size(); i++) { Edge e = n.edges.get(i); if( e.target.marked ) continue; double d = e.target.ellipse.center.distance2(p); if( d < bes...
java
protected static NodeInfo findClosestEdge( NodeInfo n , Point2D_F64 p ) { double bestDistance = Double.MAX_VALUE; NodeInfo best = null; for (int i = 0; i < n.edges.size(); i++) { Edge e = n.edges.get(i); if( e.target.marked ) continue; double d = e.target.ellipse.center.distance2(p); if( d < bes...
[ "protected", "static", "NodeInfo", "findClosestEdge", "(", "NodeInfo", "n", ",", "Point2D_F64", "p", ")", "{", "double", "bestDistance", "=", "Double", ".", "MAX_VALUE", ";", "NodeInfo", "best", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i...
Finds the node which is an edge of 'n' that is closest to point 'p'
[ "Finds", "the", "node", "which", "is", "an", "edge", "of", "n", "that", "is", "closest", "to", "point", "p" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L217-L234
50,506
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.checkDuplicates
boolean checkDuplicates(List<List<NodeInfo>> grid ) { for (int i = 0; i < listInfo.size; i++) { listInfo.get(i).marked = false; } for (int i = 0; i < grid.size(); i++) { List<NodeInfo> list = grid.get(i); for (int j = 0; j < list.size(); j++) { NodeInfo n = list.get(j); if( n.marked ) retu...
java
boolean checkDuplicates(List<List<NodeInfo>> grid ) { for (int i = 0; i < listInfo.size; i++) { listInfo.get(i).marked = false; } for (int i = 0; i < grid.size(); i++) { List<NodeInfo> list = grid.get(i); for (int j = 0; j < list.size(); j++) { NodeInfo n = list.get(j); if( n.marked ) retu...
[ "boolean", "checkDuplicates", "(", "List", "<", "List", "<", "NodeInfo", ">", ">", "grid", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listInfo", ".", "size", ";", "i", "++", ")", "{", "listInfo", ".", "get", "(", "i", ")", ".",...
Checks to see if any node is used more than once
[ "Checks", "to", "see", "if", "any", "node", "is", "used", "more", "than", "once" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L239-L255
50,507
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.addEdgesToInfo
void addEdgesToInfo(List<Node> cluster) { for (int i = 0; i < cluster.size(); i++) { Node n = cluster.get(i); NodeInfo infoA = listInfo.get(i); EllipseRotated_F64 a = infoA.ellipse; // create the edges and order them based on their direction for (int j = 0; j < n.connections.size(); j++) { NodeInf...
java
void addEdgesToInfo(List<Node> cluster) { for (int i = 0; i < cluster.size(); i++) { Node n = cluster.get(i); NodeInfo infoA = listInfo.get(i); EllipseRotated_F64 a = infoA.ellipse; // create the edges and order them based on their direction for (int j = 0; j < n.connections.size(); j++) { NodeInf...
[ "void", "addEdgesToInfo", "(", "List", "<", "Node", ">", "cluster", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cluster", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Node", "n", "=", "cluster", ".", "get", "(", "i", ")",...
Adds edges to node info and computes their orientation
[ "Adds", "edges", "to", "node", "info", "and", "computes", "their", "orientation" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L288-L308
50,508
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.pruneNearlyIdenticalAngles
void pruneNearlyIdenticalAngles() { for (int i = 0; i < listInfo.size(); i++) { NodeInfo infoN = listInfo.get(i); for (int j = 0; j < infoN.edges.size(); ) { int k = (j+1)%infoN.edges.size; double angularDiff = UtilAngle.dist(infoN.edges.get(j).angle,infoN.edges.get(k).angle); if( angularDiff < Ut...
java
void pruneNearlyIdenticalAngles() { for (int i = 0; i < listInfo.size(); i++) { NodeInfo infoN = listInfo.get(i); for (int j = 0; j < infoN.edges.size(); ) { int k = (j+1)%infoN.edges.size; double angularDiff = UtilAngle.dist(infoN.edges.get(j).angle,infoN.edges.get(k).angle); if( angularDiff < Ut...
[ "void", "pruneNearlyIdenticalAngles", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listInfo", ".", "size", "(", ")", ";", "i", "++", ")", "{", "NodeInfo", "infoN", "=", "listInfo", ".", "get", "(", "i", ")", ";", "for", "(", ...
If there is a nearly perfect line a node farther down the line can come before. This just selects the closest
[ "If", "there", "is", "a", "nearly", "perfect", "line", "a", "node", "farther", "down", "the", "line", "can", "come", "before", ".", "This", "just", "selects", "the", "closest" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L313-L339
50,509
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.findLargestAnglesForAllNodes
void findLargestAnglesForAllNodes() { for (int i = 0; i < listInfo.size(); i++) { NodeInfo info = listInfo.get(i); if( info.edges.size < 2 ) continue; for (int k = 0, j = info.edges.size-1; k < info.edges.size; j=k,k++) { double angleA = info.edges.get(j).angle; double angleB = info.edges.get(k...
java
void findLargestAnglesForAllNodes() { for (int i = 0; i < listInfo.size(); i++) { NodeInfo info = listInfo.get(i); if( info.edges.size < 2 ) continue; for (int k = 0, j = info.edges.size-1; k < info.edges.size; j=k,k++) { double angleA = info.edges.get(j).angle; double angleB = info.edges.get(k...
[ "void", "findLargestAnglesForAllNodes", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listInfo", ".", "size", "(", ")", ";", "i", "++", ")", "{", "NodeInfo", "info", "=", "listInfo", ".", "get", "(", "i", ")", ";", "if", "(", ...
Finds the two edges with the greatest angular distance between them.
[ "Finds", "the", "two", "edges", "with", "the", "greatest", "angular", "distance", "between", "them", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L344-L364
50,510
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.findContour
boolean findContour( boolean mustHaveInner ) { // find the node with the largest angleBetween NodeInfo seed = listInfo.get(0); for (int i = 1; i < listInfo.size(); i++) { NodeInfo info = listInfo.get(i); if( info.angleBetween > seed.angleBetween ) { seed = info; } } // trace around the contour ...
java
boolean findContour( boolean mustHaveInner ) { // find the node with the largest angleBetween NodeInfo seed = listInfo.get(0); for (int i = 1; i < listInfo.size(); i++) { NodeInfo info = listInfo.get(i); if( info.angleBetween > seed.angleBetween ) { seed = info; } } // trace around the contour ...
[ "boolean", "findContour", "(", "boolean", "mustHaveInner", ")", "{", "// find the node with the largest angleBetween", "NodeInfo", "seed", "=", "listInfo", ".", "get", "(", "0", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "listInfo", ".", "siz...
Finds nodes in the outside of the grid. First the node in the grid with the largest 'angleBetween' is selected as a seed. It is assumed at this node must be on the contour. Then the graph is traversed in CCW direction until a loop is formed. @return true if valid and false if invalid
[ "Finds", "nodes", "in", "the", "outside", "of", "the", "grid", ".", "First", "the", "node", "in", "the", "grid", "with", "the", "largest", "angleBetween", "is", "selected", "as", "a", "seed", ".", "It", "is", "assumed", "at", "this", "node", "must", "b...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L373-L401
50,511
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.indexOf
public static int indexOf(List<Node> list , int value ) { for (int i = 0; i < list.size(); i++) { if( list.get(i).which == value ) return i; } return -1; }
java
public static int indexOf(List<Node> list , int value ) { for (int i = 0; i < list.size(); i++) { if( list.get(i).which == value ) return i; } return -1; }
[ "public", "static", "int", "indexOf", "(", "List", "<", "Node", ">", "list", ",", "int", "value", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "list", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "list", ".", "g...
Finds the node with the index of 'value'
[ "Finds", "the", "node", "with", "the", "index", "of", "value" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L406-L414
50,512
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java
EllipseClustersIntoGrid.selectSeedCorner
NodeInfo selectSeedCorner() { NodeInfo best = null; double bestAngle = 0; for (int i = 0; i < contour.size; i++) { NodeInfo info = contour.get(i); if( info.angleBetween > bestAngle ) { bestAngle = info.angleBetween; best = info; } } best.marked = true; return best; }
java
NodeInfo selectSeedCorner() { NodeInfo best = null; double bestAngle = 0; for (int i = 0; i < contour.size; i++) { NodeInfo info = contour.get(i); if( info.angleBetween > bestAngle ) { bestAngle = info.angleBetween; best = info; } } best.marked = true; return best; }
[ "NodeInfo", "selectSeedCorner", "(", ")", "{", "NodeInfo", "best", "=", "null", ";", "double", "bestAngle", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "contour", ".", "size", ";", "i", "++", ")", "{", "NodeInfo", "info", "=", ...
Pick the node in the contour with the largest angle. Distortion tends to make the acute angle smaller. Without distortion it will be 270 degrees.
[ "Pick", "the", "node", "in", "the", "contour", "with", "the", "largest", "angle", ".", "Distortion", "tends", "to", "make", "the", "acute", "angle", "smaller", ".", "Without", "distortion", "it", "will", "be", "270", "degrees", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L420-L435
50,513
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/depth/VisualDepthOps.java
VisualDepthOps.depthTo3D
public static void depthTo3D(CameraPinholeBrown param , GrayU16 depth , FastQueue<Point3D_F64> cloud ) { cloud.reset(); Point2Transform2_F64 p2n = LensDistortionFactory.narrow(param).undistort_F64(true,false); Point2D_F64 n = new Point2D_F64(); for( int y = 0; y < depth.height; y++ ) { int index = depth.s...
java
public static void depthTo3D(CameraPinholeBrown param , GrayU16 depth , FastQueue<Point3D_F64> cloud ) { cloud.reset(); Point2Transform2_F64 p2n = LensDistortionFactory.narrow(param).undistort_F64(true,false); Point2D_F64 n = new Point2D_F64(); for( int y = 0; y < depth.height; y++ ) { int index = depth.s...
[ "public", "static", "void", "depthTo3D", "(", "CameraPinholeBrown", "param", ",", "GrayU16", "depth", ",", "FastQueue", "<", "Point3D_F64", ">", "cloud", ")", "{", "cloud", ".", "reset", "(", ")", ";", "Point2Transform2_F64", "p2n", "=", "LensDistortionFactory",...
Creates a point cloud from a depth image. @param param Intrinsic camera parameters for depth image @param depth depth image. each value is in millimeters. @param cloud Output point cloud
[ "Creates", "a", "point", "cloud", "from", "a", "depth", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/depth/VisualDepthOps.java#L45-L70
50,514
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/depth/VisualDepthOps.java
VisualDepthOps.depthTo3D
public static void depthTo3D(CameraPinholeBrown param , Planar<GrayU8> rgb , GrayU16 depth , FastQueue<Point3D_F64> cloud , FastQueueArray_I32 cloudColor ) { cloud.reset(); cloudColor.reset(); RemoveBrownPtoN_F64 p2n = new RemoveBrownPtoN_F64(); p2n.setK(param.fx,param.fy,param.skew,param.cx,param.cy)...
java
public static void depthTo3D(CameraPinholeBrown param , Planar<GrayU8> rgb , GrayU16 depth , FastQueue<Point3D_F64> cloud , FastQueueArray_I32 cloudColor ) { cloud.reset(); cloudColor.reset(); RemoveBrownPtoN_F64 p2n = new RemoveBrownPtoN_F64(); p2n.setK(param.fx,param.fy,param.skew,param.cx,param.cy)...
[ "public", "static", "void", "depthTo3D", "(", "CameraPinholeBrown", "param", ",", "Planar", "<", "GrayU8", ">", "rgb", ",", "GrayU16", "depth", ",", "FastQueue", "<", "Point3D_F64", ">", "cloud", ",", "FastQueueArray_I32", "cloudColor", ")", "{", "cloud", ".",...
Creates a point cloud from a depth image and saves the color information. The depth and color images are assumed to be aligned. @param param Intrinsic camera parameters for depth image @param depth depth image. each value is in millimeters. @param rgb Color image that's aligned to the depth. @param cloud Output point...
[ "Creates", "a", "point", "cloud", "from", "a", "depth", "image", "and", "saves", "the", "color", "information", ".", "The", "depth", "and", "color", "images", "are", "assumed", "to", "be", "aligned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/depth/VisualDepthOps.java#L81-L119
50,515
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java
MinimizeEnergyPrune.prune
public boolean prune(List<Point2D_I32> contour, GrowQueue_I32 input, GrowQueue_I32 output) { this.contour = contour; output.setTo(input); removeDuplicates(output); // can't prune a corner and it will still be a polygon if( output.size() <= 3 ) return false; computeSegmentEnergy(output); double tota...
java
public boolean prune(List<Point2D_I32> contour, GrowQueue_I32 input, GrowQueue_I32 output) { this.contour = contour; output.setTo(input); removeDuplicates(output); // can't prune a corner and it will still be a polygon if( output.size() <= 3 ) return false; computeSegmentEnergy(output); double tota...
[ "public", "boolean", "prune", "(", "List", "<", "Point2D_I32", ">", "contour", ",", "GrowQueue_I32", "input", ",", "GrowQueue_I32", "output", ")", "{", "this", ".", "contour", "=", "contour", ";", "output", ".", "setTo", "(", "input", ")", ";", "removeDupl...
Given a contour and initial set of corners compute a new set of corner indexes @param contour List of points in the shape's contour @param input Initial set of corners @param output Pruned set of corners @return true if one or more corners were pruned, false if nothing changed
[ "Given", "a", "contour", "and", "initial", "set", "of", "corners", "compute", "a", "new", "set", "of", "corner", "indexes" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L70-L144
50,516
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java
MinimizeEnergyPrune.removeDuplicates
void removeDuplicates( GrowQueue_I32 corners ) { // remove duplicates for (int i = 0; i < corners.size(); i++) { Point2D_I32 a = contour.get(corners.get(i)); // start from the top so that removing a corner doesn't mess with the for loop for (int j = corners.size()-1; j > i; j--) { Point2D_I32 b = cont...
java
void removeDuplicates( GrowQueue_I32 corners ) { // remove duplicates for (int i = 0; i < corners.size(); i++) { Point2D_I32 a = contour.get(corners.get(i)); // start from the top so that removing a corner doesn't mess with the for loop for (int j = corners.size()-1; j > i; j--) { Point2D_I32 b = cont...
[ "void", "removeDuplicates", "(", "GrowQueue_I32", "corners", ")", "{", "// remove duplicates", "for", "(", "int", "i", "=", "0", ";", "i", "<", "corners", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Point2D_I32", "a", "=", "contour", ".", "get", ...
Look for two corners which point to the same point and removes one of them from the corner list
[ "Look", "for", "two", "corners", "which", "point", "to", "the", "same", "point", "and", "removes", "one", "of", "them", "from", "the", "corner", "list" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L149-L164
50,517
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java
MinimizeEnergyPrune.computeSegmentEnergy
void computeSegmentEnergy( GrowQueue_I32 corners ) { if( energySegment.length < corners.size() ) { energySegment = new double[ corners.size() ]; } for (int i = 0,j=corners.size()-1; i < corners.size(); j=i,i++) { energySegment[j] = computeSegmentEnergy(corners, j, i); } }
java
void computeSegmentEnergy( GrowQueue_I32 corners ) { if( energySegment.length < corners.size() ) { energySegment = new double[ corners.size() ]; } for (int i = 0,j=corners.size()-1; i < corners.size(); j=i,i++) { energySegment[j] = computeSegmentEnergy(corners, j, i); } }
[ "void", "computeSegmentEnergy", "(", "GrowQueue_I32", "corners", ")", "{", "if", "(", "energySegment", ".", "length", "<", "corners", ".", "size", "(", ")", ")", "{", "energySegment", "=", "new", "double", "[", "corners", ".", "size", "(", ")", "]", ";",...
Computes the energy of each segment individually
[ "Computes", "the", "energy", "of", "each", "segment", "individually" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L169-L177
50,518
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java
MinimizeEnergyPrune.energyRemoveCorner
protected double energyRemoveCorner( int removed , GrowQueue_I32 corners ) { double total = 0; int cornerA = CircularIndex.addOffset(removed, -1 , corners.size()); int cornerB = CircularIndex.addOffset(removed, 1 , corners.size()); total += computeSegmentEnergy(corners, cornerA, cornerB); if( cornerA > co...
java
protected double energyRemoveCorner( int removed , GrowQueue_I32 corners ) { double total = 0; int cornerA = CircularIndex.addOffset(removed, -1 , corners.size()); int cornerB = CircularIndex.addOffset(removed, 1 , corners.size()); total += computeSegmentEnergy(corners, cornerA, cornerB); if( cornerA > co...
[ "protected", "double", "energyRemoveCorner", "(", "int", "removed", ",", "GrowQueue_I32", "corners", ")", "{", "double", "total", "=", "0", ";", "int", "cornerA", "=", "CircularIndex", ".", "addOffset", "(", "removed", ",", "-", "1", ",", "corners", ".", "...
Returns the total energy after removing a corner @param removed index of the corner that is being removed @param corners list of corner indexes
[ "Returns", "the", "total", "energy", "after", "removing", "a", "corner" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L184-L205
50,519
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java
MinimizeEnergyPrune.computeSegmentEnergy
protected double computeSegmentEnergy(GrowQueue_I32 corners, int cornerA, int cornerB) { int indexA = corners.get(cornerA); int indexB = corners.get(cornerB); if( indexA == indexB ) { return 100000.0; } Point2D_I32 a = contour.get(indexA); Point2D_I32 b = contour.get(indexB); line.p.x = a.x; line....
java
protected double computeSegmentEnergy(GrowQueue_I32 corners, int cornerA, int cornerB) { int indexA = corners.get(cornerA); int indexB = corners.get(cornerB); if( indexA == indexB ) { return 100000.0; } Point2D_I32 a = contour.get(indexA); Point2D_I32 b = contour.get(indexB); line.p.x = a.x; line....
[ "protected", "double", "computeSegmentEnergy", "(", "GrowQueue_I32", "corners", ",", "int", "cornerA", ",", "int", "cornerB", ")", "{", "int", "indexA", "=", "corners", ".", "get", "(", "cornerA", ")", ";", "int", "indexB", "=", "corners", ".", "get", "(",...
Computes the energy for a segment defined by the two corner indexes
[ "Computes", "the", "energy", "for", "a", "segment", "defined", "by", "the", "two", "corner", "indexes" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L210-L236
50,520
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java
MergeSmallRegions.process
public void process( T image, GrayS32 pixelToRegion , GrowQueue_I32 regionMemberCount, FastQueue<float[]> regionColor ) { stopRequested = false; // iterate until no more regions need to be merged together while( !stopRequested ) { // Update the color of each region regionColor.resize(...
java
public void process( T image, GrayS32 pixelToRegion , GrowQueue_I32 regionMemberCount, FastQueue<float[]> regionColor ) { stopRequested = false; // iterate until no more regions need to be merged together while( !stopRequested ) { // Update the color of each region regionColor.resize(...
[ "public", "void", "process", "(", "T", "image", ",", "GrayS32", "pixelToRegion", ",", "GrowQueue_I32", "regionMemberCount", ",", "FastQueue", "<", "float", "[", "]", ">", "regionColor", ")", "{", "stopRequested", "=", "false", ";", "// iterate until no more region...
Merges together smaller regions. Segmented image, region member count, and region color are all updated. @param image Input image. Used to compute color of each region @param pixelToRegion (input/output) Segmented image with the ID of each region. Modified. @param regionMemberCount (input/output) Number of members ...
[ "Merges", "together", "smaller", "regions", ".", "Segmented", "image", "region", "member", "count", "and", "region", "color", "are", "all", "updated", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java#L100-L130
50,521
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java
MergeSmallRegions.setupPruneList
protected boolean setupPruneList(GrowQueue_I32 regionMemberCount) { segmentPruneFlag.resize(regionMemberCount.size); pruneGraph.reset(); segmentToPruneID.resize(regionMemberCount.size); for( int i = 0; i < regionMemberCount.size; i++ ) { if( regionMemberCount.get(i) < minimumSize ) { segmentToPruneID.set...
java
protected boolean setupPruneList(GrowQueue_I32 regionMemberCount) { segmentPruneFlag.resize(regionMemberCount.size); pruneGraph.reset(); segmentToPruneID.resize(regionMemberCount.size); for( int i = 0; i < regionMemberCount.size; i++ ) { if( regionMemberCount.get(i) < minimumSize ) { segmentToPruneID.set...
[ "protected", "boolean", "setupPruneList", "(", "GrowQueue_I32", "regionMemberCount", ")", "{", "segmentPruneFlag", ".", "resize", "(", "regionMemberCount", ".", "size", ")", ";", "pruneGraph", ".", "reset", "(", ")", ";", "segmentToPruneID", ".", "resize", "(", ...
Identifies which regions are to be pruned based on their member counts. Then sets up data structures for graph and converting segment ID to prune ID. @return true If elements need to be pruned and false if not.
[ "Identifies", "which", "regions", "are", "to", "be", "pruned", "based", "on", "their", "member", "counts", ".", "Then", "sets", "up", "data", "structures", "for", "graph", "and", "converting", "segment", "ID", "to", "prune", "ID", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java#L138-L154
50,522
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java
MergeSmallRegions.findAdjacentRegions
protected void findAdjacentRegions(GrayS32 pixelToRegion) { // -------- Do the inner pixels first if( connect.length == 4 ) adjacentInner4(pixelToRegion); else if( connect.length == 8 ) { adjacentInner8(pixelToRegion); } adjacentBorder(pixelToRegion); }
java
protected void findAdjacentRegions(GrayS32 pixelToRegion) { // -------- Do the inner pixels first if( connect.length == 4 ) adjacentInner4(pixelToRegion); else if( connect.length == 8 ) { adjacentInner8(pixelToRegion); } adjacentBorder(pixelToRegion); }
[ "protected", "void", "findAdjacentRegions", "(", "GrayS32", "pixelToRegion", ")", "{", "// -------- Do the inner pixels first", "if", "(", "connect", ".", "length", "==", "4", ")", "adjacentInner4", "(", "pixelToRegion", ")", ";", "else", "if", "(", "connect", "."...
Go through each pixel in the image and examine its neighbors according to a 4-connect rule. If one of the pixels is in a region that is to be pruned mark them as neighbors. The image is traversed such that the number of comparisons is minimized.
[ "Go", "through", "each", "pixel", "in", "the", "image", "and", "examine", "its", "neighbors", "according", "to", "a", "4", "-", "connect", "rule", ".", "If", "one", "of", "the", "pixels", "is", "in", "a", "region", "that", "is", "to", "be", "pruned", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java#L161-L170
50,523
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java
MergeSmallRegions.selectMerge
protected void selectMerge( int pruneId , FastQueue<float[]> regionColor ) { // Grab information on the region which is being pruned Node n = pruneGraph.get(pruneId); float[] targetColor = regionColor.get(n.segment); // segment ID and distance away from the most similar neighbor int bestId = -1; float best...
java
protected void selectMerge( int pruneId , FastQueue<float[]> regionColor ) { // Grab information on the region which is being pruned Node n = pruneGraph.get(pruneId); float[] targetColor = regionColor.get(n.segment); // segment ID and distance away from the most similar neighbor int bestId = -1; float best...
[ "protected", "void", "selectMerge", "(", "int", "pruneId", ",", "FastQueue", "<", "float", "[", "]", ">", "regionColor", ")", "{", "// Grab information on the region which is being pruned", "Node", "n", "=", "pruneGraph", ".", "get", "(", "pruneId", ")", ";", "f...
Examine edges for the specified node and select node which it is the best match for it to merge with @param pruneId The prune Id of the segment which is to be merged into another segment @param regionColor List of region colors
[ "Examine", "edges", "for", "the", "specified", "node", "and", "select", "node", "which", "it", "is", "the", "best", "match", "for", "it", "to", "merge", "with" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/MergeSmallRegions.java#L343-L368
50,524
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java
EasyGeneralFeatureDetector.declareDerivativeImages
private void declareDerivativeImages(ImageGradient<T, D> gradient, ImageHessian<D> hessian, Class<D> derivType) { if( gradient != null || hessian != null ) { derivX = GeneralizedImageOps.createSingleBand(derivType, 1, 1); derivY = GeneralizedImageOps.createSingleBand(derivType,1,1); } if( hessian != null ) ...
java
private void declareDerivativeImages(ImageGradient<T, D> gradient, ImageHessian<D> hessian, Class<D> derivType) { if( gradient != null || hessian != null ) { derivX = GeneralizedImageOps.createSingleBand(derivType, 1, 1); derivY = GeneralizedImageOps.createSingleBand(derivType,1,1); } if( hessian != null ) ...
[ "private", "void", "declareDerivativeImages", "(", "ImageGradient", "<", "T", ",", "D", ">", "gradient", ",", "ImageHessian", "<", "D", ">", "hessian", ",", "Class", "<", "D", ">", "derivType", ")", "{", "if", "(", "gradient", "!=", "null", "||", "hessia...
Declare storage for image derivatives as needed
[ "Declare", "storage", "for", "image", "derivatives", "as", "needed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java#L91-L101
50,525
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java
EasyGeneralFeatureDetector.detect
public void detect(T input, QueueCorner exclude ) { initializeDerivatives(input); if (detector.getRequiresGradient() || detector.getRequiresHessian()) gradient.process(input, derivX, derivY); if (detector.getRequiresHessian()) hessian.process(derivX, derivY, derivXX, derivYY, derivXY); detector.setExcl...
java
public void detect(T input, QueueCorner exclude ) { initializeDerivatives(input); if (detector.getRequiresGradient() || detector.getRequiresHessian()) gradient.process(input, derivX, derivY); if (detector.getRequiresHessian()) hessian.process(derivX, derivY, derivXX, derivYY, derivXY); detector.setExcl...
[ "public", "void", "detect", "(", "T", "input", ",", "QueueCorner", "exclude", ")", "{", "initializeDerivatives", "(", "input", ")", ";", "if", "(", "detector", ".", "getRequiresGradient", "(", ")", "||", "detector", ".", "getRequiresHessian", "(", ")", ")", ...
Detect features inside the image. Excluding points in the exclude list. @param input Image being processed. @param exclude List of points that should not be returned.
[ "Detect", "features", "inside", "the", "image", ".", "Excluding", "points", "in", "the", "exclude", "list", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java#L109-L120
50,526
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java
EasyGeneralFeatureDetector.initializeDerivatives
private void initializeDerivatives(T input) { // reshape derivatives if the input image has changed size if (detector.getRequiresGradient() || detector.getRequiresHessian()) { derivX.reshape(input.width, input.height); derivY.reshape(input.width, input.height); } if (detector.getRequiresHessian()) { de...
java
private void initializeDerivatives(T input) { // reshape derivatives if the input image has changed size if (detector.getRequiresGradient() || detector.getRequiresHessian()) { derivX.reshape(input.width, input.height); derivY.reshape(input.width, input.height); } if (detector.getRequiresHessian()) { de...
[ "private", "void", "initializeDerivatives", "(", "T", "input", ")", "{", "// reshape derivatives if the input image has changed size", "if", "(", "detector", ".", "getRequiresGradient", "(", ")", "||", "detector", ".", "getRequiresHessian", "(", ")", ")", "{", "derivX...
Reshape derivative images to match the input image
[ "Reshape", "derivative", "images", "to", "match", "the", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/EasyGeneralFeatureDetector.java#L125-L136
50,527
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.checkFlip
public boolean checkFlip( SquareGrid grid ) { if( grid.columns == 1 || grid.rows == 1 ) return false; Point2D_F64 a = grid.get(0,0).center; Point2D_F64 b = grid.get(0,grid.columns-1).center; Point2D_F64 c = grid.get(grid.rows-1,0).center; double x0 = b.x-a.x; double y0 = b.y-a.y; double x1 = c.x-a.x...
java
public boolean checkFlip( SquareGrid grid ) { if( grid.columns == 1 || grid.rows == 1 ) return false; Point2D_F64 a = grid.get(0,0).center; Point2D_F64 b = grid.get(0,grid.columns-1).center; Point2D_F64 c = grid.get(grid.rows-1,0).center; double x0 = b.x-a.x; double y0 = b.y-a.y; double x1 = c.x-a.x...
[ "public", "boolean", "checkFlip", "(", "SquareGrid", "grid", ")", "{", "if", "(", "grid", ".", "columns", "==", "1", "||", "grid", ".", "rows", "==", "1", ")", "return", "false", ";", "Point2D_F64", "a", "=", "grid", ".", "get", "(", "0", ",", "0",...
Checks to see if it needs to be flipped. Flipping is required if X and Y axis in 2D grid are not CCW.
[ "Checks", "to", "see", "if", "it", "needs", "to", "be", "flipped", ".", "Flipping", "is", "required", "if", "X", "and", "Y", "axis", "in", "2D", "grid", "are", "not", "CCW", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L95-L112
50,528
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.orderNodeGrid
protected void orderNodeGrid(SquareGrid grid, int row, int col) { SquareNode node = grid.get(row,col); if(grid.rows==1 && grid.columns==1 ) { for (int i = 0; i < 4; i++) { ordered[i] = node.square.get(i); } } else if( grid.columns==1 ) { if (row == grid.rows - 1) { orderNode(node, grid.get(row -...
java
protected void orderNodeGrid(SquareGrid grid, int row, int col) { SquareNode node = grid.get(row,col); if(grid.rows==1 && grid.columns==1 ) { for (int i = 0; i < 4; i++) { ordered[i] = node.square.get(i); } } else if( grid.columns==1 ) { if (row == grid.rows - 1) { orderNode(node, grid.get(row -...
[ "protected", "void", "orderNodeGrid", "(", "SquareGrid", "grid", ",", "int", "row", ",", "int", "col", ")", "{", "SquareNode", "node", "=", "grid", ".", "get", "(", "row", ",", "col", ")", ";", "if", "(", "grid", ".", "rows", "==", "1", "&&", "grid...
Given the grid coordinate, order the corners for the node at that location. Takes in handles situations where there are no neighbors.
[ "Given", "the", "grid", "coordinate", "order", "the", "corners", "for", "the", "node", "at", "that", "location", ".", "Takes", "in", "handles", "situations", "where", "there", "are", "no", "neighbors", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L223-L245
50,529
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.rotateTwiceOrdered
private void rotateTwiceOrdered() { Point2D_F64 a = ordered[0]; Point2D_F64 b = ordered[1]; Point2D_F64 c = ordered[2]; Point2D_F64 d = ordered[3]; ordered[0] = c; ordered[1] = d; ordered[2] = a; ordered[3] = b; }
java
private void rotateTwiceOrdered() { Point2D_F64 a = ordered[0]; Point2D_F64 b = ordered[1]; Point2D_F64 c = ordered[2]; Point2D_F64 d = ordered[3]; ordered[0] = c; ordered[1] = d; ordered[2] = a; ordered[3] = b; }
[ "private", "void", "rotateTwiceOrdered", "(", ")", "{", "Point2D_F64", "a", "=", "ordered", "[", "0", "]", ";", "Point2D_F64", "b", "=", "ordered", "[", "1", "]", ";", "Point2D_F64", "c", "=", "ordered", "[", "2", "]", ";", "Point2D_F64", "d", "=", "...
Reorders the list by the equivalent of two rotations
[ "Reorders", "the", "list", "by", "the", "equivalent", "of", "two", "rotations" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L250-L260
50,530
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.orderNode
protected void orderNode(SquareNode target, SquareNode node, boolean pointingX) { int index0 = findIntersection(target,node); int index1 = (index0+1)%4; int index2 = (index0+2)%4; int index3 = (index0+3)%4; if( index0 < 0 ) throw new RuntimeException("Couldn't find intersection. Probable bug"); line...
java
protected void orderNode(SquareNode target, SquareNode node, boolean pointingX) { int index0 = findIntersection(target,node); int index1 = (index0+1)%4; int index2 = (index0+2)%4; int index3 = (index0+3)%4; if( index0 < 0 ) throw new RuntimeException("Couldn't find intersection. Probable bug"); line...
[ "protected", "void", "orderNode", "(", "SquareNode", "target", ",", "SquareNode", "node", ",", "boolean", "pointingX", ")", "{", "int", "index0", "=", "findIntersection", "(", "target", ",", "node", ")", ";", "int", "index1", "=", "(", "index0", "+", "1", ...
Fills the ordered list with the corners in target node in canonical order. @param pointingX true if 'node' is pointing along the x-axis from target. false for point along y-axis
[ "Fills", "the", "ordered", "list", "with", "the", "corners", "in", "target", "node", "in", "canonical", "order", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L274-L321
50,531
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.findIntersection
protected int findIntersection( SquareNode target , SquareNode node ) { lineCenters.a = target.center; lineCenters.b = node.center; for (int i = 0; i < 4; i++) { int j = (i+1)%4; lineSide.a = target.square.get(i); lineSide.b = target.square.get(j); if(Intersection2D_F64.intersection(lineCenters,lin...
java
protected int findIntersection( SquareNode target , SquareNode node ) { lineCenters.a = target.center; lineCenters.b = node.center; for (int i = 0; i < 4; i++) { int j = (i+1)%4; lineSide.a = target.square.get(i); lineSide.b = target.square.get(j); if(Intersection2D_F64.intersection(lineCenters,lin...
[ "protected", "int", "findIntersection", "(", "SquareNode", "target", ",", "SquareNode", "node", ")", "{", "lineCenters", ".", "a", "=", "target", ".", "center", ";", "lineCenters", ".", "b", "=", "node", ".", "center", ";", "for", "(", "int", "i", "=", ...
Finds the side which intersects the line segment from the center of target to center of node
[ "Finds", "the", "side", "which", "intersects", "the", "line", "segment", "from", "the", "center", "of", "target", "to", "center", "of", "node" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L326-L341
50,532
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java
SquareGridTools.orderSquareCorners
public boolean orderSquareCorners( SquareGrid grid ) { // the first pass interleaves every other row for (int row = 0; row < grid.rows; row++) { for (int col = 0; col < grid.columns; col++) { orderNodeGrid(grid, row, col); Polygon2D_F64 square = grid.get(row,col).square; for (int i = 0; i < 4; i++...
java
public boolean orderSquareCorners( SquareGrid grid ) { // the first pass interleaves every other row for (int row = 0; row < grid.rows; row++) { for (int col = 0; col < grid.columns; col++) { orderNodeGrid(grid, row, col); Polygon2D_F64 square = grid.get(row,col).square; for (int i = 0; i < 4; i++...
[ "public", "boolean", "orderSquareCorners", "(", "SquareGrid", "grid", ")", "{", "// the first pass interleaves every other row", "for", "(", "int", "row", "=", "0", ";", "row", "<", "grid", ".", "rows", ";", "row", "++", ")", "{", "for", "(", "int", "col", ...
Adjust the corners in the square's polygon so that they are aligned along the grids overall length @return true if valid grid or false if not
[ "Adjust", "the", "corners", "in", "the", "square", "s", "polygon", "so", "that", "they", "are", "aligned", "along", "the", "grids", "overall", "length" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L350-L366
50,533
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java
ExampleTemplateMatching.findMatches
private static List<Match> findMatches(GrayF32 image, GrayF32 template, GrayF32 mask, int expectedMatches) { // create template matcher. TemplateMatching<GrayF32> matcher = FactoryTemplateMatching.createMatcher(TemplateScoreType.SUM_DIFF_SQ, GrayF32.class); // Find the points which match the tem...
java
private static List<Match> findMatches(GrayF32 image, GrayF32 template, GrayF32 mask, int expectedMatches) { // create template matcher. TemplateMatching<GrayF32> matcher = FactoryTemplateMatching.createMatcher(TemplateScoreType.SUM_DIFF_SQ, GrayF32.class); // Find the points which match the tem...
[ "private", "static", "List", "<", "Match", ">", "findMatches", "(", "GrayF32", "image", ",", "GrayF32", "template", ",", "GrayF32", "mask", ",", "int", "expectedMatches", ")", "{", "// create template matcher.", "TemplateMatching", "<", "GrayF32", ">", "matcher", ...
Demonstrates how to search for matches of a template inside an image @param image Image being searched @param template Template being looked for @param mask Mask which determines the weight of each template pixel in the match score @param expectedMatches Number of expected matches it hopes ...
[ "Demonstrates", "how", "to", "search", "for", "matches", "of", "a", "template", "inside", "an", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java#L57-L70
50,534
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java
ExampleTemplateMatching.showMatchIntensity
public static void showMatchIntensity(GrayF32 image, GrayF32 template, GrayF32 mask) { // create algorithm for computing intensity image TemplateMatchingIntensity<GrayF32> matchIntensity = FactoryTemplateMatching.createIntensity(TemplateScoreType.SUM_DIFF_SQ, GrayF32.class); // apply the template to the ima...
java
public static void showMatchIntensity(GrayF32 image, GrayF32 template, GrayF32 mask) { // create algorithm for computing intensity image TemplateMatchingIntensity<GrayF32> matchIntensity = FactoryTemplateMatching.createIntensity(TemplateScoreType.SUM_DIFF_SQ, GrayF32.class); // apply the template to the ima...
[ "public", "static", "void", "showMatchIntensity", "(", "GrayF32", "image", ",", "GrayF32", "template", ",", "GrayF32", "mask", ")", "{", "// create algorithm for computing intensity image", "TemplateMatchingIntensity", "<", "GrayF32", ">", "matchIntensity", "=", "FactoryT...
Computes the template match intensity image and displays the results. Brighter intensity indicates a better match to the template.
[ "Computes", "the", "template", "match", "intensity", "image", "and", "displays", "the", "results", ".", "Brighter", "intensity", "indicates", "a", "better", "match", "to", "the", "template", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java#L76-L101
50,535
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java
ExampleTemplateMatching.drawRectangles
private static void drawRectangles(Graphics2D g2, GrayF32 image, GrayF32 template, GrayF32 mask, int expectedMatches) { List<Match> found = findMatches(image, template, mask, expectedMatches); int r = 2; int w = template.width + 2 * r; int h = template.height + 2 * r; for (Match m : ...
java
private static void drawRectangles(Graphics2D g2, GrayF32 image, GrayF32 template, GrayF32 mask, int expectedMatches) { List<Match> found = findMatches(image, template, mask, expectedMatches); int r = 2; int w = template.width + 2 * r; int h = template.height + 2 * r; for (Match m : ...
[ "private", "static", "void", "drawRectangles", "(", "Graphics2D", "g2", ",", "GrayF32", "image", ",", "GrayF32", "template", ",", "GrayF32", "mask", ",", "int", "expectedMatches", ")", "{", "List", "<", "Match", ">", "found", "=", "findMatches", "(", "image"...
Helper function will is finds matches and displays the results as colored rectangles
[ "Helper", "function", "will", "is", "finds", "matches", "and", "displays", "the", "results", "as", "colored", "rectangles" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java#L138-L165
50,536
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareBase_to_FiducialDetector.java
SquareBase_to_FiducialDetector.getCenter
@Override public void getCenter(int which, Point2D_F64 location) { Quadrilateral_F64 q = alg.getFound().get(which).distortedPixels; // compute intersection in undistorted pixels so that the intersection is the true // geometric center of the square. Since distorted pixels are being used this will only be approx...
java
@Override public void getCenter(int which, Point2D_F64 location) { Quadrilateral_F64 q = alg.getFound().get(which).distortedPixels; // compute intersection in undistorted pixels so that the intersection is the true // geometric center of the square. Since distorted pixels are being used this will only be approx...
[ "@", "Override", "public", "void", "getCenter", "(", "int", "which", ",", "Point2D_F64", "location", ")", "{", "Quadrilateral_F64", "q", "=", "alg", ".", "getFound", "(", ")", ".", "get", "(", "which", ")", ".", "distortedPixels", ";", "// compute intersecti...
Return the intersection of two lines defined by opposing corners. This should also be the geometric center @param which Fiducial's index @param location (output) Storage for the transform. modified.
[ "Return", "the", "intersection", "of", "two", "lines", "defined", "by", "opposing", "corners", ".", "This", "should", "also", "be", "the", "geometric", "center" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareBase_to_FiducialDetector.java#L91-L101
50,537
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareEdge.java
SquareEdge.destination
public <T extends SquareNode>T destination(SquareNode src) { if( a == src ) return (T)b; else if( b == src ) return (T)a; else throw new IllegalArgumentException("BUG! src is not a or b"); }
java
public <T extends SquareNode>T destination(SquareNode src) { if( a == src ) return (T)b; else if( b == src ) return (T)a; else throw new IllegalArgumentException("BUG! src is not a or b"); }
[ "public", "<", "T", "extends", "SquareNode", ">", "T", "destination", "(", "SquareNode", "src", ")", "{", "if", "(", "a", "==", "src", ")", "return", "(", "T", ")", "b", ";", "else", "if", "(", "b", "==", "src", ")", "return", "(", "T", ")", "a...
Returns the destination node.
[ "Returns", "the", "destination", "node", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareEdge.java#L51-L58
50,538
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/sfm/ExampleVisualOdometryDepth.java
ExampleVisualOdometryDepth.inlierPercent
public static String inlierPercent(VisualOdometry alg) { if( !(alg instanceof AccessPointTracks3D)) return ""; AccessPointTracks3D access = (AccessPointTracks3D)alg; int count = 0; int N = access.getAllTracks().size(); for( int i = 0; i < N; i++ ) { if( access.isInlier(i) ) count++; } return ...
java
public static String inlierPercent(VisualOdometry alg) { if( !(alg instanceof AccessPointTracks3D)) return ""; AccessPointTracks3D access = (AccessPointTracks3D)alg; int count = 0; int N = access.getAllTracks().size(); for( int i = 0; i < N; i++ ) { if( access.isInlier(i) ) count++; } return ...
[ "public", "static", "String", "inlierPercent", "(", "VisualOdometry", "alg", ")", "{", "if", "(", "!", "(", "alg", "instanceof", "AccessPointTracks3D", ")", ")", "return", "\"\"", ";", "AccessPointTracks3D", "access", "=", "(", "AccessPointTracks3D", ")", "alg",...
If the algorithm implements AccessPointTracks3D, then count the number of inlier features and return a string.
[ "If", "the", "algorithm", "implements", "AccessPointTracks3D", "then", "count", "the", "number", "of", "inlier", "features", "and", "return", "a", "string", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/sfm/ExampleVisualOdometryDepth.java#L109-L123
50,539
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java
ExampleFitPolygon.fitBinaryImage
public static void fitBinaryImage(GrayF32 input) { GrayU8 binary = new GrayU8(input.width,input.height); BufferedImage polygon = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); // the mean pixel value is often a reasonable threshold when creating a binary image double mean = ImageStati...
java
public static void fitBinaryImage(GrayF32 input) { GrayU8 binary = new GrayU8(input.width,input.height); BufferedImage polygon = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); // the mean pixel value is often a reasonable threshold when creating a binary image double mean = ImageStati...
[ "public", "static", "void", "fitBinaryImage", "(", "GrayF32", "input", ")", "{", "GrayU8", "binary", "=", "new", "GrayU8", "(", "input", ".", "width", ",", "input", ".", "height", ")", ";", "BufferedImage", "polygon", "=", "new", "BufferedImage", "(", "inp...
Fits polygons to found contours around binary blobs.
[ "Fits", "polygons", "to", "found", "contours", "around", "binary", "blobs", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java#L66-L104
50,540
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java
ExampleFitPolygon.fitCannyEdges
public static void fitCannyEdges( GrayF32 input ) { BufferedImage displayImage = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); // Finds edges inside the image CannyEdge<GrayF32,GrayF32> canny = FactoryEdgeDetectors.canny(2, true, true, GrayF32.class, GrayF32.class); canny.proces...
java
public static void fitCannyEdges( GrayF32 input ) { BufferedImage displayImage = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); // Finds edges inside the image CannyEdge<GrayF32,GrayF32> canny = FactoryEdgeDetectors.canny(2, true, true, GrayF32.class, GrayF32.class); canny.proces...
[ "public", "static", "void", "fitCannyEdges", "(", "GrayF32", "input", ")", "{", "BufferedImage", "displayImage", "=", "new", "BufferedImage", "(", "input", ".", "width", ",", "input", ".", "height", ",", "BufferedImage", ".", "TYPE_INT_RGB", ")", ";", "// Find...
Fits a sequence of line-segments into a sequence of points found using the Canny edge detector. In this case the points are not connected in a loop. The canny detector produces a more complex tree and the fitted points can be a bit noisy compared to the others.
[ "Fits", "a", "sequence", "of", "line", "-", "segments", "into", "a", "sequence", "of", "points", "found", "using", "the", "Canny", "edge", "detector", ".", "In", "this", "case", "the", "points", "are", "not", "connected", "in", "a", "loop", ".", "The", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java#L111-L140
50,541
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java
ExampleFitPolygon.fitCannyBinary
public static void fitCannyBinary( GrayF32 input ) { BufferedImage displayImage = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); GrayU8 binary = new GrayU8(input.width,input.height); // Finds edges inside the image CannyEdge<GrayF32,GrayF32> canny = FactoryEdgeDetectors.canny(2, f...
java
public static void fitCannyBinary( GrayF32 input ) { BufferedImage displayImage = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB); GrayU8 binary = new GrayU8(input.width,input.height); // Finds edges inside the image CannyEdge<GrayF32,GrayF32> canny = FactoryEdgeDetectors.canny(2, f...
[ "public", "static", "void", "fitCannyBinary", "(", "GrayF32", "input", ")", "{", "BufferedImage", "displayImage", "=", "new", "BufferedImage", "(", "input", ".", "width", ",", "input", ".", "height", ",", "BufferedImage", ".", "TYPE_INT_RGB", ")", ";", "GrayU8...
Detects contours inside the binary image generated by canny. Only the external contour is relevant. Often easier to deal with than working with Canny edges directly.
[ "Detects", "contours", "inside", "the", "binary", "image", "generated", "by", "canny", ".", "Only", "the", "external", "contour", "is", "relevant", ".", "Often", "easier", "to", "deal", "with", "than", "working", "with", "Canny", "edges", "directly", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFitPolygon.java#L146-L174
50,542
lessthanoptimal/BoofCV
main/boofcv-learning/src/main/java/boofcv/alg/bow/LearnSceneFromFiles.java
LearnSceneFromFiles.evaluate
protected Confusion evaluate( Map<String,List<String>> set ) { ClassificationHistogram histogram = new ClassificationHistogram(scenes.size()); int total = 0; for (int i = 0; i < scenes.size(); i++) { total += set.get(scenes.get(i)).size(); } System.out.println("total images "+total); for (int i = 0; i ...
java
protected Confusion evaluate( Map<String,List<String>> set ) { ClassificationHistogram histogram = new ClassificationHistogram(scenes.size()); int total = 0; for (int i = 0; i < scenes.size(); i++) { total += set.get(scenes.get(i)).size(); } System.out.println("total images "+total); for (int i = 0; i ...
[ "protected", "Confusion", "evaluate", "(", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "set", ")", "{", "ClassificationHistogram", "histogram", "=", "new", "ClassificationHistogram", "(", "scenes", ".", "size", "(", ")", ")", ";", "int", "t...
Given a set of images with known classification, predict which scene each one belongs in and compute a confusion matrix for the results. @param set Set of classified images @return Confusion matrix
[ "Given", "a", "set", "of", "images", "with", "known", "classification", "predict", "which", "scene", "each", "one", "belongs", "in", "and", "compute", "a", "confusion", "matrix", "for", "the", "results", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-learning/src/main/java/boofcv/alg/bow/LearnSceneFromFiles.java#L65-L86
50,543
lessthanoptimal/BoofCV
main/boofcv-learning/src/main/java/boofcv/alg/bow/LearnSceneFromFiles.java
LearnSceneFromFiles.findImages
public static Map<String,List<String>> findImages( File rootDir ) { File files[] = rootDir.listFiles(); if( files == null ) return null; List<File> imageDirectories = new ArrayList<>(); for( File f : files ) { if( f.isDirectory() ) { imageDirectories.add(f); } } Map<String,List<String>> out = ...
java
public static Map<String,List<String>> findImages( File rootDir ) { File files[] = rootDir.listFiles(); if( files == null ) return null; List<File> imageDirectories = new ArrayList<>(); for( File f : files ) { if( f.isDirectory() ) { imageDirectories.add(f); } } Map<String,List<String>> out = ...
[ "public", "static", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "findImages", "(", "File", "rootDir", ")", "{", "File", "files", "[", "]", "=", "rootDir", ".", "listFiles", "(", ")", ";", "if", "(", "files", "==", "null", ")", "retu...
Loads the paths to image files contained in subdirectories of the root directory. Each sub directory is assumed to be a different category of images.
[ "Loads", "the", "paths", "to", "image", "files", "contained", "in", "subdirectories", "of", "the", "root", "directory", ".", "Each", "sub", "directory", "is", "assumed", "to", "be", "a", "different", "category", "of", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-learning/src/main/java/boofcv/alg/bow/LearnSceneFromFiles.java#L163-L196
50,544
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/feature/CompareTwoImagePanel.java
CompareTwoImagePanel.setImages
public synchronized void setImages(BufferedImage leftImage , BufferedImage rightImage ) { this.leftImage = leftImage; this.rightImage = rightImage; setPreferredSize(leftImage.getWidth(),leftImage.getHeight(),rightImage.getWidth(),rightImage.getHeight()); }
java
public synchronized void setImages(BufferedImage leftImage , BufferedImage rightImage ) { this.leftImage = leftImage; this.rightImage = rightImage; setPreferredSize(leftImage.getWidth(),leftImage.getHeight(),rightImage.getWidth(),rightImage.getHeight()); }
[ "public", "synchronized", "void", "setImages", "(", "BufferedImage", "leftImage", ",", "BufferedImage", "rightImage", ")", "{", "this", ".", "leftImage", "=", "leftImage", ";", "this", ".", "rightImage", "=", "rightImage", ";", "setPreferredSize", "(", "leftImage"...
Sets the internal images. Not thread safe. @param leftImage @param rightImage
[ "Sets", "the", "internal", "images", ".", "Not", "thread", "safe", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/CompareTwoImagePanel.java#L93-L98
50,545
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/feature/CompareTwoImagePanel.java
CompareTwoImagePanel.computeScales
private void computeScales() { int width = getWidth(); int height = getHeight(); width = (width-borderSize)/2; // compute the scale factor for each image scaleLeft = scaleRight = 1; if( leftImage.getWidth() > width || leftImage.getHeight() > height ) { double scaleX = (double)width/(double)leftImage.ge...
java
private void computeScales() { int width = getWidth(); int height = getHeight(); width = (width-borderSize)/2; // compute the scale factor for each image scaleLeft = scaleRight = 1; if( leftImage.getWidth() > width || leftImage.getHeight() > height ) { double scaleX = (double)width/(double)leftImage.ge...
[ "private", "void", "computeScales", "(", ")", "{", "int", "width", "=", "getWidth", "(", ")", ";", "int", "height", "=", "getHeight", "(", ")", ";", "width", "=", "(", "width", "-", "borderSize", ")", "/", "2", ";", "// compute the scale factor for each im...
Compute individually how each image will be scaled
[ "Compute", "individually", "how", "each", "image", "will", "be", "scaled" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/CompareTwoImagePanel.java#L157-L175
50,546
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java
DataManipulationOps.normalize
public static void normalize(GrayF32 image , float mean , float stdev ) { for (int y = 0; y < image.height; y++) { int index = image.startIndex + y*image.stride; int end = index + image.width; while( index < end ) { image.data[index] = (image.data[index]-mean)/stdev; index++; } } }
java
public static void normalize(GrayF32 image , float mean , float stdev ) { for (int y = 0; y < image.height; y++) { int index = image.startIndex + y*image.stride; int end = index + image.width; while( index < end ) { image.data[index] = (image.data[index]-mean)/stdev; index++; } } }
[ "public", "static", "void", "normalize", "(", "GrayF32", "image", ",", "float", "mean", ",", "float", "stdev", ")", "{", "for", "(", "int", "y", "=", "0", ";", "y", "<", "image", ".", "height", ";", "y", "++", ")", "{", "int", "index", "=", "imag...
Normalizes a gray scale image by first subtracting the mean then dividing by stdev. @param image Image that is to be normalized @param mean Value which is subtracted by it @param stdev The divisor
[ "Normalizes", "a", "gray", "scale", "image", "by", "first", "subtracting", "the", "mean", "then", "dividing", "by", "stdev", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java#L39-L48
50,547
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java
DataManipulationOps.create1D_F32
public static Kernel1D_F32 create1D_F32( double[] kernel ) { Kernel1D_F32 k = new Kernel1D_F32(kernel.length,kernel.length/2); for (int i = 0; i < kernel.length; i++) { k.data[i] = (float)kernel[i]; } return k; }
java
public static Kernel1D_F32 create1D_F32( double[] kernel ) { Kernel1D_F32 k = new Kernel1D_F32(kernel.length,kernel.length/2); for (int i = 0; i < kernel.length; i++) { k.data[i] = (float)kernel[i]; } return k; }
[ "public", "static", "Kernel1D_F32", "create1D_F32", "(", "double", "[", "]", "kernel", ")", "{", "Kernel1D_F32", "k", "=", "new", "Kernel1D_F32", "(", "kernel", ".", "length", ",", "kernel", ".", "length", "/", "2", ")", ";", "for", "(", "int", "i", "=...
Converts the double array into a 1D float kernel @param kernel Kernel in array format @return The kernel
[ "Converts", "the", "double", "array", "into", "a", "1D", "float", "kernel" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java#L55-L61
50,548
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java
DataManipulationOps.imageToTensor
public static void imageToTensor(Planar<GrayF32> input , Tensor_F32 output , int miniBatch) { if( input.isSubimage()) throw new RuntimeException("Subimages not accepted"); if( output.getDimension() != 4 ) throw new IllegalArgumentException("Output should be 4-DOF. batch + spatial (channel,height,width)"); ...
java
public static void imageToTensor(Planar<GrayF32> input , Tensor_F32 output , int miniBatch) { if( input.isSubimage()) throw new RuntimeException("Subimages not accepted"); if( output.getDimension() != 4 ) throw new IllegalArgumentException("Output should be 4-DOF. batch + spatial (channel,height,width)"); ...
[ "public", "static", "void", "imageToTensor", "(", "Planar", "<", "GrayF32", ">", "input", ",", "Tensor_F32", "output", ",", "int", "miniBatch", ")", "{", "if", "(", "input", ".", "isSubimage", "(", ")", ")", "throw", "new", "RuntimeException", "(", "\"Subi...
Converts an image into a spatial tensor @param input BoofCV planar image @param output Tensor @param miniBatch Which mini-batch in the tensor should the image be written to
[ "Converts", "an", "image", "into", "a", "spatial", "tensor" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/DataManipulationOps.java#L70-L89
50,549
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java
LinearExternalContours.process
public void process( GrayU8 binary , int adjustX , int adjustY ) { // Initialize data structures this.adjustX = adjustX; this.adjustY = adjustY; storagePoints.reset(); ImageMiscOps.fillBorder(binary, 0, 1); tracer.setInputs(binary); final byte binaryData[] = binary.data; // Scan through the image one ...
java
public void process( GrayU8 binary , int adjustX , int adjustY ) { // Initialize data structures this.adjustX = adjustX; this.adjustY = adjustY; storagePoints.reset(); ImageMiscOps.fillBorder(binary, 0, 1); tracer.setInputs(binary); final byte binaryData[] = binary.data; // Scan through the image one ...
[ "public", "void", "process", "(", "GrayU8", "binary", ",", "int", "adjustX", ",", "int", "adjustY", ")", "{", "// Initialize data structures", "this", ".", "adjustX", "=", "adjustX", ";", "this", ".", "adjustY", "=", "adjustY", ";", "storagePoints", ".", "re...
Detects contours inside the binary image. @param binary Binary image. Will be modified. See class description @param adjustX adjustment applied to coordinate in binary image for contour. 0 or 1 is typical @param adjustY adjustment applied to coordinate in binary image for contour. 0 or 1 is typical
[ "Detects", "contours", "inside", "the", "binary", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java#L78-L134
50,550
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java
LinearExternalContours.findNotZero
static int findNotZero( byte[] data , int index , int end ) { while( index < end && data[index] == 0 ) { index++; } return index; }
java
static int findNotZero( byte[] data , int index , int end ) { while( index < end && data[index] == 0 ) { index++; } return index; }
[ "static", "int", "findNotZero", "(", "byte", "[", "]", "data", ",", "int", "index", ",", "int", "end", ")", "{", "while", "(", "index", "<", "end", "&&", "data", "[", "index", "]", "==", "0", ")", "{", "index", "++", ";", "}", "return", "index", ...
Searches for a value in the array which is not zero.
[ "Searches", "for", "a", "value", "in", "the", "array", "which", "is", "not", "zero", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java#L140-L145
50,551
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java
LinearExternalContours.findZero
static int findZero( byte[] data , int index , int end ) { while( index < end && data[index] != 0 ) { index++; } return index; }
java
static int findZero( byte[] data , int index , int end ) { while( index < end && data[index] != 0 ) { index++; } return index; }
[ "static", "int", "findZero", "(", "byte", "[", "]", "data", ",", "int", "index", ",", "int", "end", ")", "{", "while", "(", "index", "<", "end", "&&", "data", "[", "index", "]", "!=", "0", ")", "{", "index", "++", ";", "}", "return", "index", "...
Searches for a value in the array which is zero.
[ "Searches", "for", "a", "value", "in", "the", "array", "which", "is", "zero", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearExternalContours.java#L150-L155
50,552
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareImage_to_FiducialDetector.java
SquareImage_to_FiducialDetector.addPatternImage
public void addPatternImage(T pattern, double threshold, double lengthSide) { GrayU8 binary = new GrayU8(pattern.width,pattern.height); GThresholdImageOps.threshold(pattern,binary,threshold,false); alg.addPattern(binary, lengthSide); }
java
public void addPatternImage(T pattern, double threshold, double lengthSide) { GrayU8 binary = new GrayU8(pattern.width,pattern.height); GThresholdImageOps.threshold(pattern,binary,threshold,false); alg.addPattern(binary, lengthSide); }
[ "public", "void", "addPatternImage", "(", "T", "pattern", ",", "double", "threshold", ",", "double", "lengthSide", ")", "{", "GrayU8", "binary", "=", "new", "GrayU8", "(", "pattern", ".", "width", ",", "pattern", ".", "height", ")", ";", "GThresholdImageOps"...
Add a new pattern to be detected. This function takes in a raw gray scale image and thresholds it. @param pattern Gray scale image of the pattern @param threshold Threshold used to convert it into a binary image @param lengthSide Length of a side on the square in world units.
[ "Add", "a", "new", "pattern", "to", "be", "detected", ".", "This", "function", "takes", "in", "a", "raw", "gray", "scale", "image", "and", "thresholds", "it", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/SquareImage_to_FiducialDetector.java#L48-L52
50,553
lessthanoptimal/BoofCV
integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/MainActivity.java
MainActivity.requestCameraPermission
private void requestCameraPermission() { int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA); if( permissionCheck != android.content.pm.PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 0); ...
java
private void requestCameraPermission() { int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA); if( permissionCheck != android.content.pm.PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 0); ...
[ "private", "void", "requestCameraPermission", "(", ")", "{", "int", "permissionCheck", "=", "ContextCompat", ".", "checkSelfPermission", "(", "this", ",", "Manifest", ".", "permission", ".", "CAMERA", ")", ";", "if", "(", "permissionCheck", "!=", "android", ".",...
Newer versions of Android require explicit permission from the user
[ "Newer", "versions", "of", "Android", "require", "explicit", "permission", "from", "the", "user" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/MainActivity.java#L66-L76
50,554
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToGray
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else ...
java
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "bitmapToGray", "(", "Bitmap", "input", ",", "T", "output", ",", "Class", "<", "T", ">", "imageType", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "imageType", ...
Converts Bitmap image into a single band image of arbitrary type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output single band image. If null a new one will be declared. @param imageType Type of single band image. @param storage Byte array used for internal ...
[ "Converts", "Bitmap", "image", "into", "a", "single", "band", "image", "of", "arbitrary", "type", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L98-L107
50,555
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToGray
public static GrayU8 bitmapToGray( Bitmap input , GrayU8 output , byte[] storage ) { if( output == null ) { output = new GrayU8( input.getWidth() , input.getHeight() ); } else { output.reshape(input.getWidth(), input.getHeight()); } if( storage == null ) storage = declareStorage(input,null); inpu...
java
public static GrayU8 bitmapToGray( Bitmap input , GrayU8 output , byte[] storage ) { if( output == null ) { output = new GrayU8( input.getWidth() , input.getHeight() ); } else { output.reshape(input.getWidth(), input.getHeight()); } if( storage == null ) storage = declareStorage(input,null); inpu...
[ "public", "static", "GrayU8", "bitmapToGray", "(", "Bitmap", "input", ",", "GrayU8", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "output", "==", "null", ")", "{", "output", "=", "new", "GrayU8", "(", "input", ".", "getWidth", "(", ...
Converts Bitmap image into GrayU8. @param input Input Bitmap image. @param output Output image. If null a new one will be declared. @param storage Byte array used for internal storage. If null it will be declared internally. @return The converted gray scale image.
[ "Converts", "Bitmap", "image", "into", "GrayU8", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L117-L132
50,556
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToPlanar
public static <T extends ImageGray<T>> Planar<T> bitmapToPlanar(Bitmap input , Planar<T> output , Class<T> type , byte[] storage ) { if( output == null ) { output = new Planar<>(type, input.getWidth(), input.getHeight(), 3); } else { int numBands = Math.min(4,Math.max(3,output.getNumBands())); output.resh...
java
public static <T extends ImageGray<T>> Planar<T> bitmapToPlanar(Bitmap input , Planar<T> output , Class<T> type , byte[] storage ) { if( output == null ) { output = new Planar<>(type, input.getWidth(), input.getHeight(), 3); } else { int numBands = Math.min(4,Math.max(3,output.getNumBands())); output.resh...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "Planar", "<", "T", ">", "bitmapToPlanar", "(", "Bitmap", "input", ",", "Planar", "<", "T", ">", "output", ",", "Class", "<", "T", ">", "type", ",", "byte", "[", "]", "storag...
Converts Bitmap image into Planar image of the appropriate type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output image. If null a new one will be declared. @param type The type of internal single band image used in the Planar image. @param storage Byte arra...
[ "Converts", "Bitmap", "image", "into", "Planar", "image", "of", "the", "appropriate", "type", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L171-L192
50,557
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.boofToBitmap
public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) { if( BOverrideConvertAndroid.invokeBoofToBitmap(ColorFormat.RGB,input,output,storage)) return; if( input instanceof Planar ) { planarToBitmap((Planar)input,output,storage); } else if( input instanceof ImageGray ) { grayT...
java
public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) { if( BOverrideConvertAndroid.invokeBoofToBitmap(ColorFormat.RGB,input,output,storage)) return; if( input instanceof Planar ) { planarToBitmap((Planar)input,output,storage); } else if( input instanceof ImageGray ) { grayT...
[ "public", "static", "void", "boofToBitmap", "(", "ImageBase", "input", ",", "Bitmap", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "BOverrideConvertAndroid", ".", "invokeBoofToBitmap", "(", "ColorFormat", ".", "RGB", ",", "input", ",", "o...
Converts many BoofCV image types into a Bitmap. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input BoofCV image. @param output Output Bitmap image. @param storage Byte array used for internal storage. If null it will be declared internally.
[ "Converts", "many", "BoofCV", "image", "types", "into", "a", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L203-L216
50,558
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.planarToBitmap
public static <T extends ImageGray<T>> void planarToBitmap(Planar<T> input , Bitmap output , byte[] storage ) { if( output.getWidth() != input.getWidth() || output.getHeight() != input.getHeight() ) { throw new IllegalArgumentException("Image shapes are not the same"); } if( storage == null ) storage = ...
java
public static <T extends ImageGray<T>> void planarToBitmap(Planar<T> input , Bitmap output , byte[] storage ) { if( output.getWidth() != input.getWidth() || output.getHeight() != input.getHeight() ) { throw new IllegalArgumentException("Image shapes are not the same"); } if( storage == null ) storage = ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "planarToBitmap", "(", "Planar", "<", "T", ">", "input", ",", "Bitmap", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "output", ".", "getWidth", "(",...
Converts Planar image into Bitmap. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Planar image. @param output Output Bitmap image. @param storage Byte array used for internal storage. If null it will be declared internally.
[ "Converts", "Planar", "image", "into", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L311-L327
50,559
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.grayToBitmap
public static Bitmap grayToBitmap( GrayU8 input , Bitmap.Config config ) { Bitmap output = Bitmap.createBitmap(input.width, input.height, config); grayToBitmap(input,output,null); return output; }
java
public static Bitmap grayToBitmap( GrayU8 input , Bitmap.Config config ) { Bitmap output = Bitmap.createBitmap(input.width, input.height, config); grayToBitmap(input,output,null); return output; }
[ "public", "static", "Bitmap", "grayToBitmap", "(", "GrayU8", "input", ",", "Bitmap", ".", "Config", "config", ")", "{", "Bitmap", "output", "=", "Bitmap", ".", "createBitmap", "(", "input", ".", "width", ",", "input", ".", "height", ",", "config", ")", "...
Converts GrayU8 into a new Bitmap. @param input Input gray scale image. @param config Type of Bitmap image to create.
[ "Converts", "GrayU8", "into", "a", "new", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L386-L392
50,560
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.process
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) { if( checkSource ) { if( checkDestination ) { processSource(matches, numSource, firstPass); processDestination(firstPass,numDestination,pruned); } else { processSource(matches, numSource, pruned); } ...
java
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) { if( checkSource ) { if( checkDestination ) { processSource(matches, numSource, firstPass); processDestination(firstPass,numDestination,pruned); } else { processSource(matches, numSource, pruned); } ...
[ "public", "void", "process", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numSource", ",", "int", "numDestination", ")", "{", "if", "(", "checkSource", ")", "{", "if", "(", "checkDestination", ")", "{", "processSource", "(", "matche...
Given a set of matches, enforce the uniqueness rules it was configured to. @param matches Set of matching features @param numSource Number of source features @param numDestination Number of destination features
[ "Given", "a", "set", "of", "matches", "enforce", "the", "uniqueness", "rules", "it", "was", "configured", "to", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L74-L89
50,561
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.processSource
private void processSource(FastQueue<AssociatedIndex> matches, int numSource, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numSource); solutions.resize(numSource); for( int i =0; i < numSource; i++ ) { solutions.data[i] = -1; } // select best matches for( int ...
java
private void processSource(FastQueue<AssociatedIndex> matches, int numSource, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numSource); solutions.resize(numSource); for( int i =0; i < numSource; i++ ) { solutions.data[i] = -1; } // select best matches for( int ...
[ "private", "void", "processSource", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numSource", ",", "FastQueue", "<", "AssociatedIndex", ">", "output", ")", "{", "//set up data structures", "scores", ".", "resize", "(", "numSource", ")", ...
Selects a subset of matches that have at most one association for each source feature.
[ "Selects", "a", "subset", "of", "matches", "that", "have", "at", "most", "one", "association", "for", "each", "source", "feature", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L94-L144
50,562
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.processDestination
private void processDestination(FastQueue<AssociatedIndex> matches, int numDestination, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numDestination); solutions.resize(numDestination); for( int i =0; i < numDestination; i++ ) { solutions.data[i] = -1; } // select ...
java
private void processDestination(FastQueue<AssociatedIndex> matches, int numDestination, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numDestination); solutions.resize(numDestination); for( int i =0; i < numDestination; i++ ) { solutions.data[i] = -1; } // select ...
[ "private", "void", "processDestination", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numDestination", ",", "FastQueue", "<", "AssociatedIndex", ">", "output", ")", "{", "//set up data structures", "scores", ".", "resize", "(", "numDestinat...
Selects a subset of matches that have at most one association for each destination feature.
[ "Selects", "a", "subset", "of", "matches", "that", "have", "at", "most", "one", "association", "for", "each", "destination", "feature", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L149-L199
50,563
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java
PointCloudViewerPanelSwing.applyFog
private int applyFog( int rgb , float fraction ) { // avoid floating point math int adjustment = (int)(1000*fraction); int r = (rgb >> 16)&0xFF; int g = (rgb >> 8)&0xFF; int b = rgb & 0xFF; r = (r * adjustment + ((backgroundColor>>16)&0xFF)*(1000-adjustment)) / 1000; g = (g * adjustment + ((backgroundCo...
java
private int applyFog( int rgb , float fraction ) { // avoid floating point math int adjustment = (int)(1000*fraction); int r = (rgb >> 16)&0xFF; int g = (rgb >> 8)&0xFF; int b = rgb & 0xFF; r = (r * adjustment + ((backgroundColor>>16)&0xFF)*(1000-adjustment)) / 1000; g = (g * adjustment + ((backgroundCo...
[ "private", "int", "applyFog", "(", "int", "rgb", ",", "float", "fraction", ")", "{", "// avoid floating point math", "int", "adjustment", "=", "(", "int", ")", "(", "1000", "*", "fraction", ")", ";", "int", "r", "=", "(", "rgb", ">>", "16", ")", "&", ...
Fades color into background as a function of distance
[ "Fades", "color", "into", "background", "as", "a", "function", "of", "distance" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java#L246-L259
50,564
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java
PointCloudViewerPanelSwing.renderDot
private void renderDot( int cx , int cy , float Z , int rgb ) { for (int i = -dotRadius; i <= dotRadius; i++) { int y = cy+i; if( y < 0 || y >= imageRgb.height ) continue; for (int j = -dotRadius; j <= dotRadius; j++) { int x = cx+j; if( x < 0 || x >= imageRgb.width ) continue; int pixe...
java
private void renderDot( int cx , int cy , float Z , int rgb ) { for (int i = -dotRadius; i <= dotRadius; i++) { int y = cy+i; if( y < 0 || y >= imageRgb.height ) continue; for (int j = -dotRadius; j <= dotRadius; j++) { int x = cx+j; if( x < 0 || x >= imageRgb.width ) continue; int pixe...
[ "private", "void", "renderDot", "(", "int", "cx", ",", "int", "cy", ",", "float", "Z", ",", "int", "rgb", ")", "{", "for", "(", "int", "i", "=", "-", "dotRadius", ";", "i", "<=", "dotRadius", ";", "i", "++", ")", "{", "int", "y", "=", "cy", "...
Renders a dot as a square sprite with the specified color
[ "Renders", "a", "dot", "as", "a", "square", "sprite", "with", "the", "specified", "color" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java#L264-L282
50,565
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java
VideoRenderProcessing.imageToOutput
protected void imageToOutput( double x , double y , Point2D_F64 pt ) { pt.x = x/scale - tranX/scale; pt.y = y/scale - tranY/scale; }
java
protected void imageToOutput( double x , double y , Point2D_F64 pt ) { pt.x = x/scale - tranX/scale; pt.y = y/scale - tranY/scale; }
[ "protected", "void", "imageToOutput", "(", "double", "x", ",", "double", "y", ",", "Point2D_F64", "pt", ")", "{", "pt", ".", "x", "=", "x", "/", "scale", "-", "tranX", "/", "scale", ";", "pt", ".", "y", "=", "y", "/", "scale", "-", "tranY", "/", ...
Converts a coordinate from pixel to the output image coordinates
[ "Converts", "a", "coordinate", "from", "pixel", "to", "the", "output", "image", "coordinates" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java#L139-L142
50,566
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java
VideoRenderProcessing.outputToImage
protected void outputToImage( double x , double y , Point2D_F64 pt ) { pt.x = x*scale + tranX; pt.y = y*scale + tranY; }
java
protected void outputToImage( double x , double y , Point2D_F64 pt ) { pt.x = x*scale + tranX; pt.y = y*scale + tranY; }
[ "protected", "void", "outputToImage", "(", "double", "x", ",", "double", "y", ",", "Point2D_F64", "pt", ")", "{", "pt", ".", "x", "=", "x", "*", "scale", "+", "tranX", ";", "pt", ".", "y", "=", "y", "*", "scale", "+", "tranY", ";", "}" ]
Converts a coordinate from output image coordinates to input image
[ "Converts", "a", "coordinate", "from", "output", "image", "coordinates", "to", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java#L147-L150
50,567
lessthanoptimal/BoofCV
integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/ImplConvertJCodecPicture.java
ImplConvertJCodecPicture.RGB_to_PLU8
public static void RGB_to_PLU8(Picture input, Planar<GrayU8> output) { if( input.getColor() != ColorSpace.RGB ) throw new RuntimeException("Unexpected input color space!"); if( output.getNumBands() != 3 ) throw new RuntimeException("Unexpected number of bands in output image!"); output.reshape(input.getWid...
java
public static void RGB_to_PLU8(Picture input, Planar<GrayU8> output) { if( input.getColor() != ColorSpace.RGB ) throw new RuntimeException("Unexpected input color space!"); if( output.getNumBands() != 3 ) throw new RuntimeException("Unexpected number of bands in output image!"); output.reshape(input.getWid...
[ "public", "static", "void", "RGB_to_PLU8", "(", "Picture", "input", ",", "Planar", "<", "GrayU8", ">", "output", ")", "{", "if", "(", "input", ".", "getColor", "(", ")", "!=", "ColorSpace", ".", "RGB", ")", "throw", "new", "RuntimeException", "(", "\"Une...
Converts a picture in JCodec RGB into RGB BoofCV
[ "Converts", "a", "picture", "in", "JCodec", "RGB", "into", "RGB", "BoofCV" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/ImplConvertJCodecPicture.java#L34-L61
50,568
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java
HomographyTotalLeastSquares.backsubstitution0134
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H8 = H[8]; for (int i = 0, index = 0; i < N; i++) { double x = -X.data[index],y = ...
java
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H8 = H[8]; for (int i = 0, index = 0; i < N; i++) { double x = -X.data[index],y = ...
[ "static", "void", "backsubstitution0134", "(", "DMatrixRMaj", "P_plus", ",", "DMatrixRMaj", "P", ",", "DMatrixRMaj", "X", ",", "double", "H", "[", "]", ")", "{", "final", "int", "N", "=", "P", ".", "numRows", ";", "DMatrixRMaj", "tmp", "=", "new", "DMatr...
Backsubstitution for solving for 0,1 and 3,4 using solution for 6,7,8
[ "Backsubstitution", "for", "solving", "for", "0", "1", "and", "3", "4", "using", "solution", "for", "6", "7", "8" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java#L114-L148
50,569
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java
HomographyTotalLeastSquares.constructA678
void constructA678() { final int N = X1.numRows; // Pseudo-inverse of hat(p) computePseudo(X1,P_plus); DMatrixRMaj PPpXP = new DMatrixRMaj(1,1); DMatrixRMaj PPpYP = new DMatrixRMaj(1,1); computePPXP(X1,P_plus,X2,0,PPpXP); computePPXP(X1,P_plus,X2,1,PPpYP); DMatrixRMaj PPpX = new DMatrixRMaj(1,1); D...
java
void constructA678() { final int N = X1.numRows; // Pseudo-inverse of hat(p) computePseudo(X1,P_plus); DMatrixRMaj PPpXP = new DMatrixRMaj(1,1); DMatrixRMaj PPpYP = new DMatrixRMaj(1,1); computePPXP(X1,P_plus,X2,0,PPpXP); computePPXP(X1,P_plus,X2,1,PPpYP); DMatrixRMaj PPpX = new DMatrixRMaj(1,1); D...
[ "void", "constructA678", "(", ")", "{", "final", "int", "N", "=", "X1", ".", "numRows", ";", "// Pseudo-inverse of hat(p)", "computePseudo", "(", "X1", ",", "P_plus", ")", ";", "DMatrixRMaj", "PPpXP", "=", "new", "DMatrixRMaj", "(", "1", ",", "1", ")", "...
Constructs equation for elements 6 to 8 in H
[ "Constructs", "equation", "for", "elements", "6", "to", "8", "in", "H" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java#L153-L205
50,570
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/MetricSceneGraph.java
MetricSceneGraph.sanityCheck
public void sanityCheck() { for( View v : nodes ) { for( Motion m : v.connections ) { if( m.viewDst != v && m.viewSrc != v ) throw new RuntimeException("Not member of connection"); } } for( Motion m : edges ) { if( m.viewDst != m.destination(m.viewSrc) ) throw new RuntimeException("Unexpecte...
java
public void sanityCheck() { for( View v : nodes ) { for( Motion m : v.connections ) { if( m.viewDst != v && m.viewSrc != v ) throw new RuntimeException("Not member of connection"); } } for( Motion m : edges ) { if( m.viewDst != m.destination(m.viewSrc) ) throw new RuntimeException("Unexpecte...
[ "public", "void", "sanityCheck", "(", ")", "{", "for", "(", "View", "v", ":", "nodes", ")", "{", "for", "(", "Motion", "m", ":", "v", ".", "connections", ")", "{", "if", "(", "m", ".", "viewDst", "!=", "v", "&&", "m", ".", "viewSrc", "!=", "v",...
Performs simple checks to see if the data structure is avlid
[ "Performs", "simple", "checks", "to", "see", "if", "the", "data", "structure", "is", "avlid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/MetricSceneGraph.java#L98-L110
50,571
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java
TldAdjustRegion.process
public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) { // estimate how the rectangle has changed and update it if( !estimateMotion.process(pairs.toList()) ) return false; ScaleTranslate2D motion = estimateMotion.getModelParameters(); adjustRectangle(targetRectangle,mo...
java
public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) { // estimate how the rectangle has changed and update it if( !estimateMotion.process(pairs.toList()) ) return false; ScaleTranslate2D motion = estimateMotion.getModelParameters(); adjustRectangle(targetRectangle,mo...
[ "public", "boolean", "process", "(", "FastQueue", "<", "AssociatedPair", ">", "pairs", ",", "Rectangle2D_F64", "targetRectangle", ")", "{", "// estimate how the rectangle has changed and update it", "if", "(", "!", "estimateMotion", ".", "process", "(", "pairs", ".", ...
Adjusts target rectangle using track information @param pairs List of feature location in previous and current frame. @param targetRectangle (Input) current location of rectangle. (output) adjusted location @return true if successful
[ "Adjusts", "target", "rectangle", "using", "track", "information" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java#L72-L88
50,572
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java
TldAdjustRegion.adjustRectangle
protected void adjustRectangle( Rectangle2D_F64 rect , ScaleTranslate2D motion ) { rect.p0.x = rect.p0.x*motion.scale + motion.transX; rect.p0.y = rect.p0.y*motion.scale + motion.transY; rect.p1.x = rect.p1.x*motion.scale + motion.transX; rect.p1.y = rect.p1.y*motion.scale + motion.transY; }
java
protected void adjustRectangle( Rectangle2D_F64 rect , ScaleTranslate2D motion ) { rect.p0.x = rect.p0.x*motion.scale + motion.transX; rect.p0.y = rect.p0.y*motion.scale + motion.transY; rect.p1.x = rect.p1.x*motion.scale + motion.transX; rect.p1.y = rect.p1.y*motion.scale + motion.transY; }
[ "protected", "void", "adjustRectangle", "(", "Rectangle2D_F64", "rect", ",", "ScaleTranslate2D", "motion", ")", "{", "rect", ".", "p0", ".", "x", "=", "rect", ".", "p0", ".", "x", "*", "motion", ".", "scale", "+", "motion", ".", "transX", ";", "rect", ...
Estimate motion of points inside the rectangle and updates the rectangle using the found motion.
[ "Estimate", "motion", "of", "points", "inside", "the", "rectangle", "and", "updates", "the", "rectangle", "using", "the", "found", "motion", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java#L93-L98
50,573
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java
ExampleAssociatePoints.associate
public void associate( BufferedImage imageA , BufferedImage imageB ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // stores the location of detected interest points pointsA = new ArrayList<>(); point...
java
public void associate( BufferedImage imageA , BufferedImage imageB ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // stores the location of detected interest points pointsA = new ArrayList<>(); point...
[ "public", "void", "associate", "(", "BufferedImage", "imageA", ",", "BufferedImage", "imageB", ")", "{", "T", "inputA", "=", "ConvertBufferedImage", ".", "convertFromSingle", "(", "imageA", ",", "null", ",", "imageType", ")", ";", "T", "inputB", "=", "ConvertB...
Detect and associate point features in the two images. Display the results.
[ "Detect", "and", "associate", "point", "features", "in", "the", "two", "images", ".", "Display", "the", "results", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java#L76-L104
50,574
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.waveletVisu
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletVisu( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPixe...
java
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletVisu( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPixe...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "WaveletDenoiseFilter", "<", "T", ">", "waveletVisu", "(", "Class", "<", "T", ">", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue",...
Denoises an image using VISU Shrink wavelet denoiser. @param imageType The type of image being transform. @param numLevels Number of levels in the wavelet transform. If not sure, try using 3. @param minPixelValue Minimum allowed pixel intensity value @param maxPixelValue Maximum allowed pixel intensity value @return ...
[ "Denoises", "an", "image", "using", "VISU", "Shrink", "wavelet", "denoiser", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L55-L63
50,575
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.waveletBayes
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletBayes( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPix...
java
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletBayes( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPix...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "WaveletDenoiseFilter", "<", "T", ">", "waveletBayes", "(", "Class", "<", "T", ">", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue"...
Denoises an image using BayesShrink wavelet denoiser. @param imageType The type of image being transform. @param numLevels Number of levels in the wavelet transform. If not sure, try using 3. @param minPixelValue Minimum allowed pixel intensity value @param maxPixelValue Maximum allowed pixel intensity value @return ...
[ "Denoises", "an", "image", "using", "BayesShrink", "wavelet", "denoiser", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L74-L82
50,576
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.createDefaultShrinkTransform
private static WaveletTransform createDefaultShrinkTransform(ImageDataType imageType, int numLevels, double minPixelValue , double maxPixelValue ) { WaveletTransform descTran; if( !imageType.isInteger()) { WaveletDescription<WlCoef_F32> waveletDesc_F32 = FactoryWaveletDaub.daubJ_F32(4); des...
java
private static WaveletTransform createDefaultShrinkTransform(ImageDataType imageType, int numLevels, double minPixelValue , double maxPixelValue ) { WaveletTransform descTran; if( !imageType.isInteger()) { WaveletDescription<WlCoef_F32> waveletDesc_F32 = FactoryWaveletDaub.daubJ_F32(4); des...
[ "private", "static", "WaveletTransform", "createDefaultShrinkTransform", "(", "ImageDataType", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue", ")", "{", "WaveletTransform", "descTran", ";", "if", "(", "!", "imageTy...
Default wavelet transform used for denoising images.
[ "Default", "wavelet", "transform", "used", "for", "denoising", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L106-L122
50,577
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.minusPOffset
public static int minusPOffset(int index, int offset, int size) { index -= offset; if( index < 0 ) { return size + index; } else { return index; } }
java
public static int minusPOffset(int index, int offset, int size) { index -= offset; if( index < 0 ) { return size + index; } else { return index; } }
[ "public", "static", "int", "minusPOffset", "(", "int", "index", ",", "int", "offset", ",", "int", "size", ")", "{", "index", "-=", "offset", ";", "if", "(", "index", "<", "0", ")", "{", "return", "size", "+", "index", ";", "}", "else", "{", "return...
Subtracts a positive offset to index in a circular buffer. @param index element in circular buffer @param offset integer which is positive and less than size @param size size of the circular buffer @return new index
[ "Subtracts", "a", "positive", "offset", "to", "index", "in", "a", "circular", "buffer", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L47-L54
50,578
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.distanceP
public static int distanceP(int index0, int index1, int size) { int difference = index1-index0; if( difference < 0 ) { difference = size+difference; } return difference; }
java
public static int distanceP(int index0, int index1, int size) { int difference = index1-index0; if( difference < 0 ) { difference = size+difference; } return difference; }
[ "public", "static", "int", "distanceP", "(", "int", "index0", ",", "int", "index1", ",", "int", "size", ")", "{", "int", "difference", "=", "index1", "-", "index0", ";", "if", "(", "difference", "<", "0", ")", "{", "difference", "=", "size", "+", "di...
Returns how many elements away in the positive direction you need to travel to get from index0 to index1. @param index0 element in circular buffer @param index1 element in circular buffer @param size size of the circular buffer @return positive distance
[ "Returns", "how", "many", "elements", "away", "in", "the", "positive", "direction", "you", "need", "to", "travel", "to", "get", "from", "index0", "to", "index1", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L82-L88
50,579
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.subtract
public static int subtract(int index0, int index1, int size) { int distance = distanceP(index0, index1, size); if( distance >= size/2+size%2 ) { return distance-size; } else { return distance; } }
java
public static int subtract(int index0, int index1, int size) { int distance = distanceP(index0, index1, size); if( distance >= size/2+size%2 ) { return distance-size; } else { return distance; } }
[ "public", "static", "int", "subtract", "(", "int", "index0", ",", "int", "index1", ",", "int", "size", ")", "{", "int", "distance", "=", "distanceP", "(", "index0", ",", "index1", ",", "size", ")", ";", "if", "(", "distance", ">=", "size", "/", "2", ...
Subtracts index1 from index0. positive number if its closer in the positive direction or negative if closer in the negative direction. if equal distance then it will return a negative number. @param index0 element in circular buffer @param index1 element in circular buffer @param size size of the circular buffer @ret...
[ "Subtracts", "index1", "from", "index0", ".", "positive", "number", "if", "its", "closer", "in", "the", "positive", "direction", "or", "negative", "if", "closer", "in", "the", "negative", "direction", ".", "if", "equal", "distance", "then", "it", "will", "re...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L122-L129
50,580
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java
StandardAlgConfigPanel.removeChildInsidePanel
protected static void removeChildInsidePanel( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { try { JPanel p = (JPanel)root.getComponent(i); Component[] children = p.getComponents(); for (int j = 0; j < children.length; j++) { if( children...
java
protected static void removeChildInsidePanel( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { try { JPanel p = (JPanel)root.getComponent(i); Component[] children = p.getComponents(); for (int j = 0; j < children.length; j++) { if( children...
[ "protected", "static", "void", "removeChildInsidePanel", "(", "JComponent", "root", ",", "JComponent", "target", ")", "{", "int", "N", "=", "root", ".", "getComponentCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Searches inside the children of "root" for a component that's a JPanel. Then inside the JPanel it looks for the target. If the target is inside the JPanel the JPanel is removed from root.
[ "Searches", "inside", "the", "children", "of", "root", "for", "a", "component", "that", "s", "a", "JPanel", ".", "Then", "inside", "the", "JPanel", "it", "looks", "for", "the", "target", ".", "If", "the", "target", "is", "inside", "the", "JPanel", "the",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java#L263-L278
50,581
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java
StandardAlgConfigPanel.removeChildAndPrevious
protected static void removeChildAndPrevious( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { if( root.getComponent(i) == target ) { root.remove(i); root.remove(i-1); return; } } throw new RuntimeException("Can't find component"); }
java
protected static void removeChildAndPrevious( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { if( root.getComponent(i) == target ) { root.remove(i); root.remove(i-1); return; } } throw new RuntimeException("Can't find component"); }
[ "protected", "static", "void", "removeChildAndPrevious", "(", "JComponent", "root", ",", "JComponent", "target", ")", "{", "int", "N", "=", "root", ".", "getComponentCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Searches inside the children of "root" for 'target'. If found it is removed and the previous component.
[ "Searches", "inside", "the", "children", "of", "root", "for", "target", ".", "If", "found", "it", "is", "removed", "and", "the", "previous", "component", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java#L284-L295
50,582
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java
SegmentMeanShiftSearch.distanceSq
public static float distanceSq( float[] a , float[]b ) { float ret = 0; for( int i = 0; i < a.length; i++ ) { float d = a[i] - b[i]; ret += d*d; } return ret; }
java
public static float distanceSq( float[] a , float[]b ) { float ret = 0; for( int i = 0; i < a.length; i++ ) { float d = a[i] - b[i]; ret += d*d; } return ret; }
[ "public", "static", "float", "distanceSq", "(", "float", "[", "]", "a", ",", "float", "[", "]", "b", ")", "{", "float", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "a", ".", "length", ";", "i", "++", ")", "{", "fl...
Returns the Euclidean distance squared between the two vectors
[ "Returns", "the", "Euclidean", "distance", "squared", "between", "the", "two", "vectors" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java#L173-L180
50,583
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java
SegmentMeanShiftSearch.weight
protected float weight( float distance ) { float findex = distance*100f; int index = (int)findex; if( index >= 99 ) return weightTable[99]; float sample0 = weightTable[index]; float sample1 = weightTable[index+1]; float w = findex-index; return sample0*(1f-w) + sample1*w; }
java
protected float weight( float distance ) { float findex = distance*100f; int index = (int)findex; if( index >= 99 ) return weightTable[99]; float sample0 = weightTable[index]; float sample1 = weightTable[index+1]; float w = findex-index; return sample0*(1f-w) + sample1*w; }
[ "protected", "float", "weight", "(", "float", "distance", ")", "{", "float", "findex", "=", "distance", "*", "100f", ";", "int", "index", "=", "(", "int", ")", "findex", ";", "if", "(", "index", ">=", "99", ")", "return", "weightTable", "[", "99", "]...
Returns the weight given the normalized distance. Instead of computing the kernel distance every time a lookup table with linear interpolation is used. The distance has a domain from 0 to 1, inclusive @param distance Normalized Euclidean distance squared. From 0 to 1. @return Weight.
[ "Returns", "the", "weight", "given", "the", "normalized", "distance", ".", "Instead", "of", "computing", "the", "kernel", "distance", "every", "time", "a", "lookup", "table", "with", "linear", "interpolation", "is", "used", ".", "The", "distance", "has", "a", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java#L189-L201
50,584
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/FeatureToWordHistogram_F64.java
FeatureToWordHistogram_F64.process
@Override public void process() { processed = true; for (int i = 0; i < histogram.length; i++) { histogram[i] /= total; } }
java
@Override public void process() { processed = true; for (int i = 0; i < histogram.length; i++) { histogram[i] /= total; } }
[ "@", "Override", "public", "void", "process", "(", ")", "{", "processed", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "histogram", ".", "length", ";", "i", "++", ")", "{", "histogram", "[", "i", "]", "/=", "total", ";", "...
No more features are being added. Normalized the computed histogram.
[ "No", "more", "features", "are", "being", "added", ".", "Normalized", "the", "computed", "histogram", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/FeatureToWordHistogram_F64.java#L97-L103
50,585
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.transform
public void transform( GrayU8 binary ) { ImageMiscOps.fill(transform, 0); originX = binary.width/2; originY = binary.height/2; r_max = Math.sqrt(originX*originX+originY*originY); for( int y = 0; y < binary.height; y++ ) { int start = binary.startIndex + y*binary.stride; int stop = start + binary.widt...
java
public void transform( GrayU8 binary ) { ImageMiscOps.fill(transform, 0); originX = binary.width/2; originY = binary.height/2; r_max = Math.sqrt(originX*originX+originY*originY); for( int y = 0; y < binary.height; y++ ) { int start = binary.startIndex + y*binary.stride; int stop = start + binary.widt...
[ "public", "void", "transform", "(", "GrayU8", "binary", ")", "{", "ImageMiscOps", ".", "fill", "(", "transform", ",", "0", ")", ";", "originX", "=", "binary", ".", "width", "/", "2", ";", "originY", "=", "binary", ".", "height", "/", "2", ";", "r_max...
Computes the Hough transform of the image. @param binary Binary image that indicates which pixels lie on edges.
[ "Computes", "the", "Hough", "transform", "of", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L114-L132
50,586
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.lineToCoordinate
public void lineToCoordinate(LineParametric2D_F32 line , Point2D_F64 coordinate ) { line = line.copy(); line.p.x -= originX; line.p.y -= originY; LinePolar2D_F32 polar = new LinePolar2D_F32(); UtilLine2D_F32.convert(line,polar); if( polar.angle < 0 ) { polar.distance = -polar.distance; polar.angle = ...
java
public void lineToCoordinate(LineParametric2D_F32 line , Point2D_F64 coordinate ) { line = line.copy(); line.p.x -= originX; line.p.y -= originY; LinePolar2D_F32 polar = new LinePolar2D_F32(); UtilLine2D_F32.convert(line,polar); if( polar.angle < 0 ) { polar.distance = -polar.distance; polar.angle = ...
[ "public", "void", "lineToCoordinate", "(", "LineParametric2D_F32", "line", ",", "Point2D_F64", "coordinate", ")", "{", "line", "=", "line", ".", "copy", "(", ")", ";", "line", ".", "p", ".", "x", "-=", "originX", ";", "line", ".", "p", ".", "y", "-=", ...
Compute the parameterized coordinate for the line
[ "Compute", "the", "parameterized", "coordinate", "for", "the", "line" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L173-L189
50,587
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.parameterize
public void parameterize( int x , int y ) { // put the point in a new coordinate system centered at the image's origin x -= originX; y -= originY; int w2 = transform.width/2; // The line's slope is encoded using the tangent angle. Those bins are along the image's y-axis for( int i = 0; i < transform.hei...
java
public void parameterize( int x , int y ) { // put the point in a new coordinate system centered at the image's origin x -= originX; y -= originY; int w2 = transform.width/2; // The line's slope is encoded using the tangent angle. Those bins are along the image's y-axis for( int i = 0; i < transform.hei...
[ "public", "void", "parameterize", "(", "int", "x", ",", "int", "y", ")", "{", "// put the point in a new coordinate system centered at the image's origin", "x", "-=", "originX", ";", "y", "-=", "originY", ";", "int", "w2", "=", "transform", ".", "width", "/", "2...
Converts the pixel coordinate into a line in parameter space
[ "Converts", "the", "pixel", "coordinate", "into", "a", "line", "in", "parameter", "space" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L194-L212
50,588
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/struct/geo/PairLineNorm.java
PairLineNorm.set
public void set( Vector3D_F64 l1 , Vector3D_F64 l2 ) { this.l1.set(l1); this.l2.set(l2); }
java
public void set( Vector3D_F64 l1 , Vector3D_F64 l2 ) { this.l1.set(l1); this.l2.set(l2); }
[ "public", "void", "set", "(", "Vector3D_F64", "l1", ",", "Vector3D_F64", "l2", ")", "{", "this", ".", "l1", ".", "set", "(", "l1", ")", ";", "this", ".", "l2", ".", "set", "(", "l2", ")", ";", "}" ]
Sets the value of p1 and p2 to be equal to the values of the passed in objects
[ "Sets", "the", "value", "of", "p1", "and", "p2", "to", "be", "equal", "to", "the", "values", "of", "the", "passed", "in", "objects" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/geo/PairLineNorm.java#L87-L90
50,589
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java
ClassifierKNearestNeighborsBow.setClassificationData
public void setClassificationData(List<HistogramScene> memory , int numScenes ) { nn.setPoints(memory, false); scenes = new double[ numScenes ]; }
java
public void setClassificationData(List<HistogramScene> memory , int numScenes ) { nn.setPoints(memory, false); scenes = new double[ numScenes ]; }
[ "public", "void", "setClassificationData", "(", "List", "<", "HistogramScene", ">", "memory", ",", "int", "numScenes", ")", "{", "nn", ".", "setPoints", "(", "memory", ",", "false", ")", ";", "scenes", "=", "new", "double", "[", "numScenes", "]", ";", "}...
Provides a set of labeled word histograms to use to classify a new image @param memory labeled histograms
[ "Provides", "a", "set", "of", "labeled", "word", "histograms", "to", "use", "to", "classify", "a", "new", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java#L98-L103
50,590
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java
ClassifierKNearestNeighborsBow.classify
public int classify(T image) { if( numNeighbors == 0 ) throw new IllegalArgumentException("Must specify number of neighbors!"); // compute all the features inside the image describe.process(image); // find which word the feature matches and construct a frequency histogram featureToHistogram.reset(); Li...
java
public int classify(T image) { if( numNeighbors == 0 ) throw new IllegalArgumentException("Must specify number of neighbors!"); // compute all the features inside the image describe.process(image); // find which word the feature matches and construct a frequency histogram featureToHistogram.reset(); Li...
[ "public", "int", "classify", "(", "T", "image", ")", "{", "if", "(", "numNeighbors", "==", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Must specify number of neighbors!\"", ")", ";", "// compute all the features inside the image", "describe", ".", "p...
Finds the scene which most resembles the provided image @param image Image that's to be classified @return The index of the scene it most resembles
[ "Finds", "the", "scene", "which", "most", "resembles", "the", "provided", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java#L110-L154
50,591
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java
ExamplePyramidDiscrete.unusual
public void unusual() { // Note that the first level does not have to be one pyramid = FactoryPyramid.discreteGaussian(new int[]{2,6},-1,2,true, ImageType.single(imageType)); // Other kernels can also be used besides Gaussian Kernel1D kernel; if(GeneralizedImageOps.isFloatingPoint(imageType) ) { kernel = ...
java
public void unusual() { // Note that the first level does not have to be one pyramid = FactoryPyramid.discreteGaussian(new int[]{2,6},-1,2,true, ImageType.single(imageType)); // Other kernels can also be used besides Gaussian Kernel1D kernel; if(GeneralizedImageOps.isFloatingPoint(imageType) ) { kernel = ...
[ "public", "void", "unusual", "(", ")", "{", "// Note that the first level does not have to be one", "pyramid", "=", "FactoryPyramid", ".", "discreteGaussian", "(", "new", "int", "[", "]", "{", "2", ",", "6", "}", ",", "-", "1", ",", "2", ",", "true", ",", ...
Creates a more unusual pyramid and updater.
[ "Creates", "a", "more", "unusual", "pyramid", "and", "updater", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java#L66-L77
50,592
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java
ExamplePyramidDiscrete.process
public void process( BufferedImage image ) { T input = ConvertBufferedImage.convertFromSingle(image, null, imageType); pyramid.process(input); DiscretePyramidPanel gui = new DiscretePyramidPanel(); gui.setPyramid(pyramid); gui.render(); ShowImages.showWindow(gui,"Image Pyramid"); // To get an image at ...
java
public void process( BufferedImage image ) { T input = ConvertBufferedImage.convertFromSingle(image, null, imageType); pyramid.process(input); DiscretePyramidPanel gui = new DiscretePyramidPanel(); gui.setPyramid(pyramid); gui.render(); ShowImages.showWindow(gui,"Image Pyramid"); // To get an image at ...
[ "public", "void", "process", "(", "BufferedImage", "image", ")", "{", "T", "input", "=", "ConvertBufferedImage", ".", "convertFromSingle", "(", "image", ",", "null", ",", "imageType", ")", ";", "pyramid", ".", "process", "(", "input", ")", ";", "DiscretePyra...
Updates and displays the pyramid.
[ "Updates", "and", "displays", "the", "pyramid", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java#L82-L96
50,593
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createLaplacian
public static <T extends ImageGray<T>> ImageFunctionSparse<T> createLaplacian( Class<T> imageType , ImageBorder<T> border ) { if( border == null ) { border = FactoryImageBorder.single(imageType, BorderType.EXTENDED); } if( GeneralizedImageOps.isFloatingPoint(imageType)) { ImageConvolveSparse<GrayF32, Ker...
java
public static <T extends ImageGray<T>> ImageFunctionSparse<T> createLaplacian( Class<T> imageType , ImageBorder<T> border ) { if( border == null ) { border = FactoryImageBorder.single(imageType, BorderType.EXTENDED); } if( GeneralizedImageOps.isFloatingPoint(imageType)) { ImageConvolveSparse<GrayF32, Ker...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "ImageFunctionSparse", "<", "T", ">", "createLaplacian", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "border", ")", "{", "if", "(", "border", "==...
Creates a sparse Laplacian filter. @see DerivativeLaplacian @param imageType The type of image which is to be processed. @param border How the border should be handled. If null {@link BorderType#EXTENDED} will be used. @return Filter for performing a sparse laplacian.
[ "Creates", "a", "sparse", "Laplacian", "filter", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L58-L78
50,594
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createSobel
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createSobel( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseSobel_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createSobel( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseSobel_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createSobel", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse sobel gradient operator. @see GradientSobel @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient
[ "Creates", "a", "sparse", "sobel", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L89-L99
50,595
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createPrewitt
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createPrewitt( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparsePrewitt_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createPrewitt( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparsePrewitt_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createPrewitt", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse prewitt gradient operator. @see boofcv.alg.filter.derivative.GradientPrewitt @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "prewitt", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L110-L120
50,596
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createThree
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createThree( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseThree_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createThree( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseThree_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createThree", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse three gradient operator. @see boofcv.alg.filter.derivative.GradientThree @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "three", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L131-L141
50,597
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createTwo0
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo0( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo0_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo0( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo0_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createTwo0", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "...
Creates a sparse two-0 gradient operator. @see boofcv.alg.filter.derivative.GradientTwo0 @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "two", "-", "0", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L152-L162
50,598
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createTwo1
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo1( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo1_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo1( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo1_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createTwo1", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "...
Creates a sparse two-1 gradient operator. @see boofcv.alg.filter.derivative.GradientTwo1 @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "two", "-", "1", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L173-L183
50,599
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java
DenseFlowPyramidBase.process
public void process( T image1 , T image2 ) { // declare image data structures if( pyr1 == null || pyr1.getInputWidth() != image1.width || pyr1.getInputHeight() != image1.height ) { pyr1 = UtilDenseOpticalFlow.standardPyramid(image1.width, image1.height, scale, sigma, 5, maxLayers, GrayF32.class); pyr2 = Util...
java
public void process( T image1 , T image2 ) { // declare image data structures if( pyr1 == null || pyr1.getInputWidth() != image1.width || pyr1.getInputHeight() != image1.height ) { pyr1 = UtilDenseOpticalFlow.standardPyramid(image1.width, image1.height, scale, sigma, 5, maxLayers, GrayF32.class); pyr2 = Util...
[ "public", "void", "process", "(", "T", "image1", ",", "T", "image2", ")", "{", "// declare image data structures", "if", "(", "pyr1", "==", "null", "||", "pyr1", ".", "getInputWidth", "(", ")", "!=", "image1", ".", "width", "||", "pyr1", ".", "getInputHeig...
Processes the raw input images. Normalizes them and creates image pyramids from them.
[ "Processes", "the", "raw", "input", "images", ".", "Normalizes", "them", "and", "creates", "image", "pyramids", "from", "them", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java#L67-L90