repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
lessthanoptimal/BoofCV
integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/MainActivity.java
MainActivity.requestCameraPermission
private void requestCameraPermission() { int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA); if( permissionCheck != android.content.pm.PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 0); ...
java
private void requestCameraPermission() { int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA); if( permissionCheck != android.content.pm.PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 0); ...
[ "private", "void", "requestCameraPermission", "(", ")", "{", "int", "permissionCheck", "=", "ContextCompat", ".", "checkSelfPermission", "(", "this", ",", "Manifest", ".", "permission", ".", "CAMERA", ")", ";", "if", "(", "permissionCheck", "!=", "android", ".",...
Newer versions of Android require explicit permission from the user
[ "Newer", "versions", "of", "Android", "require", "explicit", "permission", "from", "the", "user" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/MainActivity.java#L66-L76
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToGray
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else ...
java
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "bitmapToGray", "(", "Bitmap", "input", ",", "T", "output", ",", "Class", "<", "T", ">", "imageType", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "imageType", ...
Converts Bitmap image into a single band image of arbitrary type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output single band image. If null a new one will be declared. @param imageType Type of single band image. @param storage Byte array used for internal ...
[ "Converts", "Bitmap", "image", "into", "a", "single", "band", "image", "of", "arbitrary", "type", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L98-L107
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToGray
public static GrayU8 bitmapToGray( Bitmap input , GrayU8 output , byte[] storage ) { if( output == null ) { output = new GrayU8( input.getWidth() , input.getHeight() ); } else { output.reshape(input.getWidth(), input.getHeight()); } if( storage == null ) storage = declareStorage(input,null); inpu...
java
public static GrayU8 bitmapToGray( Bitmap input , GrayU8 output , byte[] storage ) { if( output == null ) { output = new GrayU8( input.getWidth() , input.getHeight() ); } else { output.reshape(input.getWidth(), input.getHeight()); } if( storage == null ) storage = declareStorage(input,null); inpu...
[ "public", "static", "GrayU8", "bitmapToGray", "(", "Bitmap", "input", ",", "GrayU8", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "output", "==", "null", ")", "{", "output", "=", "new", "GrayU8", "(", "input", ".", "getWidth", "(", ...
Converts Bitmap image into GrayU8. @param input Input Bitmap image. @param output Output image. If null a new one will be declared. @param storage Byte array used for internal storage. If null it will be declared internally. @return The converted gray scale image.
[ "Converts", "Bitmap", "image", "into", "GrayU8", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L117-L132
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToPlanar
public static <T extends ImageGray<T>> Planar<T> bitmapToPlanar(Bitmap input , Planar<T> output , Class<T> type , byte[] storage ) { if( output == null ) { output = new Planar<>(type, input.getWidth(), input.getHeight(), 3); } else { int numBands = Math.min(4,Math.max(3,output.getNumBands())); output.resh...
java
public static <T extends ImageGray<T>> Planar<T> bitmapToPlanar(Bitmap input , Planar<T> output , Class<T> type , byte[] storage ) { if( output == null ) { output = new Planar<>(type, input.getWidth(), input.getHeight(), 3); } else { int numBands = Math.min(4,Math.max(3,output.getNumBands())); output.resh...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "Planar", "<", "T", ">", "bitmapToPlanar", "(", "Bitmap", "input", ",", "Planar", "<", "T", ">", "output", ",", "Class", "<", "T", ">", "type", ",", "byte", "[", "]", "storag...
Converts Bitmap image into Planar image of the appropriate type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output image. If null a new one will be declared. @param type The type of internal single band image used in the Planar image. @param storage Byte arra...
[ "Converts", "Bitmap", "image", "into", "Planar", "image", "of", "the", "appropriate", "type", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L171-L192
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.boofToBitmap
public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) { if( BOverrideConvertAndroid.invokeBoofToBitmap(ColorFormat.RGB,input,output,storage)) return; if( input instanceof Planar ) { planarToBitmap((Planar)input,output,storage); } else if( input instanceof ImageGray ) { grayT...
java
public static void boofToBitmap( ImageBase input , Bitmap output , byte[] storage) { if( BOverrideConvertAndroid.invokeBoofToBitmap(ColorFormat.RGB,input,output,storage)) return; if( input instanceof Planar ) { planarToBitmap((Planar)input,output,storage); } else if( input instanceof ImageGray ) { grayT...
[ "public", "static", "void", "boofToBitmap", "(", "ImageBase", "input", ",", "Bitmap", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "BOverrideConvertAndroid", ".", "invokeBoofToBitmap", "(", "ColorFormat", ".", "RGB", ",", "input", ",", "o...
Converts many BoofCV image types into a Bitmap. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input BoofCV image. @param output Output Bitmap image. @param storage Byte array used for internal storage. If null it will be declared internally.
[ "Converts", "many", "BoofCV", "image", "types", "into", "a", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L203-L216
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.planarToBitmap
public static <T extends ImageGray<T>> void planarToBitmap(Planar<T> input , Bitmap output , byte[] storage ) { if( output.getWidth() != input.getWidth() || output.getHeight() != input.getHeight() ) { throw new IllegalArgumentException("Image shapes are not the same"); } if( storage == null ) storage = ...
java
public static <T extends ImageGray<T>> void planarToBitmap(Planar<T> input , Bitmap output , byte[] storage ) { if( output.getWidth() != input.getWidth() || output.getHeight() != input.getHeight() ) { throw new IllegalArgumentException("Image shapes are not the same"); } if( storage == null ) storage = ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "planarToBitmap", "(", "Planar", "<", "T", ">", "input", ",", "Bitmap", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "output", ".", "getWidth", "(",...
Converts Planar image into Bitmap. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Planar image. @param output Output Bitmap image. @param storage Byte array used for internal storage. If null it will be declared internally.
[ "Converts", "Planar", "image", "into", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L311-L327
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.grayToBitmap
public static Bitmap grayToBitmap( GrayU8 input , Bitmap.Config config ) { Bitmap output = Bitmap.createBitmap(input.width, input.height, config); grayToBitmap(input,output,null); return output; }
java
public static Bitmap grayToBitmap( GrayU8 input , Bitmap.Config config ) { Bitmap output = Bitmap.createBitmap(input.width, input.height, config); grayToBitmap(input,output,null); return output; }
[ "public", "static", "Bitmap", "grayToBitmap", "(", "GrayU8", "input", ",", "Bitmap", ".", "Config", "config", ")", "{", "Bitmap", "output", "=", "Bitmap", ".", "createBitmap", "(", "input", ".", "width", ",", "input", ".", "height", ",", "config", ")", "...
Converts GrayU8 into a new Bitmap. @param input Input gray scale image. @param config Type of Bitmap image to create.
[ "Converts", "GrayU8", "into", "a", "new", "Bitmap", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L386-L392
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.process
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) { if( checkSource ) { if( checkDestination ) { processSource(matches, numSource, firstPass); processDestination(firstPass,numDestination,pruned); } else { processSource(matches, numSource, pruned); } ...
java
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) { if( checkSource ) { if( checkDestination ) { processSource(matches, numSource, firstPass); processDestination(firstPass,numDestination,pruned); } else { processSource(matches, numSource, pruned); } ...
[ "public", "void", "process", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numSource", ",", "int", "numDestination", ")", "{", "if", "(", "checkSource", ")", "{", "if", "(", "checkDestination", ")", "{", "processSource", "(", "matche...
Given a set of matches, enforce the uniqueness rules it was configured to. @param matches Set of matching features @param numSource Number of source features @param numDestination Number of destination features
[ "Given", "a", "set", "of", "matches", "enforce", "the", "uniqueness", "rules", "it", "was", "configured", "to", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L74-L89
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.processSource
private void processSource(FastQueue<AssociatedIndex> matches, int numSource, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numSource); solutions.resize(numSource); for( int i =0; i < numSource; i++ ) { solutions.data[i] = -1; } // select best matches for( int ...
java
private void processSource(FastQueue<AssociatedIndex> matches, int numSource, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numSource); solutions.resize(numSource); for( int i =0; i < numSource; i++ ) { solutions.data[i] = -1; } // select best matches for( int ...
[ "private", "void", "processSource", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numSource", ",", "FastQueue", "<", "AssociatedIndex", ">", "output", ")", "{", "//set up data structures", "scores", ".", "resize", "(", "numSource", ")", ...
Selects a subset of matches that have at most one association for each source feature.
[ "Selects", "a", "subset", "of", "matches", "that", "have", "at", "most", "one", "association", "for", "each", "source", "feature", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L94-L144
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java
AssociateUniqueByScoreAlg.processDestination
private void processDestination(FastQueue<AssociatedIndex> matches, int numDestination, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numDestination); solutions.resize(numDestination); for( int i =0; i < numDestination; i++ ) { solutions.data[i] = -1; } // select ...
java
private void processDestination(FastQueue<AssociatedIndex> matches, int numDestination, FastQueue<AssociatedIndex> output ) { //set up data structures scores.resize(numDestination); solutions.resize(numDestination); for( int i =0; i < numDestination; i++ ) { solutions.data[i] = -1; } // select ...
[ "private", "void", "processDestination", "(", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "int", "numDestination", ",", "FastQueue", "<", "AssociatedIndex", ">", "output", ")", "{", "//set up data structures", "scores", ".", "resize", "(", "numDestinat...
Selects a subset of matches that have at most one association for each destination feature.
[ "Selects", "a", "subset", "of", "matches", "that", "have", "at", "most", "one", "association", "for", "each", "destination", "feature", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L149-L199
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java
PointCloudViewerPanelSwing.applyFog
private int applyFog( int rgb , float fraction ) { // avoid floating point math int adjustment = (int)(1000*fraction); int r = (rgb >> 16)&0xFF; int g = (rgb >> 8)&0xFF; int b = rgb & 0xFF; r = (r * adjustment + ((backgroundColor>>16)&0xFF)*(1000-adjustment)) / 1000; g = (g * adjustment + ((backgroundCo...
java
private int applyFog( int rgb , float fraction ) { // avoid floating point math int adjustment = (int)(1000*fraction); int r = (rgb >> 16)&0xFF; int g = (rgb >> 8)&0xFF; int b = rgb & 0xFF; r = (r * adjustment + ((backgroundColor>>16)&0xFF)*(1000-adjustment)) / 1000; g = (g * adjustment + ((backgroundCo...
[ "private", "int", "applyFog", "(", "int", "rgb", ",", "float", "fraction", ")", "{", "// avoid floating point math", "int", "adjustment", "=", "(", "int", ")", "(", "1000", "*", "fraction", ")", ";", "int", "r", "=", "(", "rgb", ">>", "16", ")", "&", ...
Fades color into background as a function of distance
[ "Fades", "color", "into", "background", "as", "a", "function", "of", "distance" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java#L246-L259
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java
PointCloudViewerPanelSwing.renderDot
private void renderDot( int cx , int cy , float Z , int rgb ) { for (int i = -dotRadius; i <= dotRadius; i++) { int y = cy+i; if( y < 0 || y >= imageRgb.height ) continue; for (int j = -dotRadius; j <= dotRadius; j++) { int x = cx+j; if( x < 0 || x >= imageRgb.width ) continue; int pixe...
java
private void renderDot( int cx , int cy , float Z , int rgb ) { for (int i = -dotRadius; i <= dotRadius; i++) { int y = cy+i; if( y < 0 || y >= imageRgb.height ) continue; for (int j = -dotRadius; j <= dotRadius; j++) { int x = cx+j; if( x < 0 || x >= imageRgb.width ) continue; int pixe...
[ "private", "void", "renderDot", "(", "int", "cx", ",", "int", "cy", ",", "float", "Z", ",", "int", "rgb", ")", "{", "for", "(", "int", "i", "=", "-", "dotRadius", ";", "i", "<=", "dotRadius", ";", "i", "++", ")", "{", "int", "y", "=", "cy", "...
Renders a dot as a square sprite with the specified color
[ "Renders", "a", "dot", "as", "a", "square", "sprite", "with", "the", "specified", "color" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/PointCloudViewerPanelSwing.java#L264-L282
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java
VideoRenderProcessing.imageToOutput
protected void imageToOutput( double x , double y , Point2D_F64 pt ) { pt.x = x/scale - tranX/scale; pt.y = y/scale - tranY/scale; }
java
protected void imageToOutput( double x , double y , Point2D_F64 pt ) { pt.x = x/scale - tranX/scale; pt.y = y/scale - tranY/scale; }
[ "protected", "void", "imageToOutput", "(", "double", "x", ",", "double", "y", ",", "Point2D_F64", "pt", ")", "{", "pt", ".", "x", "=", "x", "/", "scale", "-", "tranX", "/", "scale", ";", "pt", ".", "y", "=", "y", "/", "scale", "-", "tranY", "/", ...
Converts a coordinate from pixel to the output image coordinates
[ "Converts", "a", "coordinate", "from", "pixel", "to", "the", "output", "image", "coordinates" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java#L139-L142
train
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java
VideoRenderProcessing.outputToImage
protected void outputToImage( double x , double y , Point2D_F64 pt ) { pt.x = x*scale + tranX; pt.y = y*scale + tranY; }
java
protected void outputToImage( double x , double y , Point2D_F64 pt ) { pt.x = x*scale + tranX; pt.y = y*scale + tranY; }
[ "protected", "void", "outputToImage", "(", "double", "x", ",", "double", "y", ",", "Point2D_F64", "pt", ")", "{", "pt", ".", "x", "=", "x", "*", "scale", "+", "tranX", ";", "pt", ".", "y", "=", "y", "*", "scale", "+", "tranY", ";", "}" ]
Converts a coordinate from output image coordinates to input image
[ "Converts", "a", "coordinate", "from", "output", "image", "coordinates", "to", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera/VideoRenderProcessing.java#L147-L150
train
lessthanoptimal/BoofCV
integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/ImplConvertJCodecPicture.java
ImplConvertJCodecPicture.RGB_to_PLU8
public static void RGB_to_PLU8(Picture input, Planar<GrayU8> output) { if( input.getColor() != ColorSpace.RGB ) throw new RuntimeException("Unexpected input color space!"); if( output.getNumBands() != 3 ) throw new RuntimeException("Unexpected number of bands in output image!"); output.reshape(input.getWid...
java
public static void RGB_to_PLU8(Picture input, Planar<GrayU8> output) { if( input.getColor() != ColorSpace.RGB ) throw new RuntimeException("Unexpected input color space!"); if( output.getNumBands() != 3 ) throw new RuntimeException("Unexpected number of bands in output image!"); output.reshape(input.getWid...
[ "public", "static", "void", "RGB_to_PLU8", "(", "Picture", "input", ",", "Planar", "<", "GrayU8", ">", "output", ")", "{", "if", "(", "input", ".", "getColor", "(", ")", "!=", "ColorSpace", ".", "RGB", ")", "throw", "new", "RuntimeException", "(", "\"Une...
Converts a picture in JCodec RGB into RGB BoofCV
[ "Converts", "a", "picture", "in", "JCodec", "RGB", "into", "RGB", "BoofCV" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-jcodec/src/main/java/boofcv/io/jcodec/ImplConvertJCodecPicture.java#L34-L61
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java
HomographyTotalLeastSquares.backsubstitution0134
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H8 = H[8]; for (int i = 0, index = 0; i < N; i++) { double x = -X.data[index],y = ...
java
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H8 = H[8]; for (int i = 0, index = 0; i < N; i++) { double x = -X.data[index],y = ...
[ "static", "void", "backsubstitution0134", "(", "DMatrixRMaj", "P_plus", ",", "DMatrixRMaj", "P", ",", "DMatrixRMaj", "X", ",", "double", "H", "[", "]", ")", "{", "final", "int", "N", "=", "P", ".", "numRows", ";", "DMatrixRMaj", "tmp", "=", "new", "DMatr...
Backsubstitution for solving for 0,1 and 3,4 using solution for 6,7,8
[ "Backsubstitution", "for", "solving", "for", "0", "1", "and", "3", "4", "using", "solution", "for", "6", "7", "8" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java#L114-L148
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java
HomographyTotalLeastSquares.constructA678
void constructA678() { final int N = X1.numRows; // Pseudo-inverse of hat(p) computePseudo(X1,P_plus); DMatrixRMaj PPpXP = new DMatrixRMaj(1,1); DMatrixRMaj PPpYP = new DMatrixRMaj(1,1); computePPXP(X1,P_plus,X2,0,PPpXP); computePPXP(X1,P_plus,X2,1,PPpYP); DMatrixRMaj PPpX = new DMatrixRMaj(1,1); D...
java
void constructA678() { final int N = X1.numRows; // Pseudo-inverse of hat(p) computePseudo(X1,P_plus); DMatrixRMaj PPpXP = new DMatrixRMaj(1,1); DMatrixRMaj PPpYP = new DMatrixRMaj(1,1); computePPXP(X1,P_plus,X2,0,PPpXP); computePPXP(X1,P_plus,X2,1,PPpYP); DMatrixRMaj PPpX = new DMatrixRMaj(1,1); D...
[ "void", "constructA678", "(", ")", "{", "final", "int", "N", "=", "X1", ".", "numRows", ";", "// Pseudo-inverse of hat(p)", "computePseudo", "(", "X1", ",", "P_plus", ")", ";", "DMatrixRMaj", "PPpXP", "=", "new", "DMatrixRMaj", "(", "1", ",", "1", ")", "...
Constructs equation for elements 6 to 8 in H
[ "Constructs", "equation", "for", "elements", "6", "to", "8", "in", "H" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java#L153-L205
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/MetricSceneGraph.java
MetricSceneGraph.sanityCheck
public void sanityCheck() { for( View v : nodes ) { for( Motion m : v.connections ) { if( m.viewDst != v && m.viewSrc != v ) throw new RuntimeException("Not member of connection"); } } for( Motion m : edges ) { if( m.viewDst != m.destination(m.viewSrc) ) throw new RuntimeException("Unexpecte...
java
public void sanityCheck() { for( View v : nodes ) { for( Motion m : v.connections ) { if( m.viewDst != v && m.viewSrc != v ) throw new RuntimeException("Not member of connection"); } } for( Motion m : edges ) { if( m.viewDst != m.destination(m.viewSrc) ) throw new RuntimeException("Unexpecte...
[ "public", "void", "sanityCheck", "(", ")", "{", "for", "(", "View", "v", ":", "nodes", ")", "{", "for", "(", "Motion", "m", ":", "v", ".", "connections", ")", "{", "if", "(", "m", ".", "viewDst", "!=", "v", "&&", "m", ".", "viewSrc", "!=", "v",...
Performs simple checks to see if the data structure is avlid
[ "Performs", "simple", "checks", "to", "see", "if", "the", "data", "structure", "is", "avlid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/MetricSceneGraph.java#L98-L110
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java
TldAdjustRegion.process
public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) { // estimate how the rectangle has changed and update it if( !estimateMotion.process(pairs.toList()) ) return false; ScaleTranslate2D motion = estimateMotion.getModelParameters(); adjustRectangle(targetRectangle,mo...
java
public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) { // estimate how the rectangle has changed and update it if( !estimateMotion.process(pairs.toList()) ) return false; ScaleTranslate2D motion = estimateMotion.getModelParameters(); adjustRectangle(targetRectangle,mo...
[ "public", "boolean", "process", "(", "FastQueue", "<", "AssociatedPair", ">", "pairs", ",", "Rectangle2D_F64", "targetRectangle", ")", "{", "// estimate how the rectangle has changed and update it", "if", "(", "!", "estimateMotion", ".", "process", "(", "pairs", ".", ...
Adjusts target rectangle using track information @param pairs List of feature location in previous and current frame. @param targetRectangle (Input) current location of rectangle. (output) adjusted location @return true if successful
[ "Adjusts", "target", "rectangle", "using", "track", "information" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java#L72-L88
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java
TldAdjustRegion.adjustRectangle
protected void adjustRectangle( Rectangle2D_F64 rect , ScaleTranslate2D motion ) { rect.p0.x = rect.p0.x*motion.scale + motion.transX; rect.p0.y = rect.p0.y*motion.scale + motion.transY; rect.p1.x = rect.p1.x*motion.scale + motion.transX; rect.p1.y = rect.p1.y*motion.scale + motion.transY; }
java
protected void adjustRectangle( Rectangle2D_F64 rect , ScaleTranslate2D motion ) { rect.p0.x = rect.p0.x*motion.scale + motion.transX; rect.p0.y = rect.p0.y*motion.scale + motion.transY; rect.p1.x = rect.p1.x*motion.scale + motion.transX; rect.p1.y = rect.p1.y*motion.scale + motion.transY; }
[ "protected", "void", "adjustRectangle", "(", "Rectangle2D_F64", "rect", ",", "ScaleTranslate2D", "motion", ")", "{", "rect", ".", "p0", ".", "x", "=", "rect", ".", "p0", ".", "x", "*", "motion", ".", "scale", "+", "motion", ".", "transX", ";", "rect", ...
Estimate motion of points inside the rectangle and updates the rectangle using the found motion.
[ "Estimate", "motion", "of", "points", "inside", "the", "rectangle", "and", "updates", "the", "rectangle", "using", "the", "found", "motion", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java#L93-L98
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java
ExampleAssociatePoints.associate
public void associate( BufferedImage imageA , BufferedImage imageB ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // stores the location of detected interest points pointsA = new ArrayList<>(); point...
java
public void associate( BufferedImage imageA , BufferedImage imageB ) { T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType); T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType); // stores the location of detected interest points pointsA = new ArrayList<>(); point...
[ "public", "void", "associate", "(", "BufferedImage", "imageA", ",", "BufferedImage", "imageB", ")", "{", "T", "inputA", "=", "ConvertBufferedImage", ".", "convertFromSingle", "(", "imageA", ",", "null", ",", "imageType", ")", ";", "T", "inputB", "=", "ConvertB...
Detect and associate point features in the two images. Display the results.
[ "Detect", "and", "associate", "point", "features", "in", "the", "two", "images", ".", "Display", "the", "results", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleAssociatePoints.java#L76-L104
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.waveletVisu
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletVisu( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPixe...
java
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletVisu( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPixe...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "WaveletDenoiseFilter", "<", "T", ">", "waveletVisu", "(", "Class", "<", "T", ">", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue",...
Denoises an image using VISU Shrink wavelet denoiser. @param imageType The type of image being transform. @param numLevels Number of levels in the wavelet transform. If not sure, try using 3. @param minPixelValue Minimum allowed pixel intensity value @param maxPixelValue Maximum allowed pixel intensity value @return ...
[ "Denoises", "an", "image", "using", "VISU", "Shrink", "wavelet", "denoiser", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L55-L63
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.waveletBayes
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletBayes( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPix...
java
public static <T extends ImageGray<T>> WaveletDenoiseFilter<T> waveletBayes( Class<T> imageType , int numLevels , double minPixelValue , double maxPixelValue ) { ImageDataType info = ImageDataType.classToType(imageType); WaveletTransform descTran = createDefaultShrinkTransform(info, numLevels,minPixelValue,maxPix...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "WaveletDenoiseFilter", "<", "T", ">", "waveletBayes", "(", "Class", "<", "T", ">", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue"...
Denoises an image using BayesShrink wavelet denoiser. @param imageType The type of image being transform. @param numLevels Number of levels in the wavelet transform. If not sure, try using 3. @param minPixelValue Minimum allowed pixel intensity value @param maxPixelValue Maximum allowed pixel intensity value @return ...
[ "Denoises", "an", "image", "using", "BayesShrink", "wavelet", "denoiser", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L74-L82
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java
FactoryImageDenoise.createDefaultShrinkTransform
private static WaveletTransform createDefaultShrinkTransform(ImageDataType imageType, int numLevels, double minPixelValue , double maxPixelValue ) { WaveletTransform descTran; if( !imageType.isInteger()) { WaveletDescription<WlCoef_F32> waveletDesc_F32 = FactoryWaveletDaub.daubJ_F32(4); des...
java
private static WaveletTransform createDefaultShrinkTransform(ImageDataType imageType, int numLevels, double minPixelValue , double maxPixelValue ) { WaveletTransform descTran; if( !imageType.isInteger()) { WaveletDescription<WlCoef_F32> waveletDesc_F32 = FactoryWaveletDaub.daubJ_F32(4); des...
[ "private", "static", "WaveletTransform", "createDefaultShrinkTransform", "(", "ImageDataType", "imageType", ",", "int", "numLevels", ",", "double", "minPixelValue", ",", "double", "maxPixelValue", ")", "{", "WaveletTransform", "descTran", ";", "if", "(", "!", "imageTy...
Default wavelet transform used for denoising images.
[ "Default", "wavelet", "transform", "used", "for", "denoising", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/abst/denoise/FactoryImageDenoise.java#L106-L122
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.minusPOffset
public static int minusPOffset(int index, int offset, int size) { index -= offset; if( index < 0 ) { return size + index; } else { return index; } }
java
public static int minusPOffset(int index, int offset, int size) { index -= offset; if( index < 0 ) { return size + index; } else { return index; } }
[ "public", "static", "int", "minusPOffset", "(", "int", "index", ",", "int", "offset", ",", "int", "size", ")", "{", "index", "-=", "offset", ";", "if", "(", "index", "<", "0", ")", "{", "return", "size", "+", "index", ";", "}", "else", "{", "return...
Subtracts a positive offset to index in a circular buffer. @param index element in circular buffer @param offset integer which is positive and less than size @param size size of the circular buffer @return new index
[ "Subtracts", "a", "positive", "offset", "to", "index", "in", "a", "circular", "buffer", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L47-L54
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.distanceP
public static int distanceP(int index0, int index1, int size) { int difference = index1-index0; if( difference < 0 ) { difference = size+difference; } return difference; }
java
public static int distanceP(int index0, int index1, int size) { int difference = index1-index0; if( difference < 0 ) { difference = size+difference; } return difference; }
[ "public", "static", "int", "distanceP", "(", "int", "index0", ",", "int", "index1", ",", "int", "size", ")", "{", "int", "difference", "=", "index1", "-", "index0", ";", "if", "(", "difference", "<", "0", ")", "{", "difference", "=", "size", "+", "di...
Returns how many elements away in the positive direction you need to travel to get from index0 to index1. @param index0 element in circular buffer @param index1 element in circular buffer @param size size of the circular buffer @return positive distance
[ "Returns", "how", "many", "elements", "away", "in", "the", "positive", "direction", "you", "need", "to", "travel", "to", "get", "from", "index0", "to", "index1", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L82-L88
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java
CircularIndex.subtract
public static int subtract(int index0, int index1, int size) { int distance = distanceP(index0, index1, size); if( distance >= size/2+size%2 ) { return distance-size; } else { return distance; } }
java
public static int subtract(int index0, int index1, int size) { int distance = distanceP(index0, index1, size); if( distance >= size/2+size%2 ) { return distance-size; } else { return distance; } }
[ "public", "static", "int", "subtract", "(", "int", "index0", ",", "int", "index1", ",", "int", "size", ")", "{", "int", "distance", "=", "distanceP", "(", "index0", ",", "index1", ",", "size", ")", ";", "if", "(", "distance", ">=", "size", "/", "2", ...
Subtracts index1 from index0. positive number if its closer in the positive direction or negative if closer in the negative direction. if equal distance then it will return a negative number. @param index0 element in circular buffer @param index1 element in circular buffer @param size size of the circular buffer @ret...
[ "Subtracts", "index1", "from", "index0", ".", "positive", "number", "if", "its", "closer", "in", "the", "positive", "direction", "or", "negative", "if", "closer", "in", "the", "negative", "direction", ".", "if", "equal", "distance", "then", "it", "will", "re...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L122-L129
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java
StandardAlgConfigPanel.removeChildInsidePanel
protected static void removeChildInsidePanel( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { try { JPanel p = (JPanel)root.getComponent(i); Component[] children = p.getComponents(); for (int j = 0; j < children.length; j++) { if( children...
java
protected static void removeChildInsidePanel( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { try { JPanel p = (JPanel)root.getComponent(i); Component[] children = p.getComponents(); for (int j = 0; j < children.length; j++) { if( children...
[ "protected", "static", "void", "removeChildInsidePanel", "(", "JComponent", "root", ",", "JComponent", "target", ")", "{", "int", "N", "=", "root", ".", "getComponentCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Searches inside the children of "root" for a component that's a JPanel. Then inside the JPanel it looks for the target. If the target is inside the JPanel the JPanel is removed from root.
[ "Searches", "inside", "the", "children", "of", "root", "for", "a", "component", "that", "s", "a", "JPanel", ".", "Then", "inside", "the", "JPanel", "it", "looks", "for", "the", "target", ".", "If", "the", "target", "is", "inside", "the", "JPanel", "the",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java#L263-L278
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java
StandardAlgConfigPanel.removeChildAndPrevious
protected static void removeChildAndPrevious( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { if( root.getComponent(i) == target ) { root.remove(i); root.remove(i-1); return; } } throw new RuntimeException("Can't find component"); }
java
protected static void removeChildAndPrevious( JComponent root , JComponent target ) { int N = root.getComponentCount(); for (int i = 0; i < N; i++) { if( root.getComponent(i) == target ) { root.remove(i); root.remove(i-1); return; } } throw new RuntimeException("Can't find component"); }
[ "protected", "static", "void", "removeChildAndPrevious", "(", "JComponent", "root", ",", "JComponent", "target", ")", "{", "int", "N", "=", "root", ".", "getComponentCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Searches inside the children of "root" for 'target'. If found it is removed and the previous component.
[ "Searches", "inside", "the", "children", "of", "root", "for", "target", ".", "If", "found", "it", "is", "removed", "and", "the", "previous", "component", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java#L284-L295
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java
SegmentMeanShiftSearch.distanceSq
public static float distanceSq( float[] a , float[]b ) { float ret = 0; for( int i = 0; i < a.length; i++ ) { float d = a[i] - b[i]; ret += d*d; } return ret; }
java
public static float distanceSq( float[] a , float[]b ) { float ret = 0; for( int i = 0; i < a.length; i++ ) { float d = a[i] - b[i]; ret += d*d; } return ret; }
[ "public", "static", "float", "distanceSq", "(", "float", "[", "]", "a", ",", "float", "[", "]", "b", ")", "{", "float", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "a", ".", "length", ";", "i", "++", ")", "{", "fl...
Returns the Euclidean distance squared between the two vectors
[ "Returns", "the", "Euclidean", "distance", "squared", "between", "the", "two", "vectors" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java#L173-L180
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java
SegmentMeanShiftSearch.weight
protected float weight( float distance ) { float findex = distance*100f; int index = (int)findex; if( index >= 99 ) return weightTable[99]; float sample0 = weightTable[index]; float sample1 = weightTable[index+1]; float w = findex-index; return sample0*(1f-w) + sample1*w; }
java
protected float weight( float distance ) { float findex = distance*100f; int index = (int)findex; if( index >= 99 ) return weightTable[99]; float sample0 = weightTable[index]; float sample1 = weightTable[index+1]; float w = findex-index; return sample0*(1f-w) + sample1*w; }
[ "protected", "float", "weight", "(", "float", "distance", ")", "{", "float", "findex", "=", "distance", "*", "100f", ";", "int", "index", "=", "(", "int", ")", "findex", ";", "if", "(", "index", ">=", "99", ")", "return", "weightTable", "[", "99", "]...
Returns the weight given the normalized distance. Instead of computing the kernel distance every time a lookup table with linear interpolation is used. The distance has a domain from 0 to 1, inclusive @param distance Normalized Euclidean distance squared. From 0 to 1. @return Weight.
[ "Returns", "the", "weight", "given", "the", "normalized", "distance", ".", "Instead", "of", "computing", "the", "kernel", "distance", "every", "time", "a", "lookup", "table", "with", "linear", "interpolation", "is", "used", ".", "The", "distance", "has", "a", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java#L189-L201
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/FeatureToWordHistogram_F64.java
FeatureToWordHistogram_F64.process
@Override public void process() { processed = true; for (int i = 0; i < histogram.length; i++) { histogram[i] /= total; } }
java
@Override public void process() { processed = true; for (int i = 0; i < histogram.length; i++) { histogram[i] /= total; } }
[ "@", "Override", "public", "void", "process", "(", ")", "{", "processed", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "histogram", ".", "length", ";", "i", "++", ")", "{", "histogram", "[", "i", "]", "/=", "total", ";", "...
No more features are being added. Normalized the computed histogram.
[ "No", "more", "features", "are", "being", "added", ".", "Normalized", "the", "computed", "histogram", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/FeatureToWordHistogram_F64.java#L97-L103
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.transform
public void transform( GrayU8 binary ) { ImageMiscOps.fill(transform, 0); originX = binary.width/2; originY = binary.height/2; r_max = Math.sqrt(originX*originX+originY*originY); for( int y = 0; y < binary.height; y++ ) { int start = binary.startIndex + y*binary.stride; int stop = start + binary.widt...
java
public void transform( GrayU8 binary ) { ImageMiscOps.fill(transform, 0); originX = binary.width/2; originY = binary.height/2; r_max = Math.sqrt(originX*originX+originY*originY); for( int y = 0; y < binary.height; y++ ) { int start = binary.startIndex + y*binary.stride; int stop = start + binary.widt...
[ "public", "void", "transform", "(", "GrayU8", "binary", ")", "{", "ImageMiscOps", ".", "fill", "(", "transform", ",", "0", ")", ";", "originX", "=", "binary", ".", "width", "/", "2", ";", "originY", "=", "binary", ".", "height", "/", "2", ";", "r_max...
Computes the Hough transform of the image. @param binary Binary image that indicates which pixels lie on edges.
[ "Computes", "the", "Hough", "transform", "of", "the", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L114-L132
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.lineToCoordinate
public void lineToCoordinate(LineParametric2D_F32 line , Point2D_F64 coordinate ) { line = line.copy(); line.p.x -= originX; line.p.y -= originY; LinePolar2D_F32 polar = new LinePolar2D_F32(); UtilLine2D_F32.convert(line,polar); if( polar.angle < 0 ) { polar.distance = -polar.distance; polar.angle = ...
java
public void lineToCoordinate(LineParametric2D_F32 line , Point2D_F64 coordinate ) { line = line.copy(); line.p.x -= originX; line.p.y -= originY; LinePolar2D_F32 polar = new LinePolar2D_F32(); UtilLine2D_F32.convert(line,polar); if( polar.angle < 0 ) { polar.distance = -polar.distance; polar.angle = ...
[ "public", "void", "lineToCoordinate", "(", "LineParametric2D_F32", "line", ",", "Point2D_F64", "coordinate", ")", "{", "line", "=", "line", ".", "copy", "(", ")", ";", "line", ".", "p", ".", "x", "-=", "originX", ";", "line", ".", "p", ".", "y", "-=", ...
Compute the parameterized coordinate for the line
[ "Compute", "the", "parameterized", "coordinate", "for", "the", "line" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L173-L189
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java
HoughTransformLinePolar.parameterize
public void parameterize( int x , int y ) { // put the point in a new coordinate system centered at the image's origin x -= originX; y -= originY; int w2 = transform.width/2; // The line's slope is encoded using the tangent angle. Those bins are along the image's y-axis for( int i = 0; i < transform.hei...
java
public void parameterize( int x , int y ) { // put the point in a new coordinate system centered at the image's origin x -= originX; y -= originY; int w2 = transform.width/2; // The line's slope is encoded using the tangent angle. Those bins are along the image's y-axis for( int i = 0; i < transform.hei...
[ "public", "void", "parameterize", "(", "int", "x", ",", "int", "y", ")", "{", "// put the point in a new coordinate system centered at the image's origin", "x", "-=", "originX", ";", "y", "-=", "originY", ";", "int", "w2", "=", "transform", ".", "width", "/", "2...
Converts the pixel coordinate into a line in parameter space
[ "Converts", "the", "pixel", "coordinate", "into", "a", "line", "in", "parameter", "space" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/HoughTransformLinePolar.java#L194-L212
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/struct/geo/PairLineNorm.java
PairLineNorm.set
public void set( Vector3D_F64 l1 , Vector3D_F64 l2 ) { this.l1.set(l1); this.l2.set(l2); }
java
public void set( Vector3D_F64 l1 , Vector3D_F64 l2 ) { this.l1.set(l1); this.l2.set(l2); }
[ "public", "void", "set", "(", "Vector3D_F64", "l1", ",", "Vector3D_F64", "l2", ")", "{", "this", ".", "l1", ".", "set", "(", "l1", ")", ";", "this", ".", "l2", ".", "set", "(", "l2", ")", ";", "}" ]
Sets the value of p1 and p2 to be equal to the values of the passed in objects
[ "Sets", "the", "value", "of", "p1", "and", "p2", "to", "be", "equal", "to", "the", "values", "of", "the", "passed", "in", "objects" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/geo/PairLineNorm.java#L87-L90
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java
ClassifierKNearestNeighborsBow.setClassificationData
public void setClassificationData(List<HistogramScene> memory , int numScenes ) { nn.setPoints(memory, false); scenes = new double[ numScenes ]; }
java
public void setClassificationData(List<HistogramScene> memory , int numScenes ) { nn.setPoints(memory, false); scenes = new double[ numScenes ]; }
[ "public", "void", "setClassificationData", "(", "List", "<", "HistogramScene", ">", "memory", ",", "int", "numScenes", ")", "{", "nn", ".", "setPoints", "(", "memory", ",", "false", ")", ";", "scenes", "=", "new", "double", "[", "numScenes", "]", ";", "}...
Provides a set of labeled word histograms to use to classify a new image @param memory labeled histograms
[ "Provides", "a", "set", "of", "labeled", "word", "histograms", "to", "use", "to", "classify", "a", "new", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java#L98-L103
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java
ClassifierKNearestNeighborsBow.classify
public int classify(T image) { if( numNeighbors == 0 ) throw new IllegalArgumentException("Must specify number of neighbors!"); // compute all the features inside the image describe.process(image); // find which word the feature matches and construct a frequency histogram featureToHistogram.reset(); Li...
java
public int classify(T image) { if( numNeighbors == 0 ) throw new IllegalArgumentException("Must specify number of neighbors!"); // compute all the features inside the image describe.process(image); // find which word the feature matches and construct a frequency histogram featureToHistogram.reset(); Li...
[ "public", "int", "classify", "(", "T", "image", ")", "{", "if", "(", "numNeighbors", "==", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Must specify number of neighbors!\"", ")", ";", "// compute all the features inside the image", "describe", ".", "p...
Finds the scene which most resembles the provided image @param image Image that's to be classified @return The index of the scene it most resembles
[ "Finds", "the", "scene", "which", "most", "resembles", "the", "provided", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/scene/ClassifierKNearestNeighborsBow.java#L110-L154
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java
ExamplePyramidDiscrete.unusual
public void unusual() { // Note that the first level does not have to be one pyramid = FactoryPyramid.discreteGaussian(new int[]{2,6},-1,2,true, ImageType.single(imageType)); // Other kernels can also be used besides Gaussian Kernel1D kernel; if(GeneralizedImageOps.isFloatingPoint(imageType) ) { kernel = ...
java
public void unusual() { // Note that the first level does not have to be one pyramid = FactoryPyramid.discreteGaussian(new int[]{2,6},-1,2,true, ImageType.single(imageType)); // Other kernels can also be used besides Gaussian Kernel1D kernel; if(GeneralizedImageOps.isFloatingPoint(imageType) ) { kernel = ...
[ "public", "void", "unusual", "(", ")", "{", "// Note that the first level does not have to be one", "pyramid", "=", "FactoryPyramid", ".", "discreteGaussian", "(", "new", "int", "[", "]", "{", "2", ",", "6", "}", ",", "-", "1", ",", "2", ",", "true", ",", ...
Creates a more unusual pyramid and updater.
[ "Creates", "a", "more", "unusual", "pyramid", "and", "updater", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java#L66-L77
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java
ExamplePyramidDiscrete.process
public void process( BufferedImage image ) { T input = ConvertBufferedImage.convertFromSingle(image, null, imageType); pyramid.process(input); DiscretePyramidPanel gui = new DiscretePyramidPanel(); gui.setPyramid(pyramid); gui.render(); ShowImages.showWindow(gui,"Image Pyramid"); // To get an image at ...
java
public void process( BufferedImage image ) { T input = ConvertBufferedImage.convertFromSingle(image, null, imageType); pyramid.process(input); DiscretePyramidPanel gui = new DiscretePyramidPanel(); gui.setPyramid(pyramid); gui.render(); ShowImages.showWindow(gui,"Image Pyramid"); // To get an image at ...
[ "public", "void", "process", "(", "BufferedImage", "image", ")", "{", "T", "input", "=", "ConvertBufferedImage", ".", "convertFromSingle", "(", "image", ",", "null", ",", "imageType", ")", ";", "pyramid", ".", "process", "(", "input", ")", ";", "DiscretePyra...
Updates and displays the pyramid.
[ "Updates", "and", "displays", "the", "pyramid", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExamplePyramidDiscrete.java#L82-L96
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createLaplacian
public static <T extends ImageGray<T>> ImageFunctionSparse<T> createLaplacian( Class<T> imageType , ImageBorder<T> border ) { if( border == null ) { border = FactoryImageBorder.single(imageType, BorderType.EXTENDED); } if( GeneralizedImageOps.isFloatingPoint(imageType)) { ImageConvolveSparse<GrayF32, Ker...
java
public static <T extends ImageGray<T>> ImageFunctionSparse<T> createLaplacian( Class<T> imageType , ImageBorder<T> border ) { if( border == null ) { border = FactoryImageBorder.single(imageType, BorderType.EXTENDED); } if( GeneralizedImageOps.isFloatingPoint(imageType)) { ImageConvolveSparse<GrayF32, Ker...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "ImageFunctionSparse", "<", "T", ">", "createLaplacian", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "border", ")", "{", "if", "(", "border", "==...
Creates a sparse Laplacian filter. @see DerivativeLaplacian @param imageType The type of image which is to be processed. @param border How the border should be handled. If null {@link BorderType#EXTENDED} will be used. @return Filter for performing a sparse laplacian.
[ "Creates", "a", "sparse", "Laplacian", "filter", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L58-L78
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createSobel
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createSobel( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseSobel_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createSobel( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseSobel_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createSobel", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse sobel gradient operator. @see GradientSobel @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient
[ "Creates", "a", "sparse", "sobel", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L89-L99
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createPrewitt
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createPrewitt( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparsePrewitt_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createPrewitt( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparsePrewitt_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createPrewitt", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse prewitt gradient operator. @see boofcv.alg.filter.derivative.GradientPrewitt @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "prewitt", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L110-L120
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createThree
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createThree( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseThree_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createThree( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseThree_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ ret...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createThree", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", ...
Creates a sparse three gradient operator. @see boofcv.alg.filter.derivative.GradientThree @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "three", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L131-L141
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createTwo0
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo0( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo0_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo0( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo0_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createTwo0", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "...
Creates a sparse two-0 gradient operator. @see boofcv.alg.filter.derivative.GradientTwo0 @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "two", "-", "0", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L152-L162
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java
FactoryDerivativeSparse.createTwo1
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo1( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo1_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
java
public static <T extends ImageGray<T>, G extends GradientValue> SparseImageGradient<T,G> createTwo1( Class<T> imageType , ImageBorder<T> border ) { if( imageType == GrayF32.class) { return (SparseImageGradient)new GradientSparseTwo1_F32((ImageBorder_F32)border); } else if( imageType == GrayU8.class ){ retur...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ",", "G", "extends", "GradientValue", ">", "SparseImageGradient", "<", "T", ",", "G", ">", "createTwo1", "(", "Class", "<", "T", ">", "imageType", ",", "ImageBorder", "<", "T", ">", "...
Creates a sparse two-1 gradient operator. @see boofcv.alg.filter.derivative.GradientTwo1 @param imageType The type of image which is to be processed. @param border How the border should be handled. If null then the borders can't be processed. @return Sparse gradient.
[ "Creates", "a", "sparse", "two", "-", "1", "gradient", "operator", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/derivative/FactoryDerivativeSparse.java#L173-L183
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java
DenseFlowPyramidBase.process
public void process( T image1 , T image2 ) { // declare image data structures if( pyr1 == null || pyr1.getInputWidth() != image1.width || pyr1.getInputHeight() != image1.height ) { pyr1 = UtilDenseOpticalFlow.standardPyramid(image1.width, image1.height, scale, sigma, 5, maxLayers, GrayF32.class); pyr2 = Util...
java
public void process( T image1 , T image2 ) { // declare image data structures if( pyr1 == null || pyr1.getInputWidth() != image1.width || pyr1.getInputHeight() != image1.height ) { pyr1 = UtilDenseOpticalFlow.standardPyramid(image1.width, image1.height, scale, sigma, 5, maxLayers, GrayF32.class); pyr2 = Util...
[ "public", "void", "process", "(", "T", "image1", ",", "T", "image2", ")", "{", "// declare image data structures", "if", "(", "pyr1", "==", "null", "||", "pyr1", ".", "getInputWidth", "(", ")", "!=", "image1", ".", "width", "||", "pyr1", ".", "getInputHeig...
Processes the raw input images. Normalizes them and creates image pyramids from them.
[ "Processes", "the", "raw", "input", "images", ".", "Normalizes", "them", "and", "creates", "image", "pyramids", "from", "them", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java#L67-L90
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java
DenseFlowPyramidBase.imageNormalization
protected static<T extends ImageGray<T>> void imageNormalization(T image1, T image2, GrayF32 normalized1, GrayF32 normalized2 ) { // find the max and min of both images float max1 = (float)GImageStatistics.max(image1); float max2 = (float)GImageStatistics.max(image2); float min1 = (float)GImageStatistics.min(...
java
protected static<T extends ImageGray<T>> void imageNormalization(T image1, T image2, GrayF32 normalized1, GrayF32 normalized2 ) { // find the max and min of both images float max1 = (float)GImageStatistics.max(image1); float max2 = (float)GImageStatistics.max(image2); float min1 = (float)GImageStatistics.min(...
[ "protected", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "imageNormalization", "(", "T", "image1", ",", "T", "image2", ",", "GrayF32", "normalized1", ",", "GrayF32", "normalized2", ")", "{", "// find the max and min of both images", "...
Function to normalize the images between 0 and 255.
[ "Function", "to", "normalize", "the", "images", "between", "0", "and", "255", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/DenseFlowPyramidBase.java#L152-L184
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java
HomographyInducedStereo3Pts.process
public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) { // Fill rows of M with observations from image 1 fillM(p1.p1,p2.p1,p3.p1); // Compute 'b' vector b.x = computeB(p1.p2); b.y = computeB(p2.p2); b.z = computeB(p3.p2); // A_inv_b = inv(A)*b if( !solver.setA(M) ) return...
java
public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) { // Fill rows of M with observations from image 1 fillM(p1.p1,p2.p1,p3.p1); // Compute 'b' vector b.x = computeB(p1.p2); b.y = computeB(p2.p2); b.z = computeB(p3.p2); // A_inv_b = inv(A)*b if( !solver.setA(M) ) return...
[ "public", "boolean", "process", "(", "AssociatedPair", "p1", ",", "AssociatedPair", "p2", ",", "AssociatedPair", "p3", ")", "{", "// Fill rows of M with observations from image 1", "fillM", "(", "p1", ".", "p1", ",", "p2", ".", "p1", ",", "p3", ".", "p1", ")",...
Estimates the homography from view 1 to view 2 induced by a plane from 3 point associations. Each pair must pass the epipolar constraint. This can fail if the points are colinear. @param p1 Associated point observation @param p2 Associated point observation @param p3 Associated point observation @return True if succe...
[ "Estimates", "the", "homography", "from", "view", "1", "to", "view", "2", "induced", "by", "a", "plane", "from", "3", "point", "associations", ".", "Each", "pair", "must", "pass", "the", "epipolar", "constraint", ".", "This", "can", "fail", "if", "the", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java#L104-L128
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java
HomographyInducedStereo3Pts.fillM
private void fillM( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) { M.data[0] = x1.x; M.data[1] = x1.y; M.data[2] = 1; M.data[3] = x2.x; M.data[4] = x2.y; M.data[5] = 1; M.data[6] = x3.x; M.data[7] = x3.y; M.data[8] = 1; }
java
private void fillM( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) { M.data[0] = x1.x; M.data[1] = x1.y; M.data[2] = 1; M.data[3] = x2.x; M.data[4] = x2.y; M.data[5] = 1; M.data[6] = x3.x; M.data[7] = x3.y; M.data[8] = 1; }
[ "private", "void", "fillM", "(", "Point2D_F64", "x1", ",", "Point2D_F64", "x2", ",", "Point2D_F64", "x3", ")", "{", "M", ".", "data", "[", "0", "]", "=", "x1", ".", "x", ";", "M", ".", "data", "[", "1", "]", "=", "x1", ".", "y", ";", "M", "."...
Fill rows of M with observations from image 1
[ "Fill", "rows", "of", "M", "with", "observations", "from", "image", "1" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo3Pts.java#L133-L137
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java
DecomposeAbsoluteDualQuadratic.decompose
public boolean decompose( DMatrix4x4 Q ) { // scale Q so that Q(3,3) = 1 to provide a uniform scaling CommonOps_DDF4.scale(1.0/Q.a33,Q); // TODO consider using eigen decomposition like it was suggested // Directly extract from the definition of Q // Q = [w -w*p;-p'*w p'*w*p] // w = k*k' k.a11 = Q.a11;k...
java
public boolean decompose( DMatrix4x4 Q ) { // scale Q so that Q(3,3) = 1 to provide a uniform scaling CommonOps_DDF4.scale(1.0/Q.a33,Q); // TODO consider using eigen decomposition like it was suggested // Directly extract from the definition of Q // Q = [w -w*p;-p'*w p'*w*p] // w = k*k' k.a11 = Q.a11;k...
[ "public", "boolean", "decompose", "(", "DMatrix4x4", "Q", ")", "{", "// scale Q so that Q(3,3) = 1 to provide a uniform scaling", "CommonOps_DDF4", ".", "scale", "(", "1.0", "/", "Q", ".", "a33", ",", "Q", ")", ";", "// TODO consider using eigen decomposition like it was ...
Decomposes the passed in absolute quadratic @param Q Absolute quadratic @return true if successful or false if it failed
[ "Decomposes", "the", "passed", "in", "absolute", "quadratic" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L54-L92
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java
DecomposeAbsoluteDualQuadratic.recomputeQ
public void recomputeQ( DMatrix4x4 Q ) { CommonOps_DDF3.multTransB(k,k,w); Q.a11 = w.a11;Q.a12 = w.a12;Q.a13 = w.a13; Q.a21 = w.a21;Q.a22 = w.a22;Q.a23 = w.a23; Q.a31 = w.a31;Q.a32 = w.a32;Q.a33 = w.a33; CommonOps_DDF3.mult(w,p,t); CommonOps_DDF3.scale(-1,t); Q.a14 = t.a1;Q.a24 = t.a2;Q.a34 = t.a3; Q...
java
public void recomputeQ( DMatrix4x4 Q ) { CommonOps_DDF3.multTransB(k,k,w); Q.a11 = w.a11;Q.a12 = w.a12;Q.a13 = w.a13; Q.a21 = w.a21;Q.a22 = w.a22;Q.a23 = w.a23; Q.a31 = w.a31;Q.a32 = w.a32;Q.a33 = w.a33; CommonOps_DDF3.mult(w,p,t); CommonOps_DDF3.scale(-1,t); Q.a14 = t.a1;Q.a24 = t.a2;Q.a34 = t.a3; Q...
[ "public", "void", "recomputeQ", "(", "DMatrix4x4", "Q", ")", "{", "CommonOps_DDF3", ".", "multTransB", "(", "k", ",", "k", ",", "w", ")", ";", "Q", ".", "a11", "=", "w", ".", "a11", ";", "Q", ".", "a12", "=", "w", ".", "a12", ";", "Q", ".", "...
Recomputes Q from w and p. @param Q Storage for the recomputed Q
[ "Recomputes", "Q", "from", "w", "and", "p", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L99-L113
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java
DecomposeAbsoluteDualQuadratic.computeRectifyingHomography
public boolean computeRectifyingHomography( DMatrixRMaj H ) { H.reshape(4,4); // insert the results into H // H = [K 0;-p'*K 1 ] H.zero(); for (int i = 0; i < 3; i++) { for (int j = i; j < 3; j++) { H.set(i,j,k.get(i,j)); } } // p and k have different scales, fix that H.set(3,0, -(p.a1*k.a11 ...
java
public boolean computeRectifyingHomography( DMatrixRMaj H ) { H.reshape(4,4); // insert the results into H // H = [K 0;-p'*K 1 ] H.zero(); for (int i = 0; i < 3; i++) { for (int j = i; j < 3; j++) { H.set(i,j,k.get(i,j)); } } // p and k have different scales, fix that H.set(3,0, -(p.a1*k.a11 ...
[ "public", "boolean", "computeRectifyingHomography", "(", "DMatrixRMaj", "H", ")", "{", "H", ".", "reshape", "(", "4", ",", "4", ")", ";", "// insert the results into H", "// H = [K 0;-p'*K 1 ]", "H", ".", "zero", "(", ")", ";", "for", "(", "int", "i", "=", ...
Computes the rectifying homography from the decomposed Q H = [K 0; -p'*K 1] see Pg 460
[ "Computes", "the", "rectifying", "homography", "from", "the", "decomposed", "Q" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/DecomposeAbsoluteDualQuadratic.java#L120-L138
train
lessthanoptimal/BoofCV
integration/boofcv-WebcamCapture/examples/boofcv/examples/ExampleWebcamObjectTracking.java
ExampleWebcamObjectTracking.process
public void process() { Webcam webcam = UtilWebcamCapture.openDefault(desiredWidth,desiredHeight); // adjust the window size and let the GUI know it has changed Dimension actualSize = webcam.getViewSize(); setPreferredSize(actualSize); setMinimumSize(actualSize); window.setMinimumSize(actualSize); window...
java
public void process() { Webcam webcam = UtilWebcamCapture.openDefault(desiredWidth,desiredHeight); // adjust the window size and let the GUI know it has changed Dimension actualSize = webcam.getViewSize(); setPreferredSize(actualSize); setMinimumSize(actualSize); window.setMinimumSize(actualSize); window...
[ "public", "void", "process", "(", ")", "{", "Webcam", "webcam", "=", "UtilWebcamCapture", ".", "openDefault", "(", "desiredWidth", ",", "desiredHeight", ")", ";", "// adjust the window size and let the GUI know it has changed", "Dimension", "actualSize", "=", "webcam", ...
Invoke to start the main processing loop.
[ "Invoke", "to", "start", "the", "main", "processing", "loop", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-WebcamCapture/examples/boofcv/examples/ExampleWebcamObjectTracking.java#L92-L144
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java
ExampleFeatureSurf.easy
public static void easy( GrayF32 image ) { // create the detector and descriptors DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe. surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class); // specify the image to process surf.detect(image); System.out.p...
java
public static void easy( GrayF32 image ) { // create the detector and descriptors DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe. surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class); // specify the image to process surf.detect(image); System.out.p...
[ "public", "static", "void", "easy", "(", "GrayF32", "image", ")", "{", "// create the detector and descriptors", "DetectDescribePoint", "<", "GrayF32", ",", "BrightFeature", ">", "surf", "=", "FactoryDetectDescribe", ".", "surfStable", "(", "new", "ConfigFastHessian", ...
Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility and slightly increases memory and computational requirements. @param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too
[ "Use", "generalized", "interfaces", "for", "working", "with", "SURF", ".", "This", "removes", "much", "of", "the", "drudgery", "but", "also", "reduces", "flexibility", "and", "slightly", "increases", "memory", "and", "computational", "requirements", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L59-L69
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java
ExampleFeatureSurf.harder
public static <II extends ImageGray<II>> void harder(GrayF32 image ) { // SURF works off of integral images Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class); // define the feature detection algorithm NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(2...
java
public static <II extends ImageGray<II>> void harder(GrayF32 image ) { // SURF works off of integral images Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class); // define the feature detection algorithm NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(2...
[ "public", "static", "<", "II", "extends", "ImageGray", "<", "II", ">", ">", "void", "harder", "(", "GrayF32", "image", ")", "{", "// SURF works off of integral images", "Class", "<", "II", ">", "integralType", "=", "GIntegralImageOps", ".", "getIntegralType", "(...
Configured exactly the same as the easy example above, but require a lot more code and a more in depth understanding of how SURF works and is configured. Instead of TupleDesc_F64, SurfFeature are computed in this case. They are almost the same as TupleDesc_F64, but contain the Laplacian's sign which can be used to sp...
[ "Configured", "exactly", "the", "same", "as", "the", "easy", "example", "above", "but", "require", "a", "lot", "more", "code", "and", "a", "more", "in", "depth", "understanding", "of", "how", "SURF", "works", "and", "is", "configured", ".", "Instead", "of"...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L79-L124
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java
BackgroundModelMoving.updateBackground
public void updateBackground(MotionModel homeToCurrent, T frame) { worldToHome.concat(homeToCurrent, worldToCurrent); worldToCurrent.invert(currentToWorld); // find the distorted polygon of the current image in the "home" background reference frame transform.setModel(currentToWorld); transform.compute(0, 0, ...
java
public void updateBackground(MotionModel homeToCurrent, T frame) { worldToHome.concat(homeToCurrent, worldToCurrent); worldToCurrent.invert(currentToWorld); // find the distorted polygon of the current image in the "home" background reference frame transform.setModel(currentToWorld); transform.compute(0, 0, ...
[ "public", "void", "updateBackground", "(", "MotionModel", "homeToCurrent", ",", "T", "frame", ")", "{", "worldToHome", ".", "concat", "(", "homeToCurrent", ",", "worldToCurrent", ")", ";", "worldToCurrent", ".", "invert", "(", "currentToWorld", ")", ";", "// fin...
Updates the background with new image information. @param homeToCurrent Transform from home image to the current image @param frame The current image in the sequence
[ "Updates", "the", "background", "with", "new", "image", "information", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java#L115-L150
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java
BackgroundModelMoving.segment
public void segment( MotionModel homeToCurrent , T frame , GrayU8 segmented ) { InputSanityCheck.checkSameShape(frame,segmented); worldToHome.concat(homeToCurrent, worldToCurrent); worldToCurrent.invert(currentToWorld); _segment(currentToWorld,frame,segmented); }
java
public void segment( MotionModel homeToCurrent , T frame , GrayU8 segmented ) { InputSanityCheck.checkSameShape(frame,segmented); worldToHome.concat(homeToCurrent, worldToCurrent); worldToCurrent.invert(currentToWorld); _segment(currentToWorld,frame,segmented); }
[ "public", "void", "segment", "(", "MotionModel", "homeToCurrent", ",", "T", "frame", ",", "GrayU8", "segmented", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "frame", ",", "segmented", ")", ";", "worldToHome", ".", "concat", "(", "homeToCurrent", ...
Invoke to use the background image to segment the current frame into background and foreground pixels @param homeToCurrent Transform from home image to the current image @param frame current image @param segmented Segmented image. 0 = background, 1 = foreground/moving
[ "Invoke", "to", "use", "the", "background", "image", "to", "segment", "the", "current", "frame", "into", "background", "and", "foreground", "pixels" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelMoving.java#L165-L172
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/AdjustPolygonForThresholdBias.java
AdjustPolygonForThresholdBias.process
public void process( Polygon2D_F64 polygon, boolean clockwise) { int N = polygon.size(); segments.resize(N); // Apply the adjustment independently to each side for (int i = N - 1, j = 0; j < N; i = j, j++) { int ii,jj; if( clockwise ) { ii = i; jj = j; } else { ii = j; jj = i; } Point2...
java
public void process( Polygon2D_F64 polygon, boolean clockwise) { int N = polygon.size(); segments.resize(N); // Apply the adjustment independently to each side for (int i = N - 1, j = 0; j < N; i = j, j++) { int ii,jj; if( clockwise ) { ii = i; jj = j; } else { ii = j; jj = i; } Point2...
[ "public", "void", "process", "(", "Polygon2D_F64", "polygon", ",", "boolean", "clockwise", ")", "{", "int", "N", "=", "polygon", ".", "size", "(", ")", ";", "segments", ".", "resize", "(", "N", ")", ";", "// Apply the adjustment independently to each side", "f...
Processes and adjusts the polygon. If after adjustment a corner needs to be removed because two sides are parallel then the size of the polygon can be changed. @param polygon The polygon that is to be adjusted. Modified. @param clockwise Is the polygon in a lockwise orientation?
[ "Processes", "and", "adjusts", "the", "polygon", ".", "If", "after", "adjustment", "a", "corner", "needs", "to", "be", "removed", "because", "two", "sides", "are", "parallel", "then", "the", "size", "of", "the", "polygon", "can", "be", "changed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/AdjustPolygonForThresholdBias.java#L51-L111
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java
DetectCircleGrid.closestCorner4
static int closestCorner4(Grid g ) { double bestDistance = g.get(0,0).center.normSq(); int bestIdx = 0; double d = g.get(0,g.columns-1).center.normSq(); if( d < bestDistance ) { bestDistance = d; bestIdx = 3; } d = g.get(g.rows-1,g.columns-1).center.normSq(); if( d < bestDistance ) { bestDistanc...
java
static int closestCorner4(Grid g ) { double bestDistance = g.get(0,0).center.normSq(); int bestIdx = 0; double d = g.get(0,g.columns-1).center.normSq(); if( d < bestDistance ) { bestDistance = d; bestIdx = 3; } d = g.get(g.rows-1,g.columns-1).center.normSq(); if( d < bestDistance ) { bestDistanc...
[ "static", "int", "closestCorner4", "(", "Grid", "g", ")", "{", "double", "bestDistance", "=", "g", ".", "get", "(", "0", ",", "0", ")", ".", "center", ".", "normSq", "(", ")", ";", "int", "bestIdx", "=", "0", ";", "double", "d", "=", "g", ".", ...
Number of CCW rotations to put selected corner into the canonical location. Only works when there are 4 possible solutions @param g The grid @return number of rotations
[ "Number", "of", "CCW", "rotations", "to", "put", "selected", "corner", "into", "the", "canonical", "location", ".", "Only", "works", "when", "there", "are", "4", "possible", "solutions" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L159-L179
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java
DetectCircleGrid.rotateGridCCW
void rotateGridCCW( Grid g ) { work.clear(); for (int i = 0; i < g.rows * g.columns; i++) { work.add(null); } for (int row = 0; row < g.rows; row++) { for (int col = 0; col < g.columns; col++) { work.set(col*g.rows + row, g.get(g.rows - row - 1,col)); } } g.ellipses.clear(); g.ellipses.add...
java
void rotateGridCCW( Grid g ) { work.clear(); for (int i = 0; i < g.rows * g.columns; i++) { work.add(null); } for (int row = 0; row < g.rows; row++) { for (int col = 0; col < g.columns; col++) { work.set(col*g.rows + row, g.get(g.rows - row - 1,col)); } } g.ellipses.clear(); g.ellipses.add...
[ "void", "rotateGridCCW", "(", "Grid", "g", ")", "{", "work", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "g", ".", "rows", "*", "g", ".", "columns", ";", "i", "++", ")", "{", "work", ".", "add", "(", "null"...
performs a counter-clockwise rotation
[ "performs", "a", "counter", "-", "clockwise", "rotation" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L184-L202
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java
DetectCircleGrid.reverse
void reverse( Grid g ) { work.clear(); int N = g.rows*g.columns; for (int i = 0; i < N; i++) { work.add( g.ellipses.get(N-i-1)); } g.ellipses.clear(); g.ellipses.addAll(work); }
java
void reverse( Grid g ) { work.clear(); int N = g.rows*g.columns; for (int i = 0; i < N; i++) { work.add( g.ellipses.get(N-i-1)); } g.ellipses.clear(); g.ellipses.addAll(work); }
[ "void", "reverse", "(", "Grid", "g", ")", "{", "work", ".", "clear", "(", ")", ";", "int", "N", "=", "g", ".", "rows", "*", "g", ".", "columns", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "work", ...
Reverse the order of elements inside the grid
[ "Reverse", "the", "order", "of", "elements", "inside", "the", "grid" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L207-L216
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java
DetectCircleGrid.pruneIncorrectShape
static void pruneIncorrectShape(FastQueue<Grid> grids , int numRows, int numCols ) { // prune clusters which can't be a member calibration target for (int i = grids.size()-1; i >= 0; i--) { Grid g = grids.get(i); if ((g.rows != numRows || g.columns != numCols) && (g.rows != numCols || g.columns != numRows)) {...
java
static void pruneIncorrectShape(FastQueue<Grid> grids , int numRows, int numCols ) { // prune clusters which can't be a member calibration target for (int i = grids.size()-1; i >= 0; i--) { Grid g = grids.get(i); if ((g.rows != numRows || g.columns != numCols) && (g.rows != numCols || g.columns != numRows)) {...
[ "static", "void", "pruneIncorrectShape", "(", "FastQueue", "<", "Grid", ">", "grids", ",", "int", "numRows", ",", "int", "numCols", ")", "{", "// prune clusters which can't be a member calibration target", "for", "(", "int", "i", "=", "grids", ".", "size", "(", ...
Remove grids which cannot possible match the expected shape
[ "Remove", "grids", "which", "cannot", "possible", "match", "the", "expected", "shape" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L247-L255
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java
DetectCircleGrid.pruneIncorrectSize
static void pruneIncorrectSize(List<List<EllipsesIntoClusters.Node>> clusters, int N) { // prune clusters which can't be a member calibration target for (int i = clusters.size()-1; i >= 0; i--) { if( clusters.get(i).size() != N ) { clusters.remove(i); } } }
java
static void pruneIncorrectSize(List<List<EllipsesIntoClusters.Node>> clusters, int N) { // prune clusters which can't be a member calibration target for (int i = clusters.size()-1; i >= 0; i--) { if( clusters.get(i).size() != N ) { clusters.remove(i); } } }
[ "static", "void", "pruneIncorrectSize", "(", "List", "<", "List", "<", "EllipsesIntoClusters", ".", "Node", ">", ">", "clusters", ",", "int", "N", ")", "{", "// prune clusters which can't be a member calibration target", "for", "(", "int", "i", "=", "clusters", "....
Prune clusters which do not have the expected number of elements
[ "Prune", "clusters", "which", "do", "not", "have", "the", "expected", "number", "of", "elements" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleGrid.java#L260-L267
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java
DetectChessboardSquarePoints.process
public boolean process( T input , GrayU8 binary ) { double maxCornerDistancePixels = maxCornerDistance.computeI(Math.min(input.width,input.height)); s2c.setMaxCornerDistance(maxCornerDistancePixels); configureContourDetector(input); boundPolygon.vertexes.reset(); detectorSquare.process(input, binary); de...
java
public boolean process( T input , GrayU8 binary ) { double maxCornerDistancePixels = maxCornerDistance.computeI(Math.min(input.width,input.height)); s2c.setMaxCornerDistance(maxCornerDistancePixels); configureContourDetector(input); boundPolygon.vertexes.reset(); detectorSquare.process(input, binary); de...
[ "public", "boolean", "process", "(", "T", "input", ",", "GrayU8", "binary", ")", "{", "double", "maxCornerDistancePixels", "=", "maxCornerDistance", ".", "computeI", "(", "Math", ".", "min", "(", "input", ".", "width", ",", "input", ".", "height", ")", ")"...
Detects chessboard in the binary image. Square corners must be disconnected. Returns true if a chessboard was found, false otherwise. @param input Original input image. @param binary Binary image of chessboard @return True if successful.
[ "Detects", "chessboard", "in", "the", "binary", "image", ".", "Square", "corners", "must", "be", "disconnected", ".", "Returns", "true", "if", "a", "chessboard", "was", "found", "false", "otherwise", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L110-L157
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java
DetectChessboardSquarePoints.adjustBeforeOptimize
public void adjustBeforeOptimize(Polygon2D_F64 polygon, GrowQueue_B touchesBorder, boolean clockwise) { int N = polygon.size(); work.vertexes.resize(N); for (int i = 0; i < N; i++) { work.get(i).set(0, 0); } for (int i = N - 1, j = 0; j < N; i = j, j++) { int ii,jj,kk,mm; if( clockwise ) { mm = ...
java
public void adjustBeforeOptimize(Polygon2D_F64 polygon, GrowQueue_B touchesBorder, boolean clockwise) { int N = polygon.size(); work.vertexes.resize(N); for (int i = 0; i < N; i++) { work.get(i).set(0, 0); } for (int i = N - 1, j = 0; j < N; i = j, j++) { int ii,jj,kk,mm; if( clockwise ) { mm = ...
[ "public", "void", "adjustBeforeOptimize", "(", "Polygon2D_F64", "polygon", ",", "GrowQueue_B", "touchesBorder", ",", "boolean", "clockwise", ")", "{", "int", "N", "=", "polygon", ".", "size", "(", ")", ";", "work", ".", "vertexes", ".", "resize", "(", "N", ...
The polygon detected from the contour is too small because the binary image was eroded. This expand the size of the polygon so that it fits the image edge better
[ "The", "polygon", "detected", "from", "the", "contour", "is", "too", "small", "because", "the", "binary", "image", "was", "eroded", ".", "This", "expand", "the", "size", "of", "the", "polygon", "so", "that", "it", "fits", "the", "image", "edge", "better" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L176-L240
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java
DetectChessboardSquarePoints.computeCalibrationPoints
boolean computeCalibrationPoints(SquareGrid grid) { calibrationPoints.reset(); for (int row = 0; row < grid.rows-1; row++) { int offset = row%2; for (int col = offset; col < grid.columns; col += 2) { SquareNode a = grid.get(row,col); if( col > 0 ) { SquareNode b = grid.get(row+1,col-1); if...
java
boolean computeCalibrationPoints(SquareGrid grid) { calibrationPoints.reset(); for (int row = 0; row < grid.rows-1; row++) { int offset = row%2; for (int col = offset; col < grid.columns; col += 2) { SquareNode a = grid.get(row,col); if( col > 0 ) { SquareNode b = grid.get(row+1,col-1); if...
[ "boolean", "computeCalibrationPoints", "(", "SquareGrid", "grid", ")", "{", "calibrationPoints", ".", "reset", "(", ")", ";", "for", "(", "int", "row", "=", "0", ";", "row", "<", "grid", ".", "rows", "-", "1", ";", "row", "++", ")", "{", "int", "offs...
Find inner corner points across the grid. Start from the "top" row and work its way down. Corners are found by finding the average point between two adjacent corners on adjacent squares.
[ "Find", "inner", "corner", "points", "across", "the", "grid", ".", "Start", "from", "the", "top", "row", "and", "work", "its", "way", "down", ".", "Corners", "are", "found", "by", "finding", "the", "average", "point", "between", "two", "adjacent", "corners...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/chess/DetectChessboardSquarePoints.java#L327-L350
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/blur/impl/ImplMedianSortNaive.java
ImplMedianSortNaive.process
public static void process(GrayI input, GrayI output, int radius , int[] storage ) { int w = 2*radius+1; if( storage == null ) { storage = new int[ w*w ]; } else if( storage.length < w*w ) { throw new IllegalArgumentException("'storage' must be at least of length "+(w*w)); } for( int y = 0; y < input....
java
public static void process(GrayI input, GrayI output, int radius , int[] storage ) { int w = 2*radius+1; if( storage == null ) { storage = new int[ w*w ]; } else if( storage.length < w*w ) { throw new IllegalArgumentException("'storage' must be at least of length "+(w*w)); } for( int y = 0; y < input....
[ "public", "static", "void", "process", "(", "GrayI", "input", ",", "GrayI", "output", ",", "int", "radius", ",", "int", "[", "]", "storage", ")", "{", "int", "w", "=", "2", "*", "radius", "+", "1", ";", "if", "(", "storage", "==", "null", ")", "{...
Performs a median filter. @param input Raw input image. @param output Filtered image. @param radius Size of the filter's region. @param storage Array used for storage. If null a new array is declared internally.
[ "Performs", "a", "median", "filter", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/blur/impl/ImplMedianSortNaive.java#L49-L87
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java
FactoryPointTracker.dda_ST_BRIEF
public static <I extends ImageGray<I>, D extends ImageGray<D>> PointTracker<I> dda_ST_BRIEF(int maxAssociationError, ConfigGeneralDetector configExtract, Class<I> imageType, Class<D> derivType) { if( derivType == null ) derivType = GImageDerivativeOps.getDerivativeType(imageType); Descri...
java
public static <I extends ImageGray<I>, D extends ImageGray<D>> PointTracker<I> dda_ST_BRIEF(int maxAssociationError, ConfigGeneralDetector configExtract, Class<I> imageType, Class<D> derivType) { if( derivType == null ) derivType = GImageDerivativeOps.getDerivativeType(imageType); Descri...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ",", "D", "extends", "ImageGray", "<", "D", ">", ">", "PointTracker", "<", "I", ">", "dda_ST_BRIEF", "(", "int", "maxAssociationError", ",", "ConfigGeneralDetector", "configExtract", ",", "...
Creates a tracker which detects Shi-Tomasi corner features and describes them with BRIEF. @see ShiTomasiCornerIntensity @see DescribePointBrief @see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint @param maxAssociationError Maximum allowed association error. Try 200. @param configExtract Configuration for ...
[ "Creates", "a", "tracker", "which", "detects", "Shi", "-", "Tomasi", "corner", "features", "and", "describes", "them", "with", "BRIEF", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L229-L252
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java
FactoryPointTracker.dda_FAST_BRIEF
public static <I extends ImageGray<I>, D extends ImageGray<D>> PointTracker<I> dda_FAST_BRIEF(ConfigFastCorner configFast, ConfigGeneralDetector configExtract, int maxAssociationError, Class<I> imageType ) { DescribePointBrief<I> brief = FactoryDescribePointAlgs.brief(FactoryBriefDe...
java
public static <I extends ImageGray<I>, D extends ImageGray<D>> PointTracker<I> dda_FAST_BRIEF(ConfigFastCorner configFast, ConfigGeneralDetector configExtract, int maxAssociationError, Class<I> imageType ) { DescribePointBrief<I> brief = FactoryDescribePointAlgs.brief(FactoryBriefDe...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ",", "D", "extends", "ImageGray", "<", "D", ">", ">", "PointTracker", "<", "I", ">", "dda_FAST_BRIEF", "(", "ConfigFastCorner", "configFast", ",", "ConfigGeneralDetector", "configExtract", ",...
Creates a tracker which detects FAST corner features and describes them with BRIEF. @see FastCornerDetector @see DescribePointBrief @see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint @param configFast Configuration for FAST detector @param configExtract Configuration for extracting features @param maxAsso...
[ "Creates", "a", "tracker", "which", "detects", "FAST", "corner", "features", "and", "describes", "them", "with", "BRIEF", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L266-L288
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java
FactoryPointTracker.dda
public static <I extends ImageGray<I>, Desc extends TupleDesc> DetectDescribeAssociate<I,Desc> dda(InterestPointDetector<I> detector, OrientationImage<I> orientation , DescribeRegionPoint<I, Desc> describe, AssociateDescription2D<Desc> associate , ConfigTrackerDda config ) { ...
java
public static <I extends ImageGray<I>, Desc extends TupleDesc> DetectDescribeAssociate<I,Desc> dda(InterestPointDetector<I> detector, OrientationImage<I> orientation , DescribeRegionPoint<I, Desc> describe, AssociateDescription2D<Desc> associate , ConfigTrackerDda config ) { ...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ",", "Desc", "extends", "TupleDesc", ">", "DetectDescribeAssociate", "<", "I", ",", "Desc", ">", "dda", "(", "InterestPointDetector", "<", "I", ">", "detector", ",", "OrientationImage", "<"...
Creates a tracker which uses the detect, describe, associate architecture. @param detector Interest point detector. @param orientation Optional orientation estimation algorithm. Can be null. @param describe Region description. @param associate Description association. @param config Configuration @param <I> Type of inp...
[ "Creates", "a", "tracker", "which", "uses", "the", "detect", "describe", "associate", "architecture", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L339-L356
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java
FactoryPointTracker.combined_FH_SURF_KLT
public static <I extends ImageGray<I>> PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig , int reactivateThreshold , ConfigFastHessian configDetector , ConfigSurfDescribe.Stability configDescribe , ConfigSlidingIntegral configOrientation , Class<I> i...
java
public static <I extends ImageGray<I>> PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig , int reactivateThreshold , ConfigFastHessian configDetector , ConfigSurfDescribe.Stability configDescribe , ConfigSlidingIntegral configOrientation , Class<I> i...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ">", "PointTracker", "<", "I", ">", "combined_FH_SURF_KLT", "(", "PkltConfig", "kltConfig", ",", "int", "reactivateThreshold", ",", "ConfigFastHessian", "configDetector", ",", "ConfigSurfDescribe",...
Creates a tracker which detects Fast-Hessian features, describes them with SURF, nominally tracks them using KLT. @see DescribePointSurf @see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint @param kltConfig Configuration for KLT tracker @param reactivateThreshold Tracks are reactivated after this many have ...
[ "Creates", "a", "tracker", "which", "detects", "Fast", "-", "Hessian", "features", "describes", "them", "with", "SURF", "nominally", "tracks", "them", "using", "KLT", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L387-L404
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java
FactoryPointTracker.createShiTomasi
public static <I extends ImageGray<I>, D extends ImageGray<D>> GeneralFeatureDetector<I, D> createShiTomasi(ConfigGeneralDetector config , Class<D> derivType) { GradientCornerIntensity<D> cornerIntensity = FactoryIntensityPointAlg.shiTomasi(1, false, derivType); return FactoryDetectPoint.createGener...
java
public static <I extends ImageGray<I>, D extends ImageGray<D>> GeneralFeatureDetector<I, D> createShiTomasi(ConfigGeneralDetector config , Class<D> derivType) { GradientCornerIntensity<D> cornerIntensity = FactoryIntensityPointAlg.shiTomasi(1, false, derivType); return FactoryDetectPoint.createGener...
[ "public", "static", "<", "I", "extends", "ImageGray", "<", "I", ">", ",", "D", "extends", "ImageGray", "<", "D", ">", ">", "GeneralFeatureDetector", "<", "I", ",", "D", ">", "createShiTomasi", "(", "ConfigGeneralDetector", "config", ",", "Class", "<", "D",...
Creates a Shi-Tomasi corner detector specifically designed for SFM. Smaller feature radius work better. Variable detectRadius to control the number of features. When larger features are used weighting should be set to true, but because this is so small, it is set to false
[ "Creates", "a", "Shi", "-", "Tomasi", "corner", "detector", "specifically", "designed", "for", "SFM", ".", "Smaller", "feature", "radius", "work", "better", ".", "Variable", "detectRadius", "to", "control", "the", "number", "of", "features", ".", "When", "larg...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L534-L541
train
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/CameraCalibration.java
CameraCalibration.handleWebcam
public void handleWebcam() { final Webcam webcam = openSelectedCamera(); if( desiredWidth > 0 && desiredHeight > 0 ) UtilWebcamCapture.adjustResolution(webcam, desiredWidth, desiredHeight); webcam.open(); // close the webcam gracefully on exit Runtime.getRuntime().addShutdownHook(new Thread(){public void...
java
public void handleWebcam() { final Webcam webcam = openSelectedCamera(); if( desiredWidth > 0 && desiredHeight > 0 ) UtilWebcamCapture.adjustResolution(webcam, desiredWidth, desiredHeight); webcam.open(); // close the webcam gracefully on exit Runtime.getRuntime().addShutdownHook(new Thread(){public void...
[ "public", "void", "handleWebcam", "(", ")", "{", "final", "Webcam", "webcam", "=", "openSelectedCamera", "(", ")", ";", "if", "(", "desiredWidth", ">", "0", "&&", "desiredHeight", ">", "0", ")", "UtilWebcamCapture", ".", "adjustResolution", "(", "webcam", ",...
Captures calibration data live using a webcam and a GUI to assist the user
[ "Captures", "calibration", "data", "live", "using", "a", "webcam", "and", "a", "GUI", "to", "assist", "the", "user" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/CameraCalibration.java#L535-L581
train
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java
ImageSelectorAndSaver.setTemplate
public void setTemplate(GrayF32 image, List<Point2D_F64> sides) { if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3)); templateOriginal.setTo(removePerspective.getOutput()); // blur the ...
java
public void setTemplate(GrayF32 image, List<Point2D_F64> sides) { if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3)); templateOriginal.setTo(removePerspective.getOutput()); // blur the ...
[ "public", "void", "setTemplate", "(", "GrayF32", "image", ",", "List", "<", "Point2D_F64", ">", "sides", ")", "{", "if", "(", "sides", ".", "size", "(", ")", "!=", "4", ")", "throw", "new", "IllegalArgumentException", "(", "\"Expected 4 sidesCollision\"", ")...
Creates a template of the fiducial and this is then used to determine how blurred the image is
[ "Creates", "a", "template", "of", "the", "fiducial", "and", "this", "is", "then", "used", "to", "determine", "how", "blurred", "the", "image", "is" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L82-L110
train
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java
ImageSelectorAndSaver.process
public synchronized void process(GrayF32 image, List<Point2D_F64> sides) { if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); updateScore(image,sides); if( currentScore < bestScore ) { bestScore = currentScore; if( bestImage == null ) { bestImage = new Buffered...
java
public synchronized void process(GrayF32 image, List<Point2D_F64> sides) { if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); updateScore(image,sides); if( currentScore < bestScore ) { bestScore = currentScore; if( bestImage == null ) { bestImage = new Buffered...
[ "public", "synchronized", "void", "process", "(", "GrayF32", "image", ",", "List", "<", "Point2D_F64", ">", "sides", ")", "{", "if", "(", "sides", ".", "size", "(", ")", "!=", "4", ")", "throw", "new", "IllegalArgumentException", "(", "\"Expected 4 sidesColl...
Computes the sharpness score for the current image, if better than the current best image it's then saved. @param image Gray scale input image for detector @param sides Location of 4 corners on fiducial
[ "Computes", "the", "sharpness", "score", "for", "the", "current", "image", "if", "better", "than", "the", "current", "best", "image", "it", "s", "then", "saved", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L125-L138
train
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java
ImageSelectorAndSaver.updateScore
public synchronized void updateScore(GrayF32 image, List<Point2D_F64> sides) { removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3)); GrayF32 current = removePerspective.getOutput(); float mean = (float)ImageStatistics.mean(current); PixelMath.divide(current,mean,tempImage); Pix...
java
public synchronized void updateScore(GrayF32 image, List<Point2D_F64> sides) { removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3)); GrayF32 current = removePerspective.getOutput(); float mean = (float)ImageStatistics.mean(current); PixelMath.divide(current,mean,tempImage); Pix...
[ "public", "synchronized", "void", "updateScore", "(", "GrayF32", "image", ",", "List", "<", "Point2D_F64", ">", "sides", ")", "{", "removePerspective", ".", "apply", "(", "image", ",", "sides", ".", "get", "(", "0", ")", ",", "sides", ".", "get", "(", ...
Used when you just want to update the score for visualization purposes but not update the best image.
[ "Used", "when", "you", "just", "want", "to", "update", "the", "score", "for", "visualization", "purposes", "but", "not", "update", "the", "best", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L143-L155
train
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java
ImageSelectorAndSaver.save
public synchronized void save() { if( bestImage != null ) { File path = new File(outputDirectory, String.format("image%04d.png",imageNumber)); UtilImageIO.saveImage(bestImage,path.getAbsolutePath()); imageNumber++; } clearHistory(); }
java
public synchronized void save() { if( bestImage != null ) { File path = new File(outputDirectory, String.format("image%04d.png",imageNumber)); UtilImageIO.saveImage(bestImage,path.getAbsolutePath()); imageNumber++; } clearHistory(); }
[ "public", "synchronized", "void", "save", "(", ")", "{", "if", "(", "bestImage", "!=", "null", ")", "{", "File", "path", "=", "new", "File", "(", "outputDirectory", ",", "String", ".", "format", "(", "\"image%04d.png\"", ",", "imageNumber", ")", ")", ";"...
Saves the image to a file
[ "Saves", "the", "image", "to", "a", "file" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L160-L167
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/image/ImagePanel.java
ImagePanel.setImageRepaint
public void setImageRepaint(BufferedImage image) { // if image is larger before than the new image then you need to make sure you repaint // the entire image otherwise a ghost will be left ScaleOffset workspace; if( SwingUtilities.isEventDispatchThread() ) { workspace = adjustmentGUI; } else { workspac...
java
public void setImageRepaint(BufferedImage image) { // if image is larger before than the new image then you need to make sure you repaint // the entire image otherwise a ghost will be left ScaleOffset workspace; if( SwingUtilities.isEventDispatchThread() ) { workspace = adjustmentGUI; } else { workspac...
[ "public", "void", "setImageRepaint", "(", "BufferedImage", "image", ")", "{", "// if image is larger before than the new image then you need to make sure you repaint", "// the entire image otherwise a ghost will be left", "ScaleOffset", "workspace", ";", "if", "(", "SwingUtilities", ...
Changes the buffered image and calls repaint. Does not need to be called in the UI thread.
[ "Changes", "the", "buffered", "image", "and", "calls", "repaint", ".", "Does", "not", "need", "to", "be", "called", "in", "the", "UI", "thread", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ImagePanel.java#L166-L182
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPtkSmartRespawn.java
ImageMotionPtkSmartRespawn.computeContainment
private void computeContainment( int imageArea ) { // mark that the track is in the inlier set and compute the containment rectangle contRect.x0 = contRect.y0 = Double.MAX_VALUE; contRect.x1 = contRect.y1 = -Double.MAX_VALUE; for( AssociatedPair p : motion.getModelMatcher().getMatchSet() ) { Point2D_F64 t = ...
java
private void computeContainment( int imageArea ) { // mark that the track is in the inlier set and compute the containment rectangle contRect.x0 = contRect.y0 = Double.MAX_VALUE; contRect.x1 = contRect.y1 = -Double.MAX_VALUE; for( AssociatedPair p : motion.getModelMatcher().getMatchSet() ) { Point2D_F64 t = ...
[ "private", "void", "computeContainment", "(", "int", "imageArea", ")", "{", "// mark that the track is in the inlier set and compute the containment rectangle", "contRect", ".", "x0", "=", "contRect", ".", "y0", "=", "Double", ".", "MAX_VALUE", ";", "contRect", ".", "x1...
Computes an axis-aligned rectangle that contains all the inliers. It then computes the area contained in that rectangle to the total area of the image @param imageArea width*height
[ "Computes", "an", "axis", "-", "aligned", "rectangle", "that", "contains", "all", "the", "inliers", ".", "It", "then", "computes", "the", "area", "contained", "in", "that", "rectangle", "to", "the", "total", "area", "of", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/ImageMotionPtkSmartRespawn.java#L149-L165
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneProjective.java
PruneStructureFromSceneProjective.pruneViews
public boolean pruneViews(int count) { List<SceneStructureProjective.View> remainingS = new ArrayList<>(); List<SceneObservations.View> remainingO = new ArrayList<>(); // count number of observations in each view int counts[] = new int[structure.views.length]; for (int pointIdx = 0; pointIdx < structure.poin...
java
public boolean pruneViews(int count) { List<SceneStructureProjective.View> remainingS = new ArrayList<>(); List<SceneObservations.View> remainingO = new ArrayList<>(); // count number of observations in each view int counts[] = new int[structure.views.length]; for (int pointIdx = 0; pointIdx < structure.poin...
[ "public", "boolean", "pruneViews", "(", "int", "count", ")", "{", "List", "<", "SceneStructureProjective", ".", "View", ">", "remainingS", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "SceneObservations", ".", "View", ">", "remainingO", "=", ...
Removes views with less than 'count' features visible. Observations of features in removed views are also removed. Features are not automatically removed even if there are zero observations of them. @param count Prune if it has this number of views or less @return true if views were pruned or false if not
[ "Removes", "views", "with", "less", "than", "count", "features", "visible", ".", "Observations", "of", "features", "in", "removed", "views", "are", "also", "removed", ".", "Features", "are", "not", "automatically", "removed", "even", "if", "there", "are", "zer...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/PruneStructureFromSceneProjective.java#L166-L214
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java
DisparityScoreRowFormat.process
public void process( Input left , Input right , Disparity disparity ) { // initialize data structures InputSanityCheck.checkSameShape(left, right, disparity); if( maxDisparity > left.width-2*radiusX ) throw new RuntimeException( "The maximum disparity is too large for this image size: max size "+(left.w...
java
public void process( Input left , Input right , Disparity disparity ) { // initialize data structures InputSanityCheck.checkSameShape(left, right, disparity); if( maxDisparity > left.width-2*radiusX ) throw new RuntimeException( "The maximum disparity is too large for this image size: max size "+(left.w...
[ "public", "void", "process", "(", "Input", "left", ",", "Input", "right", ",", "Disparity", "disparity", ")", "{", "// initialize data structures", "InputSanityCheck", ".", "checkSameShape", "(", "left", ",", "right", ",", "disparity", ")", ";", "if", "(", "ma...
Computes disparity between two stereo images @param left Left rectified stereo image. Input @param right Right rectified stereo image. Input @param disparity Disparity between the two images. Output
[ "Computes", "disparity", "between", "two", "stereo", "images" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java#L92-L103
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java
SelfCalibrationLinearDualQuadratic.solve
public GeometricResult solve() { if( cameras.size < minimumProjectives ) throw new IllegalArgumentException("You need at least "+minimumProjectives+" motions"); int N = cameras.size; DMatrixRMaj L = new DMatrixRMaj(N*eqs,10); // Convert constraints into a (N*eqs) by 10 matrix. Null space is Q constructMa...
java
public GeometricResult solve() { if( cameras.size < minimumProjectives ) throw new IllegalArgumentException("You need at least "+minimumProjectives+" motions"); int N = cameras.size; DMatrixRMaj L = new DMatrixRMaj(N*eqs,10); // Convert constraints into a (N*eqs) by 10 matrix. Null space is Q constructMa...
[ "public", "GeometricResult", "solve", "(", ")", "{", "if", "(", "cameras", ".", "size", "<", "minimumProjectives", ")", "throw", "new", "IllegalArgumentException", "(", "\"You need at least \"", "+", "minimumProjectives", "+", "\" motions\"", ")", ";", "int", "N",...
Solve for camera calibration. A sanity check is performed to ensure that a valid calibration is found. All values must be countable numbers and the focal lengths must be positive numbers. @return Indicates if it was successful or not. If it fails it says why
[ "Solve", "for", "camera", "calibration", ".", "A", "sanity", "check", "is", "performed", "to", "ensure", "that", "a", "valid", "calibration", "is", "found", ".", "All", "values", "must", "be", "countable", "numbers", "and", "the", "focal", "lengths", "must",...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L124-L162
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java
SelfCalibrationLinearDualQuadratic.extractSolutionForQ
private void extractSolutionForQ( DMatrix4x4 Q ) { DMatrixRMaj nv = new DMatrixRMaj(10,1); SingularOps_DDRM.nullVector(svd,true,nv); // Convert the solution into a fixed sized matrix because it's easier to read encodeQ(Q,nv.data); // diagonal elements must be positive because Q = [K*K' .. ; ... ] // If th...
java
private void extractSolutionForQ( DMatrix4x4 Q ) { DMatrixRMaj nv = new DMatrixRMaj(10,1); SingularOps_DDRM.nullVector(svd,true,nv); // Convert the solution into a fixed sized matrix because it's easier to read encodeQ(Q,nv.data); // diagonal elements must be positive because Q = [K*K' .. ; ... ] // If th...
[ "private", "void", "extractSolutionForQ", "(", "DMatrix4x4", "Q", ")", "{", "DMatrixRMaj", "nv", "=", "new", "DMatrixRMaj", "(", "10", ",", "1", ")", ";", "SingularOps_DDRM", ".", "nullVector", "(", "svd", ",", "true", ",", "nv", ")", ";", "// Convert the ...
Extracts the null space and converts it into the Q matrix
[ "Extracts", "the", "null", "space", "and", "converts", "it", "into", "the", "Q", "matrix" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L167-L180
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java
SelfCalibrationLinearDualQuadratic.computeSolutions
private void computeSolutions(DMatrix4x4 Q) { DMatrixRMaj w_i = new DMatrixRMaj(3,3); for (int i = 0; i < cameras.size; i++) { computeW(cameras.get(i),Q,w_i); Intrinsic calib = solveForCalibration(w_i); if( sanityCheck(calib)) { solutions.add(calib); } } }
java
private void computeSolutions(DMatrix4x4 Q) { DMatrixRMaj w_i = new DMatrixRMaj(3,3); for (int i = 0; i < cameras.size; i++) { computeW(cameras.get(i),Q,w_i); Intrinsic calib = solveForCalibration(w_i); if( sanityCheck(calib)) { solutions.add(calib); } } }
[ "private", "void", "computeSolutions", "(", "DMatrix4x4", "Q", ")", "{", "DMatrixRMaj", "w_i", "=", "new", "DMatrixRMaj", "(", "3", ",", "3", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cameras", ".", "size", ";", "i", "++", ")", ...
Computes the calibration for each view..
[ "Computes", "the", "calibration", "for", "each", "view", ".." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L185-L195
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java
SelfCalibrationLinearDualQuadratic.solveForCalibration
private Intrinsic solveForCalibration(DMatrixRMaj w) { Intrinsic calib = new Intrinsic(); // CholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false); // // chol.decompose(w.copy()); // DMatrixRMaj R = chol.getT(w); // R.print(); if( zeroSkew ) { calib.skew = 0; calib.fy = Mat...
java
private Intrinsic solveForCalibration(DMatrixRMaj w) { Intrinsic calib = new Intrinsic(); // CholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false); // // chol.decompose(w.copy()); // DMatrixRMaj R = chol.getT(w); // R.print(); if( zeroSkew ) { calib.skew = 0; calib.fy = Mat...
[ "private", "Intrinsic", "solveForCalibration", "(", "DMatrixRMaj", "w", ")", "{", "Intrinsic", "calib", "=", "new", "Intrinsic", "(", ")", ";", "//\t\tCholeskyDecomposition_F64<DMatrixRMaj> chol = DecompositionFactory_DDRM.chol(false);", "//", "//\t\tchol.decompose(w.copy());", ...
Given the solution for w and the constraints solve for the remaining parameters
[ "Given", "the", "solution", "for", "w", "and", "the", "constraints", "solve", "for", "the", "remaining", "parameters" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L200-L228
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java
SelfCalibrationLinearDualQuadratic.sanityCheck
boolean sanityCheck(Intrinsic calib ) { if(UtilEjml.isUncountable(calib.fx)) return false; if(UtilEjml.isUncountable(calib.fy)) return false; if(UtilEjml.isUncountable(calib.skew)) return false; if( calib.fx < 0 ) return false; if( calib.fy < 0 ) return false; return true; }
java
boolean sanityCheck(Intrinsic calib ) { if(UtilEjml.isUncountable(calib.fx)) return false; if(UtilEjml.isUncountable(calib.fy)) return false; if(UtilEjml.isUncountable(calib.skew)) return false; if( calib.fx < 0 ) return false; if( calib.fy < 0 ) return false; return true; }
[ "boolean", "sanityCheck", "(", "Intrinsic", "calib", ")", "{", "if", "(", "UtilEjml", ".", "isUncountable", "(", "calib", ".", "fx", ")", ")", "return", "false", ";", "if", "(", "UtilEjml", ".", "isUncountable", "(", "calib", ".", "fy", ")", ")", "retu...
Makes sure that the found solution is valid and physically possible @return true if valid
[ "Makes", "sure", "that", "the", "found", "solution", "is", "valid", "and", "physically", "possible" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearDualQuadratic.java#L234-L248
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplSelectRectStandardBase_S32.java
ImplSelectRectStandardBase_S32.selectRightToLeft
private int selectRightToLeft( int col , int[] scores ) { // see how far it can search int localMax = Math.min(imageWidth-regionWidth,col+maxDisparity)-col-minDisparity; int indexBest = 0; int indexScore = col; int scoreBest = scores[col]; indexScore += imageWidth+1; for( int i = 1; i < localMax; i++ ,i...
java
private int selectRightToLeft( int col , int[] scores ) { // see how far it can search int localMax = Math.min(imageWidth-regionWidth,col+maxDisparity)-col-minDisparity; int indexBest = 0; int indexScore = col; int scoreBest = scores[col]; indexScore += imageWidth+1; for( int i = 1; i < localMax; i++ ,i...
[ "private", "int", "selectRightToLeft", "(", "int", "col", ",", "int", "[", "]", "scores", ")", "{", "// see how far it can search", "int", "localMax", "=", "Math", ".", "min", "(", "imageWidth", "-", "regionWidth", ",", "col", "+", "maxDisparity", ")", "-", ...
Finds the best disparity going from right to left image.
[ "Finds", "the", "best", "disparity", "going", "from", "right", "to", "left", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplSelectRectStandardBase_S32.java#L135-L154
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldNonMaximalSuppression.java
TldNonMaximalSuppression.process
public void process( FastQueue<TldRegion> regions , FastQueue<TldRegion> output ) { final int N = regions.size; // set all connections to be a local maximum initially conn.growArray(N); for( int i = 0; i < N; i++ ) { conn.data[i].reset(); } // Create the graph of connected regions and mark which regio...
java
public void process( FastQueue<TldRegion> regions , FastQueue<TldRegion> output ) { final int N = regions.size; // set all connections to be a local maximum initially conn.growArray(N); for( int i = 0; i < N; i++ ) { conn.data[i].reset(); } // Create the graph of connected regions and mark which regio...
[ "public", "void", "process", "(", "FastQueue", "<", "TldRegion", ">", "regions", ",", "FastQueue", "<", "TldRegion", ">", "output", ")", "{", "final", "int", "N", "=", "regions", ".", "size", ";", "// set all connections to be a local maximum initially", "conn", ...
Finds local maximums from the set of provided regions @param regions Set of high confidence regions for target @param output Output after non-maximum suppression
[ "Finds", "local", "maximums", "from", "the", "set", "of", "provided", "regions" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldNonMaximalSuppression.java#L61-L108
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java
ImageType.createImage
public T createImage( int width , int height ) { switch( family ) { case GRAY: return (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height); case INTERLEAVED: return (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands); case PLANAR: return (T)new Pl...
java
public T createImage( int width , int height ) { switch( family ) { case GRAY: return (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height); case INTERLEAVED: return (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands); case PLANAR: return (T)new Pl...
[ "public", "T", "createImage", "(", "int", "width", ",", "int", "height", ")", "{", "switch", "(", "family", ")", "{", "case", "GRAY", ":", "return", "(", "T", ")", "GeneralizedImageOps", ".", "createSingleBand", "(", "getImageClass", "(", ")", ",", "widt...
Creates a new image. @param width Number of columns in the image. @param height Number of rows in the image. @return New instance of the image.
[ "Creates", "a", "new", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L87-L101
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java
ImageType.createArray
public T[] createArray( int length ) { switch( family ) { case GRAY: case INTERLEAVED: return (T[])Array.newInstance(getImageClass(),length); case PLANAR: return (T[])new Planar[ length ]; default: throw new IllegalArgumentException("Type not yet supported"); } }
java
public T[] createArray( int length ) { switch( family ) { case GRAY: case INTERLEAVED: return (T[])Array.newInstance(getImageClass(),length); case PLANAR: return (T[])new Planar[ length ]; default: throw new IllegalArgumentException("Type not yet supported"); } }
[ "public", "T", "[", "]", "createArray", "(", "int", "length", ")", "{", "switch", "(", "family", ")", "{", "case", "GRAY", ":", "case", "INTERLEAVED", ":", "return", "(", "T", "[", "]", ")", "Array", ".", "newInstance", "(", "getImageClass", "(", ")"...
Creates an array of the specified iamge type @param length Number of elements in the array @return array of image type
[ "Creates", "an", "array", "of", "the", "specified", "iamge", "type" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L108-L120
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java
ImageType.isSameType
public boolean isSameType( ImageType o ) { if( family != o.family ) return false; if( dataType != o.dataType) return false; if( numBands != o.numBands ) return false; return true; }
java
public boolean isSameType( ImageType o ) { if( family != o.family ) return false; if( dataType != o.dataType) return false; if( numBands != o.numBands ) return false; return true; }
[ "public", "boolean", "isSameType", "(", "ImageType", "o", ")", "{", "if", "(", "family", "!=", "o", ".", "family", ")", "return", "false", ";", "if", "(", "dataType", "!=", "o", ".", "dataType", ")", "return", "false", ";", "if", "(", "numBands", "!=...
Returns true if the passed in ImageType is the same as this image type
[ "Returns", "true", "if", "the", "passed", "in", "ImageType", "is", "the", "same", "as", "this", "image", "type" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L178-L186
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java
ImageType.setTo
public void setTo( ImageType o ) { this.family = o.family; this.dataType = o.dataType; this.numBands = o.numBands; }
java
public void setTo( ImageType o ) { this.family = o.family; this.dataType = o.dataType; this.numBands = o.numBands; }
[ "public", "void", "setTo", "(", "ImageType", "o", ")", "{", "this", ".", "family", "=", "o", ".", "family", ";", "this", ".", "dataType", "=", "o", ".", "dataType", ";", "this", ".", "numBands", "=", "o", ".", "numBands", ";", "}" ]
Sets 'this' to be identical to 'o' @param o What is to be copied.
[ "Sets", "this", "to", "be", "identical", "to", "o" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/ImageType.java#L192-L196
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java
DescribeDenseHogFastAlg.growCellArray
void growCellArray(int imageWidth, int imageHeight) { cellCols = imageWidth/ pixelsPerCell; cellRows = imageHeight/ pixelsPerCell; if( cellRows*cellCols > cells.length ) { Cell[] a = new Cell[cellCols*cellRows]; System.arraycopy(cells,0,a,0,cells.length); for (int i = cells.length; i < a.length; i++) {...
java
void growCellArray(int imageWidth, int imageHeight) { cellCols = imageWidth/ pixelsPerCell; cellRows = imageHeight/ pixelsPerCell; if( cellRows*cellCols > cells.length ) { Cell[] a = new Cell[cellCols*cellRows]; System.arraycopy(cells,0,a,0,cells.length); for (int i = cells.length; i < a.length; i++) {...
[ "void", "growCellArray", "(", "int", "imageWidth", ",", "int", "imageHeight", ")", "{", "cellCols", "=", "imageWidth", "/", "pixelsPerCell", ";", "cellRows", "=", "imageHeight", "/", "pixelsPerCell", ";", "if", "(", "cellRows", "*", "cellCols", ">", "cells", ...
Determines if the cell array needs to grow. If it does a new array is declared. Old data is recycled when possible
[ "Determines", "if", "the", "cell", "array", "needs", "to", "grow", ".", "If", "it", "does", "a", "new", "array", "is", "declared", ".", "Old", "data", "is", "recycled", "when", "possible" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L104-L118
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java
DescribeDenseHogFastAlg.getDescriptorsInRegion
public void getDescriptorsInRegion(int pixelX0 , int pixelY0 , int pixelX1 , int pixelY1 , List<TupleDesc_F64> output ) { int gridX0 = (int)Math.ceil(pixelX0/(double) pixelsPerCell); int gridY0 = (int)Math.ceil(pixelY0/(double) pixelsPerCell); int gridX1 = pixelX1/ pixelsPerCell - cellsPerBlockX; i...
java
public void getDescriptorsInRegion(int pixelX0 , int pixelY0 , int pixelX1 , int pixelY1 , List<TupleDesc_F64> output ) { int gridX0 = (int)Math.ceil(pixelX0/(double) pixelsPerCell); int gridY0 = (int)Math.ceil(pixelY0/(double) pixelsPerCell); int gridX1 = pixelX1/ pixelsPerCell - cellsPerBlockX; i...
[ "public", "void", "getDescriptorsInRegion", "(", "int", "pixelX0", ",", "int", "pixelY0", ",", "int", "pixelX1", ",", "int", "pixelY1", ",", "List", "<", "TupleDesc_F64", ">", "output", ")", "{", "int", "gridX0", "=", "(", "int", ")", "Math", ".", "ceil"...
Convenience function which returns a list of all the descriptors computed inside the specified region in the image @param pixelX0 Pixel coordinate X-axis lower extent @param pixelY0 Pixel coordinate Y-axis lower extent @param pixelX1 Pixel coordinate X-axis upper extent @param pixelY1 Pixel coordinate Y-axis upper ext...
[ "Convenience", "function", "which", "returns", "a", "list", "of", "all", "the", "descriptors", "computed", "inside", "the", "specified", "region", "in", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L129-L143
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java
DescribeDenseHogFastAlg.computeCellHistograms
void computeCellHistograms() { int width = cellCols* pixelsPerCell; int height = cellRows* pixelsPerCell; float angleBinSize = GrlConstants.F_PI/orientationBins; int indexCell = 0; for (int i = 0; i < height; i += pixelsPerCell) { for (int j = 0; j < width; j += pixelsPerCell, indexCell++ ) { Cell c...
java
void computeCellHistograms() { int width = cellCols* pixelsPerCell; int height = cellRows* pixelsPerCell; float angleBinSize = GrlConstants.F_PI/orientationBins; int indexCell = 0; for (int i = 0; i < height; i += pixelsPerCell) { for (int j = 0; j < width; j += pixelsPerCell, indexCell++ ) { Cell c...
[ "void", "computeCellHistograms", "(", ")", "{", "int", "width", "=", "cellCols", "*", "pixelsPerCell", ";", "int", "height", "=", "cellRows", "*", "pixelsPerCell", ";", "float", "angleBinSize", "=", "GrlConstants", ".", "F_PI", "/", "orientationBins", ";", "in...
Compute histograms for all the cells inside the image using precomputed derivative.
[ "Compute", "histograms", "for", "all", "the", "cells", "inside", "the", "image", "using", "precomputed", "derivative", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L175-L215
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detdesc/DetectDescribeSurfPlanar.java
DetectDescribeSurfPlanar.detect
public void detect( II grayII , Planar<II> colorII ) { descriptions.reset(); featureAngles.reset(); // detect features detector.detect(grayII); // describe the found interest points foundPoints = detector.getFoundPoints(); descriptions.resize(foundPoints.size()); featureAngles.resize(foundPoints.siz...
java
public void detect( II grayII , Planar<II> colorII ) { descriptions.reset(); featureAngles.reset(); // detect features detector.detect(grayII); // describe the found interest points foundPoints = detector.getFoundPoints(); descriptions.resize(foundPoints.size()); featureAngles.resize(foundPoints.siz...
[ "public", "void", "detect", "(", "II", "grayII", ",", "Planar", "<", "II", ">", "colorII", ")", "{", "descriptions", ".", "reset", "(", ")", ";", "featureAngles", ".", "reset", "(", ")", ";", "// detect features", "detector", ".", "detect", "(", "grayII"...
Detects and describes features inside provide images. All images are integral images. @param grayII Gray-scale integral image @param colorII Color integral image
[ "Detects", "and", "describes", "features", "inside", "provide", "images", ".", "All", "images", "are", "integral", "images", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detdesc/DetectDescribeSurfPlanar.java#L87-L102
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java
QrPose3DUtils.getLandmark3D
public List<Point3D_F64> getLandmark3D( int version ) { int N = QrCode.totalModules(version); set3D( 0,0,N,point3D.get(0)); set3D( 0,7,N,point3D.get(1)); set3D( 7,7,N,point3D.get(2)); set3D( 7,0,N,point3D.get(3)); set3D( 0,N-7,N,point3D.get(4)); set3D( 0,N,N,point3D.get(5)); set3D( 7,N,N,point3D.get(6...
java
public List<Point3D_F64> getLandmark3D( int version ) { int N = QrCode.totalModules(version); set3D( 0,0,N,point3D.get(0)); set3D( 0,7,N,point3D.get(1)); set3D( 7,7,N,point3D.get(2)); set3D( 7,0,N,point3D.get(3)); set3D( 0,N-7,N,point3D.get(4)); set3D( 0,N,N,point3D.get(5)); set3D( 7,N,N,point3D.get(6...
[ "public", "List", "<", "Point3D_F64", ">", "getLandmark3D", "(", "int", "version", ")", "{", "int", "N", "=", "QrCode", ".", "totalModules", "(", "version", ")", ";", "set3D", "(", "0", ",", "0", ",", "N", ",", "point3D", ".", "get", "(", "0", ")",...
Location of each corner in the QR Code's reference frame in 3D @param version QR Code's version @return List. Recycled on each call
[ "Location", "of", "each", "corner", "in", "the", "QR", "Code", "s", "reference", "frame", "in", "3D" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L119-L138
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java
QrPose3DUtils.setPair
private void setPair(int which, int row, int col, int N , Point2D_F64 pixel ) { set3D(row,col,N,point23.get(which).location); pixelToNorm.compute(pixel.x,pixel.y,point23.get(which).observation); }
java
private void setPair(int which, int row, int col, int N , Point2D_F64 pixel ) { set3D(row,col,N,point23.get(which).location); pixelToNorm.compute(pixel.x,pixel.y,point23.get(which).observation); }
[ "private", "void", "setPair", "(", "int", "which", ",", "int", "row", ",", "int", "col", ",", "int", "N", ",", "Point2D_F64", "pixel", ")", "{", "set3D", "(", "row", ",", "col", ",", "N", ",", "point23", ".", "get", "(", "which", ")", ".", "locat...
Specifies PNP parameters for a single feature @param which Landmark's index @param row row in the QR code's grid coordinate system @param col column in the QR code's grid coordinate system @param N width of grid @param pixel observed pixel coordinate of feature
[ "Specifies", "PNP", "parameters", "for", "a", "single", "feature" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L149-L152
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java
QrPose3DUtils.set3D
private void set3D(int row, int col, int N , Point3D_F64 location ) { double _N = N; double gridX = 2.0*(col/_N-0.5); double gridY = 2.0*(0.5-row/_N); location.set(gridX,gridY,0); }
java
private void set3D(int row, int col, int N , Point3D_F64 location ) { double _N = N; double gridX = 2.0*(col/_N-0.5); double gridY = 2.0*(0.5-row/_N); location.set(gridX,gridY,0); }
[ "private", "void", "set3D", "(", "int", "row", ",", "int", "col", ",", "int", "N", ",", "Point3D_F64", "location", ")", "{", "double", "_N", "=", "N", ";", "double", "gridX", "=", "2.0", "*", "(", "col", "/", "_N", "-", "0.5", ")", ";", "double",...
Specifies 3D location of landmark in marker coordinate system @param row row in the QR code's grid coordinate system @param col column in the QR code's grid coordinate system @param N width of grid @param location (Output) location of feature in marker reference frame
[ "Specifies", "3D", "location", "of", "landmark", "in", "marker", "coordinate", "system" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrPose3DUtils.java#L161-L167
train