repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java | ThresholdBlock.applyThreshold | protected void applyThreshold( T input, GrayU8 output ) {
for (int blockY = 0; blockY < stats.height; blockY++) {
for (int blockX = 0; blockX < stats.width; blockX++) {
original.thresholdBlock(blockX,blockY,input,stats,output);
}
}
} | java | protected void applyThreshold( T input, GrayU8 output ) {
for (int blockY = 0; blockY < stats.height; blockY++) {
for (int blockX = 0; blockX < stats.width; blockX++) {
original.thresholdBlock(blockX,blockY,input,stats,output);
}
}
} | [
"protected",
"void",
"applyThreshold",
"(",
"T",
"input",
",",
"GrayU8",
"output",
")",
"{",
"for",
"(",
"int",
"blockY",
"=",
"0",
";",
"blockY",
"<",
"stats",
".",
"height",
";",
"blockY",
"++",
")",
"{",
"for",
"(",
"int",
"blockX",
"=",
"0",
";... | Applies the dynamically computed threshold to each pixel in the image, one block at a time | [
"Applies",
"the",
"dynamically",
"computed",
"threshold",
"to",
"each",
"pixel",
"in",
"the",
"image",
"one",
"block",
"at",
"a",
"time"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L132-L138 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java | PairwiseImageMatching.addImage | public void addImage(T image , String cameraName ) {
PairwiseImageGraph.View view = new PairwiseImageGraph.View(graph.nodes.size(),
new FastQueue<TupleDesc>(TupleDesc.class,true) {
@Override
protected TupleDesc createInstance() {
return detDesc.createDescription();
}
});
view.camera =... | java | public void addImage(T image , String cameraName ) {
PairwiseImageGraph.View view = new PairwiseImageGraph.View(graph.nodes.size(),
new FastQueue<TupleDesc>(TupleDesc.class,true) {
@Override
protected TupleDesc createInstance() {
return detDesc.createDescription();
}
});
view.camera =... | [
"public",
"void",
"addImage",
"(",
"T",
"image",
",",
"String",
"cameraName",
")",
"{",
"PairwiseImageGraph",
".",
"View",
"view",
"=",
"new",
"PairwiseImageGraph",
".",
"View",
"(",
"graph",
".",
"nodes",
".",
"size",
"(",
")",
",",
"new",
"FastQueue",
... | Adds a new observation from a camera. Detects features inside the and saves those.
@param image The image | [
"Adds",
"a",
"new",
"observation",
"from",
"a",
"camera",
".",
"Detects",
"features",
"inside",
"the",
"and",
"saves",
"those",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L118-L162 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java | PairwiseImageMatching.connectViews | protected boolean connectViews(PairwiseImageGraph.View viewA , PairwiseImageGraph.View viewB ,
FastQueue<AssociatedIndex> matches) {
// Estimate fundamental/essential with RANSAC
PairwiseImageGraph.Motion edge = new PairwiseImageGraph.Motion();
int inliersEpipolar;
CameraPinhole pinhole0 = viewA.ca... | java | protected boolean connectViews(PairwiseImageGraph.View viewA , PairwiseImageGraph.View viewB ,
FastQueue<AssociatedIndex> matches) {
// Estimate fundamental/essential with RANSAC
PairwiseImageGraph.Motion edge = new PairwiseImageGraph.Motion();
int inliersEpipolar;
CameraPinhole pinhole0 = viewA.ca... | [
"protected",
"boolean",
"connectViews",
"(",
"PairwiseImageGraph",
".",
"View",
"viewA",
",",
"PairwiseImageGraph",
".",
"View",
"viewB",
",",
"FastQueue",
"<",
"AssociatedIndex",
">",
"matches",
")",
"{",
"// Estimate fundamental/essential with RANSAC",
"PairwiseImageGra... | Associate features between the two views. Then compute a homography and essential matrix using LSMed. Add
features to the edge if they an inlier in essential. Save fit score of homography vs essential. | [
"Associate",
"features",
"between",
"the",
"two",
"views",
".",
"Then",
"compute",
"a",
"homography",
"and",
"essential",
"matrix",
"using",
"LSMed",
".",
"Add",
"features",
"to",
"the",
"edge",
"if",
"they",
"an",
"inlier",
"in",
"essential",
".",
"Save",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L215-L277 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java | PairwiseImageMatching.fitEpipolar | boolean fitEpipolar(FastQueue<AssociatedIndex> matches ,
List<Point2D_F64> pointsA , List<Point2D_F64> pointsB ,
ModelMatcher<?,AssociatedPair> ransac ,
PairwiseImageGraph.Motion edge )
{
pairs.resize(matches.size);
for (int i = 0; i < matches.size; i++) {
AssociatedIndex a = matches.get(i);
... | java | boolean fitEpipolar(FastQueue<AssociatedIndex> matches ,
List<Point2D_F64> pointsA , List<Point2D_F64> pointsB ,
ModelMatcher<?,AssociatedPair> ransac ,
PairwiseImageGraph.Motion edge )
{
pairs.resize(matches.size);
for (int i = 0; i < matches.size; i++) {
AssociatedIndex a = matches.get(i);
... | [
"boolean",
"fitEpipolar",
"(",
"FastQueue",
"<",
"AssociatedIndex",
">",
"matches",
",",
"List",
"<",
"Point2D_F64",
">",
"pointsA",
",",
"List",
"<",
"Point2D_F64",
">",
"pointsB",
",",
"ModelMatcher",
"<",
"?",
",",
"AssociatedPair",
">",
"ransac",
",",
"P... | Uses ransac to fit an epipolar model to the associated features. Adds list of matched features to the edge.
@param matches List of matched features by index
@param pointsA Set of observations from image A
@param pointsB Set of observations from image B
@param ransac Model fitter
@param edge Edge which will contain a d... | [
"Uses",
"ransac",
"to",
"fit",
"an",
"epipolar",
"model",
"to",
"the",
"associated",
"features",
".",
"Adds",
"list",
"of",
"matched",
"features",
"to",
"the",
"edge",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/PairwiseImageMatching.java#L289-L308 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.process | public void process(T gray, GrayU8 binary) {
if( verbose ) System.out.println("ENTER DetectPolygonFromContour.process()");
if( contourPadded != null && !contourPadded.isCreatePaddedCopy() ) {
int padding = 2;
if( gray.width+padding != binary.width || gray.height+padding != binary.height ) {
throw new Il... | java | public void process(T gray, GrayU8 binary) {
if( verbose ) System.out.println("ENTER DetectPolygonFromContour.process()");
if( contourPadded != null && !contourPadded.isCreatePaddedCopy() ) {
int padding = 2;
if( gray.width+padding != binary.width || gray.height+padding != binary.height ) {
throw new Il... | [
"public",
"void",
"process",
"(",
"T",
"gray",
",",
"GrayU8",
"binary",
")",
"{",
"if",
"(",
"verbose",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"ENTER DetectPolygonFromContour.process()\"",
")",
";",
"if",
"(",
"contourPadded",
"!=",
"null",
"&&",... | Examines the undistorted gray scale input image for squares. If p
@param gray Input image | [
"Examines",
"the",
"undistorted",
"gray",
"scale",
"input",
"image",
"for",
"squares",
".",
"If",
"p"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L212-L256 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.determineCornersOnBorder | void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) {
onImageBorder.reset();
for (int i = 0; i < polygon.size(); i++) {
Point2D_F64 p = polygon.get(i);
onImageBorder.add( p.x <= 1 || p.y <= 1 || p.x >= imageWidth-2 || p.y >= imageHeight-2);
}
} | java | void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) {
onImageBorder.reset();
for (int i = 0; i < polygon.size(); i++) {
Point2D_F64 p = polygon.get(i);
onImageBorder.add( p.x <= 1 || p.y <= 1 || p.x >= imageWidth-2 || p.y >= imageHeight-2);
}
} | [
"void",
"determineCornersOnBorder",
"(",
"Polygon2D_F64",
"polygon",
",",
"GrowQueue_B",
"onImageBorder",
")",
"{",
"onImageBorder",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"polygon",
".",
"size",
"(",
")",
";",
"i",... | Check to see if corners are touching the image border
@param polygon Polygon in distorted (original image) pixels
@param onImageBorder storage for corner indexes | [
"Check",
"to",
"see",
"if",
"corners",
"are",
"touching",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L442-L449 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.getContour | public List<Point2D_I32> getContour( Info info ) {
contourTmp.reset();
contourFinder.loadContour(info.contour.externalIndex,contourTmp);
return contourTmp.toList();
} | java | public List<Point2D_I32> getContour( Info info ) {
contourTmp.reset();
contourFinder.loadContour(info.contour.externalIndex,contourTmp);
return contourTmp.toList();
} | [
"public",
"List",
"<",
"Point2D_I32",
">",
"getContour",
"(",
"Info",
"info",
")",
"{",
"contourTmp",
".",
"reset",
"(",
")",
";",
"contourFinder",
".",
"loadContour",
"(",
"info",
".",
"contour",
".",
"externalIndex",
",",
"contourTmp",
")",
";",
"return"... | Returns the undistorted contour for a shape. Data is potentially recycled the next time
any function in this class is invoked.
@param info Which shape
@return List of points in the contour | [
"Returns",
"the",
"undistorted",
"contour",
"for",
"a",
"shape",
".",
"Data",
"is",
"potentially",
"recycled",
"the",
"next",
"time",
"any",
"function",
"in",
"this",
"class",
"is",
"invoked",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L457-L461 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.removeDistortionFromContour | private void removeDistortionFromContour(List<Point2D_I32> distorted , FastQueue<Point2D_I32> undistorted ) {
undistorted.reset();
for (int j = 0; j < distorted.size(); j++) {
// remove distortion
Point2D_I32 p = distorted.get(j);
Point2D_I32 q = undistorted.grow();
distToUndist.compute(p.x,p.y,disto... | java | private void removeDistortionFromContour(List<Point2D_I32> distorted , FastQueue<Point2D_I32> undistorted ) {
undistorted.reset();
for (int j = 0; j < distorted.size(); j++) {
// remove distortion
Point2D_I32 p = distorted.get(j);
Point2D_I32 q = undistorted.grow();
distToUndist.compute(p.x,p.y,disto... | [
"private",
"void",
"removeDistortionFromContour",
"(",
"List",
"<",
"Point2D_I32",
">",
"distorted",
",",
"FastQueue",
"<",
"Point2D_I32",
">",
"undistorted",
")",
"{",
"undistorted",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",... | Removes lens distortion from the found contour | [
"Removes",
"lens",
"distortion",
"from",
"the",
"found",
"contour"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L499-L513 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.touchesBorder | protected final boolean touchesBorder( List<Point2D_I32> contour ) {
int endX = imageWidth-1;
int endY = imageHeight-1;
for (int j = 0; j < contour.size(); j++) {
Point2D_I32 p = contour.get(j);
if( p.x == 0 || p.y == 0 || p.x == endX || p.y == endY )
{
return true;
}
}
return false;
} | java | protected final boolean touchesBorder( List<Point2D_I32> contour ) {
int endX = imageWidth-1;
int endY = imageHeight-1;
for (int j = 0; j < contour.size(); j++) {
Point2D_I32 p = contour.get(j);
if( p.x == 0 || p.y == 0 || p.x == endX || p.y == endY )
{
return true;
}
}
return false;
} | [
"protected",
"final",
"boolean",
"touchesBorder",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
")",
"{",
"int",
"endX",
"=",
"imageWidth",
"-",
"1",
";",
"int",
"endY",
"=",
"imageHeight",
"-",
"1",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j"... | Checks to see if some part of the contour touches the image border. Most likely cropped | [
"Checks",
"to",
"see",
"if",
"some",
"part",
"of",
"the",
"contour",
"touches",
"the",
"image",
"border",
".",
"Most",
"likely",
"cropped"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L518-L531 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizedToPixelError.java | NormalizedToPixelError.set | public void set(double fx, double fy, double skew) {
this.fx = fx;
this.fy = fy;
this.skew = skew;
} | java | public void set(double fx, double fy, double skew) {
this.fx = fx;
this.fy = fy;
this.skew = skew;
} | [
"public",
"void",
"set",
"(",
"double",
"fx",
",",
"double",
"fy",
",",
"double",
"skew",
")",
"{",
"this",
".",
"fx",
"=",
"fx",
";",
"this",
".",
"fy",
"=",
"fy",
";",
"this",
".",
"skew",
"=",
"skew",
";",
"}"
] | Specify camera intrinsic parameters
@param fx focal length x
@param fy focal length y
@param skew camera skew | [
"Specify",
"camera",
"intrinsic",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizedToPixelError.java#L48-L52 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java | ExampleImageStitching.computeTransform | public static<T extends ImageGray<T>, FD extends TupleDesc> Homography2D_F64
computeTransform( T imageA , T imageB ,
DetectDescribePoint<T,FD> detDesc ,
AssociateDescription<FD> associate ,
ModelMatcher<Homography2D_F64,AssociatedPair> modelMatcher )
{
// get the length of the description
Lis... | java | public static<T extends ImageGray<T>, FD extends TupleDesc> Homography2D_F64
computeTransform( T imageA , T imageB ,
DetectDescribePoint<T,FD> detDesc ,
AssociateDescription<FD> associate ,
ModelMatcher<Homography2D_F64,AssociatedPair> modelMatcher )
{
// get the length of the description
Lis... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"FD",
"extends",
"TupleDesc",
">",
"Homography2D_F64",
"computeTransform",
"(",
"T",
"imageA",
",",
"T",
"imageB",
",",
"DetectDescribePoint",
"<",
"T",
",",
"FD",
">",
"detDesc",
",... | Using abstracted code, find a transform which minimizes the difference between corresponding features
in both images. This code is completely model independent and is the core algorithms. | [
"Using",
"abstracted",
"code",
"find",
"a",
"transform",
"which",
"minimizes",
"the",
"difference",
"between",
"corresponding",
"features",
"in",
"both",
"images",
".",
"This",
"code",
"is",
"completely",
"model",
"independent",
"and",
"is",
"the",
"core",
"algo... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java#L82-L122 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java | ExampleImageStitching.stitch | public static <T extends ImageGray<T>>
void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType )
{
T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType);
T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType);
// Detect using the standard SURF feat... | java | public static <T extends ImageGray<T>>
void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType )
{
T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType);
T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType);
// Detect using the standard SURF feat... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"stitch",
"(",
"BufferedImage",
"imageA",
",",
"BufferedImage",
"imageB",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"T",
"inputA",
"=",
"ConvertBufferedImage",
".",... | Given two input images create and display an image where the two have been overlayed on top of each other. | [
"Given",
"two",
"input",
"images",
"create",
"and",
"display",
"an",
"image",
"where",
"the",
"two",
"have",
"been",
"overlayed",
"on",
"top",
"of",
"each",
"other",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java#L144-L163 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java | DisparityToColorPointCloud.configure | public void configure(double baseline,
DMatrixRMaj K, DMatrixRMaj rectifiedR,
Point2Transform2_F64 rectifiedToColor,
int minDisparity, int maxDisparity) {
this.K = K;
ConvertMatrixData.convert(rectifiedR,this.rectifiedR);
this.rectifiedToColor = rectifiedToColor;
this.baseline = (float)b... | java | public void configure(double baseline,
DMatrixRMaj K, DMatrixRMaj rectifiedR,
Point2Transform2_F64 rectifiedToColor,
int minDisparity, int maxDisparity) {
this.K = K;
ConvertMatrixData.convert(rectifiedR,this.rectifiedR);
this.rectifiedToColor = rectifiedToColor;
this.baseline = (float)b... | [
"public",
"void",
"configure",
"(",
"double",
"baseline",
",",
"DMatrixRMaj",
"K",
",",
"DMatrixRMaj",
"rectifiedR",
",",
"Point2Transform2_F64",
"rectifiedToColor",
",",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
")",
"{",
"this",
".",
"K",
"=",
"K",
... | Stereo and intrinsic camera parameters
@param baseline Stereo baseline (world units)
@param K Intrinsic camera calibration matrix of rectified camera
@param rectifiedToColor Transform from rectified pixels to the color image pixels.
@param minDisparity Minimum disparity that's computed (pixels)
@param maxDisparity Maxi... | [
"Stereo",
"and",
"intrinsic",
"camera",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java#L93-L108 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java | DisparityToColorPointCloud.process | public void process(ImageGray disparity , BufferedImage color ) {
cloudRgb.setMaxSize(disparity.width*disparity.height);
cloudXyz.setMaxSize(disparity.width*disparity.height*3);
cloudRgb.reset();
cloudXyz.reset();
if( disparity instanceof GrayU8)
process((GrayU8)disparity,color);
else
process((GrayF3... | java | public void process(ImageGray disparity , BufferedImage color ) {
cloudRgb.setMaxSize(disparity.width*disparity.height);
cloudXyz.setMaxSize(disparity.width*disparity.height*3);
cloudRgb.reset();
cloudXyz.reset();
if( disparity instanceof GrayU8)
process((GrayU8)disparity,color);
else
process((GrayF3... | [
"public",
"void",
"process",
"(",
"ImageGray",
"disparity",
",",
"BufferedImage",
"color",
")",
"{",
"cloudRgb",
".",
"setMaxSize",
"(",
"disparity",
".",
"width",
"*",
"disparity",
".",
"height",
")",
";",
"cloudXyz",
".",
"setMaxSize",
"(",
"disparity",
".... | Given the disparity image compute the 3D location of valid points and save pixel colors
at that point
@param disparity Disparity image
@param color Color image of left camera | [
"Given",
"the",
"disparity",
"image",
"compute",
"the",
"3D",
"location",
"of",
"valid",
"points",
"and",
"save",
"pixel",
"colors",
"at",
"that",
"point"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/DisparityToColorPointCloud.java#L117-L127 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/feature/detect/ImageCorruptPanel.java | ImageCorruptPanel.corruptImage | public <T extends ImageGray<T>> void corruptImage(T original , T corrupted )
{
GGrayImageOps.stretch(original, valueScale, valueOffset, 255.0, corrupted);
GImageMiscOps.addGaussian(corrupted, rand, valueNoise, 0, 255);
GPixelMath.boundImage(corrupted,0,255);
} | java | public <T extends ImageGray<T>> void corruptImage(T original , T corrupted )
{
GGrayImageOps.stretch(original, valueScale, valueOffset, 255.0, corrupted);
GImageMiscOps.addGaussian(corrupted, rand, valueNoise, 0, 255);
GPixelMath.boundImage(corrupted,0,255);
} | [
"public",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"corruptImage",
"(",
"T",
"original",
",",
"T",
"corrupted",
")",
"{",
"GGrayImageOps",
".",
"stretch",
"(",
"original",
",",
"valueScale",
",",
"valueOffset",
",",
"255.0",
",",
"co... | Applies the specified corruption to the image.
@param original Original uncorrupted image.
@param corrupted Corrupted mage. | [
"Applies",
"the",
"specified",
"corruption",
"to",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/detect/ImageCorruptPanel.java#L95-L100 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/AdjustHomographyMatrix.java | AdjustHomographyMatrix.findScaleH | protected boolean findScaleH( DMatrixRMaj H ) {
if( !svd.decompose(H) )
return false;
Arrays.sort(svd.getSingularValues(), 0, 3);
double scale = svd.getSingularValues()[1];
CommonOps_DDRM.divide(H,scale);
return true;
} | java | protected boolean findScaleH( DMatrixRMaj H ) {
if( !svd.decompose(H) )
return false;
Arrays.sort(svd.getSingularValues(), 0, 3);
double scale = svd.getSingularValues()[1];
CommonOps_DDRM.divide(H,scale);
return true;
} | [
"protected",
"boolean",
"findScaleH",
"(",
"DMatrixRMaj",
"H",
")",
"{",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
"H",
")",
")",
"return",
"false",
";",
"Arrays",
".",
"sort",
"(",
"svd",
".",
"getSingularValues",
"(",
")",
",",
"0",
",",
"3",
... | The scale of H is found by computing the second smallest singular value. | [
"The",
"scale",
"of",
"H",
"is",
"found",
"by",
"computing",
"the",
"second",
"smallest",
"singular",
"value",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/AdjustHomographyMatrix.java#L66-L76 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/impl/ImplWaveletTransformNaive.java | ImplWaveletTransformNaive.vertical | public static void vertical(BorderIndex1D border , WlCoef_I32 coefficients ,
GrayI input , GrayI output ) {
UtilWavelet.checkShape(input,output);
final int offsetA = coefficients.offsetScaling;
final int offsetB = coefficients.offsetWavelet;
final int[] alpha = coefficients.scaling;
final int[] beta... | java | public static void vertical(BorderIndex1D border , WlCoef_I32 coefficients ,
GrayI input , GrayI output ) {
UtilWavelet.checkShape(input,output);
final int offsetA = coefficients.offsetScaling;
final int offsetB = coefficients.offsetWavelet;
final int[] alpha = coefficients.scaling;
final int[] beta... | [
"public",
"static",
"void",
"vertical",
"(",
"BorderIndex1D",
"border",
",",
"WlCoef_I32",
"coefficients",
",",
"GrayI",
"input",
",",
"GrayI",
"output",
")",
"{",
"UtilWavelet",
".",
"checkShape",
"(",
"input",
",",
"output",
")",
";",
"final",
"int",
"offs... | Performs a single level wavelet transform along the vertical axis.
@param coefficients Description of wavelet coefficients.
@param input Input image which is being transform. Not modified.
@param output where the output is written to. Modified | [
"Performs",
"a",
"single",
"level",
"wavelet",
"transform",
"along",
"the",
"vertical",
"axis",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/impl/ImplWaveletTransformNaive.java#L341-L382 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/convolve/FactoryConvolve.java | FactoryConvolve.convolve | public static <Input extends ImageBase<Input>, Output extends ImageBase<Output>>
ConvolveInterface<Input,Output>
convolve(Kernel1D kernel, ImageType<Input> inputType, ImageType<Output> outputType , BorderType border , boolean isHorizontal )
{
if( inputType.getFamily() != ImageType.Family.GRAY )
throw new Illega... | java | public static <Input extends ImageBase<Input>, Output extends ImageBase<Output>>
ConvolveInterface<Input,Output>
convolve(Kernel1D kernel, ImageType<Input> inputType, ImageType<Output> outputType , BorderType border , boolean isHorizontal )
{
if( inputType.getFamily() != ImageType.Family.GRAY )
throw new Illega... | [
"public",
"static",
"<",
"Input",
"extends",
"ImageBase",
"<",
"Input",
">",
",",
"Output",
"extends",
"ImageBase",
"<",
"Output",
">",
">",
"ConvolveInterface",
"<",
"Input",
",",
"Output",
">",
"convolve",
"(",
"Kernel1D",
"kernel",
",",
"ImageType",
"<",
... | Creates a filter for convolving 1D kernels along the image.
@param kernel Convolution kernel.
@param inputType Specifies input image type.
@param outputType Specifies input image type.
@param border How the image border is handled.
@return FilterInterface which will perform the specified convolution. | [
"Creates",
"a",
"filter",
"for",
"convolving",
"1D",
"kernels",
"along",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/convolve/FactoryConvolve.java#L53-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps.java | LensDistortionOps.changeCameraModel | public static <T extends ImageBase<T>,O extends CameraPinhole, D extends CameraPinhole>
ImageDistort<T,T> changeCameraModel(AdjustmentType type, BorderType borderType,
O original,
D desired,
D modified,
ImageType<T> imageType)
{
Class bandType = imageType.getImageClass();
b... | java | public static <T extends ImageBase<T>,O extends CameraPinhole, D extends CameraPinhole>
ImageDistort<T,T> changeCameraModel(AdjustmentType type, BorderType borderType,
O original,
D desired,
D modified,
ImageType<T> imageType)
{
Class bandType = imageType.getImageClass();
b... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
",",
"O",
"extends",
"CameraPinhole",
",",
"D",
"extends",
"CameraPinhole",
">",
"ImageDistort",
"<",
"T",
",",
"T",
">",
"changeCameraModel",
"(",
"AdjustmentType",
"type",
",",
"BorderTyp... | Creates a distortion for modifying the input image from one camera model into another camera model. If
requested the camera model can be further modified to ensure certain visibility requirements are meet
and the adjusted camera model will be returned.
@param type How it should modify the image model to ensure visibil... | [
"Creates",
"a",
"distortion",
"for",
"modifying",
"the",
"input",
"image",
"from",
"one",
"camera",
"model",
"into",
"another",
"camera",
"model",
".",
"If",
"requested",
"the",
"camera",
"model",
"can",
"be",
"further",
"modified",
"to",
"ensure",
"certain",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps.java#L53-L77 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java | ImplBinaryNaiveOps.getT | public static boolean getT(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return true;
}
} | java | public static boolean getT(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return true;
}
} | [
"public",
"static",
"boolean",
"getT",
"(",
"GrayU8",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"image",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"{",
"return",
"image",
".",
"get",
"(",
"x",
",",
"y",
")",
"!=",
... | If a point is inside the image true is returned if its value is not zero, otherwise true is returned. | [
"If",
"a",
"point",
"is",
"inside",
"the",
"image",
"true",
"is",
"returned",
"if",
"its",
"value",
"is",
"not",
"zero",
"otherwise",
"true",
"is",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L183-L189 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java | ImplBinaryNaiveOps.getF | public static boolean getF(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return false;
}
} | java | public static boolean getF(GrayU8 image, int x, int y) {
if (image.isInBounds(x, y)) {
return image.get(x, y) != 0;
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"getF",
"(",
"GrayU8",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"image",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"{",
"return",
"image",
".",
"get",
"(",
"x",
",",
"y",
")",
"!=",
... | If a point is inside the image true is returned if its value is not zero, otherwise false is returned. | [
"If",
"a",
"point",
"is",
"inside",
"the",
"image",
"true",
"is",
"returned",
"if",
"its",
"value",
"is",
"not",
"zero",
"otherwise",
"false",
"is",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/impl/ImplBinaryNaiveOps.java#L194-L200 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.convert | public boolean convert( ChessboardCornerGraph cluster , GridInfo info ) {
// default to an invalid value to ensure a failure doesn't go unnoticed.
info.reset();
// Get the edges in a consistent order
if( !orderEdges(cluster) )
return false;
// Now we need to order the nodes into a proper grid which follo... | java | public boolean convert( ChessboardCornerGraph cluster , GridInfo info ) {
// default to an invalid value to ensure a failure doesn't go unnoticed.
info.reset();
// Get the edges in a consistent order
if( !orderEdges(cluster) )
return false;
// Now we need to order the nodes into a proper grid which follo... | [
"public",
"boolean",
"convert",
"(",
"ChessboardCornerGraph",
"cluster",
",",
"GridInfo",
"info",
")",
"{",
"// default to an invalid value to ensure a failure doesn't go unnoticed.",
"info",
".",
"reset",
"(",
")",
";",
"// Get the edges in a consistent order",
"if",
"(",
... | Puts cluster nodes into grid order and computes the number of rows and columns. If the cluster is not
a complete grid this function will fail and return false
@param cluster (Input) cluster. Edge order will be modified.
@param info (Output) Contains ordered nodes and the grid's size.
@return true if successful or fals... | [
"Puts",
"cluster",
"nodes",
"into",
"grid",
"order",
"and",
"computes",
"the",
"number",
"of",
"rows",
"and",
"columns",
".",
"If",
"the",
"cluster",
"is",
"not",
"a",
"complete",
"grid",
"this",
"function",
"will",
"fail",
"and",
"return",
"false"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L79-L103 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.selectCorner | int selectCorner( GridInfo info ) {
info.lookupGridCorners(cornerList);
int bestCorner = -1;
double bestScore = Double.MAX_VALUE;
boolean bestIsCornerSquare = false;
for (int i = 0; i < cornerList.size(); i++) {
Node n = cornerList.get(i);
boolean corner = isCornerValidOrigin(n);
// If there are... | java | int selectCorner( GridInfo info ) {
info.lookupGridCorners(cornerList);
int bestCorner = -1;
double bestScore = Double.MAX_VALUE;
boolean bestIsCornerSquare = false;
for (int i = 0; i < cornerList.size(); i++) {
Node n = cornerList.get(i);
boolean corner = isCornerValidOrigin(n);
// If there are... | [
"int",
"selectCorner",
"(",
"GridInfo",
"info",
")",
"{",
"info",
".",
"lookupGridCorners",
"(",
"cornerList",
")",
";",
"int",
"bestCorner",
"=",
"-",
"1",
";",
"double",
"bestScore",
"=",
"Double",
".",
"MAX_VALUE",
";",
"boolean",
"bestIsCornerSquare",
"=... | Selects a corner to be the grid's origin. 0 = top-left, 1 = top-right, 2 = bottom-right, 3 = bottom-left.
Looks at each grid and see if it can be valid. Out of the valid list | [
"Selects",
"a",
"corner",
"to",
"be",
"the",
"grid",
"s",
"origin",
".",
"0",
"=",
"top",
"-",
"left",
"1",
"=",
"top",
"-",
"right",
"2",
"=",
"bottom",
"-",
"right",
"3",
"=",
"bottom",
"-",
"left",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L110-L151 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.orderNodes | boolean orderNodes( FastQueue<Node> corners , GridInfo info ) {
// Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph
Node seed = null;
for (int i = 0; i < corners.size; i++) {
Node n = corners.get(i);
if( n.countEdges() == 2 ) {
seed = n;
break;
}
... | java | boolean orderNodes( FastQueue<Node> corners , GridInfo info ) {
// Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph
Node seed = null;
for (int i = 0; i < corners.size; i++) {
Node n = corners.get(i);
if( n.countEdges() == 2 ) {
seed = n;
break;
}
... | [
"boolean",
"orderNodes",
"(",
"FastQueue",
"<",
"Node",
">",
"corners",
",",
"GridInfo",
"info",
")",
"{",
"// Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph",
"Node",
"seed",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"="... | Put corners into a proper grid. Make sure its a rectangular grid or else return false. Rows and columns
are selected to ensure right hand rule. | [
"Put",
"corners",
"into",
"a",
"proper",
"grid",
".",
"Make",
"sure",
"its",
"a",
"rectangular",
"grid",
"or",
"else",
"return",
"false",
".",
"Rows",
"and",
"columns",
"are",
"selected",
"to",
"ensure",
"right",
"hand",
"rule",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L182-L236 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.isRightHanded | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI;
} | java | static boolean isRightHanded( Node seed , int idxRow , int idxCol ) {
Node r = seed.edges[idxRow];
Node c = seed.edges[idxCol];
double dirRow = Math.atan2(r.y-seed.y,r.x-seed.x);
double dirCol = Math.atan2(c.y-seed.y,c.x-seed.x);
return UtilAngle.distanceCW(dirRow,dirCol) < Math.PI;
} | [
"static",
"boolean",
"isRightHanded",
"(",
"Node",
"seed",
",",
"int",
"idxRow",
",",
"int",
"idxCol",
")",
"{",
"Node",
"r",
"=",
"seed",
".",
"edges",
"[",
"idxRow",
"]",
";",
"Node",
"c",
"=",
"seed",
".",
"edges",
"[",
"idxCol",
"]",
";",
"doub... | Checks to see if the rows and columns for a coordinate system which is right handed
@param idxRow Index for moving up a row
@param idxCol index for moving up a column | [
"Checks",
"to",
"see",
"if",
"the",
"rows",
"and",
"columns",
"for",
"a",
"coordinate",
"system",
"which",
"is",
"right",
"handed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L244-L252 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.sortEdgesCCW | void sortEdgesCCW(FastQueue<Node> corners) {
for (int nodeIdx = 0; nodeIdx < corners.size; nodeIdx++) {
Node na = corners.get(nodeIdx);
// reference node to do angles relative to.
double ref = Double.NaN;
int count = 0;
for (int i = 0; i < 4; i++) {
order[i] = i;
tmpEdges[i] = na.edges[i];
... | java | void sortEdgesCCW(FastQueue<Node> corners) {
for (int nodeIdx = 0; nodeIdx < corners.size; nodeIdx++) {
Node na = corners.get(nodeIdx);
// reference node to do angles relative to.
double ref = Double.NaN;
int count = 0;
for (int i = 0; i < 4; i++) {
order[i] = i;
tmpEdges[i] = na.edges[i];
... | [
"void",
"sortEdgesCCW",
"(",
"FastQueue",
"<",
"Node",
">",
"corners",
")",
"{",
"for",
"(",
"int",
"nodeIdx",
"=",
"0",
";",
"nodeIdx",
"<",
"corners",
".",
"size",
";",
"nodeIdx",
"++",
")",
"{",
"Node",
"na",
"=",
"corners",
".",
"get",
"(",
"no... | Sorts edges so that they point towards nodes in an increasing counter clockwise direction | [
"Sorts",
"edges",
"so",
"that",
"they",
"point",
"towards",
"nodes",
"in",
"an",
"increasing",
"counter",
"clockwise",
"direction"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L320-L379 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java | ChessboardCornerClusterToGrid.rotateCCW | public void rotateCCW(GridInfo grid ) {
cornerList.clear();
for (int col = 0; col < grid.cols; col++) {
for (int row = 0; row < grid.rows; row++) {
cornerList.add(grid.get(row,grid.cols - col - 1));
}
}
int tmp = grid.rows;
grid.rows = grid.cols;
grid.cols = tmp;
grid.nodes.clear();
grid.node... | java | public void rotateCCW(GridInfo grid ) {
cornerList.clear();
for (int col = 0; col < grid.cols; col++) {
for (int row = 0; row < grid.rows; row++) {
cornerList.add(grid.get(row,grid.cols - col - 1));
}
}
int tmp = grid.rows;
grid.rows = grid.cols;
grid.cols = tmp;
grid.nodes.clear();
grid.node... | [
"public",
"void",
"rotateCCW",
"(",
"GridInfo",
"grid",
")",
"{",
"cornerList",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"col",
"=",
"0",
";",
"col",
"<",
"grid",
".",
"cols",
";",
"col",
"++",
")",
"{",
"for",
"(",
"int",
"row",
"=",
"0... | Rotates the grid in the CCW direction | [
"Rotates",
"the",
"grid",
"in",
"the",
"CCW",
"direction"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/ChessboardCornerClusterToGrid.java#L384-L397 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java | StereoProcessingBase.setCalibration | public void setCalibration(StereoParameters stereoParam) {
CameraPinholeBrown left = stereoParam.getLeft();
CameraPinholeBrown right = stereoParam.getRight();
// adjust image size
imageLeftRect.reshape(left.getWidth(), left.getHeight());
imageRightRect.reshape(right.getWidth(), right.getHeight());
// comp... | java | public void setCalibration(StereoParameters stereoParam) {
CameraPinholeBrown left = stereoParam.getLeft();
CameraPinholeBrown right = stereoParam.getRight();
// adjust image size
imageLeftRect.reshape(left.getWidth(), left.getHeight());
imageRightRect.reshape(right.getWidth(), right.getHeight());
// comp... | [
"public",
"void",
"setCalibration",
"(",
"StereoParameters",
"stereoParam",
")",
"{",
"CameraPinholeBrown",
"left",
"=",
"stereoParam",
".",
"getLeft",
"(",
")",
";",
"CameraPinholeBrown",
"right",
"=",
"stereoParam",
".",
"getRight",
"(",
")",
";",
"// adjust ima... | Specifies stereo parameters
@param stereoParam stereo parameters | [
"Specifies",
"stereo",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java#L95-L136 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java | StereoProcessingBase.computeHomo3D | public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) {
// Coordinate in rectified camera frame
pointRect.z = baseline*fx;
pointRect.x = pointRect.z*(x - cx)/fx;
pointRect.y = pointRect.z*(y - cy)/fy;
// rotate into the original left camera frame
GeometryMath_F64.multTran(rectR,pointRect,poi... | java | public void computeHomo3D(double x, double y, Point3D_F64 pointLeft) {
// Coordinate in rectified camera frame
pointRect.z = baseline*fx;
pointRect.x = pointRect.z*(x - cx)/fx;
pointRect.y = pointRect.z*(y - cy)/fy;
// rotate into the original left camera frame
GeometryMath_F64.multTran(rectR,pointRect,poi... | [
"public",
"void",
"computeHomo3D",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Point3D_F64",
"pointLeft",
")",
"{",
"// Coordinate in rectified camera frame",
"pointRect",
".",
"z",
"=",
"baseline",
"*",
"fx",
";",
"pointRect",
".",
"x",
"=",
"pointRect",
".... | Given a coordinate of a point in the left rectified frame, compute the point's 3D
coordinate in the camera's reference frame in homogeneous coordinates. To convert the coordinate
into normal 3D, divide each element by the disparity.
@param x x-coordinate of pixel in rectified left image
@param y y-coordinate of pixel ... | [
"Given",
"a",
"coordinate",
"of",
"a",
"point",
"in",
"the",
"left",
"rectified",
"frame",
"compute",
"the",
"point",
"s",
"3D",
"coordinate",
"in",
"the",
"camera",
"s",
"reference",
"frame",
"in",
"homogeneous",
"coordinates",
".",
"To",
"convert",
"the",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoProcessingBase.java#L147-L155 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/GIntegralImageOps.java | GIntegralImageOps.getIntegralType | public static <I extends ImageGray<I>, II extends ImageGray<II>>
Class<II> getIntegralType( Class<I> inputType ) {
if( inputType == GrayF32.class ) {
return (Class<II>)GrayF32.class;
} else if( inputType == GrayU8.class ){
return (Class<II>)GrayS32.class;
} else if( inputType == GrayS32.class ){
return ... | java | public static <I extends ImageGray<I>, II extends ImageGray<II>>
Class<II> getIntegralType( Class<I> inputType ) {
if( inputType == GrayF32.class ) {
return (Class<II>)GrayF32.class;
} else if( inputType == GrayU8.class ){
return (Class<II>)GrayS32.class;
} else if( inputType == GrayS32.class ){
return ... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"Class",
"<",
"II",
">",
"getIntegralType",
"(",
"Class",
"<",
"I",
">",
"inputType",
")",
"{",
"if",
"(",
"inputType",
"==",... | Given the input image, return the type of image the integral image should be. | [
"Given",
"the",
"input",
"image",
"return",
"the",
"type",
"of",
"image",
"the",
"integral",
"image",
"should",
"be",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/GIntegralImageOps.java#L35-L46 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java | FiducialDetectorPnP.computeStability | @Override
public boolean computeStability(int which, double disturbance, FiducialStability results) {
if( !getFiducialToCamera(which, targetToCamera))
return false;
stability.setShape(getSideWidth(which), getSideHeight(which));
stability.computeStability(targetToCamera,disturbance,results);
return true;
... | java | @Override
public boolean computeStability(int which, double disturbance, FiducialStability results) {
if( !getFiducialToCamera(which, targetToCamera))
return false;
stability.setShape(getSideWidth(which), getSideHeight(which));
stability.computeStability(targetToCamera,disturbance,results);
return true;
... | [
"@",
"Override",
"public",
"boolean",
"computeStability",
"(",
"int",
"which",
",",
"double",
"disturbance",
",",
"FiducialStability",
"results",
")",
"{",
"if",
"(",
"!",
"getFiducialToCamera",
"(",
"which",
",",
"targetToCamera",
")",
")",
"return",
"false",
... | Estimates the stability by perturbing each land mark by the specified number of pixels in the distorted image. | [
"Estimates",
"the",
"stability",
"by",
"perturbing",
"each",
"land",
"mark",
"by",
"the",
"specified",
"number",
"of",
"pixels",
"in",
"the",
"distorted",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L98-L108 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java | FiducialDetectorPnP.createDetectedList | private void createDetectedList(int which, List<PointIndex2D_F64> pixels) {
detected2D3D.clear();
List<Point2D3D> all = getControl3D(which);
for (int i = 0; i < pixels.size(); i++) {
PointIndex2D_F64 a = pixels.get(i);
Point2D3D b = all.get(i);
pixelToNorm.compute(a.x,a.y, b.observation);
detected2D3... | java | private void createDetectedList(int which, List<PointIndex2D_F64> pixels) {
detected2D3D.clear();
List<Point2D3D> all = getControl3D(which);
for (int i = 0; i < pixels.size(); i++) {
PointIndex2D_F64 a = pixels.get(i);
Point2D3D b = all.get(i);
pixelToNorm.compute(a.x,a.y, b.observation);
detected2D3... | [
"private",
"void",
"createDetectedList",
"(",
"int",
"which",
",",
"List",
"<",
"PointIndex2D_F64",
">",
"pixels",
")",
"{",
"detected2D3D",
".",
"clear",
"(",
")",
";",
"List",
"<",
"Point2D3D",
">",
"all",
"=",
"getControl3D",
"(",
"which",
")",
";",
"... | Create the list of observed points in 2D3D | [
"Create",
"the",
"list",
"of",
"observed",
"points",
"in",
"2D3D"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L148-L158 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java | FiducialDetectorPnP.estimatePose | protected boolean estimatePose( int which ,List<Point2D3D> points , Se3_F64 fiducialToCamera ) {
if( !estimatePnP.process(points, initialEstimate) ) {
return false;
}
filtered.clear();
// Don't bother if there are hardly any points to work with
if( points.size() > 6 ) {
w2p.configure(lensDistortion, ini... | java | protected boolean estimatePose( int which ,List<Point2D3D> points , Se3_F64 fiducialToCamera ) {
if( !estimatePnP.process(points, initialEstimate) ) {
return false;
}
filtered.clear();
// Don't bother if there are hardly any points to work with
if( points.size() > 6 ) {
w2p.configure(lensDistortion, ini... | [
"protected",
"boolean",
"estimatePose",
"(",
"int",
"which",
",",
"List",
"<",
"Point2D3D",
">",
"points",
",",
"Se3_F64",
"fiducialToCamera",
")",
"{",
"if",
"(",
"!",
"estimatePnP",
".",
"process",
"(",
"points",
",",
"initialEstimate",
")",
")",
"{",
"r... | Given the mapping of 2D observations to known 3D points estimate the pose of the fiducial.
This solves the P-n-P problem.
Do a simple form of robust estimation. Prune points which are greater than 3 standard deviations
and likely noise the recompute the pose | [
"Given",
"the",
"mapping",
"of",
"2D",
"observations",
"to",
"known",
"3D",
"points",
"estimate",
"the",
"pose",
"of",
"the",
"fiducial",
".",
"This",
"solves",
"the",
"P",
"-",
"n",
"-",
"P",
"problem",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FiducialDetectorPnP.java#L167-L210 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java | HoughTransformLineFootOfNorm.transform | public <D extends ImageGray<D>> void transform(D derivX , D derivY , GrayU8 binary )
{
InputSanityCheck.checkSameShape(derivX,derivY,binary);
transform.reshape(derivX.width,derivY.height);
ImageMiscOps.fill(transform,0);
originX = derivX.width/2;
originY = derivX.height/2;
candidates.reset();
if( deri... | java | public <D extends ImageGray<D>> void transform(D derivX , D derivY , GrayU8 binary )
{
InputSanityCheck.checkSameShape(derivX,derivY,binary);
transform.reshape(derivX.width,derivY.height);
ImageMiscOps.fill(transform,0);
originX = derivX.width/2;
originY = derivX.height/2;
candidates.reset();
if( deri... | [
"public",
"<",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"transform",
"(",
"D",
"derivX",
",",
"D",
"derivY",
",",
"GrayU8",
"binary",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"derivX",
",",
"derivY",
",",
"binary",
")",
... | Computes the Hough transform using the image gradient and a binary image which flags pixels as being edges or not.
@param derivX Image derivative along x-axis.
@param derivY Image derivative along y-axis.
@param binary Non-zero pixels are considered to be line pixels. | [
"Computes",
"the",
"Hough",
"transform",
"using",
"the",
"image",
"gradient",
"and",
"a",
"binary",
"image",
"which",
"flags",
"pixels",
"as",
"being",
"edges",
"or",
"not",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java#L92-L111 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java | HoughTransformLineFootOfNorm.parameterize | public void parameterize( int x , int y , float derivX , float derivY )
{
// put the point in a new coordinate system centered at the image's origin
// this minimizes error, which is a function of distance from origin
x -= originX;
y -= originY;
float v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY... | java | public void parameterize( int x , int y , float derivX , float derivY )
{
// put the point in a new coordinate system centered at the image's origin
// this minimizes error, which is a function of distance from origin
x -= originX;
y -= originY;
float v = (x*derivX + y*derivY)/(derivX*derivX + derivY*derivY... | [
"public",
"void",
"parameterize",
"(",
"int",
"x",
",",
"int",
"y",
",",
"float",
"derivX",
",",
"float",
"derivY",
")",
"{",
"// put the point in a new coordinate system centered at the image's origin",
"// this minimizes error, which is a function of distance from origin",
"x... | Takes the detected point along the line and its gradient and converts it into transform space.
@param x point in image.
@param y point in image.
@param derivX gradient of point.
@param derivY gradient of point. | [
"Takes",
"the",
"detected",
"point",
"along",
"the",
"line",
"and",
"its",
"gradient",
"and",
"converts",
"it",
"into",
"transform",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLineFootOfNorm.java#L150-L170 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleDenseImageFeatures.java | ExampleDenseImageFeatures.HighLevel | public static void HighLevel( GrayF32 input) {
System.out.println("\n------------------- Dense High Level");
DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense.
hog(new ConfigDenseHoG(),input.getImageType());
// sift(new ConfigDenseSift(),GrayF32.class);
// surfFast(new Config... | java | public static void HighLevel( GrayF32 input) {
System.out.println("\n------------------- Dense High Level");
DescribeImageDense<GrayF32,TupleDesc_F64> describer = FactoryDescribeImageDense.
hog(new ConfigDenseHoG(),input.getImageType());
// sift(new ConfigDenseSift(),GrayF32.class);
// surfFast(new Config... | [
"public",
"static",
"void",
"HighLevel",
"(",
"GrayF32",
"input",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\n------------------- Dense High Level\"",
")",
";",
"DescribeImageDense",
"<",
"GrayF32",
",",
"TupleDesc_F64",
">",
"describer",
"=",
"Fact... | For much larger images you might need to shrink the image down or change the cell size to get good results. | [
"For",
"much",
"larger",
"images",
"you",
"might",
"need",
"to",
"shrink",
"the",
"image",
"down",
"or",
"change",
"the",
"cell",
"size",
"to",
"get",
"good",
"results",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDenseImageFeatures.java#L52-L72 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java | StereoDisparityWtoNaiveFive.process | public void process( I left , I right , GrayF32 imageDisparity ) {
// check inputs and initialize data structures
InputSanityCheck.checkSameShape(left,right,imageDisparity);
this.imageLeft = left;
this.imageRight = right;
w = left.width; h = left.height;
// Compute disparity for each pixel
for( int y = ... | java | public void process( I left , I right , GrayF32 imageDisparity ) {
// check inputs and initialize data structures
InputSanityCheck.checkSameShape(left,right,imageDisparity);
this.imageLeft = left;
this.imageRight = right;
w = left.width; h = left.height;
// Compute disparity for each pixel
for( int y = ... | [
"public",
"void",
"process",
"(",
"I",
"left",
",",
"I",
"right",
",",
"GrayF32",
"imageDisparity",
")",
"{",
"// check inputs and initialize data structures",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"left",
",",
"right",
",",
"imageDisparity",
")",
";",
"... | Computes the disparity for two stereo images along the image's right axis. Both
image must be rectified.
@param left Left camera image.
@param right Right camera image. | [
"Computes",
"the",
"disparity",
"for",
"two",
"stereo",
"images",
"along",
"the",
"image",
"s",
"right",
"axis",
".",
"Both",
"image",
"must",
"be",
"rectified",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L75-L96 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java | StereoDisparityWtoNaiveFive.processPixel | private void processPixel( int c_x , int c_y , int maxDisparity ) {
for( int i = minDisparity; i < maxDisparity; i++ ) {
score[i] = computeScore( c_x , c_x-i,c_y);
}
} | java | private void processPixel( int c_x , int c_y , int maxDisparity ) {
for( int i = minDisparity; i < maxDisparity; i++ ) {
score[i] = computeScore( c_x , c_x-i,c_y);
}
} | [
"private",
"void",
"processPixel",
"(",
"int",
"c_x",
",",
"int",
"c_y",
",",
"int",
"maxDisparity",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"minDisparity",
";",
"i",
"<",
"maxDisparity",
";",
"i",
"++",
")",
"{",
"score",
"[",
"i",
"]",
"=",
"compu... | Computes fit score for each possible disparity
@param c_x Center of region on left image. x-axis
@param c_y Center of region on left image. y-axis
@param maxDisparity Max allowed disparity | [
"Computes",
"fit",
"score",
"for",
"each",
"possible",
"disparity"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L105-L110 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java | StereoDisparityWtoNaiveFive.selectBest | protected double selectBest( int length ) {
double best = Double.MAX_VALUE;
int index = -1;
for( int i = minDisparity; i < length; i++ ) {
if( score[i] < best ) {
best = score[i];
index = i;
}
}
return index-minDisparity;
} | java | protected double selectBest( int length ) {
double best = Double.MAX_VALUE;
int index = -1;
for( int i = minDisparity; i < length; i++ ) {
if( score[i] < best ) {
best = score[i];
index = i;
}
}
return index-minDisparity;
} | [
"protected",
"double",
"selectBest",
"(",
"int",
"length",
")",
"{",
"double",
"best",
"=",
"Double",
".",
"MAX_VALUE",
";",
"int",
"index",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"minDisparity",
";",
"i",
"<",
"length",
";",
"i",
"++",
"... | Select best disparity using the inner takes all approach
@param length The max allowed disparity at this pixel
@return The best disparity selected. | [
"Select",
"best",
"disparity",
"using",
"the",
"inner",
"takes",
"all",
"approach"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L118-L129 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java | StereoDisparityWtoNaiveFive.computeScore | protected double computeScore( int leftX , int rightX , int centerY ) {
double center = computeScoreRect(leftX,rightX,centerY);
four[0] = computeScoreRect(leftX-radiusX,rightX-radiusX,centerY-radiusY);
four[1] = computeScoreRect(leftX+radiusX,rightX+radiusX,centerY-radiusY);
four[2] = computeScoreRect(leftX... | java | protected double computeScore( int leftX , int rightX , int centerY ) {
double center = computeScoreRect(leftX,rightX,centerY);
four[0] = computeScoreRect(leftX-radiusX,rightX-radiusX,centerY-radiusY);
four[1] = computeScoreRect(leftX+radiusX,rightX+radiusX,centerY-radiusY);
four[2] = computeScoreRect(leftX... | [
"protected",
"double",
"computeScore",
"(",
"int",
"leftX",
",",
"int",
"rightX",
",",
"int",
"centerY",
")",
"{",
"double",
"center",
"=",
"computeScoreRect",
"(",
"leftX",
",",
"rightX",
",",
"centerY",
")",
";",
"four",
"[",
"0",
"]",
"=",
"computeSco... | Compute the score for five local regions and just use the center + the two best
@param leftX X-axis center left image
@param rightX X-axis center left image
@param centerY Y-axis center for both images
@return Fit score for both regions. | [
"Compute",
"the",
"score",
"for",
"five",
"local",
"regions",
"and",
"just",
"use",
"the",
"center",
"+",
"the",
"two",
"best"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L139-L150 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java | QrCodeGenerator.render | public void render( QrCode qr ) {
initialize(qr);
render.init();
positionPattern(0,0, qr.ppCorner);
positionPattern((numModules-7)*moduleWidth,0, qr.ppRight);
positionPattern(0,(numModules-7)*moduleWidth, qr.ppDown);
timingPattern(7*moduleWidth,6*moduleWidth,moduleWidth,0);
timingPattern(6*moduleWidth,7... | java | public void render( QrCode qr ) {
initialize(qr);
render.init();
positionPattern(0,0, qr.ppCorner);
positionPattern((numModules-7)*moduleWidth,0, qr.ppRight);
positionPattern(0,(numModules-7)*moduleWidth, qr.ppDown);
timingPattern(7*moduleWidth,6*moduleWidth,moduleWidth,0);
timingPattern(6*moduleWidth,7... | [
"public",
"void",
"render",
"(",
"QrCode",
"qr",
")",
"{",
"initialize",
"(",
"qr",
")",
";",
"render",
".",
"init",
"(",
")",
";",
"positionPattern",
"(",
"0",
",",
"0",
",",
"qr",
".",
"ppCorner",
")",
";",
"positionPattern",
"(",
"(",
"numModules"... | Generates a QR Code with the specified message. An exception is thrown if the message is
too long to be encoded. | [
"Generates",
"a",
"QR",
"Code",
"with",
"the",
"specified",
"message",
".",
"An",
"exception",
"is",
"thrown",
"if",
"the",
"message",
"is",
"too",
"long",
"to",
"be",
"encoded",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java#L67-L122 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java | QrCodeGenerator.renderData | private void renderData() {
QrCodeMaskPattern mask = qr.mask;
int count = 0;
int length = bitLocations.size() - bitLocations.size()%8;
while( count < length ) {
int bits = qr.rawbits[count/8]&0xFF;
int N = Math.min(8,bitLocations.size()-count);
for (int i = 0; i < N; i++) {
Point2D_I32 coor = bi... | java | private void renderData() {
QrCodeMaskPattern mask = qr.mask;
int count = 0;
int length = bitLocations.size() - bitLocations.size()%8;
while( count < length ) {
int bits = qr.rawbits[count/8]&0xFF;
int N = Math.min(8,bitLocations.size()-count);
for (int i = 0; i < N; i++) {
Point2D_I32 coor = bi... | [
"private",
"void",
"renderData",
"(",
")",
"{",
"QrCodeMaskPattern",
"mask",
"=",
"qr",
".",
"mask",
";",
"int",
"count",
"=",
"0",
";",
"int",
"length",
"=",
"bitLocations",
".",
"size",
"(",
")",
"-",
"bitLocations",
".",
"size",
"(",
")",
"%",
"8"... | Renders the raw data bit output while applying the selected mask | [
"Renders",
"the",
"raw",
"data",
"bit",
"output",
"while",
"applying",
"the",
"selected",
"mask"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeGenerator.java#L134-L155 | train |
lessthanoptimal/BoofCV | integration/boofcv-javacv/src/main/java/boofcv/javacv/UtilOpenCV.java | UtilOpenCV.loadPinholeRadial | public static CameraPinholeBrown loadPinholeRadial(String fileName ) {
FileStorage fs = new FileStorage(
new File(fileName).getAbsolutePath(), FileStorage.READ);
IntPointer width = new IntPointer(1);
IntPointer height = new IntPointer(1);
read(fs.get("image_width"),width,-1);
read(fs.get("image_height")... | java | public static CameraPinholeBrown loadPinholeRadial(String fileName ) {
FileStorage fs = new FileStorage(
new File(fileName).getAbsolutePath(), FileStorage.READ);
IntPointer width = new IntPointer(1);
IntPointer height = new IntPointer(1);
read(fs.get("image_width"),width,-1);
read(fs.get("image_height")... | [
"public",
"static",
"CameraPinholeBrown",
"loadPinholeRadial",
"(",
"String",
"fileName",
")",
"{",
"FileStorage",
"fs",
"=",
"new",
"FileStorage",
"(",
"new",
"File",
"(",
"fileName",
")",
".",
"getAbsolutePath",
"(",
")",
",",
"FileStorage",
".",
"READ",
")"... | Loads a pinhole camera model with radian and tangential distortion in OpenCV format
@param fileName path to file
@return CameraPinholeRadial | [
"Loads",
"a",
"pinhole",
"camera",
"model",
"with",
"radian",
"and",
"tangential",
"distortion",
"in",
"OpenCV",
"format"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-javacv/src/main/java/boofcv/javacv/UtilOpenCV.java#L44-L79 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java | SquareNode.distanceSqCorner | public double distanceSqCorner( Point2D_F64 p ) {
double best = Double.MAX_VALUE;
for (int i = 0; i < 4; i++) {
double d = square.get(i).distance2(p);
if( d < best ) {
best = d;
}
}
return best;
} | java | public double distanceSqCorner( Point2D_F64 p ) {
double best = Double.MAX_VALUE;
for (int i = 0; i < 4; i++) {
double d = square.get(i).distance2(p);
if( d < best ) {
best = d;
}
}
return best;
} | [
"public",
"double",
"distanceSqCorner",
"(",
"Point2D_F64",
"p",
")",
"{",
"double",
"best",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"double",
"d",
"=",
"square",
".",
... | Finds the Euclidean distance squared of the closest corner to point p | [
"Finds",
"the",
"Euclidean",
"distance",
"squared",
"of",
"the",
"closest",
"corner",
"to",
"point",
"p"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L59-L68 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java | SquareNode.reset | public void reset() {
square = null;
touch = null;
center.set(-1,-1);
largestSide = 0;
smallestSide = Double.MAX_VALUE;
graph = RESET_GRAPH;
for (int i = 0; i < edges.length; i++) {
if ( edges[i] != null )
throw new RuntimeException("BUG!");
sideLengths[i] = 0;
}
} | java | public void reset() {
square = null;
touch = null;
center.set(-1,-1);
largestSide = 0;
smallestSide = Double.MAX_VALUE;
graph = RESET_GRAPH;
for (int i = 0; i < edges.length; i++) {
if ( edges[i] != null )
throw new RuntimeException("BUG!");
sideLengths[i] = 0;
}
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"square",
"=",
"null",
";",
"touch",
"=",
"null",
";",
"center",
".",
"set",
"(",
"-",
"1",
",",
"-",
"1",
")",
";",
"largestSide",
"=",
"0",
";",
"smallestSide",
"=",
"Double",
".",
"MAX_VALUE",
";",
"gr... | Discards previous information | [
"Discards",
"previous",
"information"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L73-L85 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java | SquareNode.updateArrayLength | public void updateArrayLength() {
if( edges.length != square.size() ) {
edges = new SquareEdge[square.size()];
sideLengths = new double[square.size()];
}
} | java | public void updateArrayLength() {
if( edges.length != square.size() ) {
edges = new SquareEdge[square.size()];
sideLengths = new double[square.size()];
}
} | [
"public",
"void",
"updateArrayLength",
"(",
")",
"{",
"if",
"(",
"edges",
".",
"length",
"!=",
"square",
".",
"size",
"(",
")",
")",
"{",
"edges",
"=",
"new",
"SquareEdge",
"[",
"square",
".",
"size",
"(",
")",
"]",
";",
"sideLengths",
"=",
"new",
... | touch the border? | [
"touch",
"the",
"border?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L91-L96 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java | SquareNode.getNumberOfConnections | public int getNumberOfConnections() {
int ret = 0;
for (int i = 0; i < square.size(); i++) {
if( edges[i] != null )
ret++;
}
return ret;
} | java | public int getNumberOfConnections() {
int ret = 0;
for (int i = 0; i < square.size(); i++) {
if( edges[i] != null )
ret++;
}
return ret;
} | [
"public",
"int",
"getNumberOfConnections",
"(",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"square",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"edges",
"[",
"i",
"]",
"!=",
"null"... | Computes the number of edges attached to this node | [
"Computes",
"the",
"number",
"of",
"edges",
"attached",
"to",
"this",
"node"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareNode.java#L101-L108 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java | FactoryInterpolation.createPixelS | public static <T extends ImageGray<T>> InterpolatePixelS<T>
createPixelS(double min, double max, InterpolationType type, BorderType borderType, Class<T> imageType)
{
InterpolatePixelS<T> alg;
switch( type ) {
case NEAREST_NEIGHBOR:
alg = nearestNeighborPixelS(imageType);
break;
case BILINEAR:
... | java | public static <T extends ImageGray<T>> InterpolatePixelS<T>
createPixelS(double min, double max, InterpolationType type, BorderType borderType, Class<T> imageType)
{
InterpolatePixelS<T> alg;
switch( type ) {
case NEAREST_NEIGHBOR:
alg = nearestNeighborPixelS(imageType);
break;
case BILINEAR:
... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"InterpolatePixelS",
"<",
"T",
">",
"createPixelS",
"(",
"double",
"min",
",",
"double",
"max",
",",
"InterpolationType",
"type",
",",
"BorderType",
"borderType",
",",
"Class",
"<",
... | Creates an interpolation class of the specified type for the specified image type.
@param min Minimum possible pixel value. Inclusive.
@param max Maximum possible pixel value. Inclusive.
@param type Interpolation type
@param borderType Border type. If null then it will not be set here.
@param imageType Type of input... | [
"Creates",
"an",
"interpolation",
"class",
"of",
"the",
"specified",
"type",
"for",
"the",
"specified",
"image",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java#L80-L108 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java | FactoryInterpolation.createPixelMB | public static <T extends ImageBase<T>> InterpolatePixelMB<T>
createPixelMB(double min, double max, InterpolationType type, BorderType borderType, ImageType<T> imageType )
{
switch (imageType.getFamily()) {
case PLANAR:
return (InterpolatePixelMB<T>) createPixelPL((InterpolatePixelS)createPixelS(min, max, ty... | java | public static <T extends ImageBase<T>> InterpolatePixelMB<T>
createPixelMB(double min, double max, InterpolationType type, BorderType borderType, ImageType<T> imageType )
{
switch (imageType.getFamily()) {
case PLANAR:
return (InterpolatePixelMB<T>) createPixelPL((InterpolatePixelS)createPixelS(min, max, ty... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"InterpolatePixelMB",
"<",
"T",
">",
"createPixelMB",
"(",
"double",
"min",
",",
"double",
"max",
",",
"InterpolationType",
"type",
",",
"BorderType",
"borderType",
",",
"ImageType",
"... | Pixel based interpolation on multi-band image
@param min Minimum possible pixel value. Inclusive.
@param max Maximum possible pixel value. Inclusive.
@param type Interpolation type
@param imageType Type of input image | [
"Pixel",
"based",
"interpolation",
"on",
"multi",
"-",
"band",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/interpolate/FactoryInterpolation.java#L118-L146 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYV12.java | ConvertYV12.yu12ToBoof | public static void yu12ToBoof(byte[] data, int width, int height, ImageBase output) {
if( output instanceof Planar) {
Planar ms = (Planar) output;
ms.reshape(width,height,3);
if( BoofConcurrency.USE_CONCURRENT ) {
if (ms.getBandType() == GrayU8.class) {
... | java | public static void yu12ToBoof(byte[] data, int width, int height, ImageBase output) {
if( output instanceof Planar) {
Planar ms = (Planar) output;
ms.reshape(width,height,3);
if( BoofConcurrency.USE_CONCURRENT ) {
if (ms.getBandType() == GrayU8.class) {
... | [
"public",
"static",
"void",
"yu12ToBoof",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"ImageBase",
"output",
")",
"{",
"if",
"(",
"output",
"instanceof",
"Planar",
")",
"{",
"Planar",
"ms",
"=",
"(",
"Planar",
")",
... | Converts a YU12 encoded byte array into a BoofCV formatted image.
@param data (input) YU12 byte array
@param width (input) image width
@param height (input) image height
@param output (output) BoofCV image | [
"Converts",
"a",
"YU12",
"encoded",
"byte",
"array",
"into",
"a",
"BoofCV",
"formatted",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYV12.java#L45-L99 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYV12.java | ConvertYV12.yu12ToGray | public static GrayU8 yu12ToGray(byte[] data , int width , int height , GrayU8 output ) {
if( output != null ) {
if( output.width != width || output.height != height )
throw new IllegalArgumentException("output width and height must be "+width+" "+height);
} else {
... | java | public static GrayU8 yu12ToGray(byte[] data , int width , int height , GrayU8 output ) {
if( output != null ) {
if( output.width != width || output.height != height )
throw new IllegalArgumentException("output width and height must be "+width+" "+height);
} else {
... | [
"public",
"static",
"GrayU8",
"yu12ToGray",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"GrayU8",
"output",
")",
"{",
"if",
"(",
"output",
"!=",
"null",
")",
"{",
"if",
"(",
"output",
".",
"width",
"!=",
"width",
... | Converts an YV12 image into a gray scale U8 image.
@param data Input: YV12 image data
@param width Input: image width
@param height Input: image height
@param output Output: Optional storage for output image. Can be null.
@return Gray scale image | [
"Converts",
"an",
"YV12",
"image",
"into",
"a",
"gray",
"scale",
"U8",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYV12.java#L110-L125 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java | FactoryAssociation.scoreEuclidean | public static <D>
ScoreAssociation<D> scoreEuclidean( Class<D> tupleType , boolean squared ) {
if( TupleDesc_F64.class.isAssignableFrom(tupleType) ) {
if( squared )
return (ScoreAssociation)new ScoreAssociateEuclideanSq_F64();
else
return (ScoreAssociation)new ScoreAssociateEuclidean_F64();
} else if... | java | public static <D>
ScoreAssociation<D> scoreEuclidean( Class<D> tupleType , boolean squared ) {
if( TupleDesc_F64.class.isAssignableFrom(tupleType) ) {
if( squared )
return (ScoreAssociation)new ScoreAssociateEuclideanSq_F64();
else
return (ScoreAssociation)new ScoreAssociateEuclidean_F64();
} else if... | [
"public",
"static",
"<",
"D",
">",
"ScoreAssociation",
"<",
"D",
">",
"scoreEuclidean",
"(",
"Class",
"<",
"D",
">",
"tupleType",
",",
"boolean",
"squared",
")",
"{",
"if",
"(",
"TupleDesc_F64",
".",
"class",
".",
"isAssignableFrom",
"(",
"tupleType",
")",... | Scores features based on the Euclidean distance between them. The square is often used instead
of the Euclidean distance since it is much faster to compute.
@param tupleType Type of descriptor being scored
@param squared IF true the distance squared is returned. Usually true
@return Euclidean distance measure | [
"Scores",
"features",
"based",
"on",
"the",
"Euclidean",
"distance",
"between",
"them",
".",
"The",
"square",
"is",
"often",
"used",
"instead",
"of",
"the",
"Euclidean",
"distance",
"since",
"it",
"is",
"much",
"faster",
"to",
"compute",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java#L196-L209 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java | FactoryAssociation.scoreHamming | public static <D>
ScoreAssociation<D> scoreHamming( Class<D> tupleType ) {
if( tupleType == TupleDesc_B.class ) {
return (ScoreAssociation)new ScoreAssociateHamming_B();
}
throw new IllegalArgumentException("Hamming distance not yet supported for type "+tupleType.getSimpleName());
} | java | public static <D>
ScoreAssociation<D> scoreHamming( Class<D> tupleType ) {
if( tupleType == TupleDesc_B.class ) {
return (ScoreAssociation)new ScoreAssociateHamming_B();
}
throw new IllegalArgumentException("Hamming distance not yet supported for type "+tupleType.getSimpleName());
} | [
"public",
"static",
"<",
"D",
">",
"ScoreAssociation",
"<",
"D",
">",
"scoreHamming",
"(",
"Class",
"<",
"D",
">",
"tupleType",
")",
"{",
"if",
"(",
"tupleType",
"==",
"TupleDesc_B",
".",
"class",
")",
"{",
"return",
"(",
"ScoreAssociation",
")",
"new",
... | Hamming distance between two binary descriptors.
@param tupleType Type of descriptor being scored
@return Hamming distance measure | [
"Hamming",
"distance",
"between",
"two",
"binary",
"descriptors",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/associate/FactoryAssociation.java#L217-L224 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/extract/ThresholdCornerExtractor.java | ThresholdCornerExtractor.process | public void process(GrayF32 intensity, QueueCorner corners ) {
corners.reset();
float data[] = intensity.data;
for( int y = 0; y < intensity.height; y++ ) {
int startIndex = intensity.startIndex + y*intensity.stride;
int endIndex = startIndex + intensity.width;
for( int index = startIndex; index < end... | java | public void process(GrayF32 intensity, QueueCorner corners ) {
corners.reset();
float data[] = intensity.data;
for( int y = 0; y < intensity.height; y++ ) {
int startIndex = intensity.startIndex + y*intensity.stride;
int endIndex = startIndex + intensity.width;
for( int index = startIndex; index < end... | [
"public",
"void",
"process",
"(",
"GrayF32",
"intensity",
",",
"QueueCorner",
"corners",
")",
"{",
"corners",
".",
"reset",
"(",
")",
";",
"float",
"data",
"[",
"]",
"=",
"intensity",
".",
"data",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<... | Selects pixels as corners which are above the threshold. | [
"Selects",
"pixels",
"as",
"corners",
"which",
"are",
"above",
"the",
"threshold",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/extract/ThresholdCornerExtractor.java#L44-L60 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java | AssociateSurfBasic.swapLists | public void swapLists() {
FastQueue<Helper> tmp = srcPositive;
srcPositive = dstPositive;
dstPositive = tmp;
tmp = srcNegative;
srcNegative = dstNegative;
dstNegative = tmp;
} | java | public void swapLists() {
FastQueue<Helper> tmp = srcPositive;
srcPositive = dstPositive;
dstPositive = tmp;
tmp = srcNegative;
srcNegative = dstNegative;
dstNegative = tmp;
} | [
"public",
"void",
"swapLists",
"(",
")",
"{",
"FastQueue",
"<",
"Helper",
">",
"tmp",
"=",
"srcPositive",
";",
"srcPositive",
"=",
"dstPositive",
";",
"dstPositive",
"=",
"tmp",
";",
"tmp",
"=",
"srcNegative",
";",
"srcNegative",
"=",
"dstNegative",
";",
"... | Swaps the source and dest feature list. Useful when processing a sequence
of images and don't want to resort everything. | [
"Swaps",
"the",
"source",
"and",
"dest",
"feature",
"list",
".",
"Useful",
"when",
"processing",
"a",
"sequence",
"of",
"images",
"and",
"don",
"t",
"want",
"to",
"resort",
"everything",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java#L70-L78 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java | AssociateSurfBasic.associate | public void associate()
{
// initialize data structures
matches.reset();
unassociatedSrc.reset();
if( srcPositive.size == 0 && srcNegative.size == 0 )
return;
if( dstPositive.size == 0 && dstNegative.size == 0 )
return;
// find and add the matches
assoc.setSource((FastQueue)srcPositive);
assoc.... | java | public void associate()
{
// initialize data structures
matches.reset();
unassociatedSrc.reset();
if( srcPositive.size == 0 && srcNegative.size == 0 )
return;
if( dstPositive.size == 0 && dstNegative.size == 0 )
return;
// find and add the matches
assoc.setSource((FastQueue)srcPositive);
assoc.... | [
"public",
"void",
"associate",
"(",
")",
"{",
"// initialize data structures",
"matches",
".",
"reset",
"(",
")",
";",
"unassociatedSrc",
".",
"reset",
"(",
")",
";",
"if",
"(",
"srcPositive",
".",
"size",
"==",
"0",
"&&",
"srcNegative",
".",
"size",
"==",... | Associates the features together. | [
"Associates",
"the",
"features",
"together",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java#L83-L123 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java | AssociateSurfBasic.sort | private void sort(FastQueue<BrightFeature> input ,
FastQueue<Helper> pos , FastQueue<Helper> neg ) {
pos.reset();
neg.reset();
for( int i = 0; i < input.size; i++ ) {
BrightFeature f = input.get(i);
if( f.white) {
pos.grow().wrap(f,i);
} else {
neg.grow().wrap(f,i);
}
}
} | java | private void sort(FastQueue<BrightFeature> input ,
FastQueue<Helper> pos , FastQueue<Helper> neg ) {
pos.reset();
neg.reset();
for( int i = 0; i < input.size; i++ ) {
BrightFeature f = input.get(i);
if( f.white) {
pos.grow().wrap(f,i);
} else {
neg.grow().wrap(f,i);
}
}
} | [
"private",
"void",
"sort",
"(",
"FastQueue",
"<",
"BrightFeature",
">",
"input",
",",
"FastQueue",
"<",
"Helper",
">",
"pos",
",",
"FastQueue",
"<",
"Helper",
">",
"neg",
")",
"{",
"pos",
".",
"reset",
"(",
")",
";",
"neg",
".",
"reset",
"(",
")",
... | Splits the set of input features into positive and negative laplacian lists.
Keep track of the feature's index in the original input list. This is
the index that needs to be returned. | [
"Splits",
"the",
"set",
"of",
"input",
"features",
"into",
"positive",
"and",
"negative",
"laplacian",
"lists",
".",
"Keep",
"track",
"of",
"the",
"feature",
"s",
"index",
"in",
"the",
"original",
"input",
"list",
".",
"This",
"is",
"the",
"index",
"that",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateSurfBasic.java#L137-L150 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivative.java | FactoryDerivative.gradientReduce | public static <I extends ImageMultiBand<I>, M extends ImageMultiBand<M>, D extends ImageGray<D>>
ImageGradient<I,D> gradientReduce( ImageGradient<I,M> gradient ,
DerivativeReduceType type,
Class<D> outputType )
{
String name;
switch( type ) {
case MAX_F: name = "maxf"; break;
defau... | java | public static <I extends ImageMultiBand<I>, M extends ImageMultiBand<M>, D extends ImageGray<D>>
ImageGradient<I,D> gradientReduce( ImageGradient<I,M> gradient ,
DerivativeReduceType type,
Class<D> outputType )
{
String name;
switch( type ) {
case MAX_F: name = "maxf"; break;
defau... | [
"public",
"static",
"<",
"I",
"extends",
"ImageMultiBand",
"<",
"I",
">",
",",
"M",
"extends",
"ImageMultiBand",
"<",
"M",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"ImageGradient",
"<",
"I",
",",
"D",
">",
"gradientReduce",
"(",
"Imag... | Computes the image gradient inside a multi-band image then reduces the output to a single
band before returning the results
@param gradient Computes the multi-band image gradient
@param type Specifies which method is to be used to reduce the output into single band image
@param outputType Type of output image
@param <... | [
"Computes",
"the",
"image",
"gradient",
"inside",
"a",
"multi",
"-",
"band",
"image",
"then",
"reduces",
"the",
"output",
"to",
"a",
"single",
"band",
"before",
"returning",
"the",
"results"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivative.java#L52-L85 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivative.java | FactoryDerivative.gradientSB | public static <I extends ImageGray<I>, D extends ImageGray<D>>
ImageGradient<I,D> gradientSB( DerivativeType type , Class<I> inputType , Class<D> derivType )
{
if( derivType == null )
derivType = GImageDerivativeOps.getDerivativeType(inputType);
Class which;
switch( type ) {
case PREWITT:
which = Gr... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
ImageGradient<I,D> gradientSB( DerivativeType type , Class<I> inputType , Class<D> derivType )
{
if( derivType == null )
derivType = GImageDerivativeOps.getDerivativeType(inputType);
Class which;
switch( type ) {
case PREWITT:
which = Gr... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"ImageGradient",
"<",
"I",
",",
"D",
">",
"gradientSB",
"(",
"DerivativeType",
"type",
",",
"Class",
"<",
"I",
">",
"inputType",
... | Returns the gradient for single band images of the specified type
@param type Type of gradient
@param inputType Type of input image
@param derivType Type of gradient image. null for default
@param <I> Input image
@param <D> Derivative image
@return gradient filter | [
"Returns",
"the",
"gradient",
"for",
"single",
"band",
"images",
"of",
"the",
"specified",
"type"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivative.java#L96-L131 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java | DetectFiducialSquareImage.addPattern | public int addPattern(GrayU8 inputBinary, double lengthSide) {
if( inputBinary == null ) {
throw new IllegalArgumentException("Input image is null.");
} else if( lengthSide <= 0 ) {
throw new IllegalArgumentException("Parameter lengthSide must be more than zero");
} else if(ImageStatistics.max(inputBinary) ... | java | public int addPattern(GrayU8 inputBinary, double lengthSide) {
if( inputBinary == null ) {
throw new IllegalArgumentException("Input image is null.");
} else if( lengthSide <= 0 ) {
throw new IllegalArgumentException("Parameter lengthSide must be more than zero");
} else if(ImageStatistics.max(inputBinary) ... | [
"public",
"int",
"addPattern",
"(",
"GrayU8",
"inputBinary",
",",
"double",
"lengthSide",
")",
"{",
"if",
"(",
"inputBinary",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Input image is null.\"",
")",
";",
"}",
"else",
"if",
"(",... | Adds a new image to the detector. Image must be gray-scale and is converted into
a binary image using the specified threshold. All input images are rescaled to be
square and of the appropriate size. Thus the original shape of the image doesn't
matter. Square shapes are highly recommended since that's what the targe... | [
"Adds",
"a",
"new",
"image",
"to",
"the",
"detector",
".",
"Image",
"must",
"be",
"gray",
"-",
"scale",
"and",
"is",
"converted",
"into",
"a",
"binary",
"image",
"using",
"the",
"specified",
"threshold",
".",
"All",
"input",
"images",
"are",
"rescaled",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java#L114-L158 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java | DetectFiducialSquareImage.binaryToDef | protected static void binaryToDef(GrayU8 binary , short[] desc ) {
for (int i = 0; i < binary.data.length; i+=16) {
int value = 0;
for (int j = 0; j < 16; j++) {
value |= binary.data[i+j] << j;
}
desc[i/16] = (short)value;
}
} | java | protected static void binaryToDef(GrayU8 binary , short[] desc ) {
for (int i = 0; i < binary.data.length; i+=16) {
int value = 0;
for (int j = 0; j < 16; j++) {
value |= binary.data[i+j] << j;
}
desc[i/16] = (short)value;
}
} | [
"protected",
"static",
"void",
"binaryToDef",
"(",
"GrayU8",
"binary",
",",
"short",
"[",
"]",
"desc",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"binary",
".",
"data",
".",
"length",
";",
"i",
"+=",
"16",
")",
"{",
"int",
"value"... | Converts a binary image into the compressed bit format | [
"Converts",
"a",
"binary",
"image",
"into",
"the",
"compressed",
"bit",
"format"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java#L163-L171 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java | DetectFiducialSquareImage.hamming | protected int hamming(short[] a, short[] b) {
int distance = 0;
for (int i = 0; i < a.length; i++) {
distance += DescriptorDistance.hamming((a[i]&0xFFFF) ^ (b[i]&0xFFFF));
}
return distance;
} | java | protected int hamming(short[] a, short[] b) {
int distance = 0;
for (int i = 0; i < a.length; i++) {
distance += DescriptorDistance.hamming((a[i]&0xFFFF) ^ (b[i]&0xFFFF));
}
return distance;
} | [
"protected",
"int",
"hamming",
"(",
"short",
"[",
"]",
"a",
",",
"short",
"[",
"]",
"b",
")",
"{",
"int",
"distance",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"length",
";",
"i",
"++",
")",
"{",
"distance",
... | Computes the hamming score between two descriptions. Larger the number better the fit | [
"Computes",
"the",
"hamming",
"score",
"between",
"two",
"descriptions",
".",
"Larger",
"the",
"number",
"better",
"the",
"fit"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java#L211-L217 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/descriptor/UtilFeature.java | UtilFeature.combine | public static TupleDesc_F64 combine( List<TupleDesc_F64> inputs , TupleDesc_F64 combined ) {
int N = 0;
for (int i = 0; i < inputs.size(); i++) {
N += inputs.get(i).size();
}
if( combined == null ) {
combined = new TupleDesc_F64(N);
} else {
if (N != combined.size())
throw new RuntimeException("T... | java | public static TupleDesc_F64 combine( List<TupleDesc_F64> inputs , TupleDesc_F64 combined ) {
int N = 0;
for (int i = 0; i < inputs.size(); i++) {
N += inputs.get(i).size();
}
if( combined == null ) {
combined = new TupleDesc_F64(N);
} else {
if (N != combined.size())
throw new RuntimeException("T... | [
"public",
"static",
"TupleDesc_F64",
"combine",
"(",
"List",
"<",
"TupleDesc_F64",
">",
"inputs",
",",
"TupleDesc_F64",
"combined",
")",
"{",
"int",
"N",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"inputs",
".",
"size",
"(",
")",... | Concats the list of tuples together into one big feature. The combined feature must be large
enough to store all the inputs.
@param inputs List of tuples.
@param combined Storage for combined output. If null a new instance will be declared.
@return Resulting combined. | [
"Concats",
"the",
"list",
"of",
"tuples",
"together",
"into",
"one",
"big",
"feature",
".",
"The",
"combined",
"feature",
"must",
"be",
"large",
"enough",
"to",
"store",
"all",
"the",
"inputs",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/descriptor/UtilFeature.java#L67-L87 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java | VideoDisplayActivity.setProcessing | public void setProcessing( VideoProcessing processing ) {
if( this.processing != null ) {
// kill the old process
this.processing.stopProcessing();
}
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Not called from a GUI thread. Bad stuff could happen");
... | java | public void setProcessing( VideoProcessing processing ) {
if( this.processing != null ) {
// kill the old process
this.processing.stopProcessing();
}
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Not called from a GUI thread. Bad stuff could happen");
... | [
"public",
"void",
"setProcessing",
"(",
"VideoProcessing",
"processing",
")",
"{",
"if",
"(",
"this",
".",
"processing",
"!=",
"null",
")",
"{",
"// kill the old process",
"this",
".",
"processing",
".",
"stopProcessing",
"(",
")",
";",
"}",
"if",
"(",
"Loop... | Changes the CV algorithm running. Should only be called from a GUI thread. | [
"Changes",
"the",
"CV",
"algorithm",
"running",
".",
"Should",
"only",
"be",
"called",
"from",
"a",
"GUI",
"thread",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java#L88-L103 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java | VideoDisplayActivity.setUpAndConfigureCamera | private void setUpAndConfigureCamera() {
// Open and configure the camera
mCamera = openConfigureCamera(mCameraInfo);
setCameraDisplayOrientation(mCameraInfo,mCamera);
// Create an instance of Camera
mPreview.setCamera(mCamera);
if( processing != null ) {
processing.init(mDraw,mCamera,mCameraInfo,previ... | java | private void setUpAndConfigureCamera() {
// Open and configure the camera
mCamera = openConfigureCamera(mCameraInfo);
setCameraDisplayOrientation(mCameraInfo,mCamera);
// Create an instance of Camera
mPreview.setCamera(mCamera);
if( processing != null ) {
processing.init(mDraw,mCamera,mCameraInfo,previ... | [
"private",
"void",
"setUpAndConfigureCamera",
"(",
")",
"{",
"// Open and configure the camera",
"mCamera",
"=",
"openConfigureCamera",
"(",
"mCameraInfo",
")",
";",
"setCameraDisplayOrientation",
"(",
"mCameraInfo",
",",
"mCamera",
")",
";",
"// Create an instance of Camer... | Sets up the camera if it is not already setup. | [
"Sets",
"up",
"the",
"camera",
"if",
"it",
"is",
"not",
"already",
"setup",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java#L179-L190 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java | VideoDisplayActivity.setProgressMessage | protected void setProgressMessage(final String message) {
runOnUiThread(new Runnable() {
public void run() {
synchronized ( lockProgress ) {
if( progressDialog != null ) {
// a dialog is already open, change the message
progressDialog.setMessage(message);
return;
}
progressDial... | java | protected void setProgressMessage(final String message) {
runOnUiThread(new Runnable() {
public void run() {
synchronized ( lockProgress ) {
if( progressDialog != null ) {
// a dialog is already open, change the message
progressDialog.setMessage(message);
return;
}
progressDial... | [
"protected",
"void",
"setProgressMessage",
"(",
"final",
"String",
"message",
")",
"{",
"runOnUiThread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"synchronized",
"(",
"lockProgress",
")",
"{",
"if",
"(",
"progressDialog"... | Displays an indeterminate progress dialog. If the dialog is already open this will change the message being
displayed. Function blocks until the dialog has been declared.
@param message Text shown in dialog | [
"Displays",
"an",
"indeterminate",
"progress",
"dialog",
".",
"If",
"the",
"dialog",
"is",
"already",
"open",
"this",
"will",
"change",
"the",
"message",
"being",
"displayed",
".",
"Function",
"blocks",
"until",
"the",
"dialog",
"has",
"been",
"declared",
"."
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java#L294-L325 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java | VideoDisplayActivity.hideProgressDialog | protected void hideProgressDialog() {
// do nothing if the dialog is already being displayed
synchronized ( lockProgress ) {
if( progressDialog == null )
return;
}
if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
// if inside the UI thread just dismiss the dialog and avoid a potent... | java | protected void hideProgressDialog() {
// do nothing if the dialog is already being displayed
synchronized ( lockProgress ) {
if( progressDialog == null )
return;
}
if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
// if inside the UI thread just dismiss the dialog and avoid a potent... | [
"protected",
"void",
"hideProgressDialog",
"(",
")",
"{",
"// do nothing if the dialog is already being displayed",
"synchronized",
"(",
"lockProgress",
")",
"{",
"if",
"(",
"progressDialog",
"==",
"null",
")",
"return",
";",
"}",
"if",
"(",
"Looper",
".",
"getMainL... | Dismisses the progress dialog. Can be called even if there is no progressDialog being shown. | [
"Dismisses",
"the",
"progress",
"dialog",
".",
"Can",
"be",
"called",
"even",
"if",
"there",
"is",
"no",
"progressDialog",
"being",
"shown",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoDisplayActivity.java#L330-L357 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/struct/calib/CameraUniversalOmni.java | CameraUniversalOmni.set | public void set( CameraUniversalOmni original ) {
super.set(original);
this.mirrorOffset = original.mirrorOffset;
if( radial.length != original.radial.length )
radial = new double[ original.radial.length ];
System.arraycopy(original.radial,0,radial,0,radial.length);
this.t1 = original.t1;
this.t2 = or... | java | public void set( CameraUniversalOmni original ) {
super.set(original);
this.mirrorOffset = original.mirrorOffset;
if( radial.length != original.radial.length )
radial = new double[ original.radial.length ];
System.arraycopy(original.radial,0,radial,0,radial.length);
this.t1 = original.t1;
this.t2 = or... | [
"public",
"void",
"set",
"(",
"CameraUniversalOmni",
"original",
")",
"{",
"super",
".",
"set",
"(",
"original",
")",
";",
"this",
".",
"mirrorOffset",
"=",
"original",
".",
"mirrorOffset",
";",
"if",
"(",
"radial",
".",
"length",
"!=",
"original",
".",
... | Assigns this model to be identical to the passed in model
@param original Model which is to be copied | [
"Assigns",
"this",
"model",
"to",
"be",
"identical",
"to",
"the",
"passed",
"in",
"model"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/calib/CameraUniversalOmni.java#L110-L121 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java | HornSchunck.process | public void process( T image1 , T image2 , ImageFlow output) {
InputSanityCheck.checkSameShape(image1,image2);
derivX.reshape(image1.width,image1.height);
derivY.reshape(image1.width,image1.height);
derivT.reshape(image1.width,image1.height);
averageFlow.reshape(output.width,output.height);
if( resetOut... | java | public void process( T image1 , T image2 , ImageFlow output) {
InputSanityCheck.checkSameShape(image1,image2);
derivX.reshape(image1.width,image1.height);
derivY.reshape(image1.width,image1.height);
derivT.reshape(image1.width,image1.height);
averageFlow.reshape(output.width,output.height);
if( resetOut... | [
"public",
"void",
"process",
"(",
"T",
"image1",
",",
"T",
"image2",
",",
"ImageFlow",
"output",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"image1",
",",
"image2",
")",
";",
"derivX",
".",
"reshape",
"(",
"image1",
".",
"width",
",",
"ima... | Computes dense optical flow from the first image's gradient and the difference between
the second and the first image.
@param image1 First image
@param image2 Second image
@param output Found dense optical flow | [
"Computes",
"dense",
"optical",
"flow",
"from",
"the",
"first",
"image",
"s",
"gradient",
"and",
"the",
"difference",
"between",
"the",
"second",
"and",
"the",
"first",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java#L92-L110 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java | HornSchunck.innerAverageFlow | protected static void innerAverageFlow( ImageFlow flow , ImageFlow averageFlow ) {
int endX = flow.width-1;
int endY = flow.height-1;
for( int y = 1; y < endY; y++ ) {
int index = flow.width*y + 1;
for( int x = 1; x < endX; x++ , index++) {
ImageFlow.D average = averageFlow.data[index];
ImageFlow... | java | protected static void innerAverageFlow( ImageFlow flow , ImageFlow averageFlow ) {
int endX = flow.width-1;
int endY = flow.height-1;
for( int y = 1; y < endY; y++ ) {
int index = flow.width*y + 1;
for( int x = 1; x < endX; x++ , index++) {
ImageFlow.D average = averageFlow.data[index];
ImageFlow... | [
"protected",
"static",
"void",
"innerAverageFlow",
"(",
"ImageFlow",
"flow",
",",
"ImageFlow",
"averageFlow",
")",
"{",
"int",
"endX",
"=",
"flow",
".",
"width",
"-",
"1",
";",
"int",
"endY",
"=",
"flow",
".",
"height",
"-",
"1",
";",
"for",
"(",
"int"... | Computes average flow using an 8-connect neighborhood for the inner image | [
"Computes",
"average",
"flow",
"using",
"an",
"8",
"-",
"connect",
"neighborhood",
"for",
"the",
"inner",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java#L125-L149 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java | HornSchunck.borderAverageFlow | protected static void borderAverageFlow( ImageFlow flow , ImageFlow averageFlow) {
for( int y = 0; y < flow.height; y++ ) {
computeBorder(flow,averageFlow, 0, y);
computeBorder(flow,averageFlow, flow.width-1, y);
}
for( int x = 1; x < flow.width-1; x++ ) {
computeBorder(flow,averageFlow, x, 0);
comp... | java | protected static void borderAverageFlow( ImageFlow flow , ImageFlow averageFlow) {
for( int y = 0; y < flow.height; y++ ) {
computeBorder(flow,averageFlow, 0, y);
computeBorder(flow,averageFlow, flow.width-1, y);
}
for( int x = 1; x < flow.width-1; x++ ) {
computeBorder(flow,averageFlow, x, 0);
comp... | [
"protected",
"static",
"void",
"borderAverageFlow",
"(",
"ImageFlow",
"flow",
",",
"ImageFlow",
"averageFlow",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"flow",
".",
"height",
";",
"y",
"++",
")",
"{",
"computeBorder",
"(",
"flow",
","... | Computes average flow using an 8-connect neighborhood for the image border | [
"Computes",
"average",
"flow",
"using",
"an",
"8",
"-",
"connect",
"neighborhood",
"for",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java#L154-L165 | train |
lessthanoptimal/BoofCV | main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java | SimulatePlanarWorld.computeProjectionTable | void computeProjectionTable( int width , int height ) {
output.reshape(width,height);
depthMap.reshape(width,height);
ImageMiscOps.fill(depthMap,-1);
pointing = new float[width*height*3];
for (int y = 0; y < output.height; y++) {
for (int x = 0; x < output.width; x++) {
// Should this add 0.5 so tha... | java | void computeProjectionTable( int width , int height ) {
output.reshape(width,height);
depthMap.reshape(width,height);
ImageMiscOps.fill(depthMap,-1);
pointing = new float[width*height*3];
for (int y = 0; y < output.height; y++) {
for (int x = 0; x < output.width; x++) {
// Should this add 0.5 so tha... | [
"void",
"computeProjectionTable",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"output",
".",
"reshape",
"(",
"width",
",",
"height",
")",
";",
"depthMap",
".",
"reshape",
"(",
"width",
",",
"height",
")",
";",
"ImageMiscOps",
".",
"fill",
"(",
... | Computes 3D pointing vector for every pixel in the simulated camera frame
@param width width of simulated camera
@param height height of simulated camera | [
"Computes",
"3D",
"pointing",
"vector",
"for",
"every",
"pixel",
"in",
"the",
"simulated",
"camera",
"frame"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java#L120-L142 | train |
lessthanoptimal/BoofCV | main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java | SimulatePlanarWorld.render | public GrayF32 render()
{
ImageMiscOps.fill(output,background);
ImageMiscOps.fill(depthMap,Float.MAX_VALUE);
for (int i = 0; i < scene.size(); i++) {
SurfaceRect r = scene.get(i);
r.rectInCamera();
}
if( BoofConcurrency.USE_CONCURRENT ) {
renderMultiThread();
} else {
renderSingleThread();
... | java | public GrayF32 render()
{
ImageMiscOps.fill(output,background);
ImageMiscOps.fill(depthMap,Float.MAX_VALUE);
for (int i = 0; i < scene.size(); i++) {
SurfaceRect r = scene.get(i);
r.rectInCamera();
}
if( BoofConcurrency.USE_CONCURRENT ) {
renderMultiThread();
} else {
renderSingleThread();
... | [
"public",
"GrayF32",
"render",
"(",
")",
"{",
"ImageMiscOps",
".",
"fill",
"(",
"output",
",",
"background",
")",
";",
"ImageMiscOps",
".",
"fill",
"(",
"depthMap",
",",
"Float",
".",
"MAX_VALUE",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | Render the scene and returns the rendered image.
@see #getOutput()
@return rendered image | [
"Render",
"the",
"scene",
"and",
"returns",
"the",
"rendered",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java#L177-L194 | train |
lessthanoptimal/BoofCV | main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java | SimulatePlanarWorld.computePixel | public void computePixel(int which, double x, double y, Point2D_F64 output) {
SurfaceRect r = scene.get(which);
Point3D_F64 p3 = new Point3D_F64(-x,-y,0);
SePointOps_F64.transform(r.rectToCamera, p3, p3);
// unit sphere
p3.scale(1.0/p3.norm());
sphereToPixel.compute(p3.x,p3.y,p3.z,output);
} | java | public void computePixel(int which, double x, double y, Point2D_F64 output) {
SurfaceRect r = scene.get(which);
Point3D_F64 p3 = new Point3D_F64(-x,-y,0);
SePointOps_F64.transform(r.rectToCamera, p3, p3);
// unit sphere
p3.scale(1.0/p3.norm());
sphereToPixel.compute(p3.x,p3.y,p3.z,output);
} | [
"public",
"void",
"computePixel",
"(",
"int",
"which",
",",
"double",
"x",
",",
"double",
"y",
",",
"Point2D_F64",
"output",
")",
"{",
"SurfaceRect",
"r",
"=",
"scene",
".",
"get",
"(",
"which",
")",
";",
"Point3D_F64",
"p3",
"=",
"new",
"Point3D_F64",
... | Project a point which lies on the 2D planar polygon's surface onto the rendered image | [
"Project",
"a",
"point",
"which",
"lies",
"on",
"the",
"2D",
"planar",
"polygon",
"s",
"surface",
"onto",
"the",
"rendered",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java#L307-L317 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/DepthSparse3D.java | DepthSparse3D.configure | public void configure(LensDistortionNarrowFOV model , PixelTransform<Point2D_F32> visualToDepth ) {
this.visualToDepth = visualToDepth;
this.p2n = model.undistort_F64(true,false);
} | java | public void configure(LensDistortionNarrowFOV model , PixelTransform<Point2D_F32> visualToDepth ) {
this.visualToDepth = visualToDepth;
this.p2n = model.undistort_F64(true,false);
} | [
"public",
"void",
"configure",
"(",
"LensDistortionNarrowFOV",
"model",
",",
"PixelTransform",
"<",
"Point2D_F32",
">",
"visualToDepth",
")",
"{",
"this",
".",
"visualToDepth",
"=",
"visualToDepth",
";",
"this",
".",
"p2n",
"=",
"model",
".",
"undistort_F64",
"(... | Configures intrinsic camera parameters
@param model Model for narrow FOV cameras
@param visualToDepth Transform from visual to depth camera pixel coordinate systems. | [
"Configures",
"intrinsic",
"camera",
"parameters"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/DepthSparse3D.java#L79-L82 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/DepthSparse3D.java | DepthSparse3D.process | public boolean process( int x , int y ) {
visualToDepth.compute(x, y,distorted);
int depthX = (int)distorted.x;
int depthY = (int)distorted.y;
if( depthImage.isInBounds(depthX,depthY) ) {
// get the depth at the specified location
double value = lookupDepth(depthX, depthY);
// see if its an invalid ... | java | public boolean process( int x , int y ) {
visualToDepth.compute(x, y,distorted);
int depthX = (int)distorted.x;
int depthY = (int)distorted.y;
if( depthImage.isInBounds(depthX,depthY) ) {
// get the depth at the specified location
double value = lookupDepth(depthX, depthY);
// see if its an invalid ... | [
"public",
"boolean",
"process",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"visualToDepth",
".",
"compute",
"(",
"x",
",",
"y",
",",
"distorted",
")",
";",
"int",
"depthX",
"=",
"(",
"int",
")",
"distorted",
".",
"x",
";",
"int",
"depthY",
"=",
... | Given a pixel coordinate in the visual camera, compute the 3D coordinate of that point.
@param x x-coordinate of point in visual camera
@param y y-coordinate of point in visual camera
@return true if a 3D point could be computed and false if not | [
"Given",
"a",
"pixel",
"coordinate",
"in",
"the",
"visual",
"camera",
"compute",
"the",
"3D",
"coordinate",
"of",
"that",
"point",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/DepthSparse3D.java#L101-L127 | train |
lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/AssistedCalibration.java | AssistedCalibration.captureFiducialPoints | private void captureFiducialPoints() {
Polygon2D_F64 p = regions.grow();
p.vertexes.resize(sidesCollision.size());
for (int i = 0; i < sidesCollision.size(); i++) {
p.get(i).set( sidesCollision.get(i) );
}
quality.addObservations(detector.getDetectedPoints());
gui.getInfoPanel().updateGeometry(quality.ge... | java | private void captureFiducialPoints() {
Polygon2D_F64 p = regions.grow();
p.vertexes.resize(sidesCollision.size());
for (int i = 0; i < sidesCollision.size(); i++) {
p.get(i).set( sidesCollision.get(i) );
}
quality.addObservations(detector.getDetectedPoints());
gui.getInfoPanel().updateGeometry(quality.ge... | [
"private",
"void",
"captureFiducialPoints",
"(",
")",
"{",
"Polygon2D_F64",
"p",
"=",
"regions",
".",
"grow",
"(",
")",
";",
"p",
".",
"vertexes",
".",
"resize",
"(",
"sidesCollision",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | Record the area covered in the image by the fiducial, update the quality calculation, and see if it should
enable the save button. | [
"Record",
"the",
"area",
"covered",
"in",
"the",
"image",
"by",
"the",
"fiducial",
"update",
"the",
"quality",
"calculation",
"and",
"see",
"if",
"it",
"should",
"enable",
"the",
"save",
"button",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/AssistedCalibration.java#L477-L491 | train |
lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/calib/AssistedCalibration.java | AssistedCalibration.checkMagnetCapturePicture | private boolean checkMagnetCapturePicture() {
boolean captured = false;
Iterator<Magnet> iter = magnets.iterator();
while( iter.hasNext() ) {
Magnet i = iter.next();
if( i.handlePictureTaken() ) {
iter.remove();
captured = true;
}
}
return captured;
} | java | private boolean checkMagnetCapturePicture() {
boolean captured = false;
Iterator<Magnet> iter = magnets.iterator();
while( iter.hasNext() ) {
Magnet i = iter.next();
if( i.handlePictureTaken() ) {
iter.remove();
captured = true;
}
}
return captured;
} | [
"private",
"boolean",
"checkMagnetCapturePicture",
"(",
")",
"{",
"boolean",
"captured",
"=",
"false",
";",
"Iterator",
"<",
"Magnet",
">",
"iter",
"=",
"magnets",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
... | Checks to see if its near one of the magnets in the image broder | [
"Checks",
"to",
"see",
"if",
"its",
"near",
"one",
"of",
"the",
"magnets",
"in",
"the",
"image",
"broder"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/AssistedCalibration.java#L496-L507 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.fit | public boolean fit( List<Point2D_I32> contour , GrowQueue_I32 corners )
{
if( corners.size() < 3 ) {
return false;
}
searchRadius = Math.min(6,Math.max(contour.size()/12,3));
int startCorner,endCorner;
if( looping ) {
startCorner = 0;
endCorner = corners.size;
} else {
// the end point positio... | java | public boolean fit( List<Point2D_I32> contour , GrowQueue_I32 corners )
{
if( corners.size() < 3 ) {
return false;
}
searchRadius = Math.min(6,Math.max(contour.size()/12,3));
int startCorner,endCorner;
if( looping ) {
startCorner = 0;
endCorner = corners.size;
} else {
// the end point positio... | [
"public",
"boolean",
"fit",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"GrowQueue_I32",
"corners",
")",
"{",
"if",
"(",
"corners",
".",
"size",
"(",
")",
"<",
"3",
")",
"{",
"return",
"false",
";",
"}",
"searchRadius",
"=",
"Math",
".",
"m... | Fits a polygon to the contour given an initial set of candidate corners. If not looping the corners
must include the end points still. Minimum of 3 points required. Otherwise there's no corner!.
@param contour Contours around the shape
@param corners (Input) initial set of corners. (output) refined set of corners | [
"Fits",
"a",
"polygon",
"to",
"the",
"contour",
"given",
"an",
"initial",
"set",
"of",
"candidate",
"corners",
".",
"If",
"not",
"looping",
"the",
"corners",
"must",
"include",
"the",
"end",
"points",
"still",
".",
"Minimum",
"of",
"3",
"points",
"required... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L92-L125 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.optimize | protected int optimize( List<Point2D_I32> contour , int c0,int c1,int c2 ) {
double bestDistance = computeCost(contour,c0,c1,c2,0);
int bestIndex = 0;
for( int i = -searchRadius; i <= searchRadius; i++ ) {
if( i == 0 ) {
// if it found a better point in the first half stop the search since that's probably... | java | protected int optimize( List<Point2D_I32> contour , int c0,int c1,int c2 ) {
double bestDistance = computeCost(contour,c0,c1,c2,0);
int bestIndex = 0;
for( int i = -searchRadius; i <= searchRadius; i++ ) {
if( i == 0 ) {
// if it found a better point in the first half stop the search since that's probably... | [
"protected",
"int",
"optimize",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"int",
"c0",
",",
"int",
"c1",
",",
"int",
"c2",
")",
"{",
"double",
"bestDistance",
"=",
"computeCost",
"(",
"contour",
",",
"c0",
",",
"c1",
",",
"c2",
",",
"0",
... | Searches around the current c1 point for the best place to put the corner
@return location of best corner in local search region | [
"Searches",
"around",
"the",
"current",
"c1",
"point",
"for",
"the",
"best",
"place",
"to",
"put",
"the",
"corner"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L133-L152 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.computeCost | protected double computeCost(List<Point2D_I32> contour, int c0, int c1, int c2,
int offset)
{
c1 = CircularIndex.addOffset(c1, offset, contour.size());
createLine(c0,c1,contour,line0);
createLine(c1,c2,contour,line1);
return distanceSum(line0,c0,c1,contour)+distanceSum(line1,c1,c2,contour);
} | java | protected double computeCost(List<Point2D_I32> contour, int c0, int c1, int c2,
int offset)
{
c1 = CircularIndex.addOffset(c1, offset, contour.size());
createLine(c0,c1,contour,line0);
createLine(c1,c2,contour,line1);
return distanceSum(line0,c0,c1,contour)+distanceSum(line1,c1,c2,contour);
} | [
"protected",
"double",
"computeCost",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"int",
"c0",
",",
"int",
"c1",
",",
"int",
"c2",
",",
"int",
"offset",
")",
"{",
"c1",
"=",
"CircularIndex",
".",
"addOffset",
"(",
"c1",
",",
"offset",
",",
... | Computes the distance between the two lines defined by corner points in the contour
@param contour list of contour points
@param c0 end point of line 0
@param c1 start of line 0 and 1
@param c2 end point of line 1
@param offset added to c1 to make start of lines
@return sum of distance of points along contour | [
"Computes",
"the",
"distance",
"between",
"the",
"two",
"lines",
"defined",
"by",
"corner",
"points",
"in",
"the",
"contour"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L163-L170 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.distanceSum | protected double distanceSum( LineGeneral2D_F64 line , int c0 , int c1 , List<Point2D_I32> contour ) {
double total = 0;
if( c0 < c1 ) {
int length = c1-c0+1;
int samples = Math.min(maxLineSamples,length);
for (int i = 0; i < samples; i++) {
int index = c0 + i*(length-1)/(samples-1);
total += dis... | java | protected double distanceSum( LineGeneral2D_F64 line , int c0 , int c1 , List<Point2D_I32> contour ) {
double total = 0;
if( c0 < c1 ) {
int length = c1-c0+1;
int samples = Math.min(maxLineSamples,length);
for (int i = 0; i < samples; i++) {
int index = c0 + i*(length-1)/(samples-1);
total += dis... | [
"protected",
"double",
"distanceSum",
"(",
"LineGeneral2D_F64",
"line",
",",
"int",
"c0",
",",
"int",
"c1",
",",
"List",
"<",
"Point2D_I32",
">",
"contour",
")",
"{",
"double",
"total",
"=",
"0",
";",
"if",
"(",
"c0",
"<",
"c1",
")",
"{",
"int",
"len... | Sum of Euclidean distance of contour points along the line | [
"Sum",
"of",
"Euclidean",
"distance",
"of",
"contour",
"points",
"along",
"the",
"line"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L175-L205 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.createLine | private void createLine( int index0 , int index1 , List<Point2D_I32> contour , LineGeneral2D_F64 line )
{
if( index1 < 0 )
System.out.println("SHIT");
Point2D_I32 p0 = contour.get(index0);
Point2D_I32 p1 = contour.get(index1);
// System.out.println("createLine "+p0+" "+p1);
work.a.set(p0.x, p0.y);
work... | java | private void createLine( int index0 , int index1 , List<Point2D_I32> contour , LineGeneral2D_F64 line )
{
if( index1 < 0 )
System.out.println("SHIT");
Point2D_I32 p0 = contour.get(index0);
Point2D_I32 p1 = contour.get(index1);
// System.out.println("createLine "+p0+" "+p1);
work.a.set(p0.x, p0.y);
work... | [
"private",
"void",
"createLine",
"(",
"int",
"index0",
",",
"int",
"index1",
",",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"LineGeneral2D_F64",
"line",
")",
"{",
"if",
"(",
"index1",
"<",
"0",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"... | Given segment information create a line in general notation which has been normalized | [
"Given",
"segment",
"information",
"create",
"a",
"line",
"in",
"general",
"notation",
"which",
"has",
"been",
"normalized"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L217-L233 | train |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/ImageGray.java | ImageGray.createSameShape | public <B extends ImageGray<B>> B createSameShape( Class<B> type )
{
return GeneralizedImageOps.createSingleBand(type,width,height);
} | java | public <B extends ImageGray<B>> B createSameShape( Class<B> type )
{
return GeneralizedImageOps.createSingleBand(type,width,height);
} | [
"public",
"<",
"B",
"extends",
"ImageGray",
"<",
"B",
">",
">",
"B",
"createSameShape",
"(",
"Class",
"<",
"B",
">",
"type",
")",
"{",
"return",
"GeneralizedImageOps",
".",
"createSingleBand",
"(",
"type",
",",
"width",
",",
"height",
")",
";",
"}"
] | Creates a single band image of the specified type that will have the same
shape as this image | [
"Creates",
"a",
"single",
"band",
"image",
"of",
"the",
"specified",
"type",
"that",
"will",
"have",
"the",
"same",
"shape",
"as",
"this",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageGray.java#L190-L193 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java | VisualizeStereoDisparity.changeImageView | private synchronized void changeImageView() {
JComponent comp;
if( control.selectedView < 3 ) {
BufferedImage img;
switch (control.selectedView) {
case 0:
img = disparityOut;
break;
case 1:
img = colorLeft;
break;
case 2:
img = colorRight;
break;
default:
... | java | private synchronized void changeImageView() {
JComponent comp;
if( control.selectedView < 3 ) {
BufferedImage img;
switch (control.selectedView) {
case 0:
img = disparityOut;
break;
case 1:
img = colorLeft;
break;
case 2:
img = colorRight;
break;
default:
... | [
"private",
"synchronized",
"void",
"changeImageView",
"(",
")",
"{",
"JComponent",
"comp",
";",
"if",
"(",
"control",
".",
"selectedView",
"<",
"3",
")",
"{",
"BufferedImage",
"img",
";",
"switch",
"(",
"control",
".",
"selectedView",
")",
"{",
"case",
"0"... | Changes which image is being displayed depending on GUI selection | [
"Changes",
"which",
"image",
"is",
"being",
"displayed",
"depending",
"on",
"GUI",
"selection"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java#L164-L215 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java | VisualizeStereoDisparity.rectifyInputImages | private void rectifyInputImages() {
// get intrinsic camera calibration matrices
DMatrixRMaj K1 = PerspectiveOps.pinholeToMatrix(calib.left, (DMatrixRMaj)null);
DMatrixRMaj K2 = PerspectiveOps.pinholeToMatrix(calib.right, (DMatrixRMaj)null);
// compute rectification matrices
rectifyAlg.process(K1,new Se3_F64... | java | private void rectifyInputImages() {
// get intrinsic camera calibration matrices
DMatrixRMaj K1 = PerspectiveOps.pinholeToMatrix(calib.left, (DMatrixRMaj)null);
DMatrixRMaj K2 = PerspectiveOps.pinholeToMatrix(calib.right, (DMatrixRMaj)null);
// compute rectification matrices
rectifyAlg.process(K1,new Se3_F64... | [
"private",
"void",
"rectifyInputImages",
"(",
")",
"{",
"// get intrinsic camera calibration matrices",
"DMatrixRMaj",
"K1",
"=",
"PerspectiveOps",
".",
"pinholeToMatrix",
"(",
"calib",
".",
"left",
",",
"(",
"DMatrixRMaj",
")",
"null",
")",
";",
"DMatrixRMaj",
"K2"... | Removes distortion and rectifies images. | [
"Removes",
"distortion",
"and",
"rectifies",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java#L247-L283 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java | VisualizeStereoDisparity.changeGuiActive | private void changeGuiActive( final boolean error , final boolean reverse ) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
control.setActiveGui(error,reverse);
}
});
} | java | private void changeGuiActive( final boolean error , final boolean reverse ) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
control.setActiveGui(error,reverse);
}
});
} | [
"private",
"void",
"changeGuiActive",
"(",
"final",
"boolean",
"error",
",",
"final",
"boolean",
"reverse",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"control",
".",
"setA... | Active and deactivates different GUI configurations | [
"Active",
"and",
"deactivates",
"different",
"GUI",
"configurations"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/disparity/VisualizeStereoDisparity.java#L386-L392 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/EciEncoding.java | EciEncoding.guessEncoding | public static String guessEncoding( byte[] message ) {
// this function is inspired by a similarly named function in ZXing, but was written from scratch
// using specifications for each encoding since I didn't understand what they were doing
boolean isUtf8 = true;
boolean isJis = true;
boolean isIso = true;
... | java | public static String guessEncoding( byte[] message ) {
// this function is inspired by a similarly named function in ZXing, but was written from scratch
// using specifications for each encoding since I didn't understand what they were doing
boolean isUtf8 = true;
boolean isJis = true;
boolean isIso = true;
... | [
"public",
"static",
"String",
"guessEncoding",
"(",
"byte",
"[",
"]",
"message",
")",
"{",
"// this function is inspired by a similarly named function in ZXing, but was written from scratch",
"// using specifications for each encoding since I didn't understand what they were doing",
"boole... | The encoding for byte messages should be ISO8859_1 or JIS, depending on which version of the specification
you follow. In reality people use whatever they want and expect it to magically work. This attempts to
figure out if it's ISO8859_1, JIS, or UTF8. UTF-8 is the most common and is used if its ambiguous.
@param mes... | [
"The",
"encoding",
"for",
"byte",
"messages",
"should",
"be",
"ISO8859_1",
"or",
"JIS",
"depending",
"on",
"which",
"version",
"of",
"the",
"specification",
"you",
"follow",
".",
"In",
"reality",
"people",
"use",
"whatever",
"they",
"want",
"and",
"expect",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/EciEncoding.java#L39-L68 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/image/GConvertImage.java | GConvertImage.convert | public static <T extends ImageGray<T>> T convert(ImageGray<?> src , T dst , Class<T> typeDst )
{
if (dst == null) {
dst =(T) GeneralizedImageOps.createSingleBand(typeDst, src.width, src.height);
} else {
InputSanityCheck.checkSameShape(src, dst);
}
convert(src,dst);
return dst;
} | java | public static <T extends ImageGray<T>> T convert(ImageGray<?> src , T dst , Class<T> typeDst )
{
if (dst == null) {
dst =(T) GeneralizedImageOps.createSingleBand(typeDst, src.width, src.height);
} else {
InputSanityCheck.checkSameShape(src, dst);
}
convert(src,dst);
return dst;
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"convert",
"(",
"ImageGray",
"<",
"?",
">",
"src",
",",
"T",
"dst",
",",
"Class",
"<",
"T",
">",
"typeDst",
")",
"{",
"if",
"(",
"dst",
"==",
"null",
")",
"{",
"dst"... | Converts an image from one type to another type. Creates a new image instance if
an output is not provided.
@param src Input image. Not modified.
@param dst Converted output image. If null a new one will be declared. Modified.
@param typeDst The type of output image.
@return Converted image. | [
"Converts",
"an",
"image",
"from",
"one",
"type",
"to",
"another",
"type",
".",
"Creates",
"a",
"new",
"image",
"instance",
"if",
"an",
"output",
"is",
"not",
"provided",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/image/GConvertImage.java#L299-L309 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java | TrifocalExtractGeometries.setTensor | public void setTensor( TrifocalTensor tensor ) {
this.tensor = tensor;
if( !svd.decompose(tensor.T1) )
throw new RuntimeException("SVD failed?!");
SingularOps_DDRM.nullVector(svd, true, v1);
SingularOps_DDRM.nullVector(svd, false,u1);
// DMatrixRMaj zero = new DMatrixRMaj(3,1);
// CommonOps_DDRM.mult(ten... | java | public void setTensor( TrifocalTensor tensor ) {
this.tensor = tensor;
if( !svd.decompose(tensor.T1) )
throw new RuntimeException("SVD failed?!");
SingularOps_DDRM.nullVector(svd, true, v1);
SingularOps_DDRM.nullVector(svd, false,u1);
// DMatrixRMaj zero = new DMatrixRMaj(3,1);
// CommonOps_DDRM.mult(ten... | [
"public",
"void",
"setTensor",
"(",
"TrifocalTensor",
"tensor",
")",
"{",
"this",
".",
"tensor",
"=",
"tensor",
";",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
"tensor",
".",
"T1",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"SVD failed?!\"",
... | Specifies the input tensor. The epipoles are immediately extracted since they
are needed to extract all other data structures
@param tensor The tensor. Reference is saved but not modified | [
"Specifies",
"the",
"input",
"tensor",
".",
"The",
"epipoles",
"are",
"immediately",
"extracted",
"since",
"they",
"are",
"needed",
"to",
"extract",
"all",
"other",
"data",
"structures"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java#L92-L135 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java | TrifocalExtractGeometries.extractEpipoles | public void extractEpipoles( Point3D_F64 e2 , Point3D_F64 e3 ) {
e2.set(this.e2);
e3.set(this.e3);
} | java | public void extractEpipoles( Point3D_F64 e2 , Point3D_F64 e3 ) {
e2.set(this.e2);
e3.set(this.e3);
} | [
"public",
"void",
"extractEpipoles",
"(",
"Point3D_F64",
"e2",
",",
"Point3D_F64",
"e3",
")",
"{",
"e2",
".",
"set",
"(",
"this",
".",
"e2",
")",
";",
"e3",
".",
"set",
"(",
"this",
".",
"e3",
")",
";",
"}"
] | Extracts the epipoles from the trifocal tensor. Extracted epipoles will have a norm of 1
as an artifact of using SVD.
@param e2 Output: Epipole in image 2. Homogeneous coordinates. Modified
@param e3 Output: Epipole in image 3. Homogeneous coordinates. Modified | [
"Extracts",
"the",
"epipoles",
"from",
"the",
"trifocal",
"tensor",
".",
"Extracted",
"epipoles",
"will",
"have",
"a",
"norm",
"of",
"1",
"as",
"an",
"artifact",
"of",
"using",
"SVD",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java#L144-L147 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/GHistogramFeatureOps.java | GHistogramFeatureOps.histogram | public static <T extends ImageGray<T>>
void histogram( T image , double minPixelValue , double maxPixelValue , TupleDesc_F64 histogram ) {
if( image.getClass() == GrayU8.class ) {
HistogramFeatureOps.histogram((GrayU8) image, (int) maxPixelValue, histogram);
} else if( image.getClass() == GrayU16.class ) {
... | java | public static <T extends ImageGray<T>>
void histogram( T image , double minPixelValue , double maxPixelValue , TupleDesc_F64 histogram ) {
if( image.getClass() == GrayU8.class ) {
HistogramFeatureOps.histogram((GrayU8) image, (int) maxPixelValue, histogram);
} else if( image.getClass() == GrayU16.class ) {
... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"histogram",
"(",
"T",
"image",
",",
"double",
"minPixelValue",
",",
"double",
"maxPixelValue",
",",
"TupleDesc_F64",
"histogram",
")",
"{",
"if",
"(",
"image",
".",
"getClas... | Computes a single-band normalized histogram for any single band image.
@param image Input image. Not modified.
@param minPixelValue Minimum possible value for a pixel.
@param maxPixelValue Maximum possible value for a pixel.
@param histogram The output histogram. | [
"Computes",
"a",
"single",
"-",
"band",
"normalized",
"histogram",
"for",
"any",
"single",
"band",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/GHistogramFeatureOps.java#L41-L52 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/GHistogramFeatureOps.java | GHistogramFeatureOps.histogram | public static void histogram( double[] colors, int length , Histogram_F64 histogram )
{
if( length % histogram.getDimensions() != 0 )
throw new IllegalArgumentException("Length does not match dimensions");
int coordinate[] = new int[ histogram.getDimensions() ];
histogram.fill(0);
for (int i = 0; i < len... | java | public static void histogram( double[] colors, int length , Histogram_F64 histogram )
{
if( length % histogram.getDimensions() != 0 )
throw new IllegalArgumentException("Length does not match dimensions");
int coordinate[] = new int[ histogram.getDimensions() ];
histogram.fill(0);
for (int i = 0; i < len... | [
"public",
"static",
"void",
"histogram",
"(",
"double",
"[",
"]",
"colors",
",",
"int",
"length",
",",
"Histogram_F64",
"histogram",
")",
"{",
"if",
"(",
"length",
"%",
"histogram",
".",
"getDimensions",
"(",
")",
"!=",
"0",
")",
"throw",
"new",
"Illegal... | Computes a coupled histogram from a list of colors. If the input is for integer values then add one
to the maximum value. For example if the range of values is 0 to 255, then make it 0 to 256.
@param colors List of colors stored in an interleaved format
@param length Length of usable portion of colors
@param histogr... | [
"Computes",
"a",
"coupled",
"histogram",
"from",
"a",
"list",
"of",
"colors",
".",
"If",
"the",
"input",
"is",
"for",
"integer",
"values",
"then",
"add",
"one",
"to",
"the",
"maximum",
"value",
".",
"For",
"example",
"if",
"the",
"range",
"of",
"values",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/GHistogramFeatureOps.java#L84-L101 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java | ScaleSceneStructure.computePointStatistics | void computePointStatistics(Point[] points ) {
final int length = points.length;
double v[] = new double[length];
for (int axis = 0; axis < 3; axis++) {
double maxAbs = 0;
for (int i = 0; i < length; i++) {
v[i] = points[i].coordinate[axis];
maxAbs = Math.max( maxAbs , Math.abs(v[i]));
}
dou... | java | void computePointStatistics(Point[] points ) {
final int length = points.length;
double v[] = new double[length];
for (int axis = 0; axis < 3; axis++) {
double maxAbs = 0;
for (int i = 0; i < length; i++) {
v[i] = points[i].coordinate[axis];
maxAbs = Math.max( maxAbs , Math.abs(v[i]));
}
dou... | [
"void",
"computePointStatistics",
"(",
"Point",
"[",
"]",
"points",
")",
"{",
"final",
"int",
"length",
"=",
"points",
".",
"length",
";",
"double",
"v",
"[",
"]",
"=",
"new",
"double",
"[",
"length",
"]",
";",
"for",
"(",
"int",
"axis",
"=",
"0",
... | For 3D points, computes the median value and variance along each dimension. | [
"For",
"3D",
"points",
"computes",
"the",
"median",
"value",
"and",
"variance",
"along",
"each",
"dimension",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java#L217-L244 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java | ScaleSceneStructure.undoScale | public void undoScale( SceneStructureMetric structure ,
SceneObservations observations ) {
if( structure.homogenous )
return;
double scale = desiredDistancePoint / medianDistancePoint;
undoNormPoints3D(structure, scale);
Point3D_F64 c = new Point3D_F64();
for (int i = 0; i < structure.views.le... | java | public void undoScale( SceneStructureMetric structure ,
SceneObservations observations ) {
if( structure.homogenous )
return;
double scale = desiredDistancePoint / medianDistancePoint;
undoNormPoints3D(structure, scale);
Point3D_F64 c = new Point3D_F64();
for (int i = 0; i < structure.views.le... | [
"public",
"void",
"undoScale",
"(",
"SceneStructureMetric",
"structure",
",",
"SceneObservations",
"observations",
")",
"{",
"if",
"(",
"structure",
".",
"homogenous",
")",
"return",
";",
"double",
"scale",
"=",
"desiredDistancePoint",
"/",
"medianDistancePoint",
";... | Undoes scale transform for metric.
@param structure scene's structure
@param observations observations of the scene | [
"Undoes",
"scale",
"transform",
"for",
"metric",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java#L282-L308 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/RemovePerspectiveDistortion.java | RemovePerspectiveDistortion.apply | public boolean apply( T input ,
Point2D_F64 corner0 , Point2D_F64 corner1 ,
Point2D_F64 corner2 , Point2D_F64 corner3 )
{
if( createTransform(corner0, corner1, corner2, corner3)) {
distort.input(input).apply();
return true;
} else {
return false;
}
} | java | public boolean apply( T input ,
Point2D_F64 corner0 , Point2D_F64 corner1 ,
Point2D_F64 corner2 , Point2D_F64 corner3 )
{
if( createTransform(corner0, corner1, corner2, corner3)) {
distort.input(input).apply();
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"apply",
"(",
"T",
"input",
",",
"Point2D_F64",
"corner0",
",",
"Point2D_F64",
"corner1",
",",
"Point2D_F64",
"corner2",
",",
"Point2D_F64",
"corner3",
")",
"{",
"if",
"(",
"createTransform",
"(",
"corner0",
",",
"corner1",
",",
"corner2",... | Applies distortion removal to the specified region in the input image. The undistorted image is returned.
@param input Input image
@param corner0 Top left corner
@param corner1 Top right corner
@param corner2 Bottom right corner
@param corner3 Bottom left corner
@return true if successful or false if it failed | [
"Applies",
"distortion",
"removal",
"to",
"the",
"specified",
"region",
"in",
"the",
"input",
"image",
".",
"The",
"undistorted",
"image",
"is",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/RemovePerspectiveDistortion.java#L103-L114 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/RemovePerspectiveDistortion.java | RemovePerspectiveDistortion.createTransform | public boolean createTransform( Point2D_F64 tl , Point2D_F64 tr ,
Point2D_F64 br , Point2D_F64 bl )
{
associatedPairs.get(0).p2.set(tl);
associatedPairs.get(1).p2.set(tr);
associatedPairs.get(2).p2.set(br);
associatedPairs.get(3).p2.set(bl);
if( !computeHomography.process(associatedPairs, H) )
r... | java | public boolean createTransform( Point2D_F64 tl , Point2D_F64 tr ,
Point2D_F64 br , Point2D_F64 bl )
{
associatedPairs.get(0).p2.set(tl);
associatedPairs.get(1).p2.set(tr);
associatedPairs.get(2).p2.set(br);
associatedPairs.get(3).p2.set(bl);
if( !computeHomography.process(associatedPairs, H) )
r... | [
"public",
"boolean",
"createTransform",
"(",
"Point2D_F64",
"tl",
",",
"Point2D_F64",
"tr",
",",
"Point2D_F64",
"br",
",",
"Point2D_F64",
"bl",
")",
"{",
"associatedPairs",
".",
"get",
"(",
"0",
")",
".",
"p2",
".",
"set",
"(",
"tl",
")",
";",
"associate... | Compues the distortion removal transform
@param tl Top left corner
@param tr Top right corner
@param br Bottom right corner
@param bl Bottom left corner
@return true if successful or false if it failed | [
"Compues",
"the",
"distortion",
"removal",
"transform"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/RemovePerspectiveDistortion.java#L125-L145 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/ConvolveImageDownNormalized.java | ConvolveImageDownNormalized.vertical | public static void vertical(Kernel1D_F32 kernel, GrayF32 image, GrayF32 dest , int skip ) {
checkParameters(image, dest, skip);
if( kernel.width >= image.width ) {
ConvolveDownNormalizedNaive.vertical(kernel,image,dest,skip);
} else {
ConvolveImageDownNoBorder.vertical(kernel,image,dest,skip);
ConvolveD... | java | public static void vertical(Kernel1D_F32 kernel, GrayF32 image, GrayF32 dest , int skip ) {
checkParameters(image, dest, skip);
if( kernel.width >= image.width ) {
ConvolveDownNormalizedNaive.vertical(kernel,image,dest,skip);
} else {
ConvolveImageDownNoBorder.vertical(kernel,image,dest,skip);
ConvolveD... | [
"public",
"static",
"void",
"vertical",
"(",
"Kernel1D_F32",
"kernel",
",",
"GrayF32",
"image",
",",
"GrayF32",
"dest",
",",
"int",
"skip",
")",
"{",
"checkParameters",
"(",
"image",
",",
"dest",
",",
"skip",
")",
";",
"if",
"(",
"kernel",
".",
"width",
... | Performs a vertical 1D down convolution across the image while re-normalizing the kernel depending on its
overlap with the image.
@param image The original image. Not modified.
@param dest Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified. | [
"Performs",
"a",
"vertical",
"1D",
"down",
"convolution",
"across",
"the",
"image",
"while",
"re",
"-",
"normalizing",
"the",
"kernel",
"depending",
"on",
"its",
"overlap",
"with",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/ConvolveImageDownNormalized.java#L71-L80 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/RemoveBrownNtoN_F32.java | RemoveBrownNtoN_F32.removeRadial | public static void removeRadial(float x, float y, float[] radial, float t1, float t2,
Point2D_F32 out, float tol ) {
float origX = x;
float origY = y;
float prevSum = 0;
for( int iter = 0; iter < 500; iter++ ) {
// estimate the radial distance
float r2 = x*x + y*y;
float ri2 = r2;
float... | java | public static void removeRadial(float x, float y, float[] radial, float t1, float t2,
Point2D_F32 out, float tol ) {
float origX = x;
float origY = y;
float prevSum = 0;
for( int iter = 0; iter < 500; iter++ ) {
// estimate the radial distance
float r2 = x*x + y*y;
float ri2 = r2;
float... | [
"public",
"static",
"void",
"removeRadial",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"[",
"]",
"radial",
",",
"float",
"t1",
",",
"float",
"t2",
",",
"Point2D_F32",
"out",
",",
"float",
"tol",
")",
"{",
"float",
"origX",
"=",
"x",
";",
"... | Static function for removing radial and tangential distortion
@param x Distorted x-coordinate normalized image coordinate
@param y Distorted y-coordinate normalized image coordinate
@param radial Radial distortion parameters
@param t1 tangential distortion
@param t2 tangential distortion
@param out Undistorted normali... | [
"Static",
"function",
"for",
"removing",
"radial",
"and",
"tangential",
"distortion"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/RemoveBrownNtoN_F32.java#L85-L117 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java | SnapToEllipseEdge.process | public boolean process(EllipseRotated_F64 input, EllipseRotated_F64 refined) {
refined.set(input);
previous.set(input);
for (int iteration = 0; iteration < maxIterations; iteration++) {
refined.set(previous);
computePointsAndWeights(refined);
if( fitter.process(samplePts.toList(),weights.data) ) {
... | java | public boolean process(EllipseRotated_F64 input, EllipseRotated_F64 refined) {
refined.set(input);
previous.set(input);
for (int iteration = 0; iteration < maxIterations; iteration++) {
refined.set(previous);
computePointsAndWeights(refined);
if( fitter.process(samplePts.toList(),weights.data) ) {
... | [
"public",
"boolean",
"process",
"(",
"EllipseRotated_F64",
"input",
",",
"EllipseRotated_F64",
"refined",
")",
"{",
"refined",
".",
"set",
"(",
"input",
")",
";",
"previous",
".",
"set",
"(",
"input",
")",
";",
"for",
"(",
"int",
"iteration",
"=",
"0",
"... | Refines provided list by snapping it to edges found in the image
@param input (Output) Close approximation of the ellipse in the image
@param refined (Output) Storage for refined estimate. Can be same instance as input
@return True if a refined estimate could be found, false if it failed | [
"Refines",
"provided",
"list",
"by",
"snapping",
"it",
"to",
"edges",
"found",
"in",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java#L81-L111 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.