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/misc/AverageDownSampleOps.java | AverageDownSampleOps.downSampleSize | public static int downSampleSize( int length , int squareWidth ) {
int ret = length/squareWidth;
if( length%squareWidth != 0 )
ret++;
return ret;
} | java | public static int downSampleSize( int length , int squareWidth ) {
int ret = length/squareWidth;
if( length%squareWidth != 0 )
ret++;
return ret;
} | [
"public",
"static",
"int",
"downSampleSize",
"(",
"int",
"length",
",",
"int",
"squareWidth",
")",
"{",
"int",
"ret",
"=",
"length",
"/",
"squareWidth",
";",
"if",
"(",
"length",
"%",
"squareWidth",
"!=",
"0",
")",
"ret",
"++",
";",
"return",
"ret",
";... | Computes the length of a down sampled image based on the original length and the square width
@param length Length of side in input image
@param squareWidth Width of region used to down sample images
@return Length of side in down sampled image | [
"Computes",
"the",
"length",
"of",
"a",
"down",
"sampled",
"image",
"based",
"on",
"the",
"original",
"length",
"and",
"the",
"square",
"width"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java#L48-L54 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java | AverageDownSampleOps.reshapeDown | public static void reshapeDown(ImageBase image, int inputWidth, int inputHeight, int squareWidth) {
int w = downSampleSize(inputWidth,squareWidth);
int h = downSampleSize(inputHeight,squareWidth);
image.reshape(w,h);
} | java | public static void reshapeDown(ImageBase image, int inputWidth, int inputHeight, int squareWidth) {
int w = downSampleSize(inputWidth,squareWidth);
int h = downSampleSize(inputHeight,squareWidth);
image.reshape(w,h);
} | [
"public",
"static",
"void",
"reshapeDown",
"(",
"ImageBase",
"image",
",",
"int",
"inputWidth",
",",
"int",
"inputHeight",
",",
"int",
"squareWidth",
")",
"{",
"int",
"w",
"=",
"downSampleSize",
"(",
"inputWidth",
",",
"squareWidth",
")",
";",
"int",
"h",
... | Reshapes an image so that it is the correct size to store the down sampled image | [
"Reshapes",
"an",
"image",
"so",
"that",
"it",
"is",
"the",
"correct",
"size",
"to",
"store",
"the",
"down",
"sampled",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java#L59-L64 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java | AverageDownSampleOps.down | public static <T extends ImageGray<T>> void down(Planar<T> input ,
int sampleWidth , Planar<T> output )
{
for( int band = 0; band < input.getNumBands(); band++ ) {
down(input.getBand(band), sampleWidth, output.getBand(band));
}
} | java | public static <T extends ImageGray<T>> void down(Planar<T> input ,
int sampleWidth , Planar<T> output )
{
for( int band = 0; band < input.getNumBands(); band++ ) {
down(input.getBand(band), sampleWidth, output.getBand(band));
}
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"down",
"(",
"Planar",
"<",
"T",
">",
"input",
",",
"int",
"sampleWidth",
",",
"Planar",
"<",
"T",
">",
"output",
")",
"{",
"for",
"(",
"int",
"band",
"=",
"0",
";"... | Down samples a planar image. Type checking is done at runtime.
@param input Input image. Not modified.
@param sampleWidth Width of square region.
@param output Output image. Modified. | [
"Down",
"samples",
"a",
"planar",
"image",
".",
"Type",
"checking",
"is",
"done",
"at",
"runtime",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java#L178-L184 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java | EstimatePlaneAtInfinityGivenK.setCamera1 | public void setCamera1( double fx , double fy , double skew , double cx , double cy ) {
PerspectiveOps.pinholeToMatrix(fx,fy,skew,cx,cy,K1);
} | java | public void setCamera1( double fx , double fy , double skew , double cx , double cy ) {
PerspectiveOps.pinholeToMatrix(fx,fy,skew,cx,cy,K1);
} | [
"public",
"void",
"setCamera1",
"(",
"double",
"fx",
",",
"double",
"fy",
",",
"double",
"skew",
",",
"double",
"cx",
",",
"double",
"cy",
")",
"{",
"PerspectiveOps",
".",
"pinholeToMatrix",
"(",
"fx",
",",
"fy",
",",
"skew",
",",
"cx",
",",
"cy",
",... | Specifies known intrinsic parameters for view 1 | [
"Specifies",
"known",
"intrinsic",
"parameters",
"for",
"view",
"1"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java#L69-L71 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java | EstimatePlaneAtInfinityGivenK.setCamera2 | public void setCamera2( double fx , double fy , double skew , double cx , double cy ) {
PerspectiveOps.pinholeToMatrix(fx,fy,skew,cx,cy,K2);
PerspectiveOps.invertPinhole(K2,K2_inv);
} | java | public void setCamera2( double fx , double fy , double skew , double cx , double cy ) {
PerspectiveOps.pinholeToMatrix(fx,fy,skew,cx,cy,K2);
PerspectiveOps.invertPinhole(K2,K2_inv);
} | [
"public",
"void",
"setCamera2",
"(",
"double",
"fx",
",",
"double",
"fy",
",",
"double",
"skew",
",",
"double",
"cx",
",",
"double",
"cy",
")",
"{",
"PerspectiveOps",
".",
"pinholeToMatrix",
"(",
"fx",
",",
"fy",
",",
"skew",
",",
"cx",
",",
"cy",
",... | Specifies known intrinsic parameters for view 2 | [
"Specifies",
"known",
"intrinsic",
"parameters",
"for",
"view",
"2"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java#L76-L79 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java | EstimatePlaneAtInfinityGivenK.estimatePlaneAtInfinity | public boolean estimatePlaneAtInfinity( DMatrixRMaj P2 , Vector3D_F64 v ) {
PerspectiveOps.projectionSplit(P2,Q2,q2);
// inv(K2)*(Q2*K1 + q2*v')
CommonOps_DDF3.mult(K2_inv,q2,t2);
CommonOps_DDF3.mult(K2_inv,Q2,tmpA);
CommonOps_DDF3.mult(tmpA,K1,tmpB);
// Find the rotation matrix R*t2 = [||t2||,0,0]^T
co... | java | public boolean estimatePlaneAtInfinity( DMatrixRMaj P2 , Vector3D_F64 v ) {
PerspectiveOps.projectionSplit(P2,Q2,q2);
// inv(K2)*(Q2*K1 + q2*v')
CommonOps_DDF3.mult(K2_inv,q2,t2);
CommonOps_DDF3.mult(K2_inv,Q2,tmpA);
CommonOps_DDF3.mult(tmpA,K1,tmpB);
// Find the rotation matrix R*t2 = [||t2||,0,0]^T
co... | [
"public",
"boolean",
"estimatePlaneAtInfinity",
"(",
"DMatrixRMaj",
"P2",
",",
"Vector3D_F64",
"v",
")",
"{",
"PerspectiveOps",
".",
"projectionSplit",
"(",
"P2",
",",
"Q2",
",",
"q2",
")",
";",
"// inv(K2)*(Q2*K1 + q2*v')",
"CommonOps_DDF3",
".",
"mult",
"(",
"... | Computes the plane at infinity
@param P2 (Input) projective camera matrix for view 2. Not modified.
@param v (Output) plane at infinity
@return true if successful or false if it failed | [
"Computes",
"the",
"plane",
"at",
"infinity"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java#L88-L116 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java | ExamplePointFeatureTracker.process | public void process(SimpleImageSequence<T> sequence) {
// Figure out how large the GUI window should be
T frame = sequence.next();
gui.setPreferredSize(new Dimension(frame.getWidth(),frame.getHeight()));
ShowImages.showWindow(gui,"KTL Tracker", true);
// process each frame in the image sequence
while( seq... | java | public void process(SimpleImageSequence<T> sequence) {
// Figure out how large the GUI window should be
T frame = sequence.next();
gui.setPreferredSize(new Dimension(frame.getWidth(),frame.getHeight()));
ShowImages.showWindow(gui,"KTL Tracker", true);
// process each frame in the image sequence
while( seq... | [
"public",
"void",
"process",
"(",
"SimpleImageSequence",
"<",
"T",
">",
"sequence",
")",
"{",
"// Figure out how large the GUI window should be",
"T",
"frame",
"=",
"sequence",
".",
"next",
"(",
")",
";",
"gui",
".",
"setPreferredSize",
"(",
"new",
"Dimension",
... | Processes the sequence of images and displays the tracked features in a window | [
"Processes",
"the",
"sequence",
"of",
"images",
"and",
"displays",
"the",
"tracked",
"features",
"in",
"a",
"window"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java#L78-L102 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java | ExamplePointFeatureTracker.updateGUI | private void updateGUI(SimpleImageSequence<T> sequence) {
BufferedImage orig = sequence.getGuiImage();
Graphics2D g2 = orig.createGraphics();
// draw tracks with semi-unique colors so you can track individual points with your eyes
for( PointTrack p : tracker.getActiveTracks(null) ) {
int red = (int)(2.5*(p.... | java | private void updateGUI(SimpleImageSequence<T> sequence) {
BufferedImage orig = sequence.getGuiImage();
Graphics2D g2 = orig.createGraphics();
// draw tracks with semi-unique colors so you can track individual points with your eyes
for( PointTrack p : tracker.getActiveTracks(null) ) {
int red = (int)(2.5*(p.... | [
"private",
"void",
"updateGUI",
"(",
"SimpleImageSequence",
"<",
"T",
">",
"sequence",
")",
"{",
"BufferedImage",
"orig",
"=",
"sequence",
".",
"getGuiImage",
"(",
")",
";",
"Graphics2D",
"g2",
"=",
"orig",
".",
"createGraphics",
"(",
")",
";",
"// draw trac... | Draw tracked features in blue, or red if they were just spawned. | [
"Draw",
"tracked",
"features",
"in",
"blue",
"or",
"red",
"if",
"they",
"were",
"just",
"spawned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java#L107-L127 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java | ExamplePointFeatureTracker.createSURF | public void createSURF() {
ConfigFastHessian configDetector = new ConfigFastHessian();
configDetector.maxFeaturesPerScale = 250;
configDetector.extractRadius = 3;
configDetector.initialSampleSize = 2;
tracker = FactoryPointTracker.dda_FH_SURF_Fast(configDetector, null, null, imageType);
} | java | public void createSURF() {
ConfigFastHessian configDetector = new ConfigFastHessian();
configDetector.maxFeaturesPerScale = 250;
configDetector.extractRadius = 3;
configDetector.initialSampleSize = 2;
tracker = FactoryPointTracker.dda_FH_SURF_Fast(configDetector, null, null, imageType);
} | [
"public",
"void",
"createSURF",
"(",
")",
"{",
"ConfigFastHessian",
"configDetector",
"=",
"new",
"ConfigFastHessian",
"(",
")",
";",
"configDetector",
".",
"maxFeaturesPerScale",
"=",
"250",
";",
"configDetector",
".",
"extractRadius",
"=",
"3",
";",
"configDetec... | Creates a SURF feature tracker. | [
"Creates",
"a",
"SURF",
"feature",
"tracker",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java#L144-L150 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/CylinderToEquirectangular_F32.java | CylinderToEquirectangular_F32.configure | public void configure( int width , int height , float vfov ) {
declareVectors( width, height );
float r = (float)Math.tan(vfov/2.0f);
for (int pixelY = 0; pixelY < height; pixelY++) {
float z = 2*r*pixelY/(height-1) - r;
for (int pixelX = 0; pixelX < width; pixelX++) {
float theta = GrlConstants.F_PI2... | java | public void configure( int width , int height , float vfov ) {
declareVectors( width, height );
float r = (float)Math.tan(vfov/2.0f);
for (int pixelY = 0; pixelY < height; pixelY++) {
float z = 2*r*pixelY/(height-1) - r;
for (int pixelX = 0; pixelX < width; pixelX++) {
float theta = GrlConstants.F_PI2... | [
"public",
"void",
"configure",
"(",
"int",
"width",
",",
"int",
"height",
",",
"float",
"vfov",
")",
"{",
"declareVectors",
"(",
"width",
",",
"height",
")",
";",
"float",
"r",
"=",
"(",
"float",
")",
"Math",
".",
"tan",
"(",
"vfov",
"/",
"2.0f",
"... | Configures the rendered cylinder
@param width Cylinder width in pixels
@param height Cylinder height in pixels
@param vfov vertical FOV in radians | [
"Configures",
"the",
"rendered",
"cylinder"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/CylinderToEquirectangular_F32.java#L47-L62 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/grid/DetectSquareGridFiducial.java | DetectSquareGridFiducial.process | public boolean process( T image ) {
configureContourDetector(image);
binary.reshape(image.width,image.height);
inputToBinary.process(image,binary);
detectorSquare.process(image, binary);
detectorSquare.refineAll();
detectorSquare.getPolygons(found,null);
clusters = s2c.process(found);
c2g.process(clu... | java | public boolean process( T image ) {
configureContourDetector(image);
binary.reshape(image.width,image.height);
inputToBinary.process(image,binary);
detectorSquare.process(image, binary);
detectorSquare.refineAll();
detectorSquare.getPolygons(found,null);
clusters = s2c.process(found);
c2g.process(clu... | [
"public",
"boolean",
"process",
"(",
"T",
"image",
")",
"{",
"configureContourDetector",
"(",
"image",
")",
";",
"binary",
".",
"reshape",
"(",
"image",
".",
"width",
",",
"image",
".",
"height",
")",
";",
"inputToBinary",
".",
"process",
"(",
"image",
"... | Process the image and detect the calibration target
@param image Input image
@return true if a calibration target was found and false if not | [
"Process",
"the",
"image",
"and",
"detect",
"the",
"calibration",
"target"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/grid/DetectSquareGridFiducial.java#L118-L162 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/grid/DetectSquareGridFiducial.java | DetectSquareGridFiducial.extractCalibrationPoints | void extractCalibrationPoints(SquareGrid grid) {
calibrationPoints.clear();
for (int row = 0; row < grid.rows; row++) {
row0.clear();
row1.clear();
for (int col = 0; col < grid.columns; col++) {
Polygon2D_F64 square = grid.get(row,col).square;
row0.add(square.get(0));
row0.add(square.get(1));... | java | void extractCalibrationPoints(SquareGrid grid) {
calibrationPoints.clear();
for (int row = 0; row < grid.rows; row++) {
row0.clear();
row1.clear();
for (int col = 0; col < grid.columns; col++) {
Polygon2D_F64 square = grid.get(row,col).square;
row0.add(square.get(0));
row0.add(square.get(1));... | [
"void",
"extractCalibrationPoints",
"(",
"SquareGrid",
"grid",
")",
"{",
"calibrationPoints",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"grid",
".",
"rows",
";",
"row",
"++",
")",
"{",
"row0",
".",
"clear",
"("... | Extracts the calibration points from the corners of a fully ordered grid | [
"Extracts",
"the",
"calibration",
"points",
"from",
"the",
"corners",
"of",
"a",
"fully",
"ordered",
"grid"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/grid/DetectSquareGridFiducial.java#L182-L203 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java | SurfDescribeOps.createGradient | public static <T extends ImageGray<T>>
SparseScaleGradient<T,?> createGradient( boolean useHaar , Class<T> imageType )
{
if( useHaar )
return FactorySparseIntegralFilters.haar(imageType);
else
return FactorySparseIntegralFilters.gradient(imageType);
} | java | public static <T extends ImageGray<T>>
SparseScaleGradient<T,?> createGradient( boolean useHaar , Class<T> imageType )
{
if( useHaar )
return FactorySparseIntegralFilters.haar(imageType);
else
return FactorySparseIntegralFilters.gradient(imageType);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"SparseScaleGradient",
"<",
"T",
",",
"?",
">",
"createGradient",
"(",
"boolean",
"useHaar",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"if",
"(",
"useHaar",
")",
"retur... | Creates a class for computing the image gradient from an integral image in a sparse fashion.
All these kernels assume that the kernel is entirely contained inside the image!
@param useHaar Should it use a haar wavelet or an derivative kernel.
@param imageType Type of image being processed.
@return Sparse gradient algo... | [
"Creates",
"a",
"class",
"for",
"computing",
"the",
"image",
"gradient",
"from",
"an",
"integral",
"image",
"in",
"a",
"sparse",
"fashion",
".",
"All",
"these",
"kernels",
"assume",
"that",
"the",
"kernel",
"is",
"entirely",
"contained",
"inside",
"the",
"im... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java#L98-L105 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java | SurfDescribeOps.isInside | public static <T extends ImageGray<T>>
boolean isInside( T ii , double X , double Y , int radiusRegions , int kernelSize ,
double scale, double c , double s )
{
int c_x = (int)Math.round(X);
int c_y = (int)Math.round(Y);
kernelSize = (int)Math.ceil(kernelSize*scale);
int kernelRadius = kernelSize/2+... | java | public static <T extends ImageGray<T>>
boolean isInside( T ii , double X , double Y , int radiusRegions , int kernelSize ,
double scale, double c , double s )
{
int c_x = (int)Math.round(X);
int c_y = (int)Math.round(Y);
kernelSize = (int)Math.ceil(kernelSize*scale);
int kernelRadius = kernelSize/2+... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"boolean",
"isInside",
"(",
"T",
"ii",
",",
"double",
"X",
",",
"double",
"Y",
",",
"int",
"radiusRegions",
",",
"int",
"kernelSize",
",",
"double",
"scale",
",",
"double",
"c",
... | Checks to see if the region is contained inside the image. This includes convolution
kernel. Take in account the orientation of the region.
@param X Center of the interest point.
@param Y Center of the interest point.
@param radiusRegions Radius in pixels of the whole region at a scale of 1
@param kernelSize Size of... | [
"Checks",
"to",
"see",
"if",
"the",
"region",
"is",
"contained",
"inside",
"the",
"image",
".",
"This",
"includes",
"convolution",
"kernel",
".",
"Take",
"in",
"account",
"the",
"orientation",
"of",
"the",
"region",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java#L119-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java | SurfDescribeOps.rotatedWidth | public static double rotatedWidth( double width , double c , double s )
{
return Math.abs(c)*width + Math.abs(s)*width;
} | java | public static double rotatedWidth( double width , double c , double s )
{
return Math.abs(c)*width + Math.abs(s)*width;
} | [
"public",
"static",
"double",
"rotatedWidth",
"(",
"double",
"width",
",",
"double",
"c",
",",
"double",
"s",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"c",
")",
"*",
"width",
"+",
"Math",
".",
"abs",
"(",
"s",
")",
"*",
"width",
";",
"}"
] | Computes the width of a square containment region that contains a rotated rectangle.
@param width Size of the original rectangle.
@param c Cosine(theta)
@param s Sine(theta)
@return Side length of the containment square. | [
"Computes",
"the",
"width",
"of",
"a",
"square",
"containment",
"region",
"that",
"contains",
"a",
"rotated",
"rectangle",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/SurfDescribeOps.java#L214-L217 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.assignIDsToRigidPoints | public void assignIDsToRigidPoints() {
// return if it has already been assigned
if( lookupRigid != null )
return;
// Assign a unique ID to each point belonging to a rigid object
// at the same time create a look up table that allows for the object that a point belongs to be quickly found
lookupRigid = new... | java | public void assignIDsToRigidPoints() {
// return if it has already been assigned
if( lookupRigid != null )
return;
// Assign a unique ID to each point belonging to a rigid object
// at the same time create a look up table that allows for the object that a point belongs to be quickly found
lookupRigid = new... | [
"public",
"void",
"assignIDsToRigidPoints",
"(",
")",
"{",
"// return if it has already been assigned",
"if",
"(",
"lookupRigid",
"!=",
"null",
")",
"return",
";",
"// Assign a unique ID to each point belonging to a rigid object",
"// at the same time create a look up table that allo... | Assigns an ID to all rigid points. This function does not need to be called by the user as it will be called
by the residual function if needed | [
"Assigns",
"an",
"ID",
"to",
"all",
"rigid",
"points",
".",
"This",
"function",
"does",
"not",
"need",
"to",
"be",
"called",
"by",
"the",
"user",
"as",
"it",
"will",
"be",
"called",
"by",
"the",
"residual",
"function",
"if",
"needed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L104-L120 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.setCamera | public void setCamera(int which , boolean fixed , BundleAdjustmentCamera model ) {
cameras[which].known = fixed;
cameras[which].model = model;
} | java | public void setCamera(int which , boolean fixed , BundleAdjustmentCamera model ) {
cameras[which].known = fixed;
cameras[which].model = model;
} | [
"public",
"void",
"setCamera",
"(",
"int",
"which",
",",
"boolean",
"fixed",
",",
"BundleAdjustmentCamera",
"model",
")",
"{",
"cameras",
"[",
"which",
"]",
".",
"known",
"=",
"fixed",
";",
"cameras",
"[",
"which",
"]",
".",
"model",
"=",
"model",
";",
... | Specifies the camera model being used.
@param which Which camera is being specified
@param fixed If these parameters are constant or not
@param model The camera model | [
"Specifies",
"the",
"camera",
"model",
"being",
"used",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L135-L138 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.setRigid | public void setRigid( int which , boolean fixed , Se3_F64 worldToObject , int totalPoints ) {
Rigid r = rigids[which] = new Rigid();
r.known = fixed;
r.objectToWorld.set(worldToObject);
r.points = new Point[totalPoints];
for (int i = 0; i < totalPoints; i++) {
r.points[i] = new Point(pointSize);
}
} | java | public void setRigid( int which , boolean fixed , Se3_F64 worldToObject , int totalPoints ) {
Rigid r = rigids[which] = new Rigid();
r.known = fixed;
r.objectToWorld.set(worldToObject);
r.points = new Point[totalPoints];
for (int i = 0; i < totalPoints; i++) {
r.points[i] = new Point(pointSize);
}
} | [
"public",
"void",
"setRigid",
"(",
"int",
"which",
",",
"boolean",
"fixed",
",",
"Se3_F64",
"worldToObject",
",",
"int",
"totalPoints",
")",
"{",
"Rigid",
"r",
"=",
"rigids",
"[",
"which",
"]",
"=",
"new",
"Rigid",
"(",
")",
";",
"r",
".",
"known",
"... | Declares the data structure for a rigid object. Location of points are set by accessing the object directly.
Rigid objects are useful in known scenes with calibration targets.
@param which Index of rigid object
@param fixed If the pose is known or not
@param worldToObject Initial estimated location of rigid object
@pa... | [
"Declares",
"the",
"data",
"structure",
"for",
"a",
"rigid",
"object",
".",
"Location",
"of",
"points",
"are",
"set",
"by",
"accessing",
"the",
"object",
"directly",
".",
"Rigid",
"objects",
"are",
"useful",
"in",
"known",
"scenes",
"with",
"calibration",
"t... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L168-L176 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.connectViewToCamera | public void connectViewToCamera( int viewIndex , int cameraIndex ) {
if( views[viewIndex].camera != -1 )
throw new RuntimeException("View has already been assigned a camera");
views[viewIndex].camera = cameraIndex;
} | java | public void connectViewToCamera( int viewIndex , int cameraIndex ) {
if( views[viewIndex].camera != -1 )
throw new RuntimeException("View has already been assigned a camera");
views[viewIndex].camera = cameraIndex;
} | [
"public",
"void",
"connectViewToCamera",
"(",
"int",
"viewIndex",
",",
"int",
"cameraIndex",
")",
"{",
"if",
"(",
"views",
"[",
"viewIndex",
"]",
".",
"camera",
"!=",
"-",
"1",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"View has already been assigned a cam... | Specifies that the view uses the specified camera
@param viewIndex index of view
@param cameraIndex index of camera | [
"Specifies",
"that",
"the",
"view",
"uses",
"the",
"specified",
"camera"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L183-L187 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.getUnknownCameraCount | public int getUnknownCameraCount() {
int total = 0;
for (int i = 0; i < cameras.length; i++) {
if( !cameras[i].known) {
total++;
}
}
return total;
} | java | public int getUnknownCameraCount() {
int total = 0;
for (int i = 0; i < cameras.length; i++) {
if( !cameras[i].known) {
total++;
}
}
return total;
} | [
"public",
"int",
"getUnknownCameraCount",
"(",
")",
"{",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cameras",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"cameras",
"[",
"i",
"]",
".",
"known",... | Returns the number of cameras with parameters that are not fixed
@return non-fixed camera count | [
"Returns",
"the",
"number",
"of",
"cameras",
"with",
"parameters",
"that",
"are",
"not",
"fixed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L193-L201 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.getTotalRigidPoints | public int getTotalRigidPoints() {
if( rigids == null )
return 0;
int total = 0;
for (int i = 0; i < rigids.length; i++) {
total += rigids[i].points.length;
}
return total;
} | java | public int getTotalRigidPoints() {
if( rigids == null )
return 0;
int total = 0;
for (int i = 0; i < rigids.length; i++) {
total += rigids[i].points.length;
}
return total;
} | [
"public",
"int",
"getTotalRigidPoints",
"(",
")",
"{",
"if",
"(",
"rigids",
"==",
"null",
")",
"return",
"0",
";",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"rigids",
".",
"length",
";",
"i",
"++",
")",
"{"... | Returns total number of points associated with rigid objects. | [
"Returns",
"total",
"number",
"of",
"points",
"associated",
"with",
"rigid",
"objects",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L249-L258 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java | FactoryKernel.random | public static <T extends KernelBase> T random( Class<?> type , int radius , int min , int max , Random rand )
{
int width = radius*2+1;
return random(type,width,radius,min,max,rand);
} | java | public static <T extends KernelBase> T random( Class<?> type , int radius , int min , int max , Random rand )
{
int width = radius*2+1;
return random(type,width,radius,min,max,rand);
} | [
"public",
"static",
"<",
"T",
"extends",
"KernelBase",
">",
"T",
"random",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"int",
"radius",
",",
"int",
"min",
",",
"int",
"max",
",",
"Random",
"rand",
")",
"{",
"int",
"width",
"=",
"radius",
"*",
"2",
... | Creates a random kernel of the specified type where each element is drawn from an uniform
distribution.
@param type Class of the kernel which is to be created.
@param radius The kernel's radius.
@param min Min value.
@param max Max value.
@param rand Random number generator.
@return The generated kernel. | [
"Creates",
"a",
"random",
"kernel",
"of",
"the",
"specified",
"type",
"where",
"each",
"element",
"is",
"drawn",
"from",
"an",
"uniform",
"distribution",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java#L187-L192 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java | FastHessianFeatureDetector.detect | public void detect( II integral ) {
if( intensity == null ) {
intensity = new GrayF32[3];
for( int i = 0; i < intensity.length; i++ ) {
intensity[i] = new GrayF32(integral.width,integral.height);
}
}
foundPoints.reset();
// computes feature intensity every 'skip' pixels
int skip = initialSampleR... | java | public void detect( II integral ) {
if( intensity == null ) {
intensity = new GrayF32[3];
for( int i = 0; i < intensity.length; i++ ) {
intensity[i] = new GrayF32(integral.width,integral.height);
}
}
foundPoints.reset();
// computes feature intensity every 'skip' pixels
int skip = initialSampleR... | [
"public",
"void",
"detect",
"(",
"II",
"integral",
")",
"{",
"if",
"(",
"intensity",
"==",
"null",
")",
"{",
"intensity",
"=",
"new",
"GrayF32",
"[",
"3",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"intensity",
".",
"length",
";",... | Detect interest points inside of the image.
@param integral Image transformed into an integral image. | [
"Detect",
"interest",
"points",
"inside",
"of",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java#L156-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java | FastHessianFeatureDetector.detectOctave | protected void detectOctave( II integral , int skip , int ...featureSize ) {
int w = integral.width/skip;
int h = integral.height/skip;
// resize the output intensity image taking in account subsampling
for( int i = 0; i < intensity.length; i++ ) {
intensity[i].reshape(w,h);
}
// compute feature inten... | java | protected void detectOctave( II integral , int skip , int ...featureSize ) {
int w = integral.width/skip;
int h = integral.height/skip;
// resize the output intensity image taking in account subsampling
for( int i = 0; i < intensity.length; i++ ) {
intensity[i].reshape(w,h);
}
// compute feature inten... | [
"protected",
"void",
"detectOctave",
"(",
"II",
"integral",
",",
"int",
"skip",
",",
"int",
"...",
"featureSize",
")",
"{",
"int",
"w",
"=",
"integral",
".",
"width",
"/",
"skip",
";",
"int",
"h",
"=",
"integral",
".",
"height",
"/",
"skip",
";",
"//... | Computes feature intensities for all the specified feature sizes and finds features
inside of the middle feature sizes.
@param integral Integral image.
@param skip Pixel skip factor
@param featureSize which feature sizes should be detected. | [
"Computes",
"feature",
"intensities",
"for",
"all",
"the",
"specified",
"feature",
"sizes",
"and",
"finds",
"features",
"inside",
"of",
"the",
"middle",
"feature",
"sizes",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java#L198-L221 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java | FastHessianFeatureDetector.checkMax | protected static boolean checkMax(ImageBorder_F32 inten, float bestScore, int c_x, int c_y) {
for( int y = c_y -1; y <= c_y+1; y++ ) {
for( int x = c_x-1; x <= c_x+1; x++ ) {
if( inten.get(x,y) >= bestScore ) {
return false;
}
}
}
return true;
} | java | protected static boolean checkMax(ImageBorder_F32 inten, float bestScore, int c_x, int c_y) {
for( int y = c_y -1; y <= c_y+1; y++ ) {
for( int x = c_x-1; x <= c_x+1; x++ ) {
if( inten.get(x,y) >= bestScore ) {
return false;
}
}
}
return true;
} | [
"protected",
"static",
"boolean",
"checkMax",
"(",
"ImageBorder_F32",
"inten",
",",
"float",
"bestScore",
",",
"int",
"c_x",
",",
"int",
"c_y",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"c_y",
"-",
"1",
";",
"y",
"<=",
"c_y",
"+",
"1",
";",
"y",
"++",... | Sees if the best score in the current layer is greater than all the scores in a 3x3 neighborhood
in another layer. | [
"Sees",
"if",
"the",
"best",
"score",
"in",
"the",
"current",
"layer",
"is",
"greater",
"than",
"all",
"the",
"scores",
"in",
"a",
"3x3",
"neighborhood",
"in",
"another",
"layer",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FastHessianFeatureDetector.java#L304-L313 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.process | public void process(T gray, GrayU8 binary ) {
configureContourDetector(gray);
recycleData();
positionPatterns.reset();
interpolate.setImage(gray);
// detect squares
squareDetector.process(gray,binary);
long time0 = System.nanoTime();
squaresToPositionList();
long time1 = System.nanoTime();
// Cr... | java | public void process(T gray, GrayU8 binary ) {
configureContourDetector(gray);
recycleData();
positionPatterns.reset();
interpolate.setImage(gray);
// detect squares
squareDetector.process(gray,binary);
long time0 = System.nanoTime();
squaresToPositionList();
long time1 = System.nanoTime();
// Cr... | [
"public",
"void",
"process",
"(",
"T",
"gray",
",",
"GrayU8",
"binary",
")",
"{",
"configureContourDetector",
"(",
"gray",
")",
";",
"recycleData",
"(",
")",
";",
"positionPatterns",
".",
"reset",
"(",
")",
";",
"interpolate",
".",
"setImage",
"(",
"gray",... | Detects position patterns inside the image and forms a graph.
@param gray Gray scale input image
@param binary Thresholed version of gray image. | [
"Detects",
"position",
"patterns",
"inside",
"the",
"image",
"and",
"forms",
"a",
"graph",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L121-L149 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.createPositionPatternGraph | private void createPositionPatternGraph() {
// Add items to NN search
nn.setPoints((List)positionPatterns.toList(),false);
for (int i = 0; i < positionPatterns.size(); i++) {
PositionPatternNode f = positionPatterns.get(i);
// The QR code version specifies the number of "modules"/blocks across the marker... | java | private void createPositionPatternGraph() {
// Add items to NN search
nn.setPoints((List)positionPatterns.toList(),false);
for (int i = 0; i < positionPatterns.size(); i++) {
PositionPatternNode f = positionPatterns.get(i);
// The QR code version specifies the number of "modules"/blocks across the marker... | [
"private",
"void",
"createPositionPatternGraph",
"(",
")",
"{",
"// Add items to NN search",
"nn",
".",
"setPoints",
"(",
"(",
"List",
")",
"positionPatterns",
".",
"toList",
"(",
")",
",",
"false",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | Connects together position patterns. For each square, finds all of its neighbors based on center distance.
Then considers them for connections | [
"Connects",
"together",
"position",
"patterns",
".",
"For",
"each",
"square",
"finds",
"all",
"of",
"its",
"neighbors",
"based",
"on",
"center",
"distance",
".",
"Then",
"considers",
"them",
"for",
"connections"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L241-L269 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.considerConnect | void considerConnect(SquareNode node0, SquareNode node1) {
// Find the side on each line which intersects the line connecting the two centers
lineA.a = node0.center;
lineA.b = node1.center;
int intersection0 = graph.findSideIntersect(node0,lineA,intersection,lineB);
connectLine.a.set(intersection);
int int... | java | void considerConnect(SquareNode node0, SquareNode node1) {
// Find the side on each line which intersects the line connecting the two centers
lineA.a = node0.center;
lineA.b = node1.center;
int intersection0 = graph.findSideIntersect(node0,lineA,intersection,lineB);
connectLine.a.set(intersection);
int int... | [
"void",
"considerConnect",
"(",
"SquareNode",
"node0",
",",
"SquareNode",
"node1",
")",
"{",
"// Find the side on each line which intersects the line connecting the two centers",
"lineA",
".",
"a",
"=",
"node0",
".",
"center",
";",
"lineA",
".",
"b",
"=",
"node1",
"."... | Connects the 'candidate' node to node 'n' if they meet several criteria. See code for details. | [
"Connects",
"the",
"candidate",
"node",
"to",
"node",
"n",
"if",
"they",
"meet",
"several",
"criteria",
".",
"See",
"code",
"for",
"details",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L274-L322 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.checkPositionPatternAppearance | boolean checkPositionPatternAppearance( Polygon2D_F64 square , float grayThreshold ) {
return( checkLine(square,grayThreshold,0) || checkLine(square,grayThreshold,1));
} | java | boolean checkPositionPatternAppearance( Polygon2D_F64 square , float grayThreshold ) {
return( checkLine(square,grayThreshold,0) || checkLine(square,grayThreshold,1));
} | [
"boolean",
"checkPositionPatternAppearance",
"(",
"Polygon2D_F64",
"square",
",",
"float",
"grayThreshold",
")",
"{",
"return",
"(",
"checkLine",
"(",
"square",
",",
"grayThreshold",
",",
"0",
")",
"||",
"checkLine",
"(",
"square",
",",
"grayThreshold",
",",
"1"... | Determines if the found polygon looks like a position pattern. A horizontal and vertical line are sampled.
At each sample point it is marked if it is above or below the binary threshold for this square. Location
of sample points is found by "removing" perspective distortion.
@param square Position pattern square. | [
"Determines",
"if",
"the",
"found",
"polygon",
"looks",
"like",
"a",
"position",
"pattern",
".",
"A",
"horizontal",
"and",
"vertical",
"line",
"are",
"sampled",
".",
"At",
"each",
"sample",
"point",
"it",
"is",
"marked",
"if",
"it",
"is",
"above",
"or",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L331-L333 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.positionSquareIntensityCheck | static boolean positionSquareIntensityCheck(float values[] , float threshold ) {
if( values[0] > threshold || values[1] < threshold )
return false;
if( values[2] > threshold || values[3] > threshold || values[4] > threshold )
return false;
if( values[5] < threshold || values[6] > threshold )
return fals... | java | static boolean positionSquareIntensityCheck(float values[] , float threshold ) {
if( values[0] > threshold || values[1] < threshold )
return false;
if( values[2] > threshold || values[3] > threshold || values[4] > threshold )
return false;
if( values[5] < threshold || values[6] > threshold )
return fals... | [
"static",
"boolean",
"positionSquareIntensityCheck",
"(",
"float",
"values",
"[",
"]",
",",
"float",
"threshold",
")",
"{",
"if",
"(",
"values",
"[",
"0",
"]",
">",
"threshold",
"||",
"values",
"[",
"1",
"]",
"<",
"threshold",
")",
"return",
"false",
";"... | Checks to see if the array of sampled intensity values follows the expected pattern for a position pattern.
X.XXX.X where x = black and . = white. | [
"Checks",
"to",
"see",
"if",
"the",
"array",
"of",
"sampled",
"intensity",
"values",
"follows",
"the",
"expected",
"pattern",
"for",
"a",
"position",
"pattern",
".",
"X",
".",
"XXX",
".",
"X",
"where",
"x",
"=",
"black",
"and",
".",
"=",
"white",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L422-L430 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyCalibrated.java | RectifyCalibrated.process | public void process( DMatrixRMaj K1 , Se3_F64 worldToCamera1 ,
DMatrixRMaj K2 , Se3_F64 worldToCamera2 )
{
SimpleMatrix sK1 = SimpleMatrix.wrap(K1);
SimpleMatrix sK2 = SimpleMatrix.wrap(K2);
SimpleMatrix R1 = SimpleMatrix.wrap(worldToCamera1.getR());
SimpleMatrix R2 = SimpleMatrix.wrap(worldToCamera2.ge... | java | public void process( DMatrixRMaj K1 , Se3_F64 worldToCamera1 ,
DMatrixRMaj K2 , Se3_F64 worldToCamera2 )
{
SimpleMatrix sK1 = SimpleMatrix.wrap(K1);
SimpleMatrix sK2 = SimpleMatrix.wrap(K2);
SimpleMatrix R1 = SimpleMatrix.wrap(worldToCamera1.getR());
SimpleMatrix R2 = SimpleMatrix.wrap(worldToCamera2.ge... | [
"public",
"void",
"process",
"(",
"DMatrixRMaj",
"K1",
",",
"Se3_F64",
"worldToCamera1",
",",
"DMatrixRMaj",
"K2",
",",
"Se3_F64",
"worldToCamera2",
")",
"{",
"SimpleMatrix",
"sK1",
"=",
"SimpleMatrix",
".",
"wrap",
"(",
"K1",
")",
";",
"SimpleMatrix",
"sK2",
... | Computes rectification transforms for both cameras and optionally a single calibration
matrix.
@param K1 Calibration matrix for first camera.
@param worldToCamera1 Location of the first camera.
@param K2 Calibration matrix for second camera.
@param worldToCamera2 Location of the second camera. | [
"Computes",
"rectification",
"transforms",
"for",
"both",
"cameras",
"and",
"optionally",
"a",
"single",
"calibration",
"matrix",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyCalibrated.java#L79-L123 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyCalibrated.java | RectifyCalibrated.selectAxises | private void selectAxises(SimpleMatrix R1, SimpleMatrix R2, SimpleMatrix c1, SimpleMatrix c2) {
// --------- Compute the new x-axis
v1.set(c2.get(0) - c1.get(0), c2.get(1) - c1.get(1), c2.get(2) - c1.get(2));
v1.normalize();
// --------- Compute the new y-axis
// cross product of old z axis and new x axis
... | java | private void selectAxises(SimpleMatrix R1, SimpleMatrix R2, SimpleMatrix c1, SimpleMatrix c2) {
// --------- Compute the new x-axis
v1.set(c2.get(0) - c1.get(0), c2.get(1) - c1.get(1), c2.get(2) - c1.get(2));
v1.normalize();
// --------- Compute the new y-axis
// cross product of old z axis and new x axis
... | [
"private",
"void",
"selectAxises",
"(",
"SimpleMatrix",
"R1",
",",
"SimpleMatrix",
"R2",
",",
"SimpleMatrix",
"c1",
",",
"SimpleMatrix",
"c2",
")",
"{",
"// --------- Compute the new x-axis",
"v1",
".",
"set",
"(",
"c2",
".",
"get",
"(",
"0",
")",
"-",
"c1",... | Selects axises of new coordinate system | [
"Selects",
"axises",
"of",
"new",
"coordinate",
"system"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/rectify/RectifyCalibrated.java#L128-L151 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo2Line.java | HomographyInducedStereo2Line.process | public boolean process(PairLineNorm line0, PairLineNorm line1) {
// Find plane equations of second lines in the first view
double a0 = GeometryMath_F64.dot(e2,line0.l2);
double a1 = GeometryMath_F64.dot(e2,line1.l2);
GeometryMath_F64.multTran(A,line0.l2,Al0);
GeometryMath_F64.multTran(A,line1.l2,Al1);
//... | java | public boolean process(PairLineNorm line0, PairLineNorm line1) {
// Find plane equations of second lines in the first view
double a0 = GeometryMath_F64.dot(e2,line0.l2);
double a1 = GeometryMath_F64.dot(e2,line1.l2);
GeometryMath_F64.multTran(A,line0.l2,Al0);
GeometryMath_F64.multTran(A,line1.l2,Al1);
//... | [
"public",
"boolean",
"process",
"(",
"PairLineNorm",
"line0",
",",
"PairLineNorm",
"line1",
")",
"{",
"// Find plane equations of second lines in the first view",
"double",
"a0",
"=",
"GeometryMath_F64",
".",
"dot",
"(",
"e2",
",",
"line0",
".",
"l2",
")",
";",
"d... | Computes the homography based on two unique lines on the plane
@param line0 Line on the plane
@param line1 Line on the plane | [
"Computes",
"the",
"homography",
"based",
"on",
"two",
"unique",
"lines",
"on",
"the",
"plane"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo2Line.java#L110-L159 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java | DetectFiducialSquareBinary.extractNumeral | protected int extractNumeral() {
int val = 0;
final int topLeft = getTotalGridElements() - gridWidth;
int shift = 0;
// -2 because the top and bottom rows have 2 unusable bits (the first and last)
for(int i = 1; i < gridWidth - 1; i++) {
final int idx = topLeft + i;
val |= classified[idx] << shift;
... | java | protected int extractNumeral() {
int val = 0;
final int topLeft = getTotalGridElements() - gridWidth;
int shift = 0;
// -2 because the top and bottom rows have 2 unusable bits (the first and last)
for(int i = 1; i < gridWidth - 1; i++) {
final int idx = topLeft + i;
val |= classified[idx] << shift;
... | [
"protected",
"int",
"extractNumeral",
"(",
")",
"{",
"int",
"val",
"=",
"0",
";",
"final",
"int",
"topLeft",
"=",
"getTotalGridElements",
"(",
")",
"-",
"gridWidth",
";",
"int",
"shift",
"=",
"0",
";",
"// -2 because the top and bottom rows have 2 unusable bits (t... | Extract the numerical value it encodes
@return the int value of the numeral. | [
"Extract",
"the",
"numerical",
"value",
"it",
"encodes"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java#L151-L182 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java | DetectFiducialSquareBinary.rotateUntilInLowerCorner | private boolean rotateUntilInLowerCorner(Result result) {
// sanity check corners. There should only be one exactly one black
final int topLeft = getTotalGridElements() - gridWidth;
final int topRight = getTotalGridElements() - 1;
final int bottomLeft = 0;
final int bottomRight = gridWidth - 1;
if (classi... | java | private boolean rotateUntilInLowerCorner(Result result) {
// sanity check corners. There should only be one exactly one black
final int topLeft = getTotalGridElements() - gridWidth;
final int topRight = getTotalGridElements() - 1;
final int bottomLeft = 0;
final int bottomRight = gridWidth - 1;
if (classi... | [
"private",
"boolean",
"rotateUntilInLowerCorner",
"(",
"Result",
"result",
")",
"{",
"// sanity check corners. There should only be one exactly one black",
"final",
"int",
"topLeft",
"=",
"getTotalGridElements",
"(",
")",
"-",
"gridWidth",
";",
"final",
"int",
"topRight",
... | Rotate the pattern until the black corner is in the lower right. Sanity check to make
sure there is only one black corner | [
"Rotate",
"the",
"pattern",
"until",
"the",
"black",
"corner",
"is",
"in",
"the",
"lower",
"right",
".",
"Sanity",
"check",
"to",
"make",
"sure",
"there",
"is",
"only",
"one",
"black",
"corner"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java#L188-L206 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java | DetectFiducialSquareBinary.thresholdBinaryNumber | protected boolean thresholdBinaryNumber() {
int lower = (int) (N * (ambiguityThreshold / 2.0));
int upper = (int) (N * (1 - ambiguityThreshold / 2.0));
final int totalElements = getTotalGridElements();
for (int i = 0; i < totalElements; i++) {
if (counts[i] < lower) {
classified[i] = 0;
} else if (c... | java | protected boolean thresholdBinaryNumber() {
int lower = (int) (N * (ambiguityThreshold / 2.0));
int upper = (int) (N * (1 - ambiguityThreshold / 2.0));
final int totalElements = getTotalGridElements();
for (int i = 0; i < totalElements; i++) {
if (counts[i] < lower) {
classified[i] = 0;
} else if (c... | [
"protected",
"boolean",
"thresholdBinaryNumber",
"(",
")",
"{",
"int",
"lower",
"=",
"(",
"int",
")",
"(",
"N",
"*",
"(",
"ambiguityThreshold",
"/",
"2.0",
")",
")",
";",
"int",
"upper",
"=",
"(",
"int",
")",
"(",
"N",
"*",
"(",
"1",
"-",
"ambiguit... | Sees how many pixels were positive and negative in each square region. Then decides if they
should be 0 or 1 or unknown | [
"Sees",
"how",
"many",
"pixels",
"were",
"positive",
"and",
"negative",
"in",
"each",
"square",
"region",
".",
"Then",
"decides",
"if",
"they",
"should",
"be",
"0",
"or",
"1",
"or",
"unknown"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java#L229-L246 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java | DetectFiducialSquareBinary.findBitCounts | protected void findBitCounts(GrayF32 gray , double threshold ) {
// compute binary image using an adaptive algorithm to handle shadows
ThresholdImageOps.threshold(gray,binaryInner,(float)threshold,true);
Arrays.fill(counts, 0);
for (int row = 0; row < gridWidth; row++) {
int y0 = row * binaryInner.width / g... | java | protected void findBitCounts(GrayF32 gray , double threshold ) {
// compute binary image using an adaptive algorithm to handle shadows
ThresholdImageOps.threshold(gray,binaryInner,(float)threshold,true);
Arrays.fill(counts, 0);
for (int row = 0; row < gridWidth; row++) {
int y0 = row * binaryInner.width / g... | [
"protected",
"void",
"findBitCounts",
"(",
"GrayF32",
"gray",
",",
"double",
"threshold",
")",
"{",
"// compute binary image using an adaptive algorithm to handle shadows",
"ThresholdImageOps",
".",
"threshold",
"(",
"gray",
",",
"binaryInner",
",",
"(",
"float",
")",
"... | Converts the gray scale image into a binary number. Skip the outer 1 pixel of each inner square. These
tend to be incorrectly classified due to distortion. | [
"Converts",
"the",
"gray",
"scale",
"image",
"into",
"a",
"binary",
"number",
".",
"Skip",
"the",
"outer",
"1",
"pixel",
"of",
"each",
"inner",
"square",
".",
"These",
"tend",
"to",
"be",
"incorrectly",
"classified",
"due",
"to",
"distortion",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java#L252-L275 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java | DetectFiducialSquareBinary.printClassified | public void printClassified() {
System.out.println();
System.out.println(" ");
for (int row = 0; row < gridWidth; row++) {
System.out.print(" ");
for (int col = 0; col < gridWidth; col++) {
System.out.print(classified[row * gridWidth + col] == 1 ? " " : "X");
}
System.out.print(" ");
Syste... | java | public void printClassified() {
System.out.println();
System.out.println(" ");
for (int row = 0; row < gridWidth; row++) {
System.out.print(" ");
for (int col = 0; col < gridWidth; col++) {
System.out.print(classified[row * gridWidth + col] == 1 ? " " : "X");
}
System.out.print(" ");
Syste... | [
"public",
"void",
"printClassified",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\" \"",
")",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"gridWidth",
";",
"row"... | This is only works well as a visual representation if the output font is mono spaced. | [
"This",
"is",
"only",
"works",
"well",
"as",
"a",
"visual",
"representation",
"if",
"the",
"output",
"font",
"is",
"mono",
"spaced",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareBinary.java#L318-L331 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/RefineThreeViewProjectiveGeometric.java | RefineThreeViewProjectiveGeometric.initializeStructure | private void initializeStructure(List<AssociatedTriple> listObs, DMatrixRMaj P2, DMatrixRMaj P3) {
List<DMatrixRMaj> cameraMatrices = new ArrayList<>();
cameraMatrices.add(P1);
cameraMatrices.add(P2);
cameraMatrices.add(P3);
List<Point2D_F64> triangObs = new ArrayList<>();
triangObs.add(null);
triangObs.... | java | private void initializeStructure(List<AssociatedTriple> listObs, DMatrixRMaj P2, DMatrixRMaj P3) {
List<DMatrixRMaj> cameraMatrices = new ArrayList<>();
cameraMatrices.add(P1);
cameraMatrices.add(P2);
cameraMatrices.add(P3);
List<Point2D_F64> triangObs = new ArrayList<>();
triangObs.add(null);
triangObs.... | [
"private",
"void",
"initializeStructure",
"(",
"List",
"<",
"AssociatedTriple",
">",
"listObs",
",",
"DMatrixRMaj",
"P2",
",",
"DMatrixRMaj",
"P3",
")",
"{",
"List",
"<",
"DMatrixRMaj",
">",
"cameraMatrices",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ca... | Sets up data structures for SBA | [
"Sets",
"up",
"data",
"structures",
"for",
"SBA"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/RefineThreeViewProjectiveGeometric.java#L134-L179 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/BaseAssociateLocation2DFilter.java | BaseAssociateLocation2DFilter.backwardsValidation | private boolean backwardsValidation(int indexSrc, int bestIndex) {
double bestScoreV = maxError;
int bestIndexV = -1;
D d_forward = descDst.get(bestIndex);
setActiveSource(locationDst.get(bestIndex));
for( int j = 0; j < locationSrc.size(); j++ ) {
// compute distance between the two features
double ... | java | private boolean backwardsValidation(int indexSrc, int bestIndex) {
double bestScoreV = maxError;
int bestIndexV = -1;
D d_forward = descDst.get(bestIndex);
setActiveSource(locationDst.get(bestIndex));
for( int j = 0; j < locationSrc.size(); j++ ) {
// compute distance between the two features
double ... | [
"private",
"boolean",
"backwardsValidation",
"(",
"int",
"indexSrc",
",",
"int",
"bestIndex",
")",
"{",
"double",
"bestScoreV",
"=",
"maxError",
";",
"int",
"bestIndexV",
"=",
"-",
"1",
";",
"D",
"d_forward",
"=",
"descDst",
".",
"get",
"(",
"bestIndex",
"... | Finds the best match for an index in destination and sees if it matches the source index
@param indexSrc The index in source being examined
@param bestIndex Index in dst with the best fit to source
@return true if a match was found and false if not | [
"Finds",
"the",
"best",
"match",
"for",
"an",
"index",
"in",
"destination",
"and",
"sees",
"if",
"it",
"matches",
"the",
"source",
"index"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/BaseAssociateLocation2DFilter.java#L167-L191 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java | PixelMath.multiply | public static void multiply( GrayU8 input , double value , GrayU8 output ) {
output.reshape(input.width,input.height);
int columns = input.width;
if(BoofConcurrency.USE_CONCURRENT ) {
ImplPixelMath_MT.multiplyU_A(input.data,input.startIndex,input.stride,value ,
output.data,output.startIndex,output.stri... | java | public static void multiply( GrayU8 input , double value , GrayU8 output ) {
output.reshape(input.width,input.height);
int columns = input.width;
if(BoofConcurrency.USE_CONCURRENT ) {
ImplPixelMath_MT.multiplyU_A(input.data,input.startIndex,input.stride,value ,
output.data,output.startIndex,output.stri... | [
"public",
"static",
"void",
"multiply",
"(",
"GrayU8",
"input",
",",
"double",
"value",
",",
"GrayU8",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"int",
"columns",
"=",
"input",
".",... | Multiply each element by a scalar value. Both input and output images can
be the same instance.
@param input The input image. Not modified.
@param value What each element is multiplied by.
@param output The output image. Modified. | [
"Multiply",
"each",
"element",
"by",
"a",
"scalar",
"value",
".",
"Both",
"input",
"and",
"output",
"images",
"can",
"be",
"the",
"same",
"instance",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java#L587-L601 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java | PixelMath.divide | public static void divide( GrayU8 input , double denominator , GrayU8 output ) {
output.reshape(input.width,input.height);
int columns = input.width;
if(BoofConcurrency.USE_CONCURRENT ) {
ImplPixelMath_MT.divideU_A(input.data,input.startIndex,input.stride,denominator ,
output.data,output.startIndex,out... | java | public static void divide( GrayU8 input , double denominator , GrayU8 output ) {
output.reshape(input.width,input.height);
int columns = input.width;
if(BoofConcurrency.USE_CONCURRENT ) {
ImplPixelMath_MT.divideU_A(input.data,input.startIndex,input.stride,denominator ,
output.data,output.startIndex,out... | [
"public",
"static",
"void",
"divide",
"(",
"GrayU8",
"input",
",",
"double",
"denominator",
",",
"GrayU8",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"int",
"columns",
"=",
"input",
... | Divide each element by a scalar value. Both input and output images can be the same instance.
@param input The input image. Not modified.
@param denominator What each element is divided by.
@param output The output image. Modified. | [
"Divide",
"each",
"element",
"by",
"a",
"scalar",
"value",
".",
"Both",
"input",
"and",
"output",
"images",
"can",
"be",
"the",
"same",
"instance",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java#L1354-L1368 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/PyramidKltForCombined.java | PyramidKltForCombined.performTracking | public boolean performTracking( PyramidKltFeature feature ) {
KltTrackFault result = tracker.track(feature);
if( result != KltTrackFault.SUCCESS ) {
return false;
} else {
tracker.setDescription(feature);
return true;
}
} | java | public boolean performTracking( PyramidKltFeature feature ) {
KltTrackFault result = tracker.track(feature);
if( result != KltTrackFault.SUCCESS ) {
return false;
} else {
tracker.setDescription(feature);
return true;
}
} | [
"public",
"boolean",
"performTracking",
"(",
"PyramidKltFeature",
"feature",
")",
"{",
"KltTrackFault",
"result",
"=",
"tracker",
".",
"track",
"(",
"feature",
")",
";",
"if",
"(",
"result",
"!=",
"KltTrackFault",
".",
"SUCCESS",
")",
"{",
"return",
"false",
... | Updates the track using the latest inputs. If tracking fails then the feature description
in each layer is unchanged and its global position.
@param feature Feature being updated
@return true if tracking was successful, false otherwise | [
"Updates",
"the",
"track",
"using",
"the",
"latest",
"inputs",
".",
"If",
"tracking",
"fails",
"then",
"the",
"feature",
"description",
"in",
"each",
"layer",
"is",
"unchanged",
"and",
"its",
"global",
"position",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/PyramidKltForCombined.java#L79-L89 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java | ShowImages.showDialog | public static void showDialog(BufferedImage img) {
ImageIcon icon = new ImageIcon();
icon.setImage(img);
JOptionPane.showMessageDialog(null, icon);
} | java | public static void showDialog(BufferedImage img) {
ImageIcon icon = new ImageIcon();
icon.setImage(img);
JOptionPane.showMessageDialog(null, icon);
} | [
"public",
"static",
"void",
"showDialog",
"(",
"BufferedImage",
"img",
")",
"{",
"ImageIcon",
"icon",
"=",
"new",
"ImageIcon",
"(",
")",
";",
"icon",
".",
"setImage",
"(",
"img",
")",
";",
"JOptionPane",
".",
"showMessageDialog",
"(",
"null",
",",
"icon",
... | Creates a dialog window showing the specified image. The function will not
exit until the user clicks ok | [
"Creates",
"a",
"dialog",
"window",
"showing",
"the",
"specified",
"image",
".",
"The",
"function",
"will",
"not",
"exit",
"until",
"the",
"user",
"clicks",
"ok"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java#L42-L46 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java | ShowImages.showGrid | public static ImageGridPanel showGrid( int numColumns , String title , BufferedImage ...images ) {
JFrame frame = new JFrame(title);
int numRows = images.length/numColumns + images.length%numColumns;
ImageGridPanel panel = new ImageGridPanel(numRows,numColumns,images);
frame.add(panel, BorderLayout.CENTER);
... | java | public static ImageGridPanel showGrid( int numColumns , String title , BufferedImage ...images ) {
JFrame frame = new JFrame(title);
int numRows = images.length/numColumns + images.length%numColumns;
ImageGridPanel panel = new ImageGridPanel(numRows,numColumns,images);
frame.add(panel, BorderLayout.CENTER);
... | [
"public",
"static",
"ImageGridPanel",
"showGrid",
"(",
"int",
"numColumns",
",",
"String",
"title",
",",
"BufferedImage",
"...",
"images",
")",
"{",
"JFrame",
"frame",
"=",
"new",
"JFrame",
"(",
"title",
")",
";",
"int",
"numRows",
"=",
"images",
".",
"len... | Shows a set of images in a grid pattern.
@param numColumns How many columns are in the grid
@param title Number of the window
@param images List of images to show
@return Display panel | [
"Shows",
"a",
"set",
"of",
"images",
"in",
"a",
"grid",
"pattern",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java#L56-L68 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java | ShowImages.setupWindow | public static JFrame setupWindow( final JComponent component , String title, final boolean closeOnExit ) {
BoofSwingUtil.checkGuiThread();
final JFrame frame = new JFrame(title);
frame.add(component, BorderLayout.CENTER);
frame.pack();
frame.setLocationRelativeTo(null); // centers window in the monitor
if... | java | public static JFrame setupWindow( final JComponent component , String title, final boolean closeOnExit ) {
BoofSwingUtil.checkGuiThread();
final JFrame frame = new JFrame(title);
frame.add(component, BorderLayout.CENTER);
frame.pack();
frame.setLocationRelativeTo(null); // centers window in the monitor
if... | [
"public",
"static",
"JFrame",
"setupWindow",
"(",
"final",
"JComponent",
"component",
",",
"String",
"title",
",",
"final",
"boolean",
"closeOnExit",
")",
"{",
"BoofSwingUtil",
".",
"checkGuiThread",
"(",
")",
";",
"final",
"JFrame",
"frame",
"=",
"new",
"JFra... | Sets up the window but doesn't show it. Must be called in a GUI thread | [
"Sets",
"up",
"the",
"window",
"but",
"doesn",
"t",
"show",
"it",
".",
"Must",
"be",
"called",
"in",
"a",
"GUI",
"thread"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java#L145-L157 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/imageprocessing/ExampleFourierTransform.java | ExampleFourierTransform.applyBoxFilter | public static void applyBoxFilter( GrayF32 input ) {
// declare storage
GrayF32 boxImage = new GrayF32(input.width, input.height);
InterleavedF32 boxTransform = new InterleavedF32(input.width,input.height,2);
InterleavedF32 transform = new InterleavedF32(input.width,input.height,2);
GrayF32 blurredImage = ne... | java | public static void applyBoxFilter( GrayF32 input ) {
// declare storage
GrayF32 boxImage = new GrayF32(input.width, input.height);
InterleavedF32 boxTransform = new InterleavedF32(input.width,input.height,2);
InterleavedF32 transform = new InterleavedF32(input.width,input.height,2);
GrayF32 blurredImage = ne... | [
"public",
"static",
"void",
"applyBoxFilter",
"(",
"GrayF32",
"input",
")",
"{",
"// declare storage",
"GrayF32",
"boxImage",
"=",
"new",
"GrayF32",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"InterleavedF32",
"boxTransform",
"=",
"new"... | Demonstration of how to apply a box filter in the frequency domain and compares the results
to a box filter which has been applied in the spatial domain | [
"Demonstration",
"of",
"how",
"to",
"apply",
"a",
"box",
"filter",
"in",
"the",
"frequency",
"domain",
"and",
"compares",
"the",
"results",
"to",
"a",
"box",
"filter",
"which",
"has",
"been",
"applied",
"in",
"the",
"spatial",
"domain"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExampleFourierTransform.java#L49-L111 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/imageprocessing/ExampleFourierTransform.java | ExampleFourierTransform.displayTransform | public static void displayTransform( InterleavedF32 transform , String name ) {
// declare storage
GrayF32 magnitude = new GrayF32(transform.width,transform.height);
GrayF32 phase = new GrayF32(transform.width,transform.height);
// Make a copy so that you don't modify the input
transform = transform.clone()... | java | public static void displayTransform( InterleavedF32 transform , String name ) {
// declare storage
GrayF32 magnitude = new GrayF32(transform.width,transform.height);
GrayF32 phase = new GrayF32(transform.width,transform.height);
// Make a copy so that you don't modify the input
transform = transform.clone()... | [
"public",
"static",
"void",
"displayTransform",
"(",
"InterleavedF32",
"transform",
",",
"String",
"name",
")",
"{",
"// declare storage",
"GrayF32",
"magnitude",
"=",
"new",
"GrayF32",
"(",
"transform",
".",
"width",
",",
"transform",
".",
"height",
")",
";",
... | Display the fourier transform's magnitude and phase. | [
"Display",
"the",
"fourier",
"transform",
"s",
"magnitude",
"and",
"phase",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExampleFourierTransform.java#L116-L141 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java | ExampleFundamentalMatrix.robustFundamental | public static DMatrixRMaj robustFundamental( List<AssociatedPair> matches ,
List<AssociatedPair> inliers , double inlierThreshold ) {
ConfigRansac configRansac = new ConfigRansac();
configRansac.inlierThreshold = inlierThreshold;
configRansac.maxIterations = 1000;
ConfigFundamental configFundament... | java | public static DMatrixRMaj robustFundamental( List<AssociatedPair> matches ,
List<AssociatedPair> inliers , double inlierThreshold ) {
ConfigRansac configRansac = new ConfigRansac();
configRansac.inlierThreshold = inlierThreshold;
configRansac.maxIterations = 1000;
ConfigFundamental configFundament... | [
"public",
"static",
"DMatrixRMaj",
"robustFundamental",
"(",
"List",
"<",
"AssociatedPair",
">",
"matches",
",",
"List",
"<",
"AssociatedPair",
">",
"inliers",
",",
"double",
"inlierThreshold",
")",
"{",
"ConfigRansac",
"configRansac",
"=",
"new",
"ConfigRansac",
... | Given a set of noisy observations, compute the Fundamental matrix while removing
the noise.
@param matches List of associated features between the two images
@param inliers List of feature pairs that were determined to not be noise.
@return The found fundamental matrix. | [
"Given",
"a",
"set",
"of",
"noisy",
"observations",
"compute",
"the",
"Fundamental",
"matrix",
"while",
"removing",
"the",
"noise",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java#L74-L107 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java | ExampleFundamentalMatrix.simpleFundamental | public static DMatrixRMaj simpleFundamental( List<AssociatedPair> matches ) {
// Use the 8-point algorithm since it will work with an arbitrary number of points
Estimate1ofEpipolar estimateF = FactoryMultiView.fundamental_1(EnumFundamental.LINEAR_8, 0);
DMatrixRMaj F = new DMatrixRMaj(3,3);
if( !estimateF.proc... | java | public static DMatrixRMaj simpleFundamental( List<AssociatedPair> matches ) {
// Use the 8-point algorithm since it will work with an arbitrary number of points
Estimate1ofEpipolar estimateF = FactoryMultiView.fundamental_1(EnumFundamental.LINEAR_8, 0);
DMatrixRMaj F = new DMatrixRMaj(3,3);
if( !estimateF.proc... | [
"public",
"static",
"DMatrixRMaj",
"simpleFundamental",
"(",
"List",
"<",
"AssociatedPair",
">",
"matches",
")",
"{",
"// Use the 8-point algorithm since it will work with an arbitrary number of points",
"Estimate1ofEpipolar",
"estimateF",
"=",
"FactoryMultiView",
".",
"fundament... | If the set of associated features are known to be correct, then the fundamental matrix can
be computed directly with a lot less code. The down side is that this technique is very
sensitive to noise. | [
"If",
"the",
"set",
"of",
"associated",
"features",
"are",
"known",
"to",
"be",
"correct",
"then",
"the",
"fundamental",
"matrix",
"can",
"be",
"computed",
"directly",
"with",
"a",
"lot",
"less",
"code",
".",
"The",
"down",
"side",
"is",
"that",
"this",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java#L114-L125 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.applyErrorCorrection | public boolean applyErrorCorrection( QrCode qr) {
// System.out.println("decoder ver "+qr.version);
// System.out.println("decoder mask "+qr.mask);
// System.out.println("decoder error "+qr.error);
QrCode.VersionInfo info = QrCode.VERSION_INFO[qr.version];
QrCode.BlockInfo block = info.levels.get(qr.error);
... | java | public boolean applyErrorCorrection( QrCode qr) {
// System.out.println("decoder ver "+qr.version);
// System.out.println("decoder mask "+qr.mask);
// System.out.println("decoder error "+qr.error);
QrCode.VersionInfo info = QrCode.VERSION_INFO[qr.version];
QrCode.BlockInfo block = info.levels.get(qr.error);
... | [
"public",
"boolean",
"applyErrorCorrection",
"(",
"QrCode",
"qr",
")",
"{",
"//\t\tSystem.out.println(\"decoder ver \"+qr.version);",
"//\t\tSystem.out.println(\"decoder mask \"+qr.mask);",
"//\t\tSystem.out.println(\"decoder error \"+qr.error);",
"QrCode",
".",
"VersionInfo",
"info",... | Reconstruct the data while applying error correction. | [
"Reconstruct",
"the",
"data",
"while",
"applying",
"error",
"correction",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L67-L95 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.updateModeLogic | private QrCode.Mode updateModeLogic( QrCode.Mode current , QrCode.Mode candidate )
{
if( current == candidate )
return current;
else if( current == QrCode.Mode.UNKNOWN ) {
return candidate;
} else {
return QrCode.Mode.MIXED;
}
} | java | private QrCode.Mode updateModeLogic( QrCode.Mode current , QrCode.Mode candidate )
{
if( current == candidate )
return current;
else if( current == QrCode.Mode.UNKNOWN ) {
return candidate;
} else {
return QrCode.Mode.MIXED;
}
} | [
"private",
"QrCode",
".",
"Mode",
"updateModeLogic",
"(",
"QrCode",
".",
"Mode",
"current",
",",
"QrCode",
".",
"Mode",
"candidate",
")",
"{",
"if",
"(",
"current",
"==",
"candidate",
")",
"return",
"current",
";",
"else",
"if",
"(",
"current",
"==",
"Qr... | If only one mode then that mode is used. If more than one mode is used then set to multiple | [
"If",
"only",
"one",
"mode",
"then",
"that",
"mode",
"is",
"used",
".",
"If",
"more",
"than",
"one",
"mode",
"is",
"used",
"then",
"set",
"to",
"multiple"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L188-L197 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.checkPaddingBytes | boolean checkPaddingBytes(QrCode qr, int lengthBytes) {
boolean a = true;
for (int i = lengthBytes; i < qr.corrected.length; i++) {
if (a) {
if (0b00110111 != (qr.corrected[i] & 0xFF))
return false;
} else {
if (0b10001000 != (qr.corrected[i] & 0xFF)) {
// the pattern starts over at the beg... | java | boolean checkPaddingBytes(QrCode qr, int lengthBytes) {
boolean a = true;
for (int i = lengthBytes; i < qr.corrected.length; i++) {
if (a) {
if (0b00110111 != (qr.corrected[i] & 0xFF))
return false;
} else {
if (0b10001000 != (qr.corrected[i] & 0xFF)) {
// the pattern starts over at the beg... | [
"boolean",
"checkPaddingBytes",
"(",
"QrCode",
"qr",
",",
"int",
"lengthBytes",
")",
"{",
"boolean",
"a",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"lengthBytes",
";",
"i",
"<",
"qr",
".",
"corrected",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Makes sure the used bytes have the expected values
@param lengthBytes Number of bytes that data should be been written to and not filled with padding. | [
"Makes",
"sure",
"the",
"used",
"bytes",
"have",
"the",
"expected",
"values"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L208-L231 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeNumeric | private int decodeNumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsNumeric(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
while( length >= 3 ) {
if( data.size < bitLocation+10 ) {
qr.failureCause = QrCod... | java | private int decodeNumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsNumeric(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
while( length >= 3 ) {
if( data.size < bitLocation+10 ) {
qr.failureCause = QrCod... | [
"private",
"int",
"decodeNumeric",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsNumeric",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"=",
"data"... | Decodes a numeric message
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"a",
"numeric",
"message"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L240-L287 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeAlphanumeric | private int decodeAlphanumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsAlphanumeric(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
while( length >= 2 ) {
if( data.size < bitLocation+11 ) {
qr.failureCau... | java | private int decodeAlphanumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsAlphanumeric(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
while( length >= 2 ) {
if( data.size < bitLocation+11 ) {
qr.failureCau... | [
"private",
"int",
"decodeAlphanumeric",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsAlphanumeric",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"="... | Decodes alphanumeric messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"alphanumeric",
"messages"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L296-L328 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeByte | private int decodeByte( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsBytes(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
if( length*8 > data.size-bitLocation ) {
qr.failureCause = QrCode.Failure.MESSAGE_OVERFLOW... | java | private int decodeByte( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsBytes(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
if( length*8 > data.size-bitLocation ) {
qr.failureCause = QrCode.Failure.MESSAGE_OVERFLOW... | [
"private",
"int",
"decodeByte",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsBytes",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"=",
"data",
"... | Decodes byte messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"byte",
"messages"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L337-L367 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeKanji | private int decodeKanji( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsKanji(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
byte rawdata[] = new byte[ length*2 ];
for (int i = 0; i < length; i++) {
if( data.siz... | java | private int decodeKanji( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsKanji(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
byte rawdata[] = new byte[ length*2 ];
for (int i = 0; i < length; i++) {
if( data.siz... | [
"private",
"int",
"decodeKanji",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsKanji",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"=",
"data",
... | Decodes Kanji messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"Kanji",
"messages"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L376-L414 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java | EllipseClustersIntoHexagonalGrid.selectSeedCorner | NodeInfo selectSeedCorner() {
NodeInfo best = null;
double bestScore = 0;
double minAngle = Math.PI+0.1;
for (int i = 0; i < contour.size; i++) {
NodeInfo info = contour.get(i);
if( info.angleBetween < minAngle )
continue;
Edge middleR = selectClosest(info.right,info,true);
if( middleR == nul... | java | NodeInfo selectSeedCorner() {
NodeInfo best = null;
double bestScore = 0;
double minAngle = Math.PI+0.1;
for (int i = 0; i < contour.size; i++) {
NodeInfo info = contour.get(i);
if( info.angleBetween < minAngle )
continue;
Edge middleR = selectClosest(info.right,info,true);
if( middleR == nul... | [
"NodeInfo",
"selectSeedCorner",
"(",
")",
"{",
"NodeInfo",
"best",
"=",
"null",
";",
"double",
"bestScore",
"=",
"0",
";",
"double",
"minAngle",
"=",
"Math",
".",
"PI",
"+",
"0.1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"contour",
".... | Pick a corner but avoid the pointy edges at the other end | [
"Pick",
"a",
"corner",
"but",
"avoid",
"the",
"pointy",
"edges",
"at",
"the",
"other",
"end"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java#L148-L186 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java | EllipseClustersIntoHexagonalGrid.bottomTwoColumns | static void bottomTwoColumns(NodeInfo first, NodeInfo second, List<NodeInfo> column0, List<NodeInfo> column1) {
column0.add(first);
column0.add(second);
NodeInfo a = selectClosestN(first,second);
if( a == null ) {
return;
}
a.marked = true;
column1.add(a);
NodeInfo b = second;
while( true ) {
... | java | static void bottomTwoColumns(NodeInfo first, NodeInfo second, List<NodeInfo> column0, List<NodeInfo> column1) {
column0.add(first);
column0.add(second);
NodeInfo a = selectClosestN(first,second);
if( a == null ) {
return;
}
a.marked = true;
column1.add(a);
NodeInfo b = second;
while( true ) {
... | [
"static",
"void",
"bottomTwoColumns",
"(",
"NodeInfo",
"first",
",",
"NodeInfo",
"second",
",",
"List",
"<",
"NodeInfo",
">",
"column0",
",",
"List",
"<",
"NodeInfo",
">",
"column1",
")",
"{",
"column0",
".",
"add",
"(",
"first",
")",
";",
"column0",
"."... | Traverses along the first two columns and sets them up | [
"Traverses",
"along",
"the",
"first",
"two",
"columns",
"and",
"sets",
"them",
"up"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java#L228-L253 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java | EllipseClustersIntoHexagonalGrid.selectClosest | static Edge selectClosest( NodeInfo a , NodeInfo b , boolean checkSide ) {
double bestScore = Double.MAX_VALUE;
Edge bestEdgeA = null;
Edge edgeAB = a.findEdge(b);
double distAB = a.distance(b);
if( edgeAB == null ) {
return null;// TODO BUG! FIX!
}
for (int i = 0; i < a.edges.size; i++) {
Edge ... | java | static Edge selectClosest( NodeInfo a , NodeInfo b , boolean checkSide ) {
double bestScore = Double.MAX_VALUE;
Edge bestEdgeA = null;
Edge edgeAB = a.findEdge(b);
double distAB = a.distance(b);
if( edgeAB == null ) {
return null;// TODO BUG! FIX!
}
for (int i = 0; i < a.edges.size; i++) {
Edge ... | [
"static",
"Edge",
"selectClosest",
"(",
"NodeInfo",
"a",
",",
"NodeInfo",
"b",
",",
"boolean",
"checkSide",
")",
"{",
"double",
"bestScore",
"=",
"Double",
".",
"MAX_VALUE",
";",
"Edge",
"bestEdgeA",
"=",
"null",
";",
"Edge",
"edgeAB",
"=",
"a",
".",
"fi... | Finds the closest that is the same distance from the two nodes and part of an approximate equilateral triangle | [
"Finds",
"the",
"closest",
"that",
"is",
"the",
"same",
"distance",
"from",
"the",
"two",
"nodes",
"and",
"part",
"of",
"an",
"approximate",
"equilateral",
"triangle"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java#L258-L314 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java | EllipseClustersIntoHexagonalGrid.selectClosestSide | static NodeInfo selectClosestSide( NodeInfo a , NodeInfo b ) {
double ratio = 1.7321;
NodeInfo best = null;
double bestDistance = Double.MAX_VALUE;
Edge bestEdgeA = null;
Edge bestEdgeB = null;
for (int i = 0; i < a.edges.size; i++) {
NodeInfo aa = a.edges.get(i).target;
if( aa.marked ) continue;
... | java | static NodeInfo selectClosestSide( NodeInfo a , NodeInfo b ) {
double ratio = 1.7321;
NodeInfo best = null;
double bestDistance = Double.MAX_VALUE;
Edge bestEdgeA = null;
Edge bestEdgeB = null;
for (int i = 0; i < a.edges.size; i++) {
NodeInfo aa = a.edges.get(i).target;
if( aa.marked ) continue;
... | [
"static",
"NodeInfo",
"selectClosestSide",
"(",
"NodeInfo",
"a",
",",
"NodeInfo",
"b",
")",
"{",
"double",
"ratio",
"=",
"1.7321",
";",
"NodeInfo",
"best",
"=",
"null",
";",
"double",
"bestDistance",
"=",
"Double",
".",
"MAX_VALUE",
";",
"Edge",
"bestEdgeA",... | Selects the closest node with the assumption that it's along the side of the grid. | [
"Selects",
"the",
"closest",
"node",
"with",
"the",
"assumption",
"that",
"it",
"s",
"along",
"the",
"side",
"of",
"the",
"grid",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoHexagonalGrid.java#L327-L388 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java | ColorYuv.rgbToYuv | public static void rgbToYuv( double r , double g , double b , double yuv[] ) {
double y = yuv[0] = 0.299*r + 0.587*g + 0.114*b;
yuv[1] = 0.492*(b-y);
yuv[2] = 0.877*(r-y);
} | java | public static void rgbToYuv( double r , double g , double b , double yuv[] ) {
double y = yuv[0] = 0.299*r + 0.587*g + 0.114*b;
yuv[1] = 0.492*(b-y);
yuv[2] = 0.877*(r-y);
} | [
"public",
"static",
"void",
"rgbToYuv",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
",",
"double",
"yuv",
"[",
"]",
")",
"{",
"double",
"y",
"=",
"yuv",
"[",
"0",
"]",
"=",
"0.299",
"*",
"r",
"+",
"0.587",
"*",
"g",
"+",
"0.114"... | Conversion from RGB to YUV using same equations as Intel IPP. | [
"Conversion",
"from",
"RGB",
"to",
"YUV",
"using",
"same",
"equations",
"as",
"Intel",
"IPP",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java#L64-L68 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java | ColorYuv.yuvToRgb | public static void yuvToRgb( double y , double u , double v , double rgb[] ) {
rgb[0] = y + 1.13983*v;
rgb[1] = y - 0.39465*u - 0.58060*v;
rgb[2] = y + 2.032*u;
} | java | public static void yuvToRgb( double y , double u , double v , double rgb[] ) {
rgb[0] = y + 1.13983*v;
rgb[1] = y - 0.39465*u - 0.58060*v;
rgb[2] = y + 2.032*u;
} | [
"public",
"static",
"void",
"yuvToRgb",
"(",
"double",
"y",
",",
"double",
"u",
",",
"double",
"v",
",",
"double",
"rgb",
"[",
"]",
")",
"{",
"rgb",
"[",
"0",
"]",
"=",
"y",
"+",
"1.13983",
"*",
"v",
";",
"rgb",
"[",
"1",
"]",
"=",
"y",
"-",
... | Conversion from YUV to RGB using same equations as Intel IPP. | [
"Conversion",
"from",
"YUV",
"to",
"RGB",
"using",
"same",
"equations",
"as",
"Intel",
"IPP",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java#L82-L86 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java | TrifocalLinearPoint7.process | public boolean process( List<AssociatedTriple> observations , TrifocalTensor solution ) {
if( observations.size() < 7 )
throw new IllegalArgumentException(
"At least 7 correspondences must be provided. Found "+observations.size());
// compute normalization to reduce numerical errors
LowLevelMultiViewOps... | java | public boolean process( List<AssociatedTriple> observations , TrifocalTensor solution ) {
if( observations.size() < 7 )
throw new IllegalArgumentException(
"At least 7 correspondences must be provided. Found "+observations.size());
// compute normalization to reduce numerical errors
LowLevelMultiViewOps... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedTriple",
">",
"observations",
",",
"TrifocalTensor",
"solution",
")",
"{",
"if",
"(",
"observations",
".",
"size",
"(",
")",
"<",
"7",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"At leas... | Estimates the trifocal tensor given the set of observations
@param observations Set of observations
@param solution Output: Where the solution is written to
@return true if successful and false if it fails | [
"Estimates",
"the",
"trifocal",
"tensor",
"given",
"the",
"set",
"of",
"observations"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java#L97-L122 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java | TrifocalLinearPoint7.createLinearSystem | protected void createLinearSystem( List<AssociatedTriple> observations ) {
int N = observations.size();
A.reshape(4*N,27);
A.zero();
for( int i = 0; i < N; i++ ) {
AssociatedTriple t = observations.get(i);
N1.apply(t.p1,p1_norm);
N2.apply(t.p2,p2_norm);
N3.apply(t.p3,p3_norm);
insert(i,0 , p1... | java | protected void createLinearSystem( List<AssociatedTriple> observations ) {
int N = observations.size();
A.reshape(4*N,27);
A.zero();
for( int i = 0; i < N; i++ ) {
AssociatedTriple t = observations.get(i);
N1.apply(t.p1,p1_norm);
N2.apply(t.p2,p2_norm);
N3.apply(t.p3,p3_norm);
insert(i,0 , p1... | [
"protected",
"void",
"createLinearSystem",
"(",
"List",
"<",
"AssociatedTriple",
">",
"observations",
")",
"{",
"int",
"N",
"=",
"observations",
".",
"size",
"(",
")",
";",
"A",
".",
"reshape",
"(",
"4",
"*",
"N",
",",
"27",
")",
";",
"A",
".",
"zero... | Constructs the linear matrix that describes from the 3-point constraint with linear
dependent rows removed | [
"Constructs",
"the",
"linear",
"matrix",
"that",
"describes",
"from",
"the",
"3",
"-",
"point",
"constraint",
"with",
"linear",
"dependent",
"rows",
"removed"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java#L128-L145 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java | TrifocalLinearPoint7.solveLinearSystem | protected boolean solveLinearSystem() {
if( !svdNull.decompose(A) )
return false;
SingularOps_DDRM.nullVector(svdNull,true,vectorizedSolution);
solutionN.convertFrom(vectorizedSolution);
return true;
} | java | protected boolean solveLinearSystem() {
if( !svdNull.decompose(A) )
return false;
SingularOps_DDRM.nullVector(svdNull,true,vectorizedSolution);
solutionN.convertFrom(vectorizedSolution);
return true;
} | [
"protected",
"boolean",
"solveLinearSystem",
"(",
")",
"{",
"if",
"(",
"!",
"svdNull",
".",
"decompose",
"(",
"A",
")",
")",
"return",
"false",
";",
"SingularOps_DDRM",
".",
"nullVector",
"(",
"svdNull",
",",
"true",
",",
"vectorizedSolution",
")",
";",
"s... | Computes the null space of the linear system to find the trifocal tensor | [
"Computes",
"the",
"null",
"space",
"of",
"the",
"linear",
"system",
"to",
"find",
"the",
"trifocal",
"tensor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java#L190-L199 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java | TrifocalLinearPoint7.removeNormalization | protected void removeNormalization( TrifocalTensor solution ) {
DMatrixRMaj N2_inv = N2.matrixInv();
DMatrixRMaj N3_inv = N3.matrixInv();
DMatrixRMaj N1 = this.N1.matrix();
for( int i = 0; i < 3; i++ ) {
DMatrixRMaj T = solution.getT(i);
for( int j = 0; j < 3; j++ ) {
for( int k = 0; k < 3; k++ ) {
... | java | protected void removeNormalization( TrifocalTensor solution ) {
DMatrixRMaj N2_inv = N2.matrixInv();
DMatrixRMaj N3_inv = N3.matrixInv();
DMatrixRMaj N1 = this.N1.matrix();
for( int i = 0; i < 3; i++ ) {
DMatrixRMaj T = solution.getT(i);
for( int j = 0; j < 3; j++ ) {
for( int k = 0; k < 3; k++ ) {
... | [
"protected",
"void",
"removeNormalization",
"(",
"TrifocalTensor",
"solution",
")",
"{",
"DMatrixRMaj",
"N2_inv",
"=",
"N2",
".",
"matrixInv",
"(",
")",
";",
"DMatrixRMaj",
"N3_inv",
"=",
"N3",
".",
"matrixInv",
"(",
")",
";",
"DMatrixRMaj",
"N1",
"=",
"this... | Translates the trifocal tensor back into regular coordinate system | [
"Translates",
"the",
"trifocal",
"tensor",
"back",
"into",
"regular",
"coordinate",
"system"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalLinearPoint7.java#L204-L232 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/ScoreLineSegmentEdge.java | ScoreLineSegmentEdge.computeAverageDerivative | public double computeAverageDerivative(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY) {
samplesInside = 0;
averageUp = averageDown = 0;
for (int i = 0; i < numSamples; i++) {
double x = (b.x-a.x)*i/(numSamples-1) + a.x;
double y = (b.y-a.y)*i/(numSamples-1) + a.y;
double x0 = x+tanX;
double... | java | public double computeAverageDerivative(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY) {
samplesInside = 0;
averageUp = averageDown = 0;
for (int i = 0; i < numSamples; i++) {
double x = (b.x-a.x)*i/(numSamples-1) + a.x;
double y = (b.y-a.y)*i/(numSamples-1) + a.y;
double x0 = x+tanX;
double... | [
"public",
"double",
"computeAverageDerivative",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"double",
"tanX",
",",
"double",
"tanY",
")",
"{",
"samplesInside",
"=",
"0",
";",
"averageUp",
"=",
"averageDown",
"=",
"0",
";",
"for",
"(",
"int",
"i"... | Returns average tangential derivative along the line segment. Derivative is computed in direction
of tangent. A positive step in the tangent direction will have a positive value. If all samples
go outside the image then zero is returned.
@param a start point
@param b end point
@param tanX unit tangent x-axis. dete... | [
"Returns",
"average",
"tangential",
"derivative",
"along",
"the",
"line",
"segment",
".",
"Derivative",
"is",
"computed",
"in",
"direction",
"of",
"tangent",
".",
"A",
"positive",
"step",
"in",
"the",
"tangent",
"direction",
"will",
"have",
"a",
"positive",
"v... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/edge/ScoreLineSegmentEdge.java#L75-L110 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java | ColorXyz.rgbToXyz | public static void rgbToXyz( int r , int g , int b , double xyz[] ) {
srgbToXyz(r/255.0,g/255.0,b/255.0,xyz);
} | java | public static void rgbToXyz( int r , int g , int b , double xyz[] ) {
srgbToXyz(r/255.0,g/255.0,b/255.0,xyz);
} | [
"public",
"static",
"void",
"rgbToXyz",
"(",
"int",
"r",
",",
"int",
"g",
",",
"int",
"b",
",",
"double",
"xyz",
"[",
"]",
")",
"{",
"srgbToXyz",
"(",
"r",
"/",
"255.0",
",",
"g",
"/",
"255.0",
",",
"b",
"/",
"255.0",
",",
"xyz",
")",
";",
"}... | Conversion from 8-bit RGB into XYZ. 8-bit = range of 0 to 255. | [
"Conversion",
"from",
"8",
"-",
"bit",
"RGB",
"into",
"XYZ",
".",
"8",
"-",
"bit",
"=",
"range",
"of",
"0",
"to",
"255",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java#L56-L58 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoOverheadMotion2D.java | VisOdomMonoOverheadMotion2D.configureCamera | public void configureCamera(CameraPinholeBrown intrinsic ,
Se3_F64 planeToCamera ) {
this.planeToCamera = planeToCamera;
if( !selectOverhead.process(intrinsic,planeToCamera) )
throw new IllegalArgumentException("Can't find a reasonable overhead map. Can the camera view the plane?");
overhead.centerX... | java | public void configureCamera(CameraPinholeBrown intrinsic ,
Se3_F64 planeToCamera ) {
this.planeToCamera = planeToCamera;
if( !selectOverhead.process(intrinsic,planeToCamera) )
throw new IllegalArgumentException("Can't find a reasonable overhead map. Can the camera view the plane?");
overhead.centerX... | [
"public",
"void",
"configureCamera",
"(",
"CameraPinholeBrown",
"intrinsic",
",",
"Se3_F64",
"planeToCamera",
")",
"{",
"this",
".",
"planeToCamera",
"=",
"planeToCamera",
";",
"if",
"(",
"!",
"selectOverhead",
".",
"process",
"(",
"intrinsic",
",",
"planeToCamera... | Camera the camera's intrinsic and extrinsic parameters. Can be called at any time.
@param intrinsic Intrinsic camera parameters
@param planeToCamera Transform from the plane to camera. | [
"Camera",
"the",
"camera",
"s",
"intrinsic",
"and",
"extrinsic",
"parameters",
".",
"Can",
"be",
"called",
"at",
"any",
"time",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoOverheadMotion2D.java#L105-L125 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoOverheadMotion2D.java | VisOdomMonoOverheadMotion2D.getWorldToCurr3D | public Se3_F64 getWorldToCurr3D() {
// 2D to 3D coordinates
worldToCurr3D.getT().set(-worldToCurr2D.T.y,0,worldToCurr2D.T.x);
DMatrixRMaj R = worldToCurr3D.getR();
// set rotation around Y axis.
// Transpose the 2D transform since the rotation are pointing in opposite directions
R.unsafe_set(0, 0, worldToC... | java | public Se3_F64 getWorldToCurr3D() {
// 2D to 3D coordinates
worldToCurr3D.getT().set(-worldToCurr2D.T.y,0,worldToCurr2D.T.x);
DMatrixRMaj R = worldToCurr3D.getR();
// set rotation around Y axis.
// Transpose the 2D transform since the rotation are pointing in opposite directions
R.unsafe_set(0, 0, worldToC... | [
"public",
"Se3_F64",
"getWorldToCurr3D",
"(",
")",
"{",
"// 2D to 3D coordinates",
"worldToCurr3D",
".",
"getT",
"(",
")",
".",
"set",
"(",
"-",
"worldToCurr2D",
".",
"T",
".",
"y",
",",
"0",
",",
"worldToCurr2D",
".",
"T",
".",
"x",
")",
";",
"DMatrixRM... | 3D motion.
@return from world to current frame. | [
"3D",
"motion",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoOverheadMotion2D.java#L172-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetector.java | BinaryEllipseDetector.process | public void process(T gray, GrayU8 binary) {
results.reset();
ellipseDetector.process(binary);
if( ellipseRefiner != null)
ellipseRefiner.setImage(gray);
intensityCheck.setImage(gray);
List<BinaryEllipseDetectorPixel.Found> found = ellipseDetector.getFound();
for( BinaryEllipseDetectorPixel.Found f : ... | java | public void process(T gray, GrayU8 binary) {
results.reset();
ellipseDetector.process(binary);
if( ellipseRefiner != null)
ellipseRefiner.setImage(gray);
intensityCheck.setImage(gray);
List<BinaryEllipseDetectorPixel.Found> found = ellipseDetector.getFound();
for( BinaryEllipseDetectorPixel.Found f : ... | [
"public",
"void",
"process",
"(",
"T",
"gray",
",",
"GrayU8",
"binary",
")",
"{",
"results",
".",
"reset",
"(",
")",
";",
"ellipseDetector",
".",
"process",
"(",
"binary",
")",
";",
"if",
"(",
"ellipseRefiner",
"!=",
"null",
")",
"ellipseRefiner",
".",
... | Detects ellipses inside the binary image and refines the edges for all detections inside the gray image
@param gray Grayscale image
@param binary Binary image of grayscale. 1 = ellipse and 0 = ignored background | [
"Detects",
"ellipses",
"inside",
"the",
"binary",
"image",
"and",
"refines",
"the",
"edges",
"for",
"all",
"detections",
"inside",
"the",
"gray",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetector.java#L100-L136 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetector.java | BinaryEllipseDetector.refine | public boolean refine( EllipseRotated_F64 ellipse ) {
if( autoRefine )
throw new IllegalArgumentException("Autorefine is true, no need to refine again");
if( ellipseRefiner == null )
throw new IllegalArgumentException("Refiner has not been passed in");
if (!ellipseRefiner.process(ellipse,ellipse)) {
retu... | java | public boolean refine( EllipseRotated_F64 ellipse ) {
if( autoRefine )
throw new IllegalArgumentException("Autorefine is true, no need to refine again");
if( ellipseRefiner == null )
throw new IllegalArgumentException("Refiner has not been passed in");
if (!ellipseRefiner.process(ellipse,ellipse)) {
retu... | [
"public",
"boolean",
"refine",
"(",
"EllipseRotated_F64",
"ellipse",
")",
"{",
"if",
"(",
"autoRefine",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Autorefine is true, no need to refine again\"",
")",
";",
"if",
"(",
"ellipseRefiner",
"==",
"null",
")",
... | If auto refine is turned off an ellipse can be refined after the fact using this function, provided
that the refinement algorithm was passed in to the constructor
@param ellipse The ellipse to be refined
@return true if refine was successful or false if not | [
"If",
"auto",
"refine",
"is",
"turned",
"off",
"an",
"ellipse",
"can",
"be",
"refined",
"after",
"the",
"fact",
"using",
"this",
"function",
"provided",
"that",
"the",
"refinement",
"algorithm",
"was",
"passed",
"in",
"to",
"the",
"constructor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetector.java#L144-L154 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.colorizeSign | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < inp... | java | public static void colorizeSign( GrayF32 input , float maxAbsValue , Bitmap output , byte[] storage ) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < inp... | [
"public",
"static",
"void",
"colorizeSign",
"(",
"GrayF32",
"input",
",",
"float",
"maxAbsValue",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"storage",
"==",
"null"... | Renders positive and negative values as two different colors.
@param input (Input) Image with positive and negative values.
@param maxAbsValue The largest absolute value of any pixel in the image. Set to < 0 if not known.
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitma... | [
"Renders",
"positive",
"and",
"negative",
"values",
"as",
"two",
"different",
"colors",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L137-L166 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.grayMagnitude | public static void grayMagnitude(GrayS32 input , int maxAbsValue , Bitmap output , byte[] storage) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < input.... | java | public static void grayMagnitude(GrayS32 input , int maxAbsValue , Bitmap output , byte[] storage) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < input.... | [
"public",
"static",
"void",
"grayMagnitude",
"(",
"GrayS32",
"input",
",",
"int",
"maxAbsValue",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"storage",
"==",
"null",... | Renders the image using its gray magnitude
@param input (Input) Image image
@param maxAbsValue (Input) Largest absolute value of a pixel in the image
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitmap image. | [
"Renders",
"the",
"image",
"using",
"its",
"gray",
"magnitude"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L176-L199 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.disparity | public static void disparity( GrayI disparity, int minValue, int maxValue,
int invalidColor, Bitmap output , byte[] storage ) {
shapeShape(disparity, output);
if( storage == null )
storage = declareStorage(output,null);
int range = maxValue - minValue;
int indexDst = 0;
for (int y = 0; y < di... | java | public static void disparity( GrayI disparity, int minValue, int maxValue,
int invalidColor, Bitmap output , byte[] storage ) {
shapeShape(disparity, output);
if( storage == null )
storage = declareStorage(output,null);
int range = maxValue - minValue;
int indexDst = 0;
for (int y = 0; y < di... | [
"public",
"static",
"void",
"disparity",
"(",
"GrayI",
"disparity",
",",
"int",
"minValue",
",",
"int",
"maxValue",
",",
"int",
"invalidColor",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"disparity",
",",
"outpu... | Colorizes a disparity image.
@param disparity (Input) disparity image.
@param minValue Minimum possible disparity
@param maxValue Maximum possible disparity
@param invalidColor RGB value of an invalid pixel
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitmap image. Can be n... | [
"Colorizes",
"a",
"disparity",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L362-L400 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.drawEdgeContours | public static void drawEdgeContours( List<EdgeContour> contours , int color , Bitmap output , byte[] storage ) {
if( output.getConfig() != Bitmap.Config.ARGB_8888 )
throw new IllegalArgumentException("Only ARGB_8888 is supported");
if( storage == null )
storage = declareStorage(output,null);
else
Arrays... | java | public static void drawEdgeContours( List<EdgeContour> contours , int color , Bitmap output , byte[] storage ) {
if( output.getConfig() != Bitmap.Config.ARGB_8888 )
throw new IllegalArgumentException("Only ARGB_8888 is supported");
if( storage == null )
storage = declareStorage(output,null);
else
Arrays... | [
"public",
"static",
"void",
"drawEdgeContours",
"(",
"List",
"<",
"EdgeContour",
">",
"contours",
",",
"int",
"color",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"output",
".",
"getConfig",
"(",
")",
"!=",
"Bitmap",
... | Draws each contour using a single color.
@param contours List of edge contours
@param color The RGB color that each edge pixel should be drawn
@param output Where the output is written to
@param storage Optional working buffer for Bitmap image. Can be null. | [
"Draws",
"each",
"contour",
"using",
"a",
"single",
"color",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L501-L535 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java | ClipAndReduce.massage | public void massage( T input , T output ) {
if( clip ) {
T inputAdjusted = clipInput(input, output);
// configure a simple change in scale for both axises
transform.a11 = input.width / (float) output.width;
transform.a22 = input.height / (float) output.height;
// this change is automatically reflected... | java | public void massage( T input , T output ) {
if( clip ) {
T inputAdjusted = clipInput(input, output);
// configure a simple change in scale for both axises
transform.a11 = input.width / (float) output.width;
transform.a22 = input.height / (float) output.height;
// this change is automatically reflected... | [
"public",
"void",
"massage",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"if",
"(",
"clip",
")",
"{",
"T",
"inputAdjusted",
"=",
"clipInput",
"(",
"input",
",",
"output",
")",
";",
"// configure a simple change in scale for both axises",
"transform",
".",... | Clipps and scales the input iamge as neccisary
@param input Input image. Typically larger than output
@param output Output image | [
"Clipps",
"and",
"scales",
"the",
"input",
"iamge",
"as",
"neccisary"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java#L71-L89 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java | ClipAndReduce.clipInput | T clipInput(T input, T output) {
double ratioInput = input.width/(double)input.height;
double ratioOutput = output.width/(double)output.height;
T a = input;
if( ratioInput > ratioOutput ) { // clip the width
int width = input.height*output.width/output.height;
int x0 = (input.width-width)/2;
int x1 =... | java | T clipInput(T input, T output) {
double ratioInput = input.width/(double)input.height;
double ratioOutput = output.width/(double)output.height;
T a = input;
if( ratioInput > ratioOutput ) { // clip the width
int width = input.height*output.width/output.height;
int x0 = (input.width-width)/2;
int x1 =... | [
"T",
"clipInput",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"double",
"ratioInput",
"=",
"input",
".",
"width",
"/",
"(",
"double",
")",
"input",
".",
"height",
";",
"double",
"ratioOutput",
"=",
"output",
".",
"width",
"/",
"(",
"double",
")"... | Clip the input image to ensure a constant aspect ratio | [
"Clip",
"the",
"input",
"image",
"to",
"ensure",
"a",
"constant",
"aspect",
"ratio"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java#L94-L117 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java | DiscreteFourierTransformOps.nextPow2 | public static int nextPow2(int x) {
if (x < 1)
throw new IllegalArgumentException("x must be greater or equal 1");
if ((x & (x - 1)) == 0) {
if( x == 1 )
return 2;
return x; // x is already a power-of-two number
}
x |= (x >>> 1);
x |= (x >>> 2);
x |= (x >>> 4);
x |= (x >>> 8);
x |= (x >>> 1... | java | public static int nextPow2(int x) {
if (x < 1)
throw new IllegalArgumentException("x must be greater or equal 1");
if ((x & (x - 1)) == 0) {
if( x == 1 )
return 2;
return x; // x is already a power-of-two number
}
x |= (x >>> 1);
x |= (x >>> 2);
x |= (x >>> 4);
x |= (x >>> 8);
x |= (x >>> 1... | [
"public",
"static",
"int",
"nextPow2",
"(",
"int",
"x",
")",
"{",
"if",
"(",
"x",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"x must be greater or equal 1\"",
")",
";",
"if",
"(",
"(",
"x",
"&",
"(",
"x",
"-",
"1",
")",
")",
"=... | Returns the closest power-of-two number greater than or equal to x.
@param x
@return the closest power-of-two number greater than or equal to x | [
"Returns",
"the",
"closest",
"power",
"-",
"of",
"-",
"two",
"number",
"greater",
"than",
"or",
"equal",
"to",
"x",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java#L74-L89 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java | DiscreteFourierTransformOps.checkImageArguments | public static void checkImageArguments( ImageBase image , ImageInterleaved transform ) {
InputSanityCheck.checkSameShape(image,transform);
if( 2 != transform.getNumBands() )
throw new IllegalArgumentException("The transform must have two bands");
} | java | public static void checkImageArguments( ImageBase image , ImageInterleaved transform ) {
InputSanityCheck.checkSameShape(image,transform);
if( 2 != transform.getNumBands() )
throw new IllegalArgumentException("The transform must have two bands");
} | [
"public",
"static",
"void",
"checkImageArguments",
"(",
"ImageBase",
"image",
",",
"ImageInterleaved",
"transform",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"image",
",",
"transform",
")",
";",
"if",
"(",
"2",
"!=",
"transform",
".",
"getNumBand... | Checks to see if the image and its transform are appropriate sizes . The transform should have
twice the width and twice the height as the image.
@param image Storage for an image
@param transform Storage for a Fourier Transform | [
"Checks",
"to",
"see",
"if",
"the",
"image",
"and",
"its",
"transform",
"are",
"appropriate",
"sizes",
".",
"The",
"transform",
"should",
"have",
"twice",
"the",
"width",
"and",
"twice",
"the",
"height",
"as",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java#L98-L102 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java | ExampleStereoTwoViewsOneCamera.estimateCameraMotion | public static Se3_F64 estimateCameraMotion(CameraPinholeBrown intrinsic,
List<AssociatedPair> matchedNorm, List<AssociatedPair> inliers)
{
ModelMatcherMultiview<Se3_F64, AssociatedPair> epipolarMotion =
FactoryMultiViewRobust.baselineRansac(new ConfigEssential(),new ConfigRansac(200,0.5));
epipol... | java | public static Se3_F64 estimateCameraMotion(CameraPinholeBrown intrinsic,
List<AssociatedPair> matchedNorm, List<AssociatedPair> inliers)
{
ModelMatcherMultiview<Se3_F64, AssociatedPair> epipolarMotion =
FactoryMultiViewRobust.baselineRansac(new ConfigEssential(),new ConfigRansac(200,0.5));
epipol... | [
"public",
"static",
"Se3_F64",
"estimateCameraMotion",
"(",
"CameraPinholeBrown",
"intrinsic",
",",
"List",
"<",
"AssociatedPair",
">",
"matchedNorm",
",",
"List",
"<",
"AssociatedPair",
">",
"inliers",
")",
"{",
"ModelMatcherMultiview",
"<",
"Se3_F64",
",",
"Associ... | Estimates the camera motion robustly using RANSAC and a set of associated points.
@param intrinsic Intrinsic camera parameters
@param matchedNorm set of matched point features in normalized image coordinates
@param inliers OUTPUT: Set of inlier features from RANSAC
@return Found camera motion. Note translation ... | [
"Estimates",
"the",
"camera",
"motion",
"robustly",
"using",
"RANSAC",
"and",
"a",
"set",
"of",
"associated",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java#L155-L170 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java | ExampleStereoTwoViewsOneCamera.convertToNormalizedCoordinates | public static List<AssociatedPair> convertToNormalizedCoordinates(List<AssociatedPair> matchedFeatures, CameraPinholeBrown intrinsic) {
Point2Transform2_F64 p_to_n = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
List<AssociatedPair> calibratedFeatures = new ArrayList<>();
for (AssociatedP... | java | public static List<AssociatedPair> convertToNormalizedCoordinates(List<AssociatedPair> matchedFeatures, CameraPinholeBrown intrinsic) {
Point2Transform2_F64 p_to_n = LensDistortionFactory.narrow(intrinsic).undistort_F64(true, false);
List<AssociatedPair> calibratedFeatures = new ArrayList<>();
for (AssociatedP... | [
"public",
"static",
"List",
"<",
"AssociatedPair",
">",
"convertToNormalizedCoordinates",
"(",
"List",
"<",
"AssociatedPair",
">",
"matchedFeatures",
",",
"CameraPinholeBrown",
"intrinsic",
")",
"{",
"Point2Transform2_F64",
"p_to_n",
"=",
"LensDistortionFactory",
".",
"... | Convert a set of associated point features from pixel coordinates into normalized image coordinates. | [
"Convert",
"a",
"set",
"of",
"associated",
"point",
"features",
"from",
"pixel",
"coordinates",
"into",
"normalized",
"image",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java#L175-L191 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java | ExampleStereoTwoViewsOneCamera.rectifyImages | public static <T extends ImageBase<T>>
void rectifyImages(T distortedLeft,
T distortedRight,
Se3_F64 leftToRight,
CameraPinholeBrown intrinsicLeft,
CameraPinholeBrown intrinsicRight,
T rectifiedLeft,
T rectifiedRight,
GrayU8 rectifiedMask,
DMatrixRMaj rec... | java | public static <T extends ImageBase<T>>
void rectifyImages(T distortedLeft,
T distortedRight,
Se3_F64 leftToRight,
CameraPinholeBrown intrinsicLeft,
CameraPinholeBrown intrinsicRight,
T rectifiedLeft,
T rectifiedRight,
GrayU8 rectifiedMask,
DMatrixRMaj rec... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"rectifyImages",
"(",
"T",
"distortedLeft",
",",
"T",
"distortedRight",
",",
"Se3_F64",
"leftToRight",
",",
"CameraPinholeBrown",
"intrinsicLeft",
",",
"CameraPinholeBrown",
"intrins... | Remove lens distortion and rectify stereo images
@param distortedLeft Input distorted image from left camera.
@param distortedRight Input distorted image from right camera.
@param leftToRight Camera motion from left to right
@param intrinsicLeft Intrinsic camera parameters
@param rectifiedLeft Output rectified i... | [
"Remove",
"lens",
"distortion",
"and",
"rectify",
"stereo",
"images"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java#L205-L250 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java | ExampleStereoTwoViewsOneCamera.drawInliers | public static void drawInliers(BufferedImage left, BufferedImage right, CameraPinholeBrown intrinsic,
List<AssociatedPair> normalized) {
Point2Transform2_F64 n_to_p = LensDistortionFactory.narrow(intrinsic).distort_F64(false,true);
List<AssociatedPair> pixels = new ArrayList<>();
for (AssociatedPair ... | java | public static void drawInliers(BufferedImage left, BufferedImage right, CameraPinholeBrown intrinsic,
List<AssociatedPair> normalized) {
Point2Transform2_F64 n_to_p = LensDistortionFactory.narrow(intrinsic).distort_F64(false,true);
List<AssociatedPair> pixels = new ArrayList<>();
for (AssociatedPair ... | [
"public",
"static",
"void",
"drawInliers",
"(",
"BufferedImage",
"left",
",",
"BufferedImage",
"right",
",",
"CameraPinholeBrown",
"intrinsic",
",",
"List",
"<",
"AssociatedPair",
">",
"normalized",
")",
"{",
"Point2Transform2_F64",
"n_to_p",
"=",
"LensDistortionFacto... | Draw inliers for debugging purposes. Need to convert from normalized to pixel coordinates. | [
"Draw",
"inliers",
"for",
"debugging",
"purposes",
".",
"Need",
"to",
"convert",
"from",
"normalized",
"to",
"pixel",
"coordinates",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoTwoViewsOneCamera.java#L255-L276 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/descriptor/DescriptorDistance.java | DescriptorDistance.euclideanSq | public static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b) {
final int N = a.value.length;
double total = 0;
for( int i = 0; i < N; i++ ) {
double d = a.value[i]-b.value[i];
total += d*d;
}
return total;
} | java | public static double euclideanSq(TupleDesc_F64 a, TupleDesc_F64 b) {
final int N = a.value.length;
double total = 0;
for( int i = 0; i < N; i++ ) {
double d = a.value[i]-b.value[i];
total += d*d;
}
return total;
} | [
"public",
"static",
"double",
"euclideanSq",
"(",
"TupleDesc_F64",
"a",
",",
"TupleDesc_F64",
"b",
")",
"{",
"final",
"int",
"N",
"=",
"a",
".",
"value",
".",
"length",
";",
"double",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | Returns the Euclidean distance squared between the two descriptors.
@param a First descriptor
@param b Second descriptor
@return Euclidean distance squared | [
"Returns",
"the",
"Euclidean",
"distance",
"squared",
"between",
"the",
"two",
"descriptors",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/descriptor/DescriptorDistance.java#L55-L64 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.iterationSorSafe | private float iterationSorSafe(GrayF32 image1, int x, int y, int pixelIndex) {
float w = SOR_RELAXATION;
float uf;
float vf;
float ui = initFlowX.data[pixelIndex];
float vi = initFlowY.data[pixelIndex];
float u = flowX.data[pixelIndex];
float v = flowY.data[pixelIndex];
float I1 = image1.data[pixelIn... | java | private float iterationSorSafe(GrayF32 image1, int x, int y, int pixelIndex) {
float w = SOR_RELAXATION;
float uf;
float vf;
float ui = initFlowX.data[pixelIndex];
float vi = initFlowY.data[pixelIndex];
float u = flowX.data[pixelIndex];
float v = flowY.data[pixelIndex];
float I1 = image1.data[pixelIn... | [
"private",
"float",
"iterationSorSafe",
"(",
"GrayF32",
"image1",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"pixelIndex",
")",
"{",
"float",
"w",
"=",
"SOR_RELAXATION",
";",
"float",
"uf",
";",
"float",
"vf",
";",
"float",
"ui",
"=",
"initFlowX",
"... | SOR iteration for border pixels | [
"SOR",
"iteration",
"for",
"border",
"pixels"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L295-L319 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.A_safe | protected static float A_safe( int x , int y , GrayF32 flow ) {
float u0 = safe(x-1,y ,flow);
float u1 = safe(x+1,y ,flow);
float u2 = safe(x ,y-1,flow);
float u3 = safe(x ,y+1,flow);
float u4 = safe(x-1,y-1,flow);
float u5 = safe(x+1,y-1,flow);
float u6 = safe(x-1,y+1,flow);
float u7 = safe(x+1,y+... | java | protected static float A_safe( int x , int y , GrayF32 flow ) {
float u0 = safe(x-1,y ,flow);
float u1 = safe(x+1,y ,flow);
float u2 = safe(x ,y-1,flow);
float u3 = safe(x ,y+1,flow);
float u4 = safe(x-1,y-1,flow);
float u5 = safe(x+1,y-1,flow);
float u6 = safe(x-1,y+1,flow);
float u7 = safe(x+1,y+... | [
"protected",
"static",
"float",
"A_safe",
"(",
"int",
"x",
",",
"int",
"y",
",",
"GrayF32",
"flow",
")",
"{",
"float",
"u0",
"=",
"safe",
"(",
"x",
"-",
"1",
",",
"y",
",",
"flow",
")",
";",
"float",
"u1",
"=",
"safe",
"(",
"x",
"+",
"1",
","... | See equation 25. Safe version | [
"See",
"equation",
"25",
".",
"Safe",
"version"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L324-L336 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.A | protected static float A( int x , int y , GrayF32 flow ) {
int index = flow.getIndex(x,y);
float u0 = flow.data[index-1];
float u1 = flow.data[index+1];
float u2 = flow.data[index-flow.stride];
float u3 = flow.data[index+flow.stride];
float u4 = flow.data[index-1-flow.stride];
float u5 = flow.data[index... | java | protected static float A( int x , int y , GrayF32 flow ) {
int index = flow.getIndex(x,y);
float u0 = flow.data[index-1];
float u1 = flow.data[index+1];
float u2 = flow.data[index-flow.stride];
float u3 = flow.data[index+flow.stride];
float u4 = flow.data[index-1-flow.stride];
float u5 = flow.data[index... | [
"protected",
"static",
"float",
"A",
"(",
"int",
"x",
",",
"int",
"y",
",",
"GrayF32",
"flow",
")",
"{",
"int",
"index",
"=",
"flow",
".",
"getIndex",
"(",
"x",
",",
"y",
")",
";",
"float",
"u0",
"=",
"flow",
".",
"data",
"[",
"index",
"-",
"1"... | See equation 25. Fast unsafe version | [
"See",
"equation",
"25",
".",
"Fast",
"unsafe",
"version"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L341-L355 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.safe | protected static float safe( int x , int y , GrayF32 image ) {
if( x < 0 ) x = 0;
else if( x >= image.width ) x = image.width-1;
if( y < 0 ) y = 0;
else if( y >= image.height ) y = image.height-1;
return image.unsafe_get(x,y);
} | java | protected static float safe( int x , int y , GrayF32 image ) {
if( x < 0 ) x = 0;
else if( x >= image.width ) x = image.width-1;
if( y < 0 ) y = 0;
else if( y >= image.height ) y = image.height-1;
return image.unsafe_get(x,y);
} | [
"protected",
"static",
"float",
"safe",
"(",
"int",
"x",
",",
"int",
"y",
",",
"GrayF32",
"image",
")",
"{",
"if",
"(",
"x",
"<",
"0",
")",
"x",
"=",
"0",
";",
"else",
"if",
"(",
"x",
">=",
"image",
".",
"width",
")",
"x",
"=",
"image",
".",
... | Ensures pixel values are inside the image. If output it is assigned to the nearest pixel inside the image | [
"Ensures",
"pixel",
"values",
"are",
"inside",
"the",
"image",
".",
"If",
"output",
"it",
"is",
"assigned",
"to",
"the",
"nearest",
"pixel",
"inside",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L360-L367 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/peak/MeanShiftPeak.java | MeanShiftPeak.search | public void search( float cx , float cy ) {
peakX = cx; peakY = cy;
setRegion(cx, cy);
for( int i = 0; i < maxIterations; i++ ) {
float total = 0;
float sumX = 0, sumY = 0;
int kernelIndex = 0;
// see if it can use fast interpolation otherwise use the safer technique
if( interpolate.isInFastBou... | java | public void search( float cx , float cy ) {
peakX = cx; peakY = cy;
setRegion(cx, cy);
for( int i = 0; i < maxIterations; i++ ) {
float total = 0;
float sumX = 0, sumY = 0;
int kernelIndex = 0;
// see if it can use fast interpolation otherwise use the safer technique
if( interpolate.isInFastBou... | [
"public",
"void",
"search",
"(",
"float",
"cx",
",",
"float",
"cy",
")",
"{",
"peakX",
"=",
"cx",
";",
"peakY",
"=",
"cy",
";",
"setRegion",
"(",
"cx",
",",
"cy",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"maxIterations",
";",
... | Performs a mean-shift search center at the specified coordinates | [
"Performs",
"a",
"mean",
"-",
"shift",
"search",
"center",
"at",
"the",
"specified",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/peak/MeanShiftPeak.java#L97-L146 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/peak/MeanShiftPeak.java | MeanShiftPeak.setRegion | protected void setRegion(float cx, float cy) {
x0 = cx - radius;
y0 = cy - radius;
if( x0 < 0 ) { x0 = 0;}
else if( x0+width > image.width ) { x0 = image.width-width; }
if( y0 < 0 ) { y0 = 0;}
else if( y0+width > image.height ) { y0 = image.height-width; }
} | java | protected void setRegion(float cx, float cy) {
x0 = cx - radius;
y0 = cy - radius;
if( x0 < 0 ) { x0 = 0;}
else if( x0+width > image.width ) { x0 = image.width-width; }
if( y0 < 0 ) { y0 = 0;}
else if( y0+width > image.height ) { y0 = image.height-width; }
} | [
"protected",
"void",
"setRegion",
"(",
"float",
"cx",
",",
"float",
"cy",
")",
"{",
"x0",
"=",
"cx",
"-",
"radius",
";",
"y0",
"=",
"cy",
"-",
"radius",
";",
"if",
"(",
"x0",
"<",
"0",
")",
"{",
"x0",
"=",
"0",
";",
"}",
"else",
"if",
"(",
... | Updates the location of the rectangular bounding box
@param cx Image center x-axis
@param cy Image center y-axis | [
"Updates",
"the",
"location",
"of",
"the",
"rectangular",
"bounding",
"box"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/peak/MeanShiftPeak.java#L153-L162 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/transform/pyramid/EdgeIntensitiesApp.java | EdgeIntensitiesApp.gaussianDerivToDirectDeriv | public void gaussianDerivToDirectDeriv() {
T blur = GeneralizedImageOps.createSingleBand(imageType, width, height);
T blurDeriv = GeneralizedImageOps.createSingleBand(imageType, width, height);
T gaussDeriv = GeneralizedImageOps.createSingleBand(imageType, width, height);
BlurStorageFilter<T> funcBlur = Factor... | java | public void gaussianDerivToDirectDeriv() {
T blur = GeneralizedImageOps.createSingleBand(imageType, width, height);
T blurDeriv = GeneralizedImageOps.createSingleBand(imageType, width, height);
T gaussDeriv = GeneralizedImageOps.createSingleBand(imageType, width, height);
BlurStorageFilter<T> funcBlur = Factor... | [
"public",
"void",
"gaussianDerivToDirectDeriv",
"(",
")",
"{",
"T",
"blur",
"=",
"GeneralizedImageOps",
".",
"createSingleBand",
"(",
"imageType",
",",
"width",
",",
"height",
")",
";",
"T",
"blurDeriv",
"=",
"GeneralizedImageOps",
".",
"createSingleBand",
"(",
... | Compare computing the image | [
"Compare",
"computing",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/transform/pyramid/EdgeIntensitiesApp.java#L102-L118 | train |
lessthanoptimal/BoofCV | applications/src/main/java/boofcv/app/PaperSize.java | PaperSize.lookup | public static PaperSize lookup( String word ) {
for( PaperSize paper : values ) {
if( paper.name.compareToIgnoreCase(word) == 0 ) {
return paper;
}
}
return null;
} | java | public static PaperSize lookup( String word ) {
for( PaperSize paper : values ) {
if( paper.name.compareToIgnoreCase(word) == 0 ) {
return paper;
}
}
return null;
} | [
"public",
"static",
"PaperSize",
"lookup",
"(",
"String",
"word",
")",
"{",
"for",
"(",
"PaperSize",
"paper",
":",
"values",
")",
"{",
"if",
"(",
"paper",
".",
"name",
".",
"compareToIgnoreCase",
"(",
"word",
")",
"==",
"0",
")",
"{",
"return",
"paper"... | Sees if the specified work matches any of the units full name or short name. | [
"Sees",
"if",
"the",
"specified",
"work",
"matches",
"any",
"of",
"the",
"units",
"full",
"name",
"or",
"short",
"name",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/PaperSize.java#L74-L82 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java | GConvolveImageOps.horizontal | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D, B extends ImageBorder<In>>
void horizontal(K kernel, In input, Out output , B border ) {
switch( input.getImageType().getFamily() ) {
case GRAY: {
if( input instanceof GrayF32) {
ConvolveImage.horizontal((Kernel1D_F3... | java | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D, B extends ImageBorder<In>>
void horizontal(K kernel, In input, Out output , B border ) {
switch( input.getImageType().getFamily() ) {
case GRAY: {
if( input instanceof GrayF32) {
ConvolveImage.horizontal((Kernel1D_F3... | [
"public",
"static",
"<",
"In",
"extends",
"ImageBase",
"<",
"In",
">",
",",
"Out",
"extends",
"ImageBase",
"<",
"Out",
">",
",",
"K",
"extends",
"Kernel1D",
",",
"B",
"extends",
"ImageBorder",
"<",
"In",
">",
">",
"void",
"horizontal",
"(",
"K",
"kerne... | Performs a horizontal 1D convolution across the image. Borders are handled as specified by the 'border'
parameter.
@param input The original image. Not modified.
@param output Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified.
@param border How the image... | [
"Performs",
"a",
"horizontal",
"1D",
"convolution",
"across",
"the",
"image",
".",
"Borders",
"are",
"handled",
"as",
"specified",
"by",
"the",
"border",
"parameter",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java#L39-L81 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java | GConvolveImageOps.horizontal | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D>
void horizontal(K kernel, In input, Out output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNoBorder.horizontal((Kernel1D_F32) kernel, (GrayF32) input, (Gr... | java | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D>
void horizontal(K kernel, In input, Out output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNoBorder.horizontal((Kernel1D_F32) kernel, (GrayF32) input, (Gr... | [
"public",
"static",
"<",
"In",
"extends",
"ImageBase",
"<",
"In",
">",
",",
"Out",
"extends",
"ImageBase",
"<",
"Out",
">",
",",
"K",
"extends",
"Kernel1D",
">",
"void",
"horizontal",
"(",
"K",
"kernel",
",",
"In",
"input",
",",
"Out",
"output",
")",
... | Performs a horizontal 1D convolution across the image. The horizontal border is not processed.
@param input The original image. Not modified.
@param output Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified. | [
"Performs",
"a",
"horizontal",
"1D",
"convolution",
"across",
"the",
"image",
".",
"The",
"horizontal",
"border",
"is",
"not",
"processed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java#L196-L240 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java | GConvolveImageOps.horizontalNormalized | public static <In extends ImageBase, Out extends ImageBase, K extends Kernel1D>
void horizontalNormalized(K kernel, In input, Out output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNormalized.horizontal((Kernel1D_F32) kernel, (GrayF32) input, ... | java | public static <In extends ImageBase, Out extends ImageBase, K extends Kernel1D>
void horizontalNormalized(K kernel, In input, Out output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNormalized.horizontal((Kernel1D_F32) kernel, (GrayF32) input, ... | [
"public",
"static",
"<",
"In",
"extends",
"ImageBase",
",",
"Out",
"extends",
"ImageBase",
",",
"K",
"extends",
"Kernel1D",
">",
"void",
"horizontalNormalized",
"(",
"K",
"kernel",
",",
"In",
"input",
",",
"Out",
"output",
")",
"{",
"switch",
"(",
"input",... | Performs a horizontal 1D convolution across the image while re-normalizing the kernel depending on its
overlap with the image.
@param input The original image. Not modified.
@param output Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified. | [
"Performs",
"a",
"horizontal",
"1D",
"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/GConvolveImageOps.java#L355-L401 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/GConvolveImageOps.java | GConvolveImageOps.convolveNormalized | public static <T extends ImageBase<T>, K extends Kernel2D>
void convolveNormalized(K kernel, T input, T output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNormalized.convolve((Kernel2D_F32) kernel, (GrayF32) input, (GrayF32) output);
} els... | java | public static <T extends ImageBase<T>, K extends Kernel2D>
void convolveNormalized(K kernel, T input, T output ) {
switch (input.getImageType().getFamily()) {
case GRAY: {
if (input instanceof GrayF32) {
ConvolveImageNormalized.convolve((Kernel2D_F32) kernel, (GrayF32) input, (GrayF32) output);
} els... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
",",
"K",
"extends",
"Kernel2D",
">",
"void",
"convolveNormalized",
"(",
"K",
"kernel",
",",
"T",
"input",
",",
"T",
"output",
")",
"{",
"switch",
"(",
"input",
".",
"getImageType",
"... | Performs a 2D convolution across the image while re-normalizing the kernel depending on its
overlap with the image.
@param input The original image. Not modified.
@param output Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified. | [
"Performs",
"a",
"2D",
"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/GConvolveImageOps.java#L465-L508 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/HysteresisEdgeTracePoints.java | HysteresisEdgeTracePoints.addFirstSegment | private void addFirstSegment(int x, int y) {
Point2D_I32 p = queuePoints.grow();
p.set(x,y);
EdgeSegment s = new EdgeSegment();
s.points.add(p);
s.index = 0;
s.parent = s.parentPixel = -1;
e.segments.add(s);
open.add(s);
} | java | private void addFirstSegment(int x, int y) {
Point2D_I32 p = queuePoints.grow();
p.set(x,y);
EdgeSegment s = new EdgeSegment();
s.points.add(p);
s.index = 0;
s.parent = s.parentPixel = -1;
e.segments.add(s);
open.add(s);
} | [
"private",
"void",
"addFirstSegment",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"Point2D_I32",
"p",
"=",
"queuePoints",
".",
"grow",
"(",
")",
";",
"p",
".",
"set",
"(",
"x",
",",
"y",
")",
";",
"EdgeSegment",
"s",
"=",
"new",
"EdgeSegment",
"(",... | Starts a new segment at the first point in the contour | [
"Starts",
"a",
"new",
"segment",
"at",
"the",
"first",
"point",
"in",
"the",
"contour"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/HysteresisEdgeTracePoints.java#L247-L256 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java | GPixelMath.abs | public static <T extends ImageBase<T>> void abs( T input , T output )
{
if( input instanceof ImageGray) {
if (GrayS8.class == input.getClass()) {
PixelMath.abs((GrayS8) input, (GrayS8) output);
} else if (GrayS16.class == input.getClass()) {
PixelMath.abs((GrayS16) input, (GrayS16) output);
} else i... | java | public static <T extends ImageBase<T>> void abs( T input , T output )
{
if( input instanceof ImageGray) {
if (GrayS8.class == input.getClass()) {
PixelMath.abs((GrayS8) input, (GrayS8) output);
} else if (GrayS16.class == input.getClass()) {
PixelMath.abs((GrayS16) input, (GrayS16) output);
} else i... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"abs",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"if",
"(",
"input",
"instanceof",
"ImageGray",
")",
"{",
"if",
"(",
"GrayS8",
".",
"class",
"==",
"input",
"."... | Sets each pixel in the output image to be the absolute value of the input image.
Both the input and output image can be the same instance.
@param input The input image. Not modified.
@param output Where the absolute value image is written to. Modified. | [
"Sets",
"each",
"pixel",
"in",
"the",
"output",
"image",
"to",
"be",
"the",
"absolute",
"value",
"of",
"the",
"input",
"image",
".",
"Both",
"the",
"input",
"and",
"output",
"image",
"can",
"be",
"the",
"same",
"instance",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java#L37-L76 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.