id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
50,100 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java | LagrangeFormula.process_F64 | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
double result = 0;
for (int i = i0; i <= i1; i++) {
double numerator = 1.0;
for (int j = i0; j <= i1; j++) {
if (i != j)
numerator *= sample - x[j];
}
double denominator = 1.0;
double a = x[i];
... | java | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
double result = 0;
for (int i = i0; i <= i1; i++) {
double numerator = 1.0;
for (int j = i0; j <= i1; j++) {
if (i != j)
numerator *= sample - x[j];
}
double denominator = 1.0;
double a = x[i];
... | [
"public",
"static",
"double",
"process_F64",
"(",
"double",
"sample",
",",
"double",
"x",
"[",
"]",
",",
"double",
"y",
"[",
"]",
",",
"int",
"i0",
",",
"int",
"i1",
")",
"{",
"double",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"i0",
... | UsingLlangrange's formula it interpulates the value of a function at the specified sample
point given discrete samples. Which samples are used and the order of the approximation are
given by i0 and i1.
@param sample Where the estimate is done.
@param x Where the function was sampled.
@param y The function's value... | [
"UsingLlangrange",
"s",
"formula",
"it",
"interpulates",
"the",
"value",
"of",
"a",
"function",
"at",
"the",
"specified",
"sample",
"point",
"given",
"discrete",
"samples",
".",
"Which",
"samples",
"are",
"used",
"and",
"the",
"order",
"of",
"the",
"approximat... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java#L43-L67 |
50,101 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/d3/Polygon3DSequenceViewer.java | Polygon3DSequenceViewer.add | public void add( Color color , Point3D_F64... polygon ) {
final Poly p = new Poly(polygon.length,color);
for( int i = 0; i < polygon.length; i++ )
p.pts[i] = polygon[i].copy();
synchronized (polygons) {
polygons.add( p );
}
} | java | public void add( Color color , Point3D_F64... polygon ) {
final Poly p = new Poly(polygon.length,color);
for( int i = 0; i < polygon.length; i++ )
p.pts[i] = polygon[i].copy();
synchronized (polygons) {
polygons.add( p );
}
} | [
"public",
"void",
"add",
"(",
"Color",
"color",
",",
"Point3D_F64",
"...",
"polygon",
")",
"{",
"final",
"Poly",
"p",
"=",
"new",
"Poly",
"(",
"polygon",
".",
"length",
",",
"color",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pol... | Adds a polygon to the viewer. GUI Thread safe.
@param polygon shape being added | [
"Adds",
"a",
"polygon",
"to",
"the",
"viewer",
".",
"GUI",
"Thread",
"safe",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/Polygon3DSequenceViewer.java#L108-L118 |
50,102 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.checkDeclare | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type )
return new BufferedImage(width,height,type);
if( image.getWidth() != width || image.getHeight() != height )
... | java | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type )
return new BufferedImage(width,height,type);
if( image.getWidth() != width || image.getHeight() != height )
... | [
"public",
"static",
"BufferedImage",
"checkDeclare",
"(",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"image",
",",
"int",
"type",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"return",
"new",
"BufferedImage",
"(",
"width",
",",
"height... | If the provided image does not have the same shape and same type a new one is declared and returned. | [
"If",
"the",
"provided",
"image",
"does",
"not",
"have",
"the",
"same",
"shape",
"and",
"same",
"type",
"a",
"new",
"one",
"is",
"declared",
"and",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L43-L51 |
50,103 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.checkCopy | public static BufferedImage checkCopy( BufferedImage original , BufferedImage output ) {
ColorModel cm = original.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
if( output == null || original.getWidth() != output.getWidth() || original.getHeight() != output.getHeight() ||
original... | java | public static BufferedImage checkCopy( BufferedImage original , BufferedImage output ) {
ColorModel cm = original.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
if( output == null || original.getWidth() != output.getWidth() || original.getHeight() != output.getHeight() ||
original... | [
"public",
"static",
"BufferedImage",
"checkCopy",
"(",
"BufferedImage",
"original",
",",
"BufferedImage",
"output",
")",
"{",
"ColorModel",
"cm",
"=",
"original",
".",
"getColorModel",
"(",
")",
";",
"boolean",
"isAlphaPremultiplied",
"=",
"cm",
".",
"isAlphaPremu... | Copies the original image into the output image. If it can't do a copy a new image is created and returned
@param original Original image
@param output (Optional) Storage for copy.
@return The copied image. May be a new instance | [
"Copies",
"the",
"original",
"image",
"into",
"the",
"output",
"image",
".",
"If",
"it",
"can",
"t",
"do",
"a",
"copy",
"a",
"new",
"image",
"is",
"created",
"and",
"returned"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L79-L91 |
50,104 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.stripAlphaChannel | public static BufferedImage stripAlphaChannel( BufferedImage image ) {
int numBands = image.getRaster().getNumBands();
if( numBands == 4 ) {
BufferedImage output = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_RGB);
output.createGraphics().drawImage(image,0,0,null);
return ou... | java | public static BufferedImage stripAlphaChannel( BufferedImage image ) {
int numBands = image.getRaster().getNumBands();
if( numBands == 4 ) {
BufferedImage output = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_RGB);
output.createGraphics().drawImage(image,0,0,null);
return ou... | [
"public",
"static",
"BufferedImage",
"stripAlphaChannel",
"(",
"BufferedImage",
"image",
")",
"{",
"int",
"numBands",
"=",
"image",
".",
"getRaster",
"(",
")",
".",
"getNumBands",
"(",
")",
";",
"if",
"(",
"numBands",
"==",
"4",
")",
"{",
"BufferedImage",
... | Returns an image which doesn't have an alpha channel. If the input image doesn't have an alpha
channel to start then its returned as is. Otherwise a new image is created and the RGB channels are
copied and the new image returned.
@param image Input image
@return Image without an alpha channel | [
"Returns",
"an",
"image",
"which",
"doesn",
"t",
"have",
"an",
"alpha",
"channel",
".",
"If",
"the",
"input",
"image",
"doesn",
"t",
"have",
"an",
"alpha",
"channel",
"to",
"start",
"then",
"its",
"returned",
"as",
"is",
".",
"Otherwise",
"a",
"new",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L101-L111 |
50,105 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.extractInterleavedU8 | public static InterleavedU8 extractInterleavedU8(BufferedImage img) {
DataBuffer buffer = img.getRaster().getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
WritableRaster raster = img.getRaster();
InterleavedU8 ret = new InterleavedU8();
ret.width = img.getW... | java | public static InterleavedU8 extractInterleavedU8(BufferedImage img) {
DataBuffer buffer = img.getRaster().getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
WritableRaster raster = img.getRaster();
InterleavedU8 ret = new InterleavedU8();
ret.width = img.getW... | [
"public",
"static",
"InterleavedU8",
"extractInterleavedU8",
"(",
"BufferedImage",
"img",
")",
"{",
"DataBuffer",
"buffer",
"=",
"img",
".",
"getRaster",
"(",
")",
".",
"getDataBuffer",
"(",
")",
";",
"if",
"(",
"buffer",
".",
"getDataType",
"(",
")",
"==",
... | For BufferedImage stored as a byte array internally it extracts an
interleaved image. The input image and the returned image will both
share the same internal data array. Using this function allows unnecessary
memory copying to be avoided.
@param img Image whose internal data is extracted and wrapped.
@return An ima... | [
"For",
"BufferedImage",
"stored",
"as",
"a",
"byte",
"array",
"internally",
"it",
"extracts",
"an",
"interleaved",
"image",
".",
"The",
"input",
"image",
"and",
"the",
"returned",
"image",
"will",
"both",
"share",
"the",
"same",
"internal",
"data",
"array",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L122-L142 |
50,106 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.extractGrayU8 | public static GrayU8 extractGrayU8(BufferedImage img) {
WritableRaster raster = img.getRaster();
DataBuffer buffer = raster.getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
if (raster.getNumBands() != 1)
throw new IllegalArgumentException("Input image has mor... | java | public static GrayU8 extractGrayU8(BufferedImage img) {
WritableRaster raster = img.getRaster();
DataBuffer buffer = raster.getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
if (raster.getNumBands() != 1)
throw new IllegalArgumentException("Input image has mor... | [
"public",
"static",
"GrayU8",
"extractGrayU8",
"(",
"BufferedImage",
"img",
")",
"{",
"WritableRaster",
"raster",
"=",
"img",
".",
"getRaster",
"(",
")",
";",
"DataBuffer",
"buffer",
"=",
"raster",
".",
"getDataBuffer",
"(",
")",
";",
"if",
"(",
"buffer",
... | For BufferedImage stored as a byte array internally it extracts an
image. The input image and the returned image will both
share the same internal data array. Using this function allows unnecessary
memory copying to be avoided.
@param img Image whose internal data is extracted and wrapped.
@return An image whose int... | [
"For",
"BufferedImage",
"stored",
"as",
"a",
"byte",
"array",
"internally",
"it",
"extracts",
"an",
"image",
".",
"The",
"input",
"image",
"and",
"the",
"returned",
"image",
"will",
"both",
"share",
"the",
"same",
"internal",
"data",
"array",
".",
"Using",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L153-L171 |
50,107 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFromSingle | public static <T extends ImageGray<T>> T convertFromSingle(BufferedImage src, T dst, Class<T> type) {
if (type == GrayU8.class) {
return (T) convertFrom(src, (GrayU8) dst);
} else if( GrayI16.class.isAssignableFrom(type) ) {
return (T) convertFrom(src, (GrayI16) dst,(Class)type);
} else if (type == GrayF32.... | java | public static <T extends ImageGray<T>> T convertFromSingle(BufferedImage src, T dst, Class<T> type) {
if (type == GrayU8.class) {
return (T) convertFrom(src, (GrayU8) dst);
} else if( GrayI16.class.isAssignableFrom(type) ) {
return (T) convertFrom(src, (GrayI16) dst,(Class)type);
} else if (type == GrayF32.... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"convertFromSingle",
"(",
"BufferedImage",
"src",
",",
"T",
"dst",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"GrayU8",
".",
"class",
")",
"... | Converts a buffered image into an image of the specified type. In a 'dst' image is provided
it will be used for output, otherwise a new image will be created. | [
"Converts",
"a",
"buffered",
"image",
"into",
"an",
"image",
"of",
"the",
"specified",
"type",
".",
"In",
"a",
"dst",
"image",
"is",
"provided",
"it",
"will",
"be",
"used",
"for",
"output",
"otherwise",
"a",
"new",
"image",
"will",
"be",
"created",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L343-L353 |
50,108 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertTo | public static BufferedImage convertTo(JComponent comp, BufferedImage storage) {
if (storage == null)
storage = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = storage.createGraphics();
comp.paintComponents(g2);
return storage;
} | java | public static BufferedImage convertTo(JComponent comp, BufferedImage storage) {
if (storage == null)
storage = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = storage.createGraphics();
comp.paintComponents(g2);
return storage;
} | [
"public",
"static",
"BufferedImage",
"convertTo",
"(",
"JComponent",
"comp",
",",
"BufferedImage",
"storage",
")",
"{",
"if",
"(",
"storage",
"==",
"null",
")",
"storage",
"=",
"new",
"BufferedImage",
"(",
"comp",
".",
"getWidth",
"(",
")",
",",
"comp",
".... | Draws the component into a BufferedImage.
@param comp The component being drawn into an image.
@param storage if not null the component is drawn into it, if null a new BufferedImage is created.
@return image of the component | [
"Draws",
"the",
"component",
"into",
"a",
"BufferedImage",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L915-L924 |
50,109 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.orderBandsIntoBuffered | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )
return src;
Planar tmp = new Planar(src.type, src.getNumBands());
tmp.width = src.width;
tmp.height = src.height;
tmp.stride = src.stride;
tmp.... | java | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )
return src;
Planar tmp = new Planar(src.type, src.getNumBands());
tmp.width = src.width;
tmp.height = src.height;
tmp.stride = src.stride;
tmp.... | [
"public",
"static",
"Planar",
"orderBandsIntoBuffered",
"(",
"Planar",
"src",
",",
"BufferedImage",
"dst",
")",
"{",
"// see if no change is required",
"if",
"(",
"dst",
".",
"getType",
"(",
")",
"==",
"BufferedImage",
".",
"TYPE_INT_RGB",
")",
"return",
"src",
... | Returns a new image with the color bands in the appropriate ordering. The returned image will
reference the original image's image arrays. | [
"Returns",
"a",
"new",
"image",
"with",
"the",
"color",
"bands",
"in",
"the",
"appropriate",
"ordering",
".",
"The",
"returned",
"image",
"will",
"reference",
"the",
"original",
"image",
"s",
"image",
"arrays",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L930-L945 |
50,110 | lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java | DenoiseVisualizeApp.computeError | public static double computeError(GrayF32 imgA, GrayF32 imgB ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
double difference = Math.abs(imgA.get(x,y)-imgB.get(x,y));
total += difference;
}
}
... | java | public static double computeError(GrayF32 imgA, GrayF32 imgB ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
double difference = Math.abs(imgA.get(x,y)-imgB.get(x,y));
total += difference;
}
}
... | [
"public",
"static",
"double",
"computeError",
"(",
"GrayF32",
"imgA",
",",
"GrayF32",
"imgB",
")",
"{",
"final",
"int",
"h",
"=",
"imgA",
".",
"getHeight",
"(",
")",
";",
"final",
"int",
"w",
"=",
"imgA",
".",
"getWidth",
"(",
")",
";",
"double",
"to... | todo push to what ops? Also what is this error called again? | [
"todo",
"push",
"to",
"what",
"ops?",
"Also",
"what",
"is",
"this",
"error",
"called",
"again?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java#L285-L299 |
50,111 | lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java | DenoiseVisualizeApp.computeWeightedError | public static double computeWeightedError(GrayF32 imgA, GrayF32 imgB ,
GrayF32 imgWeight ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
double totalWeight = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
float weight = imgWeight.get(x... | java | public static double computeWeightedError(GrayF32 imgA, GrayF32 imgB ,
GrayF32 imgWeight ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
double totalWeight = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
float weight = imgWeight.get(x... | [
"public",
"static",
"double",
"computeWeightedError",
"(",
"GrayF32",
"imgA",
",",
"GrayF32",
"imgB",
",",
"GrayF32",
"imgWeight",
")",
"{",
"final",
"int",
"h",
"=",
"imgA",
".",
"getHeight",
"(",
")",
";",
"final",
"int",
"w",
"=",
"imgA",
".",
"getWid... | todo push to what ops? | [
"todo",
"push",
"to",
"what",
"ops?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java#L302-L320 |
50,112 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/geometry/ExampleVideoMosaic.java | ExampleVideoMosaic.nearBorder | private static boolean nearBorder( Point2D_F64 p , StitchingFromMotion2D<?,?> stitch ) {
int r = 10;
if( p.x < r || p.y < r )
return true;
if( p.x >= stitch.getStitchedImage().width-r )
return true;
if( p.y >= stitch.getStitchedImage().height-r )
return true;
return false;
} | java | private static boolean nearBorder( Point2D_F64 p , StitchingFromMotion2D<?,?> stitch ) {
int r = 10;
if( p.x < r || p.y < r )
return true;
if( p.x >= stitch.getStitchedImage().width-r )
return true;
if( p.y >= stitch.getStitchedImage().height-r )
return true;
return false;
} | [
"private",
"static",
"boolean",
"nearBorder",
"(",
"Point2D_F64",
"p",
",",
"StitchingFromMotion2D",
"<",
"?",
",",
"?",
">",
"stitch",
")",
"{",
"int",
"r",
"=",
"10",
";",
"if",
"(",
"p",
".",
"x",
"<",
"r",
"||",
"p",
".",
"y",
"<",
"r",
")",
... | Checks to see if the point is near the image border | [
"Checks",
"to",
"see",
"if",
"the",
"point",
"is",
"near",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleVideoMosaic.java#L162-L172 |
50,113 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.setShape | public void setShape(double width , double height ) {
points2D3D.get(0).location.set(-width/2,-height/2,0);
points2D3D.get(1).location.set(-width/2, height/2,0);
points2D3D.get(2).location.set( width/2, height/2,0);
points2D3D.get(3).location.set( width/2,-height/2,0);
} | java | public void setShape(double width , double height ) {
points2D3D.get(0).location.set(-width/2,-height/2,0);
points2D3D.get(1).location.set(-width/2, height/2,0);
points2D3D.get(2).location.set( width/2, height/2,0);
points2D3D.get(3).location.set( width/2,-height/2,0);
} | [
"public",
"void",
"setShape",
"(",
"double",
"width",
",",
"double",
"height",
")",
"{",
"points2D3D",
".",
"get",
"(",
"0",
")",
".",
"location",
".",
"set",
"(",
"-",
"width",
"/",
"2",
",",
"-",
"height",
"/",
"2",
",",
"0",
")",
";",
"points2... | Specifes how big the fiducial is along two axises
@param width Length along x-axis
@param height Length along y-axis | [
"Specifes",
"how",
"big",
"the",
"fiducial",
"is",
"along",
"two",
"axises"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L95-L100 |
50,114 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.computeStability | public void computeStability(Se3_F64 targetToCamera ,
double disturbance,
FiducialStability results) {
targetToCamera.invert(referenceCameraToTarget);
maxOrientation = 0;
maxLocation = 0;
Point3D_F64 cameraPt = new Point3D_F64();
for (int i = 0; i < points2D3D.size(); i++) {
Point2D3D ... | java | public void computeStability(Se3_F64 targetToCamera ,
double disturbance,
FiducialStability results) {
targetToCamera.invert(referenceCameraToTarget);
maxOrientation = 0;
maxLocation = 0;
Point3D_F64 cameraPt = new Point3D_F64();
for (int i = 0; i < points2D3D.size(); i++) {
Point2D3D ... | [
"public",
"void",
"computeStability",
"(",
"Se3_F64",
"targetToCamera",
",",
"double",
"disturbance",
",",
"FiducialStability",
"results",
")",
"{",
"targetToCamera",
".",
"invert",
"(",
"referenceCameraToTarget",
")",
";",
"maxOrientation",
"=",
"0",
";",
"maxLocat... | Estimate how sensitive this observation is to pixel noise
@param targetToCamera Observed target to camera pose estimate
@param disturbance How much the observation should be noised up, in pixels
@param results description how how sensitive the stability estimate is
@return true if stability could be computed | [
"Estimate",
"how",
"sensitive",
"this",
"observation",
"is",
"to",
"pixel",
"noise"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L109-L140 |
50,115 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.perturb | private void perturb(double disturbance , Point2D_F64 pixel , Point2D3D p23 ) {
double x;
double y = pixel.y;
x = pixel.x + disturbance;
computeDisturbance( x,y, p23);
x = pixel.x - disturbance;
computeDisturbance( x,y, p23);
x = pixel.x;
y = pixel.y + disturbance;
computeDisturbance( x,y, p23);
y ... | java | private void perturb(double disturbance , Point2D_F64 pixel , Point2D3D p23 ) {
double x;
double y = pixel.y;
x = pixel.x + disturbance;
computeDisturbance( x,y, p23);
x = pixel.x - disturbance;
computeDisturbance( x,y, p23);
x = pixel.x;
y = pixel.y + disturbance;
computeDisturbance( x,y, p23);
y ... | [
"private",
"void",
"perturb",
"(",
"double",
"disturbance",
",",
"Point2D_F64",
"pixel",
",",
"Point2D3D",
"p23",
")",
"{",
"double",
"x",
";",
"double",
"y",
"=",
"pixel",
".",
"y",
";",
"x",
"=",
"pixel",
".",
"x",
"+",
"disturbance",
";",
"computeDi... | Perturb the observation in 4 different ways
@param disturbance distance of pixel the observed point will be offset by
@param pixel observed pixel
@param p23 observation plugged into PnP | [
"Perturb",
"the",
"observation",
"in",
"4",
"different",
"ways"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L149-L162 |
50,116 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java | ExampleLineDetection.detectLines | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... | java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"detectLines",
"(",
"BufferedImage",
"image",
",",
"Class",
"<",
"T",
">",
"imageType",
",",
"Class",
"<",
"D",
">",
"d... | Detects lines inside the image using different types of Hough detectors
@param image Input image.
@param imageType Type of image processed by line detector.
@param derivType Type of image derivative. | [
"Detects",
"lines",
"inside",
"the",
"image",
"using",
"different",
"types",
"of",
"Hough",
"detectors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java#L63-L88 |
50,117 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java | ExampleLineDetection.detectLineSegments | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLineSegments( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment t... | java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLineSegments( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment t... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"detectLineSegments",
"(",
"BufferedImage",
"image",
",",
"Class",
"<",
"T",
">",
"imageType",
",",
"Class",
"<",
"D",
">... | Detects segments inside the image
@param image Input image.
@param imageType Type of image processed by line detector.
@param derivType Type of image derivative. | [
"Detects",
"segments",
"inside",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java#L97-L117 |
50,118 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledHueSat | public static List<double[]> coupledHueSat( List<String> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
Planar<GrayF32> hsv = new Planar<>(GrayF32.class,1,1,3);
for( String path : images ) {
BufferedImage buffered = UtilImageIO.loadImage(path... | java | public static List<double[]> coupledHueSat( List<String> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
Planar<GrayF32> hsv = new Planar<>(GrayF32.class,1,1,3);
for( String path : images ) {
BufferedImage buffered = UtilImageIO.loadImage(path... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledHueSat",
"(",
"List",
"<",
"String",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
... | HSV stores color information in Hue and Saturation while intensity is in Value. This computes a 2D histogram
from hue and saturation only, which makes it lighting independent. | [
"HSV",
"stores",
"color",
"information",
"in",
"Hue",
"and",
"Saturation",
"while",
"intensity",
"is",
"in",
"Value",
".",
"This",
"computes",
"a",
"2D",
"histogram",
"from",
"hue",
"and",
"saturation",
"only",
"which",
"makes",
"it",
"lighting",
"independent"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L70-L102 |
50,119 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.independentHueSat | public static List<double[]> independentHueSat( List<File> images ) {
List<double[]> points = new ArrayList<>();
// The number of bins is an important parameter. Try adjusting it
TupleDesc_F64 histogramHue = new TupleDesc_F64(30);
TupleDesc_F64 histogramValue = new TupleDesc_F64(30);
List<TupleDesc_F64> h... | java | public static List<double[]> independentHueSat( List<File> images ) {
List<double[]> points = new ArrayList<>();
// The number of bins is an important parameter. Try adjusting it
TupleDesc_F64 histogramHue = new TupleDesc_F64(30);
TupleDesc_F64 histogramValue = new TupleDesc_F64(30);
List<TupleDesc_F64> h... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"independentHueSat",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// The number of bins is an i... | Computes two independent 1D histograms from hue and saturation. Less affects by sparsity, but can produce
worse results since the basic assumption that hue and saturation are decoupled is most of the time false. | [
"Computes",
"two",
"independent",
"1D",
"histograms",
"from",
"hue",
"and",
"saturation",
".",
"Less",
"affects",
"by",
"sparsity",
"but",
"can",
"produce",
"worse",
"results",
"since",
"the",
"basic",
"assumption",
"that",
"hue",
"and",
"saturation",
"are",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L108-L142 |
50,120 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledRGB | public static List<double[]> coupledRGB( List<File> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't ... | java | public static List<double[]> coupledRGB( List<File> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't ... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledRGB",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
">",
... | Constructs a 3D histogram using RGB. RGB is a popular color space, but the resulting histogram will
depend on lighting conditions and might not produce the accurate results. | [
"Constructs",
"a",
"3D",
"histogram",
"using",
"RGB",
".",
"RGB",
"is",
"a",
"popular",
"color",
"space",
"but",
"the",
"resulting",
"histogram",
"will",
"depend",
"on",
"lighting",
"conditions",
"and",
"might",
"not",
"produce",
"the",
"accurate",
"results",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L148-L174 |
50,121 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.histogramGray | public static List<double[]> histogramGray( List<File> images ) {
List<double[]> points = new ArrayList<>();
GrayU8 gray = new GrayU8(1,1);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't load image!");
gray.... | java | public static List<double[]> histogramGray( List<File> images ) {
List<double[]> points = new ArrayList<>();
GrayU8 gray = new GrayU8(1,1);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't load image!");
gray.... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"histogramGray",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"GrayU8",
"gray",
"=",
"new"... | Computes a histogram from the gray scale intensity image alone. Probably the least effective at looking up
similar images. | [
"Computes",
"a",
"histogram",
"from",
"the",
"gray",
"scale",
"intensity",
"image",
"alone",
".",
"Probably",
"the",
"least",
"effective",
"at",
"looking",
"up",
"similar",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L180-L200 |
50,122 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/misc/DiscretizedCircle.java | DiscretizedCircle.imageOffsets | public static int[] imageOffsets(double radius, int imgWidth) {
double PI2 = Math.PI * 2.0;
double circumference = PI2 * radius;
int num = (int) Math.ceil(circumference);
num = num - num % 4;
double angleStep = PI2 / num;
int temp[] = new int[(int) Math.ceil(circumference)];
int i = 0;
int prev =... | java | public static int[] imageOffsets(double radius, int imgWidth) {
double PI2 = Math.PI * 2.0;
double circumference = PI2 * radius;
int num = (int) Math.ceil(circumference);
num = num - num % 4;
double angleStep = PI2 / num;
int temp[] = new int[(int) Math.ceil(circumference)];
int i = 0;
int prev =... | [
"public",
"static",
"int",
"[",
"]",
"imageOffsets",
"(",
"double",
"radius",
",",
"int",
"imgWidth",
")",
"{",
"double",
"PI2",
"=",
"Math",
".",
"PI",
"*",
"2.0",
";",
"double",
"circumference",
"=",
"PI2",
"*",
"radius",
";",
"int",
"num",
"=",
"(... | Computes the offsets for a discretized circle of the specified radius for an
image with the specified width.
@param radius The radius of the circle in pixels.
@param imgWidth The row step of the image
@return A list of offsets that describe the circle | [
"Computes",
"the",
"offsets",
"for",
"a",
"discretized",
"circle",
"of",
"the",
"specified",
"radius",
"for",
"an",
"image",
"with",
"the",
"specified",
"width",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/DiscretizedCircle.java#L36-L74 |
50,123 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java | ExampleDetectDescribe.createFromPremade | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromPremade( Class<T> imageType ) {
return (DetectDescribePoint)FactoryDetectDescribe.surfStable(
new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null,null, imageType);
// return (DetectDescribePoint)FactoryDetectDescrib... | java | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromPremade( Class<T> imageType ) {
return (DetectDescribePoint)FactoryDetectDescribe.surfStable(
new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null,null, imageType);
// return (DetectDescribePoint)FactoryDetectDescrib... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"TD",
"extends",
"TupleDesc",
">",
"DetectDescribePoint",
"<",
"T",
",",
"TD",
">",
"createFromPremade",
"(",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"return",
"(",
"DetectD... | For some features, there are pre-made implementations of DetectDescribePoint. This has only been done
in situations where there was a performance advantage or that it was a very common combination. | [
"For",
"some",
"features",
"there",
"are",
"pre",
"-",
"made",
"implementations",
"of",
"DetectDescribePoint",
".",
"This",
"has",
"only",
"been",
"done",
"in",
"situations",
"where",
"there",
"was",
"a",
"performance",
"advantage",
"or",
"that",
"it",
"was",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java#L61-L66 |
50,124 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java | ExampleDetectDescribe.createFromComponents | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromComponents( Class<T> imageType ) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneral... | java | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromComponents( Class<T> imageType ) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneral... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"TD",
"extends",
"TupleDesc",
">",
"DetectDescribePoint",
"<",
"T",
",",
"TD",
">",
"createFromComponents",
"(",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"// create a corner dete... | Any arbitrary implementation of InterestPointDetector, OrientationImage, DescribeRegionPoint
can be combined into DetectDescribePoint. The syntax is more complex, but the end result is more flexible.
This should only be done if there isn't a pre-made DetectDescribePoint. | [
"Any",
"arbitrary",
"implementation",
"of",
"InterestPointDetector",
"OrientationImage",
"DescribeRegionPoint",
"can",
"be",
"combined",
"into",
"DetectDescribePoint",
".",
"The",
"syntax",
"is",
"more",
"complex",
"but",
"the",
"end",
"result",
"is",
"more",
"flexibl... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java#L73-L86 |
50,125 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeWeights | protected void computeWeights(int numSamples, double numSigmas) {
weights = new float[ numSamples*numSamples ];
float w[] = new float[ numSamples ];
for( int i = 0; i < numSamples; i++ ) {
float x = i/(float)(numSamples-1);
w[i] = (float) UtilGaussian.computePDF(0, 1, 2f*numSigmas * (x - 0.5f));
}
for... | java | protected void computeWeights(int numSamples, double numSigmas) {
weights = new float[ numSamples*numSamples ];
float w[] = new float[ numSamples ];
for( int i = 0; i < numSamples; i++ ) {
float x = i/(float)(numSamples-1);
w[i] = (float) UtilGaussian.computePDF(0, 1, 2f*numSigmas * (x - 0.5f));
}
for... | [
"protected",
"void",
"computeWeights",
"(",
"int",
"numSamples",
",",
"double",
"numSigmas",
")",
"{",
"weights",
"=",
"new",
"float",
"[",
"numSamples",
"*",
"numSamples",
"]",
";",
"float",
"w",
"[",
"]",
"=",
"new",
"float",
"[",
"numSamples",
"]",
";... | compute the weights by convolving 1D gaussian kernel | [
"compute",
"the",
"weights",
"by",
"convolving",
"1D",
"gaussian",
"kernel"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L97-L111 |
50,126 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.createSamplePoints | protected void createSamplePoints(int numSamples) {
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x++ ) {
float regionX = (x/(numSamples-1.0f) - 0.5f);
samplePts.add( new Point2D_F32(regionX,regionY));
}
}
} | java | protected void createSamplePoints(int numSamples) {
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x++ ) {
float regionX = (x/(numSamples-1.0f) - 0.5f);
samplePts.add( new Point2D_F32(regionX,regionY));
}
}
} | [
"protected",
"void",
"createSamplePoints",
"(",
"int",
"numSamples",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"numSamples",
";",
"y",
"++",
")",
"{",
"float",
"regionY",
"=",
"(",
"y",
"/",
"(",
"numSamples",
"-",
"1.0f",
")",
"-"... | create the list of points in square coordinates that it will sample. values will range
from -0.5 to 0.5 along each axis. | [
"create",
"the",
"list",
"of",
"points",
"in",
"square",
"coordinates",
"that",
"it",
"will",
"sample",
".",
"values",
"will",
"range",
"from",
"-",
"0",
".",
"5",
"to",
"0",
".",
"5",
"along",
"each",
"axis",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L117-L126 |
50,127 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramInside | protected void computeHistogramInside( RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
interpolate.get_fast(imageX,imageY,value);
int indexHistogram = computeHistogramBin(value);
sampleHistIndex[ i ... | java | protected void computeHistogramInside( RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
interpolate.get_fast(imageX,imageY,value);
int indexHistogram = computeHistogramBin(value);
sampleHistIndex[ i ... | [
"protected",
"void",
"computeHistogramInside",
"(",
"RectangleRotate_F32",
"region",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"samplePts",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Point2D_F32",
"p",
"=",
"samplePts",
".",
"ge... | Computes the histogram quickly inside the image | [
"Computes",
"the",
"histogram",
"quickly",
"inside",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L158-L171 |
50,128 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramBorder | protected void computeHistogramBorder(T image, RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
// make sure its inside the image
if( !BoofMiscOps.checkInside(image, imageX, imageY)) {
sampleHistIndex... | java | protected void computeHistogramBorder(T image, RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
// make sure its inside the image
if( !BoofMiscOps.checkInside(image, imageX, imageY)) {
sampleHistIndex... | [
"protected",
"void",
"computeHistogramBorder",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"region",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"samplePts",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Point2D_F32",
"p",
"=",
... | Computes the histogram and skips pixels which are outside the image border | [
"Computes",
"the",
"histogram",
"and",
"skips",
"pixels",
"which",
"are",
"outside",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L176-L195 |
50,129 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramBin | protected int computeHistogramBin( float value[] ) {
int indexHistogram = 0;
int binStride = 1;
for( int bandIndex = 0; bandIndex < value.length; bandIndex++ ) {
int bin = (int)(numBins*value[bandIndex]/maxPixelValue);
indexHistogram += bin*binStride;
binStride *= numBins;
}
return indexHistogram;
... | java | protected int computeHistogramBin( float value[] ) {
int indexHistogram = 0;
int binStride = 1;
for( int bandIndex = 0; bandIndex < value.length; bandIndex++ ) {
int bin = (int)(numBins*value[bandIndex]/maxPixelValue);
indexHistogram += bin*binStride;
binStride *= numBins;
}
return indexHistogram;
... | [
"protected",
"int",
"computeHistogramBin",
"(",
"float",
"value",
"[",
"]",
")",
"{",
"int",
"indexHistogram",
"=",
"0",
";",
"int",
"binStride",
"=",
"1",
";",
"for",
"(",
"int",
"bandIndex",
"=",
"0",
";",
"bandIndex",
"<",
"value",
".",
"length",
";... | Given the value of a pixel, compute which bin in the histogram it belongs in | [
"Given",
"the",
"value",
"of",
"a",
"pixel",
"compute",
"which",
"bin",
"in",
"the",
"histogram",
"it",
"belongs",
"in"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L200-L210 |
50,130 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.isInFastBounds | protected boolean isInFastBounds(RectangleRotate_F32 region) {
squareToImageSample(-0.5f, -0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(-0.5f, 0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(0.5f, 0.5... | java | protected boolean isInFastBounds(RectangleRotate_F32 region) {
squareToImageSample(-0.5f, -0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(-0.5f, 0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(0.5f, 0.5... | [
"protected",
"boolean",
"isInFastBounds",
"(",
"RectangleRotate_F32",
"region",
")",
"{",
"squareToImageSample",
"(",
"-",
"0.5f",
",",
"-",
"0.5f",
",",
"region",
")",
";",
"if",
"(",
"!",
"interpolate",
".",
"isInFastBounds",
"(",
"imageX",
",",
"imageY",
... | Checks to see if the region can be sampled using the fast algorithm | [
"Checks",
"to",
"see",
"if",
"the",
"region",
"can",
"be",
"sampled",
"using",
"the",
"fast",
"algorithm"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L215-L231 |
50,131 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.squareToImageSample | protected void squareToImageSample(float x, float y, RectangleRotate_F32 region) {
// -1 because it starts counting at 0. otherwise width+1 samples are made
x *= region.width-1;
y *= region.height-1;
imageX = x*c - y*s + region.cx;
imageY = x*s + y*c + region.cy;
} | java | protected void squareToImageSample(float x, float y, RectangleRotate_F32 region) {
// -1 because it starts counting at 0. otherwise width+1 samples are made
x *= region.width-1;
y *= region.height-1;
imageX = x*c - y*s + region.cx;
imageY = x*s + y*c + region.cy;
} | [
"protected",
"void",
"squareToImageSample",
"(",
"float",
"x",
",",
"float",
"y",
",",
"RectangleRotate_F32",
"region",
")",
"{",
"// -1 because it starts counting at 0. otherwise width+1 samples are made",
"x",
"*=",
"region",
".",
"width",
"-",
"1",
";",
"y",
"*=",... | Converts a point from square coordinates into image coordinates | [
"Converts",
"a",
"point",
"from",
"square",
"coordinates",
"into",
"image",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L246-L253 |
50,132 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.createSparseDerivatives | private void createSparseDerivatives() {
Kernel1D_F32 kernelD = new Kernel1D_F32(new float[]{-1,0,1},3);
Kernel1D_F32 kernelDD = KernelMath.convolve1D_F32(kernelD, kernelD);
Kernel2D_F32 kernelXY = KernelMath.convolve2D(kernelD, kernelD);
derivXX = FactoryConvolveSparse.horizontal1D(GrayF32.class, kernelDD);
... | java | private void createSparseDerivatives() {
Kernel1D_F32 kernelD = new Kernel1D_F32(new float[]{-1,0,1},3);
Kernel1D_F32 kernelDD = KernelMath.convolve1D_F32(kernelD, kernelD);
Kernel2D_F32 kernelXY = KernelMath.convolve2D(kernelD, kernelD);
derivXX = FactoryConvolveSparse.horizontal1D(GrayF32.class, kernelDD);
... | [
"private",
"void",
"createSparseDerivatives",
"(",
")",
"{",
"Kernel1D_F32",
"kernelD",
"=",
"new",
"Kernel1D_F32",
"(",
"new",
"float",
"[",
"]",
"{",
"-",
"1",
",",
"0",
",",
"1",
"}",
",",
"3",
")",
";",
"Kernel1D_F32",
"kernelDD",
"=",
"KernelMath",
... | Define sparse image derivative operators. | [
"Define",
"sparse",
"image",
"derivative",
"operators",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L143-L158 |
50,133 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.process | public void process( GrayF32 input ) {
scaleSpace.initialize(input);
detections.reset();
do {
// scale from octave to input image
pixelScaleToInput = scaleSpace.pixelScaleCurrentToInput();
// detect features in the image
for (int j = 1; j < scaleSpace.getNumScales()+1; j++) {
// not really sur... | java | public void process( GrayF32 input ) {
scaleSpace.initialize(input);
detections.reset();
do {
// scale from octave to input image
pixelScaleToInput = scaleSpace.pixelScaleCurrentToInput();
// detect features in the image
for (int j = 1; j < scaleSpace.getNumScales()+1; j++) {
// not really sur... | [
"public",
"void",
"process",
"(",
"GrayF32",
"input",
")",
"{",
"scaleSpace",
".",
"initialize",
"(",
"input",
")",
";",
"detections",
".",
"reset",
"(",
")",
";",
"do",
"{",
"// scale from octave to input image",
"pixelScaleToInput",
"=",
"scaleSpace",
".",
"... | Detects SIFT features inside the input image
@param input Input image. Not modified. | [
"Detects",
"SIFT",
"features",
"inside",
"the",
"input",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L165-L191 |
50,134 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.detectFeatures | protected void detectFeatures( int scaleIndex ) {
extractor.process(dogTarget);
FastQueue<NonMaxLimiter.LocalExtreme> found = extractor.getLocalExtreme();
derivXX.setImage(dogTarget);
derivXY.setImage(dogTarget);
derivYY.setImage(dogTarget);
for (int i = 0; i < found.size; i++) {
NonMaxLimiter.LocalExt... | java | protected void detectFeatures( int scaleIndex ) {
extractor.process(dogTarget);
FastQueue<NonMaxLimiter.LocalExtreme> found = extractor.getLocalExtreme();
derivXX.setImage(dogTarget);
derivXY.setImage(dogTarget);
derivYY.setImage(dogTarget);
for (int i = 0; i < found.size; i++) {
NonMaxLimiter.LocalExt... | [
"protected",
"void",
"detectFeatures",
"(",
"int",
"scaleIndex",
")",
"{",
"extractor",
".",
"process",
"(",
"dogTarget",
")",
";",
"FastQueue",
"<",
"NonMaxLimiter",
".",
"LocalExtreme",
">",
"found",
"=",
"extractor",
".",
"getLocalExtreme",
"(",
")",
";",
... | Detect features inside the Difference-of-Gaussian image at the current scale
@param scaleIndex Which scale in the octave is it detecting features inside up.
Primarily provided here for use in child classes. | [
"Detect",
"features",
"inside",
"the",
"Difference",
"-",
"of",
"-",
"Gaussian",
"image",
"at",
"the",
"current",
"scale"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L199-L218 |
50,135 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.isScaleSpaceExtremum | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
if( c_x <= 1 || c_y <= 1 || c_x >= dogLower.width-1 || c_y >= dogLower.height-1)
return false;
float v;
value *= signAdj;
for( int y = -1; y <= 1; y++ ) {
for( int x = -1; x <= 1; x++ ) {
v = dogLower.unsafe_get(c_x+x,c... | java | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
if( c_x <= 1 || c_y <= 1 || c_x >= dogLower.width-1 || c_y >= dogLower.height-1)
return false;
float v;
value *= signAdj;
for( int y = -1; y <= 1; y++ ) {
for( int x = -1; x <= 1; x++ ) {
v = dogLower.unsafe_get(c_x+x,c... | [
"boolean",
"isScaleSpaceExtremum",
"(",
"int",
"c_x",
",",
"int",
"c_y",
",",
"float",
"value",
",",
"float",
"signAdj",
")",
"{",
"if",
"(",
"c_x",
"<=",
"1",
"||",
"c_y",
"<=",
"1",
"||",
"c_x",
">=",
"dogLower",
".",
"width",
"-",
"1",
"||",
"c_... | See if the point is a local extremum in scale-space above and below.
@param c_x x-coordinate of extremum
@param c_y y-coordinate of extremum
@param value The maximum value it is checking
@param signAdj Adjust the sign so that it can check for maximums
@return true if its a local extremum | [
"See",
"if",
"the",
"point",
"is",
"a",
"local",
"extremum",
"in",
"scale",
"-",
"space",
"above",
"and",
"below",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L229-L249 |
50,136 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java | DistortSupport.transformScale | public static PixelTransformAffine_F32 transformScale(ImageBase from, ImageBase to,
PixelTransformAffine_F32 distort)
{
if( distort == null )
distort = new PixelTransformAffine_F32();
float scaleX = (float)(to.width)/(float)(from.width);
float scaleY = (float)(to.height)/(float)(from.height);... | java | public static PixelTransformAffine_F32 transformScale(ImageBase from, ImageBase to,
PixelTransformAffine_F32 distort)
{
if( distort == null )
distort = new PixelTransformAffine_F32();
float scaleX = (float)(to.width)/(float)(from.width);
float scaleY = (float)(to.height)/(float)(from.height);... | [
"public",
"static",
"PixelTransformAffine_F32",
"transformScale",
"(",
"ImageBase",
"from",
",",
"ImageBase",
"to",
",",
"PixelTransformAffine_F32",
"distort",
")",
"{",
"if",
"(",
"distort",
"==",
"null",
")",
"distort",
"=",
"new",
"PixelTransformAffine_F32",
"(",... | Computes a transform which is used to rescale an image. The scale is computed
directly from the size of the two input images and independently scales
the x and y axises. | [
"Computes",
"a",
"transform",
"which",
"is",
"used",
"to",
"rescale",
"an",
"image",
".",
"The",
"scale",
"is",
"computed",
"directly",
"from",
"the",
"size",
"of",
"the",
"two",
"input",
"images",
"and",
"independently",
"scales",
"the",
"x",
"and",
"y",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java#L47-L60 |
50,137 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java | FundamentalLinear.projectOntoEssential | protected boolean projectOntoEssential( DMatrixRMaj E ) {
if( !svdConstraints.decompose(E) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// project... | java | protected boolean projectOntoEssential( DMatrixRMaj E ) {
if( !svdConstraints.decompose(E) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// project... | [
"protected",
"boolean",
"projectOntoEssential",
"(",
"DMatrixRMaj",
"E",
")",
"{",
"if",
"(",
"!",
"svdConstraints",
".",
"decompose",
"(",
"E",
")",
")",
"{",
"return",
"false",
";",
"}",
"svdV",
"=",
"svdConstraints",
".",
"getV",
"(",
"svdV",
",",
"fa... | Projects the found estimate of E onto essential space.
@return true if svd returned true. | [
"Projects",
"the",
"found",
"estimate",
"of",
"E",
"onto",
"essential",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java#L84-L106 |
50,138 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java | FundamentalLinear.projectOntoFundamentalSpace | protected boolean projectOntoFundamentalSpace( DMatrixRMaj F ) {
if( !svdConstraints.decompose(F) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// ... | java | protected boolean projectOntoFundamentalSpace( DMatrixRMaj F ) {
if( !svdConstraints.decompose(F) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// ... | [
"protected",
"boolean",
"projectOntoFundamentalSpace",
"(",
"DMatrixRMaj",
"F",
")",
"{",
"if",
"(",
"!",
"svdConstraints",
".",
"decompose",
"(",
"F",
")",
")",
"{",
"return",
"false",
";",
"}",
"svdV",
"=",
"svdConstraints",
".",
"getV",
"(",
"svdV",
","... | Projects the found estimate of F onto Fundamental space.
@return true if svd returned true. | [
"Projects",
"the",
"found",
"estimate",
"of",
"F",
"onto",
"Fundamental",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java#L113-L131 |
50,139 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.learnFern | public void learnFern(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2f;
float c_y = r.y0+(rectHeight-1)/2f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeFernValue(... | java | public void learnFern(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2f;
float c_y = r.y0+(rectHeight-1)/2f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeFernValue(... | [
"public",
"void",
"learnFern",
"(",
"boolean",
"positive",
",",
"ImageRectangle",
"r",
")",
"{",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")",
";",
"float",
"c_x",
"=",
"r",... | Learns a fern from the specified region. No noise is added. | [
"Learns",
"a",
"fern",
"from",
"the",
"specified",
"region",
".",
"No",
"noise",
"is",
"added",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L106-L121 |
50,140 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.learnFernNoise | public void learnFernNoise(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeF... | java | public void learnFernNoise(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeF... | [
"public",
"void",
"learnFernNoise",
"(",
"boolean",
"positive",
",",
"ImageRectangle",
"r",
")",
"{",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")",
";",
"float",
"c_x",
"=",
... | Computes the value for each fern inside the region and update's their P and N value. Noise is added
to the image measurements to take in account the variability. | [
"Computes",
"the",
"value",
"for",
"each",
"fern",
"inside",
"the",
"region",
"and",
"update",
"s",
"their",
"P",
"and",
"N",
"value",
".",
"Noise",
"is",
"added",
"to",
"the",
"image",
"measurements",
"to",
"take",
"in",
"account",
"the",
"variability",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L127-L148 |
50,141 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.increment | private void increment( TldFernFeature f , boolean positive ) {
if( positive ) {
f.incrementP();
if( f.numP > maxP )
maxP = f.numP;
} else {
f.incrementN();
if( f.numN > maxN )
maxN = f.numN;
}
} | java | private void increment( TldFernFeature f , boolean positive ) {
if( positive ) {
f.incrementP();
if( f.numP > maxP )
maxP = f.numP;
} else {
f.incrementN();
if( f.numN > maxN )
maxN = f.numN;
}
} | [
"private",
"void",
"increment",
"(",
"TldFernFeature",
"f",
",",
"boolean",
"positive",
")",
"{",
"if",
"(",
"positive",
")",
"{",
"f",
".",
"incrementP",
"(",
")",
";",
"if",
"(",
"f",
".",
"numP",
">",
"maxP",
")",
"maxP",
"=",
"f",
".",
"numP",
... | Increments the P and N value for a fern. Also updates the maxP and maxN statistics so that it
knows when to re-normalize data structures. | [
"Increments",
"the",
"P",
"and",
"N",
"value",
"for",
"a",
"fern",
".",
"Also",
"updates",
"the",
"maxP",
"and",
"maxN",
"statistics",
"so",
"that",
"it",
"knows",
"when",
"to",
"re",
"-",
"normalize",
"data",
"structures",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L154-L164 |
50,142 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.lookupFernPN | public boolean lookupFernPN( TldRegionFernInfo info ) {
ImageRectangle r = info.r;
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
int sumP = 0;
int sumN = 0;
for( int i = 0; i < ferns.length; i++ ) {
Tl... | java | public boolean lookupFernPN( TldRegionFernInfo info ) {
ImageRectangle r = info.r;
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
int sumP = 0;
int sumN = 0;
for( int i = 0; i < ferns.length; i++ ) {
Tl... | [
"public",
"boolean",
"lookupFernPN",
"(",
"TldRegionFernInfo",
"info",
")",
"{",
"ImageRectangle",
"r",
"=",
"info",
".",
"r",
";",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")... | For the specified regions, computes the values of each fern inside of it and then retrives their P and N values.
The sum of which is stored inside of info.
@param info (Input) Location/Rectangle (output) P and N values
@return true if a known value for any of the ferns was observed in this region | [
"For",
"the",
"specified",
"regions",
"computes",
"the",
"values",
"of",
"each",
"fern",
"inside",
"of",
"it",
"and",
"then",
"retrives",
"their",
"P",
"and",
"N",
"values",
".",
"The",
"sum",
"of",
"which",
"is",
"stored",
"inside",
"of",
"info",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L172-L201 |
50,143 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.computeFernValue | protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) {
rectWidth -= 1;
rectHeight -= 1;
int desc = 0;
for( int i = 0; i < fern.pairs.length; i++ ) {
Point2D_F32 p_a = fern.pairs[i].a;
Point2D_F32 p_b = fern.pairs[i].b;
float valA = inter... | java | protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) {
rectWidth -= 1;
rectHeight -= 1;
int desc = 0;
for( int i = 0; i < fern.pairs.length; i++ ) {
Point2D_F32 p_a = fern.pairs[i].a;
Point2D_F32 p_b = fern.pairs[i].b;
float valA = inter... | [
"protected",
"int",
"computeFernValue",
"(",
"float",
"c_x",
",",
"float",
"c_y",
",",
"float",
"rectWidth",
",",
"float",
"rectHeight",
",",
"TldFernDescription",
"fern",
")",
"{",
"rectWidth",
"-=",
"1",
";",
"rectHeight",
"-=",
"1",
";",
"int",
"desc",
... | Computes the value of the specified fern at the specified location in the image. | [
"Computes",
"the",
"value",
"of",
"the",
"specified",
"fern",
"at",
"the",
"specified",
"location",
"in",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L206-L227 |
50,144 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.renormalizeP | public void renormalizeP() {
int targetMax = maxP/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numP = targetMax*f.numP/maxP;
}
}
maxP = targetMax;... | java | public void renormalizeP() {
int targetMax = maxP/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numP = targetMax*f.numP/maxP;
}
}
maxP = targetMax;... | [
"public",
"void",
"renormalizeP",
"(",
")",
"{",
"int",
"targetMax",
"=",
"maxP",
"/",
"20",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"managers",
".",
"length",
";",
"i",
"++",
")",
"{",
"TldFernManager",
"m",
"=",
"managers",
"[",
"... | Renormalizes fern.numP to avoid overflow | [
"Renormalizes",
"fern",
".",
"numP",
"to",
"avoid",
"overflow"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L261-L274 |
50,145 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.renormalizeN | public void renormalizeN() {
int targetMax = maxN/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numN = targetMax*f.numN/maxN;
}
}
maxN = targetMax;... | java | public void renormalizeN() {
int targetMax = maxN/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numN = targetMax*f.numN/maxN;
}
}
maxN = targetMax;... | [
"public",
"void",
"renormalizeN",
"(",
")",
"{",
"int",
"targetMax",
"=",
"maxN",
"/",
"20",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"managers",
".",
"length",
";",
"i",
"++",
")",
"{",
"TldFernManager",
"m",
"=",
"managers",
"[",
"... | Renormalizes fern.numN to avoid overflow | [
"Renormalizes",
"fern",
".",
"numN",
"to",
"avoid",
"overflow"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L279-L292 |
50,146 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java | DescribePointSurf.describe | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret)
{
double c = Math.cos(angle),s=Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
bool... | java | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret)
{
double c = Math.cos(angle),s=Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
bool... | [
"public",
"void",
"describe",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"angle",
",",
"double",
"scale",
",",
"TupleDesc_F64",
"ret",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
",",
"s",
"=",
"Math",
".",
"sin... | Compute SURF descriptor, but without laplacian sign
@param x Location of interest point.
@param y Location of interest point.
@param angle The angle the feature is pointing at in radians.
@param scale Scale of the interest point. Null is returned if the feature goes outside the image border.
@param ret storage for the... | [
"Compute",
"SURF",
"descriptor",
"but",
"without",
"laplacian",
"sign"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L190-L213 |
50,147 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java | DescribePointSurf.computeLaplaceSign | public boolean computeLaplaceSign(int x, int y, double scale) {
int s = (int)Math.ceil(scale);
kerXX = DerivativeIntegralImage.kernelDerivXX(9*s,kerXX);
kerYY = DerivativeIntegralImage.kernelDerivYY(9*s,kerYY);
double lap = GIntegralImageOps.convolveSparse(ii,kerXX,x,y);
lap += GIntegralImageOps.convolveSpars... | java | public boolean computeLaplaceSign(int x, int y, double scale) {
int s = (int)Math.ceil(scale);
kerXX = DerivativeIntegralImage.kernelDerivXX(9*s,kerXX);
kerYY = DerivativeIntegralImage.kernelDerivYY(9*s,kerYY);
double lap = GIntegralImageOps.convolveSparse(ii,kerXX,x,y);
lap += GIntegralImageOps.convolveSpars... | [
"public",
"boolean",
"computeLaplaceSign",
"(",
"int",
"x",
",",
"int",
"y",
",",
"double",
"scale",
")",
"{",
"int",
"s",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"scale",
")",
";",
"kerXX",
"=",
"DerivativeIntegralImage",
".",
"kernelDerivXX",
... | Compute the sign of the Laplacian using a sparse convolution.
@param x center
@param y center
@param scale scale of the feature
@return true if positive | [
"Compute",
"the",
"sign",
"of",
"the",
"Laplacian",
"using",
"a",
"sparse",
"convolution",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L305-L313 |
50,148 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/line/FactoryDetectLineAlgs.java | FactoryDetectLineAlgs.houghPolar | public static <I extends ImageGray<I>, D extends ImageGray<D>>
DetectLineHoughPolar<I,D> houghPolar(ConfigHoughPolar config ,
Class<I> imageType ,
Class<D> derivType ) {
if( config == null )
throw new IllegalArgumentException("This is no default since minCounts must be specified");
Image... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
DetectLineHoughPolar<I,D> houghPolar(ConfigHoughPolar config ,
Class<I> imageType ,
Class<D> derivType ) {
if( config == null )
throw new IllegalArgumentException("This is no default since minCounts must be specified");
Image... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"DetectLineHoughPolar",
"<",
"I",
",",
"D",
">",
"houghPolar",
"(",
"ConfigHoughPolar",
"config",
",",
"Class",
"<",
"I",
">",
"i... | Creates a Hough line detector based on polar parametrization.
@see DetectLineHoughPolar
@param config Configuration for line detector. Can't be null.
@param imageType Type of single band input image.
@param derivType Image derivative type.
@param <I> Input image type.
@param <D> Image derivative type.
@return Line d... | [
"Creates",
"a",
"Hough",
"line",
"detector",
"based",
"on",
"polar",
"parametrization",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/line/FactoryDetectLineAlgs.java#L161-L173 |
50,149 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderContours | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
if( out == null ) {
out = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
} else {
Graphics2D g2 = out.createGraphics();
g2.set... | java | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
if( out == null ) {
out = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
} else {
Graphics2D g2 = out.createGraphics();
g2.set... | [
"public",
"static",
"BufferedImage",
"renderContours",
"(",
"List",
"<",
"Contour",
">",
"contours",
",",
"int",
"colorExternal",
",",
"int",
"colorInternal",
",",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"out",
")",
"{",
"if",
"(",
"out",... | Draws contours. Internal and external contours are different user specified colors.
@param contours List of contours
@param colorExternal RGB color
@param colorInternal RGB color
@param width Image width
@param height Image height
@param out (Optional) storage for output image
@return Rendered contours | [
"Draws",
"contours",
".",
"Internal",
"and",
"external",
"contours",
"are",
"different",
"user",
"specified",
"colors",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L77-L100 |
50,150 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.render | public static void render(List<Contour> contours , int colors[] , BufferedImage out) {
colors = checkColors(colors,contours.size());
for( int i = 0; i < contours.size(); i++ ) {
Contour c = contours.get(i);
int color = colors[i];
for(Point2D_I32 p : c.external ) {
out.setRGB(p.x,p.y,color);
}
}... | java | public static void render(List<Contour> contours , int colors[] , BufferedImage out) {
colors = checkColors(colors,contours.size());
for( int i = 0; i < contours.size(); i++ ) {
Contour c = contours.get(i);
int color = colors[i];
for(Point2D_I32 p : c.external ) {
out.setRGB(p.x,p.y,color);
}
}... | [
"public",
"static",
"void",
"render",
"(",
"List",
"<",
"Contour",
">",
"contours",
",",
"int",
"colors",
"[",
"]",
",",
"BufferedImage",
"out",
")",
"{",
"colors",
"=",
"checkColors",
"(",
"colors",
",",
"contours",
".",
"size",
"(",
")",
")",
";",
... | Renders only the external contours. Each contour is individually colored as specified by 'colors'
@param contours List of contours
@param colors List of RGB colors for each element in contours. If null then random colors will be used.
@param out (Optional) Storage for output | [
"Renders",
"only",
"the",
"external",
"contours",
".",
"Each",
"contour",
"is",
"individually",
"colored",
"as",
"specified",
"by",
"colors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L149-L161 |
50,151 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderBinary | public static BufferedImage renderBinary(GrayU8 binaryImage, boolean invert, BufferedImage out) {
if( out == null || ( out.getWidth() != binaryImage.width || out.getHeight() != binaryImage.height) ) {
out = new BufferedImage(binaryImage.getWidth(),binaryImage.getHeight(),BufferedImage.TYPE_BYTE_GRAY);
}
try ... | java | public static BufferedImage renderBinary(GrayU8 binaryImage, boolean invert, BufferedImage out) {
if( out == null || ( out.getWidth() != binaryImage.width || out.getHeight() != binaryImage.height) ) {
out = new BufferedImage(binaryImage.getWidth(),binaryImage.getHeight(),BufferedImage.TYPE_BYTE_GRAY);
}
try ... | [
"public",
"static",
"BufferedImage",
"renderBinary",
"(",
"GrayU8",
"binaryImage",
",",
"boolean",
"invert",
",",
"BufferedImage",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
"||",
"(",
"out",
".",
"getWidth",
"(",
")",
"!=",
"binaryImage",
".",
"widt... | Renders a binary image. 0 = black and 1 = white.
@param binaryImage (Input) Input binary image.
@param invert (Input) if true it will invert the image on output
@param out (Output) optional storage for output image
@return Output rendered binary image | [
"Renders",
"a",
"binary",
"image",
".",
"0",
"=",
"black",
"and",
"1",
"=",
"white",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L382-L404 |
50,152 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java | HomographyInducedStereoLinePt.process | public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
... | java | public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
... | [
"public",
"void",
"process",
"(",
"PairLineNorm",
"line",
",",
"AssociatedPair",
"point",
")",
"{",
"// t0 = (F*x) cross l'",
"GeometryMath_F64",
".",
"mult",
"(",
"F",
",",
"point",
".",
"p1",
",",
"Fx",
")",
";",
"GeometryMath_F64",
".",
"cross",
"(",
"Fx"... | Computes the homography based on a line and point on the plane
@param line Line on the plane
@param point Point on the plane | [
"Computes",
"the",
"homography",
"based",
"on",
"a",
"line",
"and",
"point",
"on",
"the",
"plane"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java#L93-L115 |
50,153 | 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 |
50,154 | 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 |
50,155 | 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 |
50,156 | 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 |
50,157 | 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 |
50,158 | 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 |
50,159 | 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 |
50,160 | 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 |
50,161 | 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 |
50,162 | 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 |
50,163 | 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 |
50,164 | 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 |
50,165 | 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 |
50,166 | 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 |
50,167 | 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 |
50,168 | 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 |
50,169 | 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 |
50,170 | 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 |
50,171 | 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 |
50,172 | 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 |
50,173 | 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 |
50,174 | 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 |
50,175 | 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 |
50,176 | 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 |
50,177 | 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 |
50,178 | 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 |
50,179 | 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 |
50,180 | 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 |
50,181 | 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 |
50,182 | 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 |
50,183 | 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 |
50,184 | 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 |
50,185 | 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 |
50,186 | 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 |
50,187 | 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 |
50,188 | 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 |
50,189 | 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 |
50,190 | 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 |
50,191 | 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 |
50,192 | 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 |
50,193 | 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 |
50,194 | 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 |
50,195 | 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 |
50,196 | 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 |
50,197 | 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 |
50,198 | 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 |
50,199 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.