repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/bundle/jacobians/JacobianSo3Numerical.java
JacobianSo3Numerical.init
public void init() { N = getParameterLength(); jacR = new DMatrixRMaj[N]; for (int i = 0; i < N; i++) { jacR[i] = new DMatrixRMaj(3,3); } jacobian = new DMatrixRMaj(N,9); paramInternal = new double[N]; numericalJac = createNumericalAlgorithm(function); }
java
public void init() { N = getParameterLength(); jacR = new DMatrixRMaj[N]; for (int i = 0; i < N; i++) { jacR[i] = new DMatrixRMaj(3,3); } jacobian = new DMatrixRMaj(N,9); paramInternal = new double[N]; numericalJac = createNumericalAlgorithm(function); }
[ "public", "void", "init", "(", ")", "{", "N", "=", "getParameterLength", "(", ")", ";", "jacR", "=", "new", "DMatrixRMaj", "[", "N", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "jacR", "[", "i", ...
Initializes data structures. Separate function to make it easier to extend the class
[ "Initializes", "data", "structures", ".", "Separate", "function", "to", "make", "it", "easier", "to", "extend", "the", "class" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/bundle/jacobians/JacobianSo3Numerical.java#L49-L58
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneObservations.java
SceneObservations.checkOneObservationPerView
public void checkOneObservationPerView() { for (int viewIdx = 0; viewIdx < views.length; viewIdx++) { SceneObservations.View v = views[viewIdx]; for (int obsIdx = 0; obsIdx < v.size(); obsIdx++) { int a = v.point.get(obsIdx); for (int i = obsIdx+1; i < v.size(); i++) { if( a == v.point.get(i)) { ...
java
public void checkOneObservationPerView() { for (int viewIdx = 0; viewIdx < views.length; viewIdx++) { SceneObservations.View v = views[viewIdx]; for (int obsIdx = 0; obsIdx < v.size(); obsIdx++) { int a = v.point.get(obsIdx); for (int i = obsIdx+1; i < v.size(); i++) { if( a == v.point.get(i)) { ...
[ "public", "void", "checkOneObservationPerView", "(", ")", "{", "for", "(", "int", "viewIdx", "=", "0", ";", "viewIdx", "<", "views", ".", "length", ";", "viewIdx", "++", ")", "{", "SceneObservations", ".", "View", "v", "=", "views", "[", "viewIdx", "]", ...
Makes sure that each feature is only observed in each view
[ "Makes", "sure", "that", "each", "feature", "is", "only", "observed", "in", "each", "view" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneObservations.java#L166-L179
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/misc/ProfileOperation.java
ProfileOperation.profile
public static void profile( Performer performer , int num ) { long deltaTime = measureTime(performer,num); System.out.printf("%30s time = %8d ms per frame = %8.3f\n", performer.getName(),deltaTime,(deltaTime/(double)num)); // System.out.println(performer.getClass().getSimpleName...
java
public static void profile( Performer performer , int num ) { long deltaTime = measureTime(performer,num); System.out.printf("%30s time = %8d ms per frame = %8.3f\n", performer.getName(),deltaTime,(deltaTime/(double)num)); // System.out.println(performer.getClass().getSimpleName...
[ "public", "static", "void", "profile", "(", "Performer", "performer", ",", "int", "num", ")", "{", "long", "deltaTime", "=", "measureTime", "(", "performer", ",", "num", ")", ";", "System", ".", "out", ".", "printf", "(", "\"%30s time = %8d ms per frame = %8.3...
See how long it takes to run the process 'num' times and print the results to standard out
[ "See", "how", "long", "it", "takes", "to", "run", "the", "process", "num", "times", "and", "print", "the", "results", "to", "standard", "out" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/ProfileOperation.java#L31-L39
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java
SegmentFelzenszwalbHuttenlocher04.initialize
protected void initialize(T input , GrayS32 output ) { this.graph = output; final int N = input.width*input.height; regionSize.resize(N); threshold.resize(N); for( int i = 0; i < N; i++ ) { regionSize.data[i] = 1; threshold.data[i] = K; graph.data[i] = i; // assign a unique label to each pixel since...
java
protected void initialize(T input , GrayS32 output ) { this.graph = output; final int N = input.width*input.height; regionSize.resize(N); threshold.resize(N); for( int i = 0; i < N; i++ ) { regionSize.data[i] = 1; threshold.data[i] = K; graph.data[i] = i; // assign a unique label to each pixel since...
[ "protected", "void", "initialize", "(", "T", "input", ",", "GrayS32", "output", ")", "{", "this", ".", "graph", "=", "output", ";", "final", "int", "N", "=", "input", ".", "width", "*", "input", ".", "height", ";", "regionSize", ".", "resize", "(", "...
Predeclares all memory required and sets data structures to their initial values
[ "Predeclares", "all", "memory", "required", "and", "sets", "data", "structures", "to", "their", "initial", "values" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java#L170-L184
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java
SegmentFelzenszwalbHuttenlocher04.mergeSmallRegions
protected void mergeSmallRegions() { for( int i = 0; i < edgesNotMatched.size(); i++ ) { Edge e = edgesNotMatched.get(i); int rootA = find(e.indexA); int rootB = find(e.indexB); // see if they are already part of the same segment if( rootA == rootB ) continue; int sizeA = regionSize.get(rootA...
java
protected void mergeSmallRegions() { for( int i = 0; i < edgesNotMatched.size(); i++ ) { Edge e = edgesNotMatched.get(i); int rootA = find(e.indexA); int rootB = find(e.indexB); // see if they are already part of the same segment if( rootA == rootB ) continue; int sizeA = regionSize.get(rootA...
[ "protected", "void", "mergeSmallRegions", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "edgesNotMatched", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Edge", "e", "=", "edgesNotMatched", ".", "get", "(", "i", ")", ";", "in...
Look at the remaining regions and if there are any small ones marge them into a larger region
[ "Look", "at", "the", "remaining", "regions", "and", "if", "there", "are", "any", "small", "ones", "marge", "them", "into", "a", "larger", "region" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java#L245-L269
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java
SegmentFelzenszwalbHuttenlocher04.find
protected int find( int child ) { int root = graph.data[child]; if( root == graph.data[root] ) return root; int inputChild = child; while( root != child ) { child = root; root = graph.data[child]; } graph.data[inputChild] = root; return root; }
java
protected int find( int child ) { int root = graph.data[child]; if( root == graph.data[root] ) return root; int inputChild = child; while( root != child ) { child = root; root = graph.data[child]; } graph.data[inputChild] = root; return root; }
[ "protected", "int", "find", "(", "int", "child", ")", "{", "int", "root", "=", "graph", ".", "data", "[", "child", "]", ";", "if", "(", "root", "==", "graph", ".", "data", "[", "root", "]", ")", "return", "root", ";", "int", "inputChild", "=", "c...
Finds the root given child. If the child does not point directly to the parent find the parent and make the child point directly towards it.
[ "Finds", "the", "root", "given", "child", ".", "If", "the", "child", "does", "not", "point", "directly", "to", "the", "parent", "find", "the", "parent", "and", "make", "the", "child", "point", "directly", "towards", "it", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java#L275-L289
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java
SegmentFelzenszwalbHuttenlocher04.computeOutput
protected void computeOutput() { outputRegionId.reset(); outputRegionSizes.reset(); for( int y = 0; y < graph.height; y++ ) { int indexGraph = graph.startIndex + y*graph.stride; for( int x = 0; x < graph.width; x++ , indexGraph++) { int parent = graph.data[indexGraph]; if( parent == indexGraph ) { ...
java
protected void computeOutput() { outputRegionId.reset(); outputRegionSizes.reset(); for( int y = 0; y < graph.height; y++ ) { int indexGraph = graph.startIndex + y*graph.stride; for( int x = 0; x < graph.width; x++ , indexGraph++) { int parent = graph.data[indexGraph]; if( parent == indexGraph ) { ...
[ "protected", "void", "computeOutput", "(", ")", "{", "outputRegionId", ".", "reset", "(", ")", ";", "outputRegionSizes", ".", "reset", "(", ")", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "graph", ".", "height", ";", "y", "++", ")", "{",...
Searches for root nodes in the graph and adds their size to the list of region sizes. Makes sure all other nodes in the graph point directly at their root.
[ "Searches", "for", "root", "nodes", "in", "the", "graph", "and", "adds", "their", "size", "to", "the", "list", "of", "region", "sizes", ".", "Makes", "sure", "all", "other", "nodes", "in", "the", "graph", "point", "directly", "at", "their", "root", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/fh04/SegmentFelzenszwalbHuttenlocher04.java#L295-L316
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizationPoint2D.java
NormalizationPoint2D.apply
public void apply( DMatrixRMaj H , DMatrixRMaj output ) { output.reshape(3,H.numCols); int stride = H.numCols; for (int col = 0; col < H.numCols; col++) { // This column in H double h1 = H.data[col], h2 = H.data[col+stride], h3 = H.data[col+2*stride]; output.data[col] = h1/stdX - meanX*h3/stdX; outpu...
java
public void apply( DMatrixRMaj H , DMatrixRMaj output ) { output.reshape(3,H.numCols); int stride = H.numCols; for (int col = 0; col < H.numCols; col++) { // This column in H double h1 = H.data[col], h2 = H.data[col+stride], h3 = H.data[col+2*stride]; output.data[col] = h1/stdX - meanX*h3/stdX; outpu...
[ "public", "void", "apply", "(", "DMatrixRMaj", "H", ",", "DMatrixRMaj", "output", ")", "{", "output", ".", "reshape", "(", "3", ",", "H", ".", "numCols", ")", ";", "int", "stride", "=", "H", ".", "numCols", ";", "for", "(", "int", "col", "=", "0", ...
Applies normalization to a H=3xN matrix out = Norm*H @param H 3xN matrix. Can be same as input matrix
[ "Applies", "normalization", "to", "a", "H", "=", "3xN", "matrix" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizationPoint2D.java#L76-L87
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizationPoint2D.java
NormalizationPoint2D.apply
public void apply(DMatrix3x3 C, DMatrix3x3 output) { DMatrix3x3 Hinv = matrixInv3(work); PerspectiveOps.multTranA(Hinv,C,Hinv,output); }
java
public void apply(DMatrix3x3 C, DMatrix3x3 output) { DMatrix3x3 Hinv = matrixInv3(work); PerspectiveOps.multTranA(Hinv,C,Hinv,output); }
[ "public", "void", "apply", "(", "DMatrix3x3", "C", ",", "DMatrix3x3", "output", ")", "{", "DMatrix3x3", "Hinv", "=", "matrixInv3", "(", "work", ")", ";", "PerspectiveOps", ".", "multTranA", "(", "Hinv", ",", "C", ",", "Hinv", ",", "output", ")", ";", "...
Apply transform to conic in 3x3 matrix format.
[ "Apply", "transform", "to", "conic", "in", "3x3", "matrix", "format", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/NormalizationPoint2D.java#L132-L135
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletHaar.java
FactoryWaveletHaar.generateInv_I32
private static WlCoef_I32 generateInv_I32() { WlCoef_I32 ret = new WlCoef_I32(); ret.scaling = new int[]{1,1}; ret.wavelet = new int[]{ret.scaling[0],-ret.scaling[0]}; ret.denominatorScaling = 2; ret.denominatorWavelet = 2; return ret; }
java
private static WlCoef_I32 generateInv_I32() { WlCoef_I32 ret = new WlCoef_I32(); ret.scaling = new int[]{1,1}; ret.wavelet = new int[]{ret.scaling[0],-ret.scaling[0]}; ret.denominatorScaling = 2; ret.denominatorWavelet = 2; return ret; }
[ "private", "static", "WlCoef_I32", "generateInv_I32", "(", ")", "{", "WlCoef_I32", "ret", "=", "new", "WlCoef_I32", "(", ")", ";", "ret", ".", "scaling", "=", "new", "int", "[", "]", "{", "1", ",", "1", "}", ";", "ret", ".", "wavelet", "=", "new", ...
Create a description for the inverse transform. Note that this will NOT produce an exact copy of the original due to rounding error. @return Wavelet inverse coefficient description.
[ "Create", "a", "description", "for", "the", "inverse", "transform", ".", "Note", "that", "this", "will", "NOT", "produce", "an", "exact", "copy", "of", "the", "original", "due", "to", "rounding", "error", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/wavelet/FactoryWaveletHaar.java#L69-L78
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.updateTracks
public void updateTracks( I input , PyramidDiscrete<I> pyramid , D[] derivX, D[] derivY ) { // forget recently dropped or spawned tracks tracksSpawned.clear(); // save references this.input = input; trackerKlt.setInputs(pyramid, derivX, derivY); trackUsingKlt(tracksPureKlt); ...
java
public void updateTracks( I input , PyramidDiscrete<I> pyramid , D[] derivX, D[] derivY ) { // forget recently dropped or spawned tracks tracksSpawned.clear(); // save references this.input = input; trackerKlt.setInputs(pyramid, derivX, derivY); trackUsingKlt(tracksPureKlt); ...
[ "public", "void", "updateTracks", "(", "I", "input", ",", "PyramidDiscrete", "<", "I", ">", "pyramid", ",", "D", "[", "]", "derivX", ",", "D", "[", "]", "derivY", ")", "{", "// forget recently dropped or spawned tracks", "tracksSpawned", ".", "clear", "(", "...
Updates the location and description of tracks using KLT. Saves a reference to the input image for future processing. @param input Input image. @param pyramid Image pyramid of input. @param derivX Derivative pyramid of input x-axis @param derivY Derivative pyramid of input y-axis
[ "Updates", "the", "location", "and", "description", "of", "tracks", "using", "KLT", ".", "Saves", "a", "reference", "to", "the", "input", "image", "for", "future", "processing", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L123-L137
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.trackUsingKlt
private void trackUsingKlt(List<CombinedTrack<TD>> tracks) { for( int i = 0; i < tracks.size(); ) { CombinedTrack<TD> track = tracks.get(i); if( !trackerKlt.performTracking(track.track) ) { // handle the dropped track tracks.remove(i); tracksDormant.add(track); } else { track.set(track.trac...
java
private void trackUsingKlt(List<CombinedTrack<TD>> tracks) { for( int i = 0; i < tracks.size(); ) { CombinedTrack<TD> track = tracks.get(i); if( !trackerKlt.performTracking(track.track) ) { // handle the dropped track tracks.remove(i); tracksDormant.add(track); } else { track.set(track.trac...
[ "private", "void", "trackUsingKlt", "(", "List", "<", "CombinedTrack", "<", "TD", ">", ">", "tracks", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tracks", ".", "size", "(", ")", ";", ")", "{", "CombinedTrack", "<", "TD", ">", "tra...
Tracks features in the list using KLT and update their state
[ "Tracks", "features", "in", "the", "list", "using", "KLT", "and", "update", "their", "state" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L142-L155
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.spawnTracksFromDetected
public void spawnTracksFromDetected() { // mark detected features with no matches as available FastQueue<AssociatedIndex> matches = associate.getMatches(); int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) associated[i] = false; for( AssociatedIndex i : matches.toList() ) { associat...
java
public void spawnTracksFromDetected() { // mark detected features with no matches as available FastQueue<AssociatedIndex> matches = associate.getMatches(); int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) associated[i] = false; for( AssociatedIndex i : matches.toList() ) { associat...
[ "public", "void", "spawnTracksFromDetected", "(", ")", "{", "// mark detected features with no matches as available", "FastQueue", "<", "AssociatedIndex", ">", "matches", "=", "associate", ".", "getMatches", "(", ")", ";", "int", "N", "=", "detector", ".", "getNumberO...
From the found interest points create new tracks. Tracks are only created at points where there are no existing tracks. Note: Must be called after {@link #associateAllToDetected}.
[ "From", "the", "found", "interest", "points", "create", "new", "tracks", ".", "Tracks", "are", "only", "created", "at", "points", "where", "there", "are", "no", "existing", "tracks", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L163-L205
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.associateToDetected
private void associateToDetected( List<CombinedTrack<TD>> known ) { // initialize data structures detectedDesc.reset(); knownDesc.reset(); // create a list of detected feature descriptions int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) { detectedDesc.add(detector.getDescription(i))...
java
private void associateToDetected( List<CombinedTrack<TD>> known ) { // initialize data structures detectedDesc.reset(); knownDesc.reset(); // create a list of detected feature descriptions int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) { detectedDesc.add(detector.getDescription(i))...
[ "private", "void", "associateToDetected", "(", "List", "<", "CombinedTrack", "<", "TD", ">", ">", "known", ")", "{", "// initialize data structures", "detectedDesc", ".", "reset", "(", ")", ";", "knownDesc", ".", "reset", "(", ")", ";", "// create a list of dete...
Associates pre-existing tracks to newly detected features @param known List of known tracks
[ "Associates", "pre", "-", "existing", "tracks", "to", "newly", "detected", "features" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L213-L237
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.associateAllToDetected
public void associateAllToDetected() { // initialize data structures List<CombinedTrack<TD>> all = new ArrayList<>(); all.addAll(tracksReactivated); all.addAll(tracksDormant); all.addAll(tracksPureKlt); int numTainted = tracksReactivated.size() + tracksDormant.size(); tracksReactivated.clear(); tracks...
java
public void associateAllToDetected() { // initialize data structures List<CombinedTrack<TD>> all = new ArrayList<>(); all.addAll(tracksReactivated); all.addAll(tracksDormant); all.addAll(tracksPureKlt); int numTainted = tracksReactivated.size() + tracksDormant.size(); tracksReactivated.clear(); tracks...
[ "public", "void", "associateAllToDetected", "(", ")", "{", "// initialize data structures", "List", "<", "CombinedTrack", "<", "TD", ">>", "all", "=", "new", "ArrayList", "<>", "(", ")", ";", "all", ".", "addAll", "(", "tracksReactivated", ")", ";", "all", "...
Associate all tracks in any state to the latest observations. If a dormant track is associated it will be reactivated. If a reactivated track is associated it's state will be updated. PureKLT tracks are left unmodified.
[ "Associate", "all", "tracks", "in", "any", "state", "to", "the", "latest", "observations", ".", "If", "a", "dormant", "track", "is", "associated", "it", "will", "be", "reactivated", ".", "If", "a", "reactivated", "track", "is", "associated", "it", "s", "st...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L244-L286
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.dropTrack
public boolean dropTrack( CombinedTrack<TD> track ) { if( !tracksPureKlt.remove(track) ) if( !tracksReactivated.remove(track) ) if( !tracksDormant.remove(track) ) return false; tracksUnused.add(track); return true; }
java
public boolean dropTrack( CombinedTrack<TD> track ) { if( !tracksPureKlt.remove(track) ) if( !tracksReactivated.remove(track) ) if( !tracksDormant.remove(track) ) return false; tracksUnused.add(track); return true; }
[ "public", "boolean", "dropTrack", "(", "CombinedTrack", "<", "TD", ">", "track", ")", "{", "if", "(", "!", "tracksPureKlt", ".", "remove", "(", "track", ")", ")", "if", "(", "!", "tracksReactivated", ".", "remove", "(", "track", ")", ")", "if", "(", ...
Stops tracking the specified track and recycles its data. @param track The track being dropped @return true if the track was being tracked and data was recycled false if not.
[ "Stops", "tracking", "the", "specified", "track", "and", "recycles", "its", "data", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L294-L302
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java
CombinedTrackerScalePoint.dropAllTracks
public void dropAllTracks() { tracksUnused.addAll(tracksDormant); tracksUnused.addAll(tracksPureKlt); tracksUnused.addAll(tracksReactivated); tracksSpawned.clear(); tracksPureKlt.clear(); tracksReactivated.clear(); tracksSpawned.clear(); tracksDormant.clear(); }
java
public void dropAllTracks() { tracksUnused.addAll(tracksDormant); tracksUnused.addAll(tracksPureKlt); tracksUnused.addAll(tracksReactivated); tracksSpawned.clear(); tracksPureKlt.clear(); tracksReactivated.clear(); tracksSpawned.clear(); tracksDormant.clear(); }
[ "public", "void", "dropAllTracks", "(", ")", "{", "tracksUnused", ".", "addAll", "(", "tracksDormant", ")", ";", "tracksUnused", ".", "addAll", "(", "tracksPureKlt", ")", ";", "tracksUnused", ".", "addAll", "(", "tracksReactivated", ")", ";", "tracksSpawned", ...
Drops all tracks and recycles the data
[ "Drops", "all", "tracks", "and", "recycles", "the", "data" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/combined/CombinedTrackerScalePoint.java#L331-L341
train
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/feature/associate/VisualizeAssociationScoreApp.java
VisualizeAssociationScoreApp.processImage
private void processImage() { final List<Point2D_F64> leftPts = new ArrayList<>(); final List<Point2D_F64> rightPts = new ArrayList<>(); final List<TupleDesc> leftDesc = new ArrayList<>(); final List<TupleDesc> rightDesc = new ArrayList<>(); final ProgressMonitor progressMonitor = new ProgressMonitor(this, ...
java
private void processImage() { final List<Point2D_F64> leftPts = new ArrayList<>(); final List<Point2D_F64> rightPts = new ArrayList<>(); final List<TupleDesc> leftDesc = new ArrayList<>(); final List<TupleDesc> rightDesc = new ArrayList<>(); final ProgressMonitor progressMonitor = new ProgressMonitor(this, ...
[ "private", "void", "processImage", "(", ")", "{", "final", "List", "<", "Point2D_F64", ">", "leftPts", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "List", "<", "Point2D_F64", ">", "rightPts", "=", "new", "ArrayList", "<>", "(", ")", ";", "fi...
Extracts image information and then passes that info onto scorePanel for display. Data is not recycled to avoid threading issues.
[ "Extracts", "image", "information", "and", "then", "passes", "that", "info", "onto", "scorePanel", "for", "display", ".", "Data", "is", "not", "recycled", "to", "avoid", "threading", "issues", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/associate/VisualizeAssociationScoreApp.java#L172-L192
train
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/feature/associate/VisualizeAssociationScoreApp.java
VisualizeAssociationScoreApp.extractImageFeatures
private void extractImageFeatures(final ProgressMonitor progressMonitor, final int progress, T image, List<TupleDesc> descs, List<Point2D_F64> locs) { SwingUtilities.invokeLater(new Runnable() { public void run() { progressMonitor.setNote("Detecting"); } }); detector.detect(image);...
java
private void extractImageFeatures(final ProgressMonitor progressMonitor, final int progress, T image, List<TupleDesc> descs, List<Point2D_F64> locs) { SwingUtilities.invokeLater(new Runnable() { public void run() { progressMonitor.setNote("Detecting"); } }); detector.detect(image);...
[ "private", "void", "extractImageFeatures", "(", "final", "ProgressMonitor", "progressMonitor", ",", "final", "int", "progress", ",", "T", "image", ",", "List", "<", "TupleDesc", ">", "descs", ",", "List", "<", "Point2D_F64", ">", "locs", ")", "{", "SwingUtilit...
Detects the locations of the features in the image and extracts descriptions of each of the features.
[ "Detects", "the", "locations", "of", "the", "features", "in", "the", "image", "and", "extracts", "descriptions", "of", "each", "of", "the", "features", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/feature/associate/VisualizeAssociationScoreApp.java#L198-L257
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java
BroxWarpingSpacial.resizeForLayer
protected void resizeForLayer( int width , int height ) { deriv1X.reshape(width,height); deriv1Y.reshape(width,height); deriv2X.reshape(width,height); deriv2Y.reshape(width,height); deriv2XX.reshape(width,height); deriv2YY.reshape(width,height); deriv2XY.reshape(width,height); warpImage2.reshape(width,...
java
protected void resizeForLayer( int width , int height ) { deriv1X.reshape(width,height); deriv1Y.reshape(width,height); deriv2X.reshape(width,height); deriv2Y.reshape(width,height); deriv2XX.reshape(width,height); deriv2YY.reshape(width,height); deriv2XY.reshape(width,height); warpImage2.reshape(width,...
[ "protected", "void", "resizeForLayer", "(", "int", "width", ",", "int", "height", ")", "{", "deriv1X", ".", "reshape", "(", "width", ",", "height", ")", ";", "deriv1Y", ".", "reshape", "(", "width", ",", "height", ")", ";", "deriv2X", ".", "reshape", "...
Resize images for the current layer being processed
[ "Resize", "images", "for", "the", "current", "layer", "being", "processed" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java#L182-L213
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java
BroxWarpingSpacial.computePsiSmooth
private void computePsiSmooth(GrayF32 ux , GrayF32 uy , GrayF32 vx , GrayF32 vy , GrayF32 psiSmooth ) { int N = derivFlowUX.width * derivFlowUX.height; for( int i = 0; i < N; i++ ) { float vux = ux.data[i]; float vuy = uy.data[i]; float vvx = vx.data[i]; float vvy = vy.data[i]; float mu =...
java
private void computePsiSmooth(GrayF32 ux , GrayF32 uy , GrayF32 vx , GrayF32 vy , GrayF32 psiSmooth ) { int N = derivFlowUX.width * derivFlowUX.height; for( int i = 0; i < N; i++ ) { float vux = ux.data[i]; float vuy = uy.data[i]; float vvx = vx.data[i]; float vvy = vy.data[i]; float mu =...
[ "private", "void", "computePsiSmooth", "(", "GrayF32", "ux", ",", "GrayF32", "uy", ",", "GrayF32", "vx", ",", "GrayF32", "vy", ",", "GrayF32", "psiSmooth", ")", "{", "int", "N", "=", "derivFlowUX", ".", "width", "*", "derivFlowUX", ".", "height", ";", "f...
Equation 5. Psi_s
[ "Equation", "5", ".", "Psi_s" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java#L377-L392
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java
BroxWarpingSpacial.computePsiDataPsiGradient
protected void computePsiDataPsiGradient(GrayF32 image1, GrayF32 image2, GrayF32 deriv1x, GrayF32 deriv1y, GrayF32 deriv2x, GrayF32 deriv2y, GrayF32 deriv2xx, GrayF32 deriv2yy, GrayF32 deriv2xy, GrayF32 du, GrayF32 dv, GrayF32 psiData, GrayF32 psiGradient ) { ...
java
protected void computePsiDataPsiGradient(GrayF32 image1, GrayF32 image2, GrayF32 deriv1x, GrayF32 deriv1y, GrayF32 deriv2x, GrayF32 deriv2y, GrayF32 deriv2xx, GrayF32 deriv2yy, GrayF32 deriv2xy, GrayF32 du, GrayF32 dv, GrayF32 psiData, GrayF32 psiGradient ) { ...
[ "protected", "void", "computePsiDataPsiGradient", "(", "GrayF32", "image1", ",", "GrayF32", "image2", ",", "GrayF32", "deriv1x", ",", "GrayF32", "deriv1y", ",", "GrayF32", "deriv2x", ",", "GrayF32", "deriv2y", ",", "GrayF32", "deriv2xx", ",", "GrayF32", "deriv2yy"...
Compute Psi-data using equation 6 and approximation in equation 5
[ "Compute", "Psi", "-", "data", "using", "equation", "6", "and", "approximation", "in", "equation", "5" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java#L397-L423
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java
BroxWarpingSpacial.computeDivUVD
private void computeDivUVD(GrayF32 u , GrayF32 v , GrayF32 psi , GrayF32 divU , GrayF32 divV , GrayF32 divD ) { final int stride = psi.stride; // compute the inside pixel for (int y = 1; y < psi.height-1; y++) { // index of the current pixel int index = y*stride + 1; for (int x = 1; x < psi...
java
private void computeDivUVD(GrayF32 u , GrayF32 v , GrayF32 psi , GrayF32 divU , GrayF32 divV , GrayF32 divD ) { final int stride = psi.stride; // compute the inside pixel for (int y = 1; y < psi.height-1; y++) { // index of the current pixel int index = y*stride + 1; for (int x = 1; x < psi...
[ "private", "void", "computeDivUVD", "(", "GrayF32", "u", ",", "GrayF32", "v", ",", "GrayF32", "psi", ",", "GrayF32", "divU", ",", "GrayF32", "divV", ",", "GrayF32", "divD", ")", "{", "final", "int", "stride", "=", "psi", ".", "stride", ";", "// compute t...
Computes the divergence for u,v, and d. Equation 8 and Equation 10.
[ "Computes", "the", "divergence", "for", "u", "v", "and", "d", ".", "Equation", "8", "and", "Equation", "10", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/BroxWarpingSpacial.java#L428-L471
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.reset
public void reset() { unused.addAll(templateNegative); unused.addAll(templatePositive); templateNegative.clear(); templatePositive.clear(); }
java
public void reset() { unused.addAll(templateNegative); unused.addAll(templatePositive); templateNegative.clear(); templatePositive.clear(); }
[ "public", "void", "reset", "(", ")", "{", "unused", ".", "addAll", "(", "templateNegative", ")", ";", "unused", ".", "addAll", "(", "templatePositive", ")", ";", "templateNegative", ".", "clear", "(", ")", ";", "templatePositive", ".", "clear", "(", ")", ...
Discard previous results and puts it back into its initial state
[ "Discard", "previous", "results", "and", "puts", "it", "back", "into", "its", "initial", "state" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L63-L68
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.addDescriptor
public void addDescriptor( boolean positive , ImageRectangle rect ) { addDescriptor(positive, rect.x0, rect.y0, rect.x1, rect.y1); }
java
public void addDescriptor( boolean positive , ImageRectangle rect ) { addDescriptor(positive, rect.x0, rect.y0, rect.x1, rect.y1); }
[ "public", "void", "addDescriptor", "(", "boolean", "positive", ",", "ImageRectangle", "rect", ")", "{", "addDescriptor", "(", "positive", ",", "rect", ".", "x0", ",", "rect", ".", "y0", ",", "rect", ".", "x1", ",", "rect", ".", "y1", ")", ";", "}" ]
Creates a new descriptor for the specified region @param positive if it is a positive or negative example
[ "Creates", "a", "new", "descriptor", "for", "the", "specified", "region" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L84-L87
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.addDescriptor
private void addDescriptor(boolean positive, NccFeature f) { // avoid adding the same descriptor twice or adding contradicting results if( positive) if( distance(f,templatePositive) < 0.05 ) { return; } if( !positive) { if( distance(f,templateNegative) < 0.05 ) { return; } // a positive pos...
java
private void addDescriptor(boolean positive, NccFeature f) { // avoid adding the same descriptor twice or adding contradicting results if( positive) if( distance(f,templatePositive) < 0.05 ) { return; } if( !positive) { if( distance(f,templateNegative) < 0.05 ) { return; } // a positive pos...
[ "private", "void", "addDescriptor", "(", "boolean", "positive", ",", "NccFeature", "f", ")", "{", "// avoid adding the same descriptor twice or adding contradicting results", "if", "(", "positive", ")", "if", "(", "distance", "(", "f", ",", "templatePositive", ")", "<...
Adds a descriptor to the positive or negative list. If it is very similar to an existing one it is not added. Look at code for details @param positive true for positive list and false for negative list @param f The feature which is to be added
[ "Adds", "a", "descriptor", "to", "the", "positive", "or", "negative", "list", ".", "If", "it", "is", "very", "similar", "to", "an", "existing", "one", "it", "is", "not", "added", ".", "Look", "at", "code", "for", "details" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L103-L124
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.computeNccDescriptor
public void computeNccDescriptor( NccFeature f , float x0 , float y0 , float x1 , float y1 ) { double mean = 0; float widthStep = (x1-x0)/15.0f; float heightStep = (y1-y0)/15.0f; // compute the mean value int index = 0; for( int y = 0; y < 15; y++ ) { float sampleY = y0 + y*heightStep; for( int x = 0...
java
public void computeNccDescriptor( NccFeature f , float x0 , float y0 , float x1 , float y1 ) { double mean = 0; float widthStep = (x1-x0)/15.0f; float heightStep = (y1-y0)/15.0f; // compute the mean value int index = 0; for( int y = 0; y < 15; y++ ) { float sampleY = y0 + y*heightStep; for( int x = 0...
[ "public", "void", "computeNccDescriptor", "(", "NccFeature", "f", ",", "float", "x0", ",", "float", "y0", ",", "float", "x1", ",", "float", "y1", ")", "{", "double", "mean", "=", "0", ";", "float", "widthStep", "=", "(", "x1", "-", "x0", ")", "/", ...
Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle
[ "Computes", "the", "NCC", "descriptor", "by", "sample", "points", "at", "evenly", "spaced", "distances", "inside", "the", "rectangle" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L129-L156
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.createDescriptor
public NccFeature createDescriptor() { NccFeature f; if( unused.isEmpty() ) f = new NccFeature(15*15); else f = unused.pop(); return f; }
java
public NccFeature createDescriptor() { NccFeature f; if( unused.isEmpty() ) f = new NccFeature(15*15); else f = unused.pop(); return f; }
[ "public", "NccFeature", "createDescriptor", "(", ")", "{", "NccFeature", "f", ";", "if", "(", "unused", ".", "isEmpty", "(", ")", ")", "f", "=", "new", "NccFeature", "(", "15", "*", "15", ")", ";", "else", "f", "=", "unused", ".", "pop", "(", ")", ...
Creates a new descriptor or recycles an old one
[ "Creates", "a", "new", "descriptor", "or", "recycles", "an", "old", "one" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L161-L168
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.computeConfidence
public double computeConfidence( int x0 , int y0 , int x1 , int y1 ) { computeNccDescriptor(observed,x0,y0,x1,y1); // distance from each set of templates if( templateNegative.size() > 0 && templatePositive.size() > 0 ) { double distancePositive = distance(observed,templatePositive); double distanceNegativ...
java
public double computeConfidence( int x0 , int y0 , int x1 , int y1 ) { computeNccDescriptor(observed,x0,y0,x1,y1); // distance from each set of templates if( templateNegative.size() > 0 && templatePositive.size() > 0 ) { double distancePositive = distance(observed,templatePositive); double distanceNegativ...
[ "public", "double", "computeConfidence", "(", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "computeNccDescriptor", "(", "observed", ",", "x0", ",", "y0", ",", "x1", ",", "y1", ")", ";", "// distance from each set of template...
Compute a value which indicates how confident the specified region is to be a member of the positive set. The confidence value is from 0 to 1. 1 indicates 100% confidence. Positive and negative templates are used to compute the confidence value. Only the point in each set which is closest to the specified region are...
[ "Compute", "a", "value", "which", "indicates", "how", "confident", "the", "specified", "region", "is", "to", "be", "a", "member", "of", "the", "positive", "set", ".", "The", "confidence", "value", "is", "from", "0", "to", "1", ".", "1", "indicates", "100...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L179-L194
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.computeConfidence
public double computeConfidence( ImageRectangle r ) { return computeConfidence(r.x0,r.y0,r.x1,r.y1); }
java
public double computeConfidence( ImageRectangle r ) { return computeConfidence(r.x0,r.y0,r.x1,r.y1); }
[ "public", "double", "computeConfidence", "(", "ImageRectangle", "r", ")", "{", "return", "computeConfidence", "(", "r", ".", "x0", ",", "r", ".", "y0", ",", "r", ".", "x1", ",", "r", ".", "y1", ")", ";", "}" ]
see the other function with the same name
[ "see", "the", "other", "function", "with", "the", "same", "name" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L199-L201
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java
TldTemplateMatching.distance
public double distance( NccFeature observed , List<NccFeature> candidates ) { double maximum = -Double.MAX_VALUE; // The feature which has the best fit will maximize the score for( NccFeature f : candidates ) { double score = DescriptorDistance.ncc(observed, f); if( score > maximum ) maximum = score; ...
java
public double distance( NccFeature observed , List<NccFeature> candidates ) { double maximum = -Double.MAX_VALUE; // The feature which has the best fit will maximize the score for( NccFeature f : candidates ) { double score = DescriptorDistance.ncc(observed, f); if( score > maximum ) maximum = score; ...
[ "public", "double", "distance", "(", "NccFeature", "observed", ",", "List", "<", "NccFeature", ">", "candidates", ")", "{", "double", "maximum", "=", "-", "Double", ".", "MAX_VALUE", ";", "// The feature which has the best fit will maximize the score", "for", "(", "...
Computes the best distance to 'observed' from the candidate list. @param observed Feature being matched @param candidates Set of candidate matches @return score from 0 to 1, where lower is closer
[ "Computes", "the", "best", "distance", "to", "observed", "from", "the", "candidate", "list", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L209-L221
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCornersPyramid.java
DetectChessboardCornersPyramid.process
public void process(GrayF32 input ) { constructPyramid(input); corners.reset(); // top to bottom. This way the intensity image is at the input image's scale. Which is useful // for visualiztion purposes double scale = Math.pow(2.0,pyramid.size()-1); for (int level = pyramid.size()-1; level >= 0; level--) ...
java
public void process(GrayF32 input ) { constructPyramid(input); corners.reset(); // top to bottom. This way the intensity image is at the input image's scale. Which is useful // for visualiztion purposes double scale = Math.pow(2.0,pyramid.size()-1); for (int level = pyramid.size()-1; level >= 0; level--) ...
[ "public", "void", "process", "(", "GrayF32", "input", ")", "{", "constructPyramid", "(", "input", ")", ";", "corners", ".", "reset", "(", ")", ";", "// top to bottom. This way the intensity image is at the input image's scale. Which is useful", "// for visualiztion purposes",...
Detects corner features inside the input gray scale image.
[ "Detects", "corner", "features", "inside", "the", "input", "gray", "scale", "image", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCornersPyramid.java#L73-L131
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCornersPyramid.java
DetectChessboardCornersPyramid.markSeenAsFalse
void markSeenAsFalse(FastQueue<ChessboardCorner> corners0 , FastQueue<ChessboardCorner> corners1 ) { nn.setPoints(corners1.toList(),false); // radius of the blob in the intensity image is 2*kernelRadius int radius = detector.shiRadius *2+1; for (int i = 0; i < corners0.size; i++) { ChessboardCorner c0 = corn...
java
void markSeenAsFalse(FastQueue<ChessboardCorner> corners0 , FastQueue<ChessboardCorner> corners1 ) { nn.setPoints(corners1.toList(),false); // radius of the blob in the intensity image is 2*kernelRadius int radius = detector.shiRadius *2+1; for (int i = 0; i < corners0.size; i++) { ChessboardCorner c0 = corn...
[ "void", "markSeenAsFalse", "(", "FastQueue", "<", "ChessboardCorner", ">", "corners0", ",", "FastQueue", "<", "ChessboardCorner", ">", "corners1", ")", "{", "nn", ".", "setPoints", "(", "corners1", ".", "toList", "(", ")", ",", "false", ")", ";", "// radius ...
Finds corners in list 1 which match corners in list 0. If the feature in list 0 has already been seen then the feature in list 1 will be marked as seen. Otherwise the feature which is the most intense is marked as first.
[ "Finds", "corners", "in", "list", "1", "which", "match", "corners", "in", "list", "0", ".", "If", "the", "feature", "in", "list", "0", "has", "already", "been", "seen", "then", "the", "feature", "in", "list", "1", "will", "be", "marked", "as", "seen", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCornersPyramid.java#L138-L162
train
lessthanoptimal/BoofCV
demonstrations/src/main/java/boofcv/demonstrations/fiducial/DetectQrCodeApp.java
DetectQrCodeApp.processImage
@Override public void processImage(int sourceID, long frameID, final BufferedImage buffered, ImageBase input) { System.out.flush(); synchronized (bufferedImageLock) { original = ConvertBufferedImage.checkCopy(buffered, original); work = ConvertBufferedImage.checkDeclare(buffered, work); } if( saveReque...
java
@Override public void processImage(int sourceID, long frameID, final BufferedImage buffered, ImageBase input) { System.out.flush(); synchronized (bufferedImageLock) { original = ConvertBufferedImage.checkCopy(buffered, original); work = ConvertBufferedImage.checkDeclare(buffered, work); } if( saveReque...
[ "@", "Override", "public", "void", "processImage", "(", "int", "sourceID", ",", "long", "frameID", ",", "final", "BufferedImage", "buffered", ",", "ImageBase", "input", ")", "{", "System", ".", "out", ".", "flush", "(", ")", ";", "synchronized", "(", "buff...
Override this function so that it doesn't threshold the image twice
[ "Override", "this", "function", "so", "that", "it", "doesn", "t", "threshold", "the", "image", "twice" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/fiducial/DetectQrCodeApp.java#L191-L241
train
lessthanoptimal/BoofCV
main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/Zhang99ComputeTargetHomography.java
Zhang99ComputeTargetHomography.computeHomography
public boolean computeHomography( CalibrationObservation observedPoints ) { if( observedPoints.size() < 4) throw new IllegalArgumentException("At least 4 points needed in each set of observations. " + " Filter these first please"); List<AssociatedPair> pairs = new ArrayList<>(); for( int i = 0; i < obse...
java
public boolean computeHomography( CalibrationObservation observedPoints ) { if( observedPoints.size() < 4) throw new IllegalArgumentException("At least 4 points needed in each set of observations. " + " Filter these first please"); List<AssociatedPair> pairs = new ArrayList<>(); for( int i = 0; i < obse...
[ "public", "boolean", "computeHomography", "(", "CalibrationObservation", "observedPoints", ")", "{", "if", "(", "observedPoints", ".", "size", "(", ")", "<", "4", ")", "throw", "new", "IllegalArgumentException", "(", "\"At least 4 points needed in each set of observations...
Computes the homography from a list of detected grid points in the image. The order of the grid points is important and must follow the expected row major starting at the top left. @param observedPoints List of ordered detected grid points in image pixels. @return True if it computed a Homography and false if it fail...
[ "Computes", "the", "homography", "from", "a", "list", "of", "detected", "grid", "points", "in", "the", "image", ".", "The", "order", "of", "the", "grid", "points", "is", "important", "and", "must", "follow", "the", "expected", "row", "major", "starting", "...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/calibration/Zhang99ComputeTargetHomography.java#L65-L85
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/concurrency/FWorkArrays.java
FWorkArrays.recycle
public synchronized void recycle( float[] array ) { if( array.length != length ) { throw new IllegalArgumentException("Unexpected array length. Expected "+length+" found "+array.length); } storage.add(array); }
java
public synchronized void recycle( float[] array ) { if( array.length != length ) { throw new IllegalArgumentException("Unexpected array length. Expected "+length+" found "+array.length); } storage.add(array); }
[ "public", "synchronized", "void", "recycle", "(", "float", "[", "]", "array", ")", "{", "if", "(", "array", ".", "length", "!=", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Unexpected array length. Expected \"", "+", "length", "+", ...
Adds the array to storage. if the array length is unexpected an exception is thrown @param array array to be recycled.
[ "Adds", "the", "array", "to", "storage", ".", "if", "the", "array", "length", "is", "unexpected", "an", "exception", "is", "thrown" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/FWorkArrays.java#L67-L72
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java
ExampleMultiviewSceneReconstruction.visualizeResults
private void visualizeResults( SceneStructureMetric structure, List<BufferedImage> colorImages ) { List<Point3D_F64> cloudXyz = new ArrayList<>(); GrowQueue_I32 cloudRgb = new GrowQueue_I32(); Point3D_F64 world = new Point3D_F64(); Point3D_F64 camera = new Point3D_F64(); Point2D_F64 pixel = new Po...
java
private void visualizeResults( SceneStructureMetric structure, List<BufferedImage> colorImages ) { List<Point3D_F64> cloudXyz = new ArrayList<>(); GrowQueue_I32 cloudRgb = new GrowQueue_I32(); Point3D_F64 world = new Point3D_F64(); Point3D_F64 camera = new Point3D_F64(); Point2D_F64 pixel = new Po...
[ "private", "void", "visualizeResults", "(", "SceneStructureMetric", "structure", ",", "List", "<", "BufferedImage", ">", "colorImages", ")", "{", "List", "<", "Point3D_F64", ">", "cloudXyz", "=", "new", "ArrayList", "<>", "(", ")", ";", "GrowQueue_I32", "cloudRg...
Opens a window showing the found point cloud. Points are colorized using the pixel value inside one of the input images
[ "Opens", "a", "window", "showing", "the", "found", "point", "cloud", ".", "Points", "are", "colorized", "using", "the", "pixel", "value", "inside", "one", "of", "the", "input", "images" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java#L153-L198
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java
QrCodePolynomialMath.decodeFormatMessage
public static void decodeFormatMessage(int message , QrCode qr ) { int error = message >> 3; qr.error = QrCode.ErrorLevel.lookup(error); qr.mask = QrCodeMaskPattern.lookupMask(message&0x07); }
java
public static void decodeFormatMessage(int message , QrCode qr ) { int error = message >> 3; qr.error = QrCode.ErrorLevel.lookup(error); qr.mask = QrCodeMaskPattern.lookupMask(message&0x07); }
[ "public", "static", "void", "decodeFormatMessage", "(", "int", "message", ",", "QrCode", "qr", ")", "{", "int", "error", "=", "message", ">>", "3", ";", "qr", ".", "error", "=", "QrCode", ".", "ErrorLevel", ".", "lookup", "(", "error", ")", ";", "qr", ...
Assumes that the format message has no errors in it and decodes its data and saves it into the qr code @param message format data bits after the mask has been remove and shifted over 10 bits @param qr Where the results are written to
[ "Assumes", "that", "the", "format", "message", "has", "no", "errors", "in", "it", "and", "decodes", "its", "data", "and", "saves", "it", "into", "the", "qr", "code" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java#L94-L99
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java
QrCodePolynomialMath.correctDCH
public static int correctDCH( int N , int messageNoMask , int generator , int totalBits, int dataBits) { int bestHamming = 255; int bestMessage = -1; int errorBits = totalBits-dataBits; // exhaustively check all possibilities for (int i = 0; i < N; i++) { int test = i << errorBits; test = test ^ bitPo...
java
public static int correctDCH( int N , int messageNoMask , int generator , int totalBits, int dataBits) { int bestHamming = 255; int bestMessage = -1; int errorBits = totalBits-dataBits; // exhaustively check all possibilities for (int i = 0; i < N; i++) { int test = i << errorBits; test = test ^ bitPo...
[ "public", "static", "int", "correctDCH", "(", "int", "N", ",", "int", "messageNoMask", ",", "int", "generator", ",", "int", "totalBits", ",", "int", "dataBits", ")", "{", "int", "bestHamming", "=", "255", ";", "int", "bestMessage", "=", "-", "1", ";", ...
Applies a brute force algorithm to find the message which has the smallest hamming distance. if two messages have the same distance -1 is returned. @param N Number of possible messages. 32 or 64 @param messageNoMask The observed message with mask removed @param generator Generator polynomial @param totalBits Total numb...
[ "Applies", "a", "brute", "force", "algorithm", "to", "find", "the", "message", "which", "has", "the", "smallest", "hamming", "distance", ".", "if", "two", "messages", "have", "the", "same", "distance", "-", "1", "is", "returned", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePolynomialMath.java#L120-L143
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/calibration/ExampleRemoveLensDistortion.java
ExampleRemoveLensDistortion.displayResults
private static void displayResults(BufferedImage orig, Planar<GrayF32> distortedImg, ImageDistort allInside, ImageDistort fullView ) { // render the results Planar<GrayF32> undistortedImg = new Planar<>(GrayF32.class, distortedImg.getWidth(),distortedImg.getHeight(),distortedImg.getNumBa...
java
private static void displayResults(BufferedImage orig, Planar<GrayF32> distortedImg, ImageDistort allInside, ImageDistort fullView ) { // render the results Planar<GrayF32> undistortedImg = new Planar<>(GrayF32.class, distortedImg.getWidth(),distortedImg.getHeight(),distortedImg.getNumBa...
[ "private", "static", "void", "displayResults", "(", "BufferedImage", "orig", ",", "Planar", "<", "GrayF32", ">", "distortedImg", ",", "ImageDistort", "allInside", ",", "ImageDistort", "fullView", ")", "{", "// render the results", "Planar", "<", "GrayF32", ">", "u...
Displays results in a window for easy comparison..
[ "Displays", "results", "in", "a", "window", "for", "easy", "comparison", ".." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/calibration/ExampleRemoveLensDistortion.java#L92-L112
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/StabilitySquareFiducialEstimate.java
StabilitySquareFiducialEstimate.process
public boolean process( double sampleRadius , Quadrilateral_F64 input ) { work.set(input); samples.reset(); estimator.process(work,false); estimator.getWorldToCamera().invert(referenceCameraToWorld); samples.reset(); createSamples(sampleRadius,work.a,input.a); createSamples(sampleRadius,work.b,input.b)...
java
public boolean process( double sampleRadius , Quadrilateral_F64 input ) { work.set(input); samples.reset(); estimator.process(work,false); estimator.getWorldToCamera().invert(referenceCameraToWorld); samples.reset(); createSamples(sampleRadius,work.a,input.a); createSamples(sampleRadius,work.b,input.b)...
[ "public", "boolean", "process", "(", "double", "sampleRadius", ",", "Quadrilateral_F64", "input", ")", "{", "work", ".", "set", "(", "input", ")", ";", "samples", ".", "reset", "(", ")", ";", "estimator", ".", "process", "(", "work", ",", "false", ")", ...
Processes the observation and generates a stability estimate @param sampleRadius Radius around the corner pixels it will sample @param input Observed corner location of the fiducial in distorted pixels. Must be in correct order. @return true if successful or false if it failed
[ "Processes", "the", "observation", "and", "generates", "a", "stability", "estimate" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/StabilitySquareFiducialEstimate.java#L68-L106
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/StabilitySquareFiducialEstimate.java
StabilitySquareFiducialEstimate.createSamples
private void createSamples( double sampleRadius , Point2D_F64 workPoint , Point2D_F64 originalPoint ) { workPoint.x = originalPoint.x + sampleRadius; if( estimator.process(work,false) ) { samples.grow().set( estimator.getWorldToCamera() ); } workPoint.x = originalPoint.x - sampleRadius; if( estimator.proc...
java
private void createSamples( double sampleRadius , Point2D_F64 workPoint , Point2D_F64 originalPoint ) { workPoint.x = originalPoint.x + sampleRadius; if( estimator.process(work,false) ) { samples.grow().set( estimator.getWorldToCamera() ); } workPoint.x = originalPoint.x - sampleRadius; if( estimator.proc...
[ "private", "void", "createSamples", "(", "double", "sampleRadius", ",", "Point2D_F64", "workPoint", ",", "Point2D_F64", "originalPoint", ")", "{", "workPoint", ".", "x", "=", "originalPoint", ".", "x", "+", "sampleRadius", ";", "if", "(", "estimator", ".", "pr...
Samples around the provided corner +- in x and y directions
[ "Samples", "around", "the", "provided", "corner", "+", "-", "in", "x", "and", "y", "directions" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/StabilitySquareFiducialEstimate.java#L111-L132
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java
TldLearning.initialLearning
public void initialLearning( Rectangle2D_F64 targetRegion , FastQueue<ImageRectangle> cascadeRegions ) { storageMetric.reset(); fernNegative.clear(); // learn the initial descriptor TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); // select the variance the first time using user s...
java
public void initialLearning( Rectangle2D_F64 targetRegion , FastQueue<ImageRectangle> cascadeRegions ) { storageMetric.reset(); fernNegative.clear(); // learn the initial descriptor TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); // select the variance the first time using user s...
[ "public", "void", "initialLearning", "(", "Rectangle2D_F64", "targetRegion", ",", "FastQueue", "<", "ImageRectangle", ">", "cascadeRegions", ")", "{", "storageMetric", ".", "reset", "(", ")", ";", "fernNegative", ".", "clear", "(", ")", ";", "// learn the initial ...
Select positive and negative examples based on the region the user's initially selected region. The selected region is used as a positive example while all the other regions far away are used as negative examples. @param targetRegion user selected region @param cascadeRegions Set of regions used by the cascade detect...
[ "Select", "positive", "and", "negative", "examples", "based", "on", "the", "region", "the", "user", "s", "initially", "selected", "region", ".", "The", "selected", "region", "is", "used", "as", "a", "positive", "example", "while", "all", "the", "other", "reg...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java#L83-L126
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java
TldLearning.updateLearning
public void updateLearning( Rectangle2D_F64 targetRegion ) { storageMetric.reset(); // learn the initial descriptor TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); template.addDescriptor(true, targetRegion_I32); fern.learnFernNoise(true, targetRegion_I32); // mark only a few of the far...
java
public void updateLearning( Rectangle2D_F64 targetRegion ) { storageMetric.reset(); // learn the initial descriptor TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); template.addDescriptor(true, targetRegion_I32); fern.learnFernNoise(true, targetRegion_I32); // mark only a few of the far...
[ "public", "void", "updateLearning", "(", "Rectangle2D_F64", "targetRegion", ")", "{", "storageMetric", ".", "reset", "(", ")", ";", "// learn the initial descriptor", "TldHelperFunctions", ".", "convertRegion", "(", "targetRegion", ",", "targetRegion_I32", ")", ";", "...
Updates learning using the latest tracking results. @param targetRegion Region selected by the fused tracking
[ "Updates", "learning", "using", "the", "latest", "tracking", "results", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java#L133-L162
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java
TldLearning.learnAmbiguousNegative
protected void learnAmbiguousNegative(Rectangle2D_F64 targetRegion) { TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); if( detection.isSuccess() ) { TldRegion best = detection.getBest(); // see if it found the correct solution double overlap = helper.computeOverlap(best.rect,targetRegio...
java
protected void learnAmbiguousNegative(Rectangle2D_F64 targetRegion) { TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32); if( detection.isSuccess() ) { TldRegion best = detection.getBest(); // see if it found the correct solution double overlap = helper.computeOverlap(best.rect,targetRegio...
[ "protected", "void", "learnAmbiguousNegative", "(", "Rectangle2D_F64", "targetRegion", ")", "{", "TldHelperFunctions", ".", "convertRegion", "(", "targetRegion", ",", "targetRegion_I32", ")", ";", "if", "(", "detection", ".", "isSuccess", "(", ")", ")", "{", "TldR...
Mark regions which were local maximums and had high confidence as negative. These regions were candidates for the tracker but were not selected
[ "Mark", "regions", "which", "were", "local", "maximums", "and", "had", "high", "confidence", "as", "negative", ".", "These", "regions", "were", "candidates", "for", "the", "tracker", "but", "were", "not", "selected" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldLearning.java#L168-L192
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.localOtsu
public static <T extends ImageGray<T>> InputToBinary<T> localOtsu(ConfigLength regionWidth, double scale, boolean down, boolean otsu2, double tuning, Class<T> inputType) { if( BOverrideFactoryThresholdBinary.localOtsu != null ) return BOverrideFactoryThresholdBinary.localOtsu.handle(otsu2,regionWidth, tuning, sca...
java
public static <T extends ImageGray<T>> InputToBinary<T> localOtsu(ConfigLength regionWidth, double scale, boolean down, boolean otsu2, double tuning, Class<T> inputType) { if( BOverrideFactoryThresholdBinary.localOtsu != null ) return BOverrideFactoryThresholdBinary.localOtsu.handle(otsu2,regionWidth, tuning, sca...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "localOtsu", "(", "ConfigLength", "regionWidth", ",", "double", "scale", ",", "boolean", "down", ",", "boolean", "otsu2", ",", "double", "tuning", ","...
Applies a local Otsu threshold @see ThresholdLocalOtsu @param regionWidth About how wide and tall you wish a block to be in pixels. @param scale Scale factor adjust for threshold. 1.0 means no change. @param down Should it threshold up or down. @param tuning Tuning parameter. 0 = standard Otsu. Greater than 0 will p...
[ "Applies", "a", "local", "Otsu", "threshold" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L128-L140
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.blockMean
public static <T extends ImageGray<T>> InputToBinary<T> blockMean(ConfigLength regionWidth, double scale , boolean down, boolean thresholdFromLocalBlocks, Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockMean != null ) return BOverrideFactoryThresholdBinary.blockMean.handle(regionWidth, sc...
java
public static <T extends ImageGray<T>> InputToBinary<T> blockMean(ConfigLength regionWidth, double scale , boolean down, boolean thresholdFromLocalBlocks, Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockMean != null ) return BOverrideFactoryThresholdBinary.blockMean.handle(regionWidth, sc...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "blockMean", "(", "ConfigLength", "regionWidth", ",", "double", "scale", ",", "boolean", "down", ",", "boolean", "thresholdFromLocalBlocks", ",", "Class",...
Applies a non-overlapping block mean threshold @see ThresholdBlockMean @param scale Scale factor adjust for threshold. 1.0 means no change. @param down Should it threshold up or down. @param regionWidth Approximate size of block region @param inputType Type of input image @return Filter to binary
[ "Applies", "a", "non", "-", "overlapping", "block", "mean", "threshold" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L186-L204
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.blockOtsu
public static <T extends ImageGray<T>> InputToBinary<T> blockOtsu(ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, boolean otsu2, double tuning,Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockOtsu != null ) return BOverrideFactoryThresholdBinary.bloc...
java
public static <T extends ImageGray<T>> InputToBinary<T> blockOtsu(ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, boolean otsu2, double tuning,Class<T> inputType) { if( BOverrideFactoryThresholdBinary.blockOtsu != null ) return BOverrideFactoryThresholdBinary.bloc...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "blockOtsu", "(", "ConfigLength", "regionWidth", ",", "double", "scale", ",", "boolean", "down", ",", "boolean", "thresholdFromLocalBlocks", ",", "boolean...
Applies a non-overlapping block Otsu threshold @see ThresholdBlockOtsu @param regionWidth Approximate size of block region @param scale Scale factor adjust for threshold. 1.0 means no change. @param down Should it threshold up or down. @param inputType Type of input image @return Filter to binary
[ "Applies", "a", "non", "-", "overlapping", "block", "Otsu", "threshold" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L217-L234
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java
FactoryThresholdBinary.threshold
public static <T extends ImageGray<T>> InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) { switch( config.type ) { case FIXED: return globalFixed(config.fixedThreshold, config.down, inputType); case GLOBAL_OTSU: return globalOtsu(config.minPixelValue, config.maxPixelValue, confi...
java
public static <T extends ImageGray<T>> InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) { switch( config.type ) { case FIXED: return globalFixed(config.fixedThreshold, config.down, inputType); case GLOBAL_OTSU: return globalOtsu(config.minPixelValue, config.maxPixelValue, confi...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "InputToBinary", "<", "T", ">", "threshold", "(", "ConfigThreshold", "config", ",", "Class", "<", "T", ">", "inputType", ")", "{", "switch", "(", "config", ".", "type", ")", "{",...
Creates threshold using a config class @param config Configuration @param inputType Type of input image @return The thresholder
[ "Creates", "threshold", "using", "a", "config", "class" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/binary/FactoryThresholdBinary.java#L318-L372
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/JSpringPanel.java
JSpringPanel.constraintSouth
public void constraintSouth(JComponent target, JComponent top, JComponent bottom, int padV ) { if( bottom == null ) { layout.putConstraint(SpringLayout.SOUTH, target, -padV, SpringLayout.SOUTH, this); } else { Spring a = Spring.sum(Spring.constant(-padV),layout.getConstraint(Spri...
java
public void constraintSouth(JComponent target, JComponent top, JComponent bottom, int padV ) { if( bottom == null ) { layout.putConstraint(SpringLayout.SOUTH, target, -padV, SpringLayout.SOUTH, this); } else { Spring a = Spring.sum(Spring.constant(-padV),layout.getConstraint(Spri...
[ "public", "void", "constraintSouth", "(", "JComponent", "target", ",", "JComponent", "top", ",", "JComponent", "bottom", ",", "int", "padV", ")", "{", "if", "(", "bottom", "==", "null", ")", "{", "layout", ".", "putConstraint", "(", "SpringLayout", ".", "S...
Constrain it to the top of it's bottom panel and prevent it from getting crushed below it's size
[ "Constrain", "it", "to", "the", "top", "of", "it", "s", "bottom", "panel", "and", "prevent", "it", "from", "getting", "crushed", "below", "it", "s", "size" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/dialogs/JSpringPanel.java#L217-L230
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.setLensDistoriton
public void setLensDistoriton(LensDistortionNarrowFOV distortion ) { pixelToNorm = distortion.undistort_F64(true,false); normToPixel = distortion.distort_F64(false, true); }
java
public void setLensDistoriton(LensDistortionNarrowFOV distortion ) { pixelToNorm = distortion.undistort_F64(true,false); normToPixel = distortion.distort_F64(false, true); }
[ "public", "void", "setLensDistoriton", "(", "LensDistortionNarrowFOV", "distortion", ")", "{", "pixelToNorm", "=", "distortion", ".", "undistort_F64", "(", "true", ",", "false", ")", ";", "normToPixel", "=", "distortion", ".", "distort_F64", "(", "false", ",", "...
Specifies the intrinsic parameters. @param distortion Intrinsic camera parameters
[ "Specifies", "the", "intrinsic", "parameters", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L133-L136
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.setFiducial
public void setFiducial( double x0 , double y0 , double x1 , double y1 , double x2 , double y2 , double x3 , double y3 ) { points.get(0).location.set(x0,y0,0); points.get(1).location.set(x1,y1,0); points.get(2).location.set(x2,y2,0); points.get(3).location.set(x3,y3,0); }
java
public void setFiducial( double x0 , double y0 , double x1 , double y1 , double x2 , double y2 , double x3 , double y3 ) { points.get(0).location.set(x0,y0,0); points.get(1).location.set(x1,y1,0); points.get(2).location.set(x2,y2,0); points.get(3).location.set(x3,y3,0); }
[ "public", "void", "setFiducial", "(", "double", "x0", ",", "double", "y0", ",", "double", "x1", ",", "double", "y1", ",", "double", "x2", ",", "double", "y2", ",", "double", "x3", ",", "double", "y3", ")", "{", "points", ".", "get", "(", "0", ")", ...
Specify the location of points on the 2D fiducial. These should be in "world coordinates"
[ "Specify", "the", "location", "of", "points", "on", "the", "2D", "fiducial", ".", "These", "should", "be", "in", "world", "coordinates" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L141-L147
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.pixelToMarker
public void pixelToMarker( double pixelX , double pixelY , Point2D_F64 marker ) { // find pointing vector in camera reference frame pixelToNorm.compute(pixelX,pixelY,marker); cameraP3.set(marker.x,marker.y,1); // rotate into marker reference frame GeometryMath_F64.multTran(outputFiducialToCamera.R,cameraP3,...
java
public void pixelToMarker( double pixelX , double pixelY , Point2D_F64 marker ) { // find pointing vector in camera reference frame pixelToNorm.compute(pixelX,pixelY,marker); cameraP3.set(marker.x,marker.y,1); // rotate into marker reference frame GeometryMath_F64.multTran(outputFiducialToCamera.R,cameraP3,...
[ "public", "void", "pixelToMarker", "(", "double", "pixelX", ",", "double", "pixelY", ",", "Point2D_F64", "marker", ")", "{", "// find pointing vector in camera reference frame", "pixelToNorm", ".", "compute", "(", "pixelX", ",", "pixelY", ",", "marker", ")", ";", ...
Given the found solution, compute the the observed pixel would appear on the marker's surface. pixel -> normalized pixel -> rotated -> projected on to plane @param pixelX (Input) pixel coordinate @param pixelY (Input) pixel coordinate @param marker (Output) location on the marker
[ "Given", "the", "found", "solution", "compute", "the", "the", "observed", "pixel", "would", "appear", "on", "the", "marker", "s", "surface", ".", "pixel", "-", ">", "normalized", "pixel", "-", ">", "rotated", "-", ">", "projected", "on", "to", "plane" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L156-L171
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.estimate
protected boolean estimate( Quadrilateral_F64 cornersPixels , Quadrilateral_F64 cornersNorm , Se3_F64 foundFiducialToCamera ) { // put it into a list to simplify algorithms listObs.clear(); listObs.add( cornersPixels.a ); listObs.add( cornersPixels.b ); listObs.add( cornersPixels.c ); listOb...
java
protected boolean estimate( Quadrilateral_F64 cornersPixels , Quadrilateral_F64 cornersNorm , Se3_F64 foundFiducialToCamera ) { // put it into a list to simplify algorithms listObs.clear(); listObs.add( cornersPixels.a ); listObs.add( cornersPixels.b ); listObs.add( cornersPixels.c ); listOb...
[ "protected", "boolean", "estimate", "(", "Quadrilateral_F64", "cornersPixels", ",", "Quadrilateral_F64", "cornersNorm", ",", "Se3_F64", "foundFiducialToCamera", ")", "{", "// put it into a list to simplify algorithms", "listObs", ".", "clear", "(", ")", ";", "listObs", "....
Given the observed corners of the quad in the image in pixels estimate and store the results of its pose
[ "Given", "the", "observed", "corners", "of", "the", "quad", "in", "the", "image", "in", "pixels", "estimate", "and", "store", "the", "results", "of", "its", "pose" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L210-L263
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.estimateP3P
protected void estimateP3P(int excluded) { // the point used to check the solutions is the last one inputP3P.clear(); for( int i = 0; i < 4; i++ ) { if( i != excluded ) { inputP3P.add( points.get(i) ); } } // initial estimate for the pose solutions.reset(); if( !p3p.process(inputP3P,solutions)...
java
protected void estimateP3P(int excluded) { // the point used to check the solutions is the last one inputP3P.clear(); for( int i = 0; i < 4; i++ ) { if( i != excluded ) { inputP3P.add( points.get(i) ); } } // initial estimate for the pose solutions.reset(); if( !p3p.process(inputP3P,solutions)...
[ "protected", "void", "estimateP3P", "(", "int", "excluded", ")", "{", "// the point used to check the solutions is the last one", "inputP3P", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "if",...
Estimates the pose using P3P from 3 out of 4 points. Then use all 4 to pick the best solution @param excluded which corner to exclude and use to check the answers from the others
[ "Estimates", "the", "pose", "using", "P3P", "from", "3", "out", "of", "4", "points", ".", "Then", "use", "all", "4", "to", "pick", "the", "best", "solution" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L270-L298
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.enlarge
protected void enlarge( Quadrilateral_F64 corners, double scale ) { UtilPolygons2D_F64.center(corners, center); extend(center,corners.a,scale); extend(center,corners.b,scale); extend(center,corners.c,scale); extend(center,corners.d,scale); }
java
protected void enlarge( Quadrilateral_F64 corners, double scale ) { UtilPolygons2D_F64.center(corners, center); extend(center,corners.a,scale); extend(center,corners.b,scale); extend(center,corners.c,scale); extend(center,corners.d,scale); }
[ "protected", "void", "enlarge", "(", "Quadrilateral_F64", "corners", ",", "double", "scale", ")", "{", "UtilPolygons2D_F64", ".", "center", "(", "corners", ",", "center", ")", ";", "extend", "(", "center", ",", "corners", ".", "a", ",", "scale", ")", ";", ...
Enlarges the quadrilateral to make it more sensitive to changes in orientation
[ "Enlarges", "the", "quadrilateral", "to", "make", "it", "more", "sensitive", "to", "changes", "in", "orientation" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L303-L311
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java
QuadPoseEstimator.computeErrors
protected double computeErrors(Se3_F64 fiducialToCamera ) { if( fiducialToCamera.T.z < 0 ) { // the low level algorithm should already filter this code, but just incase return Double.MAX_VALUE; } double maxError = 0; for( int i = 0; i < 4; i++ ) { maxError = Math.max(maxError,computePixelError(fiduci...
java
protected double computeErrors(Se3_F64 fiducialToCamera ) { if( fiducialToCamera.T.z < 0 ) { // the low level algorithm should already filter this code, but just incase return Double.MAX_VALUE; } double maxError = 0; for( int i = 0; i < 4; i++ ) { maxError = Math.max(maxError,computePixelError(fiduci...
[ "protected", "double", "computeErrors", "(", "Se3_F64", "fiducialToCamera", ")", "{", "if", "(", "fiducialToCamera", ".", "T", ".", "z", "<", "0", ")", "{", "// the low level algorithm should already filter this code, but just incase", "return", "Double", ".", "MAX_VALU...
Compute the sum of reprojection errors for all four points @param fiducialToCamera Transform being evaluated @return sum of Euclidean-squared errors
[ "Compute", "the", "sum", "of", "reprojection", "errors", "for", "all", "four", "points" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/QuadPoseEstimator.java#L323-L336
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java
ParamFundamentalEpipolar.encode
@Override public void encode(DMatrixRMaj F, double[] param) { // see if which columns are to be used selectColumns(F); // set the largest element in the first two columns and normalize // using that value double v[] = new double[]{F.get(0,col0),F.get(1,col0),F.get(2,col0), F.get(0,col1),F.get(1,col1),...
java
@Override public void encode(DMatrixRMaj F, double[] param) { // see if which columns are to be used selectColumns(F); // set the largest element in the first two columns and normalize // using that value double v[] = new double[]{F.get(0,col0),F.get(1,col0),F.get(2,col0), F.get(0,col1),F.get(1,col1),...
[ "@", "Override", "public", "void", "encode", "(", "DMatrixRMaj", "F", ",", "double", "[", "]", "param", ")", "{", "// see if which columns are to be used", "selectColumns", "(", "F", ")", ";", "// set the largest element in the first two columns and normalize", "// using ...
Examines the matrix structure to determine how to parameterize F.
[ "Examines", "the", "matrix", "structure", "to", "determine", "how", "to", "parameterize", "F", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java#L61-L85
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java
ParamFundamentalEpipolar.selectDivisor
private double selectDivisor( double v[] , double param[] ) { double maxValue = 0; int maxIndex = 0; for( int i = 0; i < v.length; i++ ) { if( Math.abs(v[i]) > maxValue ) { maxValue = Math.abs(v[i]); maxIndex = i; } } double divisor = v[maxIndex]; int index = 0; for( int i = 0; i < v.leng...
java
private double selectDivisor( double v[] , double param[] ) { double maxValue = 0; int maxIndex = 0; for( int i = 0; i < v.length; i++ ) { if( Math.abs(v[i]) > maxValue ) { maxValue = Math.abs(v[i]); maxIndex = i; } } double divisor = v[maxIndex]; int index = 0; for( int i = 0; i < v.leng...
[ "private", "double", "selectDivisor", "(", "double", "v", "[", "]", ",", "double", "param", "[", "]", ")", "{", "double", "maxValue", "=", "0", ";", "int", "maxIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "v", ".", "l...
The divisor is the element in the first two columns that has the largest absolute value. Finds this element, sets col0 to be the row which contains it, and specifies which elements in that column are to be used. @return Value of the divisor
[ "The", "divisor", "is", "the", "element", "in", "the", "first", "two", "columns", "that", "has", "the", "largest", "absolute", "value", ".", "Finds", "this", "element", "sets", "col0", "to", "be", "the", "row", "which", "contains", "it", "and", "specifies"...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java#L94-L125
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java
GeneratePairwiseImageGraph.createEdge
protected void createEdge( String src , String dst , FastQueue<AssociatedPair> pairs , FastQueue<AssociatedIndex> matches ) { // Fitting Essential/Fundamental works when the scene is not planar and not pure rotation int countF = 0; if( ransac3D.process(pairs.toList()) ) { countF = ransac3D.getMatchSe...
java
protected void createEdge( String src , String dst , FastQueue<AssociatedPair> pairs , FastQueue<AssociatedIndex> matches ) { // Fitting Essential/Fundamental works when the scene is not planar and not pure rotation int countF = 0; if( ransac3D.process(pairs.toList()) ) { countF = ransac3D.getMatchSe...
[ "protected", "void", "createEdge", "(", "String", "src", ",", "String", "dst", ",", "FastQueue", "<", "AssociatedPair", ">", "pairs", ",", "FastQueue", "<", "AssociatedIndex", ">", "matches", ")", "{", "// Fitting Essential/Fundamental works when the scene is not planar...
Connects two views together if they meet a minimal set of geometric requirements. Determines if there is strong evidence that there is 3D information present and not just a homography @param src ID of src image @param dst ID of dst image @param pairs Associated features pixels @param matches Associated features featur...
[ "Connects", "two", "views", "together", "if", "they", "meet", "a", "minimal", "set", "of", "geometric", "requirements", ".", "Determines", "if", "there", "is", "strong", "evidence", "that", "there", "is", "3D", "information", "present", "and", "not", "just", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java#L155-L195
train
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java
GeneratePairwiseImageGraph.saveInlierMatches
private void saveInlierMatches(ModelMatcher<?, ?> ransac, FastQueue<AssociatedIndex> matches, PairwiseImageGraph2.Motion edge) { int N = ransac.getMatchSet().size(); edge.inliers.reset(); for (int i = 0; i < N; i++) { int idx = ransac.getInputIndex(i); edge.inliers.grow().set(matches.get(idx)); ...
java
private void saveInlierMatches(ModelMatcher<?, ?> ransac, FastQueue<AssociatedIndex> matches, PairwiseImageGraph2.Motion edge) { int N = ransac.getMatchSet().size(); edge.inliers.reset(); for (int i = 0; i < N; i++) { int idx = ransac.getInputIndex(i); edge.inliers.grow().set(matches.get(idx)); ...
[ "private", "void", "saveInlierMatches", "(", "ModelMatcher", "<", "?", ",", "?", ">", "ransac", ",", "FastQueue", "<", "AssociatedIndex", ">", "matches", ",", "PairwiseImageGraph2", ".", "Motion", "edge", ")", "{", "int", "N", "=", "ransac", ".", "getMatchSe...
Puts the inliers from RANSAC into the edge's list of associated features @param ransac RANSAC @param matches List of matches from feature association @param edge The edge that the inliers are to be saved to
[ "Puts", "the", "inliers", "from", "RANSAC", "into", "the", "edge", "s", "list", "of", "associated", "features" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/GeneratePairwiseImageGraph.java#L203-L212
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.recycleData
protected void recycleData() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int j = 0; j < n.edges.length; j++) { if( n.edges[j] != null ) { graph.detachEdge(n.edges[j]); } } } for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int ...
java
protected void recycleData() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int j = 0; j < n.edges.length; j++) { if( n.edges[j] != null ) { graph.detachEdge(n.edges[j]); } } } for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); for (int ...
[ "protected", "void", "recycleData", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "SquareNode", "n", "=", "nodes", ".", "get", "(", "i", ")", ";", "for", "(", "int", ...
Reset and recycle data structures from the previous run
[ "Reset", "and", "recycle", "data", "structures", "from", "the", "previous", "run" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L46-L69
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.findClusters
protected void findClusters() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); if( n.graph < 0 ) { n.graph = clusters.size(); List<SquareNode> graph = clusters.grow(); graph.add(n); addToCluster(n, graph); } } }
java
protected void findClusters() { for (int i = 0; i < nodes.size(); i++) { SquareNode n = nodes.get(i); if( n.graph < 0 ) { n.graph = clusters.size(); List<SquareNode> graph = clusters.grow(); graph.add(n); addToCluster(n, graph); } } }
[ "protected", "void", "findClusters", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "SquareNode", "n", "=", "nodes", ".", "get", "(", "i", ")", ";", "if", "(", "n", ...
Put sets of nodes into the same list if they are some how connected
[ "Put", "sets", "of", "nodes", "into", "the", "same", "list", "if", "they", "are", "some", "how", "connected" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L74-L86
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java
SquaresIntoClusters.addToCluster
void addToCluster(SquareNode seed, List<SquareNode> graph) { open.clear(); open.add(seed); while( !open.isEmpty() ) { SquareNode n = open.remove( open.size() - 1 ); for (int i = 0; i < n.square.size(); i++) { SquareEdge edge = n.edges[i]; if( edge == null ) continue; SquareNode other; ...
java
void addToCluster(SquareNode seed, List<SquareNode> graph) { open.clear(); open.add(seed); while( !open.isEmpty() ) { SquareNode n = open.remove( open.size() - 1 ); for (int i = 0; i < n.square.size(); i++) { SquareEdge edge = n.edges[i]; if( edge == null ) continue; SquareNode other; ...
[ "void", "addToCluster", "(", "SquareNode", "seed", ",", "List", "<", "SquareNode", ">", "graph", ")", "{", "open", ".", "clear", "(", ")", ";", "open", ".", "add", "(", "seed", ")", ";", "while", "(", "!", "open", ".", "isEmpty", "(", ")", ")", "...
Finds all neighbors and adds them to the graph. Repeated until there are no more nodes to add to the graph
[ "Finds", "all", "neighbors", "and", "adds", "them", "to", "the", "graph", ".", "Repeated", "until", "there", "are", "no", "more", "nodes", "to", "add", "to", "the", "graph" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoClusters.java#L91-L119
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java
ExampleSegmentColor.printClickedColor
public static void printClickedColor( final BufferedImage image ) { ImagePanel gui = new ImagePanel(image); gui.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { float[] color = new float[3]; int rgb = image.getRGB(e.getX(),e.getY()); ColorHsv.rgbToHsv((rgb >...
java
public static void printClickedColor( final BufferedImage image ) { ImagePanel gui = new ImagePanel(image); gui.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { float[] color = new float[3]; int rgb = image.getRGB(e.getX(),e.getY()); ColorHsv.rgbToHsv((rgb >...
[ "public", "static", "void", "printClickedColor", "(", "final", "BufferedImage", "image", ")", "{", "ImagePanel", "gui", "=", "new", "ImagePanel", "(", "image", ")", ";", "gui", ".", "addMouseListener", "(", "new", "MouseAdapter", "(", ")", "{", "@", "Overrid...
Shows a color image and allows the user to select a pixel, convert it to HSV, print the HSV values, and calls the function below to display similar pixels.
[ "Shows", "a", "color", "image", "and", "allows", "the", "user", "to", "select", "a", "pixel", "convert", "it", "to", "HSV", "print", "the", "HSV", "values", "and", "calls", "the", "function", "below", "to", "display", "similar", "pixels", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java#L48-L63
train
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java
ExampleSegmentColor.showSelectedColor
public static void showSelectedColor( String name , BufferedImage image , float hue , float saturation ) { Planar<GrayF32> input = ConvertBufferedImage.convertFromPlanar(image,null,true,GrayF32.class); Planar<GrayF32> hsv = input.createSameShape(); // Convert into HSV ColorHsv.rgbToHsv(input,hsv); // Euclid...
java
public static void showSelectedColor( String name , BufferedImage image , float hue , float saturation ) { Planar<GrayF32> input = ConvertBufferedImage.convertFromPlanar(image,null,true,GrayF32.class); Planar<GrayF32> hsv = input.createSameShape(); // Convert into HSV ColorHsv.rgbToHsv(input,hsv); // Euclid...
[ "public", "static", "void", "showSelectedColor", "(", "String", "name", ",", "BufferedImage", "image", ",", "float", "hue", ",", "float", "saturation", ")", "{", "Planar", "<", "GrayF32", ">", "input", "=", "ConvertBufferedImage", ".", "convertFromPlanar", "(", ...
Selectively displays only pixels which have a similar hue and saturation values to what is provided. This is intended to be a simple example of color based segmentation. Color based segmentation can be done in RGB color, but is more problematic due to it not being intensity invariant. More robust techniques can use G...
[ "Selectively", "displays", "only", "pixels", "which", "have", "a", "similar", "hue", "and", "saturation", "values", "to", "what", "is", "provided", ".", "This", "is", "intended", "to", "be", "a", "simple", "example", "of", "color", "based", "segmentation", "...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentColor.java#L71-L106
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.transformDimension
public static ImageDimension transformDimension( ImageBase orig , int level ) { return transformDimension(orig.width,orig.height,level); }
java
public static ImageDimension transformDimension( ImageBase orig , int level ) { return transformDimension(orig.width,orig.height,level); }
[ "public", "static", "ImageDimension", "transformDimension", "(", "ImageBase", "orig", ",", "int", "level", ")", "{", "return", "transformDimension", "(", "orig", ".", "width", ",", "orig", ".", "height", ",", "level", ")", ";", "}" ]
Returns dimension which is required for the transformed image in a multilevel wavelet transform.
[ "Returns", "dimension", "which", "is", "required", "for", "the", "transformed", "image", "in", "a", "multilevel", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L93-L96
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.borderForwardLower
public static int borderForwardLower( WlCoef desc ) { int ret = -Math.min(desc.offsetScaling,desc.offsetWavelet); return ret + (ret % 2); }
java
public static int borderForwardLower( WlCoef desc ) { int ret = -Math.min(desc.offsetScaling,desc.offsetWavelet); return ret + (ret % 2); }
[ "public", "static", "int", "borderForwardLower", "(", "WlCoef", "desc", ")", "{", "int", "ret", "=", "-", "Math", ".", "min", "(", "desc", ".", "offsetScaling", ",", "desc", ".", "offsetWavelet", ")", ";", "return", "ret", "+", "(", "ret", "%", "2", ...
Returns the lower border for a forward wavelet transform.
[ "Returns", "the", "lower", "border", "for", "a", "forward", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L172-L176
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.borderInverseLower
public static int borderInverseLower( WlBorderCoef<?> desc, BorderIndex1D border ) { WlCoef inner = desc.getInnerCoefficients(); int borderSize = borderForwardLower(inner); WlCoef ll = borderSize > 0 ? inner : null; WlCoef lu = ll; WlCoef uu = inner; int indexLU = 0; if( desc.getLowerLength() > 0 ) { ...
java
public static int borderInverseLower( WlBorderCoef<?> desc, BorderIndex1D border ) { WlCoef inner = desc.getInnerCoefficients(); int borderSize = borderForwardLower(inner); WlCoef ll = borderSize > 0 ? inner : null; WlCoef lu = ll; WlCoef uu = inner; int indexLU = 0; if( desc.getLowerLength() > 0 ) { ...
[ "public", "static", "int", "borderInverseLower", "(", "WlBorderCoef", "<", "?", ">", "desc", ",", "BorderIndex1D", "border", ")", "{", "WlCoef", "inner", "=", "desc", ".", "getInnerCoefficients", "(", ")", ";", "int", "borderSize", "=", "borderForwardLower", "...
Returns the lower border for an inverse wavelet transform.
[ "Returns", "the", "lower", "border", "for", "an", "inverse", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L193-L219
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.round
public static int round( int top , int div2 , int divisor ) { if( top > 0 ) return (top + div2)/divisor; else return (top - div2)/divisor; }
java
public static int round( int top , int div2 , int divisor ) { if( top > 0 ) return (top + div2)/divisor; else return (top - div2)/divisor; }
[ "public", "static", "int", "round", "(", "int", "top", ",", "int", "div2", ",", "int", "divisor", ")", "{", "if", "(", "top", ">", "0", ")", "return", "(", "top", "+", "div2", ")", "/", "divisor", ";", "else", "return", "(", "top", "-", "div2", ...
Specialized rounding for use with integer wavelet transform. return (top +- div2) / divisor; @param top Top part of the equation. @param div2 The divisor divided by two. @param divisor The divisor. @return
[ "Specialized", "rounding", "for", "use", "with", "integer", "wavelet", "transform", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L308-L313
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.adjustForDisplay
public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) { if( transform instanceof GrayF32) adjustForDisplay((GrayF32)transform,numLevels,(float)valueRange); else adjustForDisplay((GrayI)transform,numLevels,(int)valueRange); }
java
public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) { if( transform instanceof GrayF32) adjustForDisplay((GrayF32)transform,numLevels,(float)valueRange); else adjustForDisplay((GrayI)transform,numLevels,(int)valueRange); }
[ "public", "static", "void", "adjustForDisplay", "(", "ImageGray", "transform", ",", "int", "numLevels", ",", "double", "valueRange", ")", "{", "if", "(", "transform", "instanceof", "GrayF32", ")", "adjustForDisplay", "(", "(", "GrayF32", ")", "transform", ",", ...
Adjusts the values inside a wavelet transform to make it easier to view. @param transform @param numLevels Number of levels in the transform
[ "Adjusts", "the", "values", "inside", "a", "wavelet", "transform", "to", "make", "it", "easier", "to", "view", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L332-L337
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.equalizeLocalNaive
public static void equalizeLocalNaive( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,input.height,(idx0,idx1)->{ int idx0 = 0, idx1 = input.height; int[] histog...
java
public static void equalizeLocalNaive( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,input.height,(idx0,idx1)->{ int idx0 = 0, idx1 = input.height; int[] histog...
[ "public", "static", "void", "equalizeLocalNaive", "(", "GrayU8", "input", ",", "int", "radius", ",", "GrayU8", "output", ",", "IWorkArrays", "workArrays", ")", "{", "int", "width", "=", "2", "*", "radius", "+", "1", ";", "int", "maxValue", "=", "workArrays...
Inefficiently computes the local histogram, but can handle every possible case for image size and local region size
[ "Inefficiently", "computes", "the", "local", "histogram", "but", "can", "handle", "every", "possible", "case", "for", "image", "size", "and", "local", "region", "size" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L111-L170
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.equalizeLocalInner
public static void equalizeLocalInner( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int area = width*width; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius,input.height-radius,(y0,y1)->{ int y0 = radius, ...
java
public static void equalizeLocalInner( GrayU8 input , int radius , GrayU8 output , IWorkArrays workArrays ) { int width = 2*radius+1; int area = width*width; int maxValue = workArrays.length()-1; //CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius,input.height-radius,(y0,y1)->{ int y0 = radius, ...
[ "public", "static", "void", "equalizeLocalInner", "(", "GrayU8", "input", ",", "int", "radius", ",", "GrayU8", "output", ",", "IWorkArrays", "workArrays", ")", "{", "int", "width", "=", "2", "*", "radius", "+", "1", ";", "int", "area", "=", "width", "*",...
Performs local histogram equalization just on the inner portion of the image
[ "Performs", "local", "histogram", "equalization", "just", "on", "the", "inner", "portion", "of", "the", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L175-L232
train
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java
ImplEnhanceHistogram.localHistogram
public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) { for( int i = 0; i < histogram.length; i++ ) histogram[i] = 0; for( int i = y0; i < y1; i++ ) { int index = input.startIndex + i*input.stride + x0; int end = index + x1-x0; for( ; index < end; index...
java
public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) { for( int i = 0; i < histogram.length; i++ ) histogram[i] = 0; for( int i = y0; i < y1; i++ ) { int index = input.startIndex + i*input.stride + x0; int end = index + x1-x0; for( ; index < end; index...
[ "public", "static", "void", "localHistogram", "(", "GrayU16", "input", ",", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ",", "int", "histogram", "[", "]", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "histogra...
Computes the local histogram just for the specified inner region
[ "Computes", "the", "local", "histogram", "just", "for", "the", "specified", "inner", "region" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L718-L729
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/image/ImageZoomPanel.java
ImageZoomPanel.setBufferedImage
public synchronized void setBufferedImage(BufferedImage image) { // assume the image was initially set before the GUI was invoked if( checkEventDispatch && this.img != null ) { if( !SwingUtilities.isEventDispatchThread() ) throw new RuntimeException("Changed image when not in GUI thread?"); } this.img =...
java
public synchronized void setBufferedImage(BufferedImage image) { // assume the image was initially set before the GUI was invoked if( checkEventDispatch && this.img != null ) { if( !SwingUtilities.isEventDispatchThread() ) throw new RuntimeException("Changed image when not in GUI thread?"); } this.img =...
[ "public", "synchronized", "void", "setBufferedImage", "(", "BufferedImage", "image", ")", "{", "// assume the image was initially set before the GUI was invoked", "if", "(", "checkEventDispatch", "&&", "this", ".", "img", "!=", "null", ")", "{", "if", "(", "!", "Swing...
Change the image being displayed. @param image The new image which will be displayed.
[ "Change", "the", "image", "being", "displayed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ImageZoomPanel.java#L127-L137
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.initialize
public void initialize( T image , RectangleLength2D_I32 initial ) { if( !image.isInBounds(initial.x0,initial.y0) ) throw new IllegalArgumentException("Initial rectangle is out of bounds!"); if( !image.isInBounds(initial.x0+initial.width,initial.y0+initial.height) ) throw new IllegalArgumentException("Initial ...
java
public void initialize( T image , RectangleLength2D_I32 initial ) { if( !image.isInBounds(initial.x0,initial.y0) ) throw new IllegalArgumentException("Initial rectangle is out of bounds!"); if( !image.isInBounds(initial.x0+initial.width,initial.y0+initial.height) ) throw new IllegalArgumentException("Initial ...
[ "public", "void", "initialize", "(", "T", "image", ",", "RectangleLength2D_I32", "initial", ")", "{", "if", "(", "!", "image", ".", "isInBounds", "(", "initial", ".", "x0", ",", "initial", ".", "y0", ")", ")", "throw", "new", "IllegalArgumentException", "(...
Specifies the initial target location so that it can learn its description @param image Image @param initial Initial target location and the mean-shift bandwidth
[ "Specifies", "the", "initial", "target", "location", "so", "that", "it", "can", "learn", "its", "description" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L93-L117
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.process
public boolean process( T image ) { if( failed ) return false; targetModel.setImage(image); // mark the region where the pdf has been modified as dirty dirty.set(location.x0, location.y0, location.x0 + location.width, location.y0 + location.height); // compute the pdf inside the initial rectangle upda...
java
public boolean process( T image ) { if( failed ) return false; targetModel.setImage(image); // mark the region where the pdf has been modified as dirty dirty.set(location.x0, location.y0, location.x0 + location.width, location.y0 + location.height); // compute the pdf inside the initial rectangle upda...
[ "public", "boolean", "process", "(", "T", "image", ")", "{", "if", "(", "failed", ")", "return", "false", ";", "targetModel", ".", "setImage", "(", "image", ")", ";", "// mark the region where the pdf has been modified as dirty", "dirty", ".", "set", "(", "locat...
Updates the target's location in the image by performing a mean-shift search. Returns if it was successful at finding the target or not. If it fails once it will need to be re-initialized @param image Most recent image in the sequence @return true for success or false if it failed
[ "Updates", "the", "target", "s", "location", "in", "the", "image", "by", "performing", "a", "mean", "-", "shift", "search", ".", "Returns", "if", "it", "was", "successful", "at", "finding", "the", "target", "or", "not", ".", "If", "it", "fails", "once", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L141-L221
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java
TrackerMeanShiftLikelihood.updatePdfImage
protected void updatePdfImage( int x0 , int y0 , int x1 , int y1 ) { for( int y = y0; y < y1; y++ ) { int indexOut = pdf.startIndex + pdf.stride*y + x0; for( int x = x0; x < x1; x++ , indexOut++ ) { if( pdf.data[indexOut] < 0 ) pdf.data[indexOut] = targetModel.compute(x, y); } } // update th...
java
protected void updatePdfImage( int x0 , int y0 , int x1 , int y1 ) { for( int y = y0; y < y1; y++ ) { int indexOut = pdf.startIndex + pdf.stride*y + x0; for( int x = x0; x < x1; x++ , indexOut++ ) { if( pdf.data[indexOut] < 0 ) pdf.data[indexOut] = targetModel.compute(x, y); } } // update th...
[ "protected", "void", "updatePdfImage", "(", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "for", "(", "int", "y", "=", "y0", ";", "y", "<", "y1", ";", "y", "++", ")", "{", "int", "indexOut", "=", "pdf", ".", "st...
Computes the PDF only inside the image as needed amd update the dirty rectangle
[ "Computes", "the", "PDF", "only", "inside", "the", "image", "as", "needed", "amd", "update", "the", "dirty", "rectangle" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftLikelihood.java#L226-L246
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearchGray.java
SegmentMeanShiftSearchGray.process
@Override public void process( T image ) { // initialize data structures this.image = image; this.stopRequested = false; modeLocation.reset(); modeColor.reset(); modeMemberCount.reset(); interpolate.setImage(image); pixelToMode.reshape(image.width, image.height); quickMode.reshape(image.width, ima...
java
@Override public void process( T image ) { // initialize data structures this.image = image; this.stopRequested = false; modeLocation.reset(); modeColor.reset(); modeMemberCount.reset(); interpolate.setImage(image); pixelToMode.reshape(image.width, image.height); quickMode.reshape(image.width, ima...
[ "@", "Override", "public", "void", "process", "(", "T", "image", ")", "{", "// initialize data structures", "this", ".", "image", "=", "image", ";", "this", ".", "stopRequested", "=", "false", ";", "modeLocation", ".", "reset", "(", ")", ";", "modeColor", ...
Performs mean-shift clustering on the input image @param image Input image
[ "Performs", "mean", "-", "shift", "clustering", "on", "the", "input", "image" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearchGray.java#L62-L131
train
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/struct/geo/Point2D3D.java
Point2D3D.set
public void set( Point2D3D src ) { observation.set(src.observation); location.set(src.location); }
java
public void set( Point2D3D src ) { observation.set(src.observation); location.set(src.location); }
[ "public", "void", "set", "(", "Point2D3D", "src", ")", "{", "observation", ".", "set", "(", "src", ".", "observation", ")", ";", "location", ".", "set", "(", "src", ".", "location", ")", ";", "}" ]
Sets 'this' to be identical to 'src'.
[ "Sets", "this", "to", "be", "identical", "to", "src", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/struct/geo/Point2D3D.java#L52-L55
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.clearLensDistortion
public void clearLensDistortion() { detector.clearLensDistortion(); if( refineGray != null ) refineGray.clearLensDistortion(); edgeIntensity.setTransform(null); }
java
public void clearLensDistortion() { detector.clearLensDistortion(); if( refineGray != null ) refineGray.clearLensDistortion(); edgeIntensity.setTransform(null); }
[ "public", "void", "clearLensDistortion", "(", ")", "{", "detector", ".", "clearLensDistortion", "(", ")", ";", "if", "(", "refineGray", "!=", "null", ")", "refineGray", ".", "clearLensDistortion", "(", ")", ";", "edgeIntensity", ".", "setTransform", "(", "null...
Discard previously set lens distortion models
[ "Discard", "previously", "set", "lens", "distortion", "models" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L132-L137
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.process
public void process(T gray , GrayU8 binary ) { detector.process(gray,binary); if( refineGray != null ) refineGray.setImage(gray); edgeIntensity.setImage(gray); long time0 = System.nanoTime(); FastQueue<DetectPolygonFromContour.Info> detections = detector.getFound(); if( adjustForBias != null ) { int...
java
public void process(T gray , GrayU8 binary ) { detector.process(gray,binary); if( refineGray != null ) refineGray.setImage(gray); edgeIntensity.setImage(gray); long time0 = System.nanoTime(); FastQueue<DetectPolygonFromContour.Info> detections = detector.getFound(); if( adjustForBias != null ) { int...
[ "public", "void", "process", "(", "T", "gray", ",", "GrayU8", "binary", ")", "{", "detector", ".", "process", "(", "gray", ",", "binary", ")", ";", "if", "(", "refineGray", "!=", "null", ")", "refineGray", ".", "setImage", "(", "gray", ")", ";", "edg...
Detects polygons inside the grayscale image and its thresholded version @param gray Gray scale image @param binary Binary version of grayscale image
[ "Detects", "polygons", "inside", "the", "grayscale", "image", "and", "its", "thresholded", "version" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L149-L177
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.refine
public boolean refine( DetectPolygonFromContour.Info info ) { double before,after; if( edgeIntensity.computeEdge(info.polygon,!detector.isOutputClockwise()) ) { before = edgeIntensity.getAverageOutside() - edgeIntensity.getAverageInside(); } else { return false; } boolean success = false; if( refine...
java
public boolean refine( DetectPolygonFromContour.Info info ) { double before,after; if( edgeIntensity.computeEdge(info.polygon,!detector.isOutputClockwise()) ) { before = edgeIntensity.getAverageOutside() - edgeIntensity.getAverageInside(); } else { return false; } boolean success = false; if( refine...
[ "public", "boolean", "refine", "(", "DetectPolygonFromContour", ".", "Info", "info", ")", "{", "double", "before", ",", "after", ";", "if", "(", "edgeIntensity", ".", "computeEdge", "(", "info", ".", "polygon", ",", "!", "detector", ".", "isOutputClockwise", ...
Refines the fit to the specified polygon. Only info.polygon is modified @param info The polygon and related info @return true if successful or false if not
[ "Refines", "the", "fit", "to", "the", "specified", "polygon", ".", "Only", "info", ".", "polygon", "is", "modified" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L184-L236
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java
DetectPolygonBinaryGrayRefine.refineAll
public void refineAll() { List<DetectPolygonFromContour.Info> detections = detector.getFound().toList(); for (int i = 0; i < detections.size(); i++) { refine(detections.get(i)); } }
java
public void refineAll() { List<DetectPolygonFromContour.Info> detections = detector.getFound().toList(); for (int i = 0; i < detections.size(); i++) { refine(detections.get(i)); } }
[ "public", "void", "refineAll", "(", ")", "{", "List", "<", "DetectPolygonFromContour", ".", "Info", ">", "detections", "=", "detector", ".", "getFound", "(", ")", ".", "toList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "detecti...
Refines all the detected polygons and places them into the provided list. Polygons which fail the refinement step are not added.
[ "Refines", "all", "the", "detected", "polygons", "and", "places", "them", "into", "the", "provided", "list", ".", "Polygons", "which", "fail", "the", "refinement", "step", "are", "not", "added", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonBinaryGrayRefine.java#L242-L248
train
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java
InputSanityCheck.checkReshape
public static <T extends ImageGray<T>> T checkReshape(T target , ImageGray testImage , Class<T> targetType ) { if( target == null ) { return GeneralizedImageOps.createSingleBand(targetType, testImage.width, testImage.height); } else if( target.width != testImage.width || target.height != testImage.height ) { ...
java
public static <T extends ImageGray<T>> T checkReshape(T target , ImageGray testImage , Class<T> targetType ) { if( target == null ) { return GeneralizedImageOps.createSingleBand(targetType, testImage.width, testImage.height); } else if( target.width != testImage.width || target.height != testImage.height ) { ...
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "checkReshape", "(", "T", "target", ",", "ImageGray", "testImage", ",", "Class", "<", "T", ">", "targetType", ")", "{", "if", "(", "target", "==", "null", ")", "{", "retur...
Checks to see if the target image is null or if it is a different size than the test image. If it is null then a new image is returned, otherwise target is reshaped and returned. @param target @param testImage @param targetType @param <T> @return
[ "Checks", "to", "see", "if", "the", "target", "image", "is", "null", "or", "if", "it", "is", "a", "different", "size", "than", "the", "test", "image", ".", "If", "it", "is", "null", "then", "a", "new", "image", "is", "returned", "otherwise", "target", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java#L44-L52
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeaturePyramid.java
FeaturePyramid.findLocalScaleSpaceMax
protected void findLocalScaleSpaceMax(PyramidFloat<T> ss, int layerID) { int index0 = spaceIndex; int index1 = (spaceIndex + 1) % 3; int index2 = (spaceIndex + 2) % 3; List<Point2D_I16> candidates = maximums[index1]; ImageBorder_F32 inten0 = (ImageBorder_F32) FactoryImageBorderAlgs.value(intensities[index0],...
java
protected void findLocalScaleSpaceMax(PyramidFloat<T> ss, int layerID) { int index0 = spaceIndex; int index1 = (spaceIndex + 1) % 3; int index2 = (spaceIndex + 2) % 3; List<Point2D_I16> candidates = maximums[index1]; ImageBorder_F32 inten0 = (ImageBorder_F32) FactoryImageBorderAlgs.value(intensities[index0],...
[ "protected", "void", "findLocalScaleSpaceMax", "(", "PyramidFloat", "<", "T", ">", "ss", ",", "int", "layerID", ")", "{", "int", "index0", "=", "spaceIndex", ";", "int", "index1", "=", "(", "spaceIndex", "+", "1", ")", "%", "3", ";", "int", "index2", "...
Searches the pyramid layers up and down to see if the found 2D features are also scale space maximums.
[ "Searches", "the", "pyramid", "layers", "up", "and", "down", "to", "see", "if", "the", "found", "2D", "features", "are", "also", "scale", "space", "maximums", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeaturePyramid.java#L168-L206
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java
SquaresIntoCrossClusters.getCornerIndex
int getCornerIndex( SquareNode node , double x , double y ) { for (int i = 0; i < node.square.size(); i++) { Point2D_F64 c = node.square.get(i); if( c.x == x && c.y == y ) return i; } throw new RuntimeException("BUG!"); }
java
int getCornerIndex( SquareNode node , double x , double y ) { for (int i = 0; i < node.square.size(); i++) { Point2D_F64 c = node.square.get(i); if( c.x == x && c.y == y ) return i; } throw new RuntimeException("BUG!"); }
[ "int", "getCornerIndex", "(", "SquareNode", "node", ",", "double", "x", ",", "double", "y", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "square", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Point2D_F64", "c", "...
Returns the corner index of the specified coordinate
[ "Returns", "the", "corner", "index", "of", "the", "specified", "coordinate" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java#L173-L181
train
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java
SquaresIntoCrossClusters.candidateIsMuchCloser
boolean candidateIsMuchCloser( SquareNode node0 , SquareNode node1 , double distance2 ) { double length = Math.max(node0.largestSide,node1.largestSide)*tooFarFraction; length *= length; if( distance2 > length) return false; return distance2 <= length; }
java
boolean candidateIsMuchCloser( SquareNode node0 , SquareNode node1 , double distance2 ) { double length = Math.max(node0.largestSide,node1.largestSide)*tooFarFraction; length *= length; if( distance2 > length) return false; return distance2 <= length; }
[ "boolean", "candidateIsMuchCloser", "(", "SquareNode", "node0", ",", "SquareNode", "node1", ",", "double", "distance2", ")", "{", "double", "length", "=", "Math", ".", "max", "(", "node0", ".", "largestSide", ",", "node1", ".", "largestSide", ")", "*", "tooF...
Checks to see if the two corners which are to be connected are by far the two closest corners between the two squares
[ "Checks", "to", "see", "if", "the", "two", "corners", "which", "are", "to", "be", "connected", "are", "by", "far", "the", "two", "closest", "corners", "between", "the", "two", "squares" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoCrossClusters.java#L209-L219
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.handleContextMenu
private void handleContextMenu(JTree tree, int x, int y) { TreePath path = tree.getPathForLocation(x, y); tree.setSelectionPath(path); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (!node.isLeaf()) { tree.setSelectionPath(null);...
java
private void handleContextMenu(JTree tree, int x, int y) { TreePath path = tree.getPathForLocation(x, y); tree.setSelectionPath(path); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (!node.isLeaf()) { tree.setSelectionPath(null);...
[ "private", "void", "handleContextMenu", "(", "JTree", "tree", ",", "int", "x", ",", "int", "y", ")", "{", "TreePath", "path", "=", "tree", ".", "getPathForLocation", "(", "x", ",", "y", ")", ";", "tree", ".", "setSelectionPath", "(", "path", ")", ";", ...
Displays a context menu for a class leaf node Allows copying of the name and the path to the source
[ "Displays", "a", "context", "menu", "for", "a", "class", "leaf", "node", "Allows", "copying", "of", "the", "name", "and", "the", "path", "to", "the", "source" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L337-L371
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.openInGitHub
private void openInGitHub( AppInfo info ) { if (Desktop.isDesktopSupported()) { try { URI uri = new URI(UtilIO.getGithubURL(info.app.getPackage().getName(), info.app.getSimpleName())); if (!uri.getPath().isEmpty()) Desktop.getDesktop().browse(uri); else System.err.println("Bad URL received")...
java
private void openInGitHub( AppInfo info ) { if (Desktop.isDesktopSupported()) { try { URI uri = new URI(UtilIO.getGithubURL(info.app.getPackage().getName(), info.app.getSimpleName())); if (!uri.getPath().isEmpty()) Desktop.getDesktop().browse(uri); else System.err.println("Bad URL received")...
[ "private", "void", "openInGitHub", "(", "AppInfo", "info", ")", "{", "if", "(", "Desktop", ".", "isDesktopSupported", "(", ")", ")", "{", "try", "{", "URI", "uri", "=", "new", "URI", "(", "UtilIO", ".", "getGithubURL", "(", "info", ".", "app", ".", "...
Opens github page of source code up in a browser window
[ "Opens", "github", "page", "of", "source", "code", "up", "in", "a", "browser", "window" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L376-L391
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.killAllProcesses
public void killAllProcesses( long blockTimeMS ) { // remove already dead processes from the GUI SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DefaultListModel model = (DefaultListModel)processList.getModel(); for (int i = model.size()-1; i >= 0; i--) { ActiveProcess p...
java
public void killAllProcesses( long blockTimeMS ) { // remove already dead processes from the GUI SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DefaultListModel model = (DefaultListModel)processList.getModel(); for (int i = model.size()-1; i >= 0; i--) { ActiveProcess p...
[ "public", "void", "killAllProcesses", "(", "long", "blockTimeMS", ")", "{", "// remove already dead processes from the GUI", "SwingUtilities", ".", "invokeLater", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "Defa...
Requests that all active processes be killed. @param blockTimeMS If &gt; 0 then it will block until all processes are killed for the specified number of milliseconds
[ "Requests", "that", "all", "active", "processes", "be", "killed", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L415-L452
train
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java
ApplicationLauncherApp.intervalAdded
@Override public void intervalAdded(ListDataEvent e) { //retrieve the most recently added process and display it DefaultListModel listModel = (DefaultListModel) e.getSource(); ActiveProcess process = (ActiveProcess) listModel.get(listModel.getSize() - 1); addProcessTab(process, outputPanel); }
java
@Override public void intervalAdded(ListDataEvent e) { //retrieve the most recently added process and display it DefaultListModel listModel = (DefaultListModel) e.getSource(); ActiveProcess process = (ActiveProcess) listModel.get(listModel.getSize() - 1); addProcessTab(process, outputPanel); }
[ "@", "Override", "public", "void", "intervalAdded", "(", "ListDataEvent", "e", ")", "{", "//retrieve the most recently added process and display it", "DefaultListModel", "listModel", "=", "(", "DefaultListModel", ")", "e", ".", "getSource", "(", ")", ";", "ActiveProcess...
Called after a new process is added to the process list @param e
[ "Called", "after", "a", "new", "process", "is", "added", "to", "the", "process", "list" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/ApplicationLauncherApp.java#L459-L465
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.setUpEdges
protected void setUpEdges(GrayS32 input , GrayS32 output ) { if( connectRule == ConnectRule.EIGHT ) { setUpEdges8(input,edgesIn); setUpEdges8(output,edgesOut); edges[0].set( 1, 0); edges[1].set( 1, 1); edges[2].set( 0, 1); edges[3].set(-1, 0); } else { setUpEdges4(input,edgesIn); setUpEdge...
java
protected void setUpEdges(GrayS32 input , GrayS32 output ) { if( connectRule == ConnectRule.EIGHT ) { setUpEdges8(input,edgesIn); setUpEdges8(output,edgesOut); edges[0].set( 1, 0); edges[1].set( 1, 1); edges[2].set( 0, 1); edges[3].set(-1, 0); } else { setUpEdges4(input,edgesIn); setUpEdge...
[ "protected", "void", "setUpEdges", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "if", "(", "connectRule", "==", "ConnectRule", ".", "EIGHT", ")", "{", "setUpEdges8", "(", "input", ",", "edgesIn", ")", ";", "setUpEdges8", "(", "output", ",",...
Declares lookup tables for neighbors
[ "Declares", "lookup", "tables", "for", "neighbors" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L88-L104
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.process
public void process(GrayS32 input , GrayS32 output , GrowQueue_I32 regionMemberCount ) { // initialize data structures this.regionMemberCount = regionMemberCount; regionMemberCount.reset(); setUpEdges(input,output); ImageMiscOps.fill(output,-1); // this is a bit of a hack here. Normally you call the pare...
java
public void process(GrayS32 input , GrayS32 output , GrowQueue_I32 regionMemberCount ) { // initialize data structures this.regionMemberCount = regionMemberCount; regionMemberCount.reset(); setUpEdges(input,output); ImageMiscOps.fill(output,-1); // this is a bit of a hack here. Normally you call the pare...
[ "public", "void", "process", "(", "GrayS32", "input", ",", "GrayS32", "output", ",", "GrowQueue_I32", "regionMemberCount", ")", "{", "// initialize data structures", "this", ".", "regionMemberCount", "=", "regionMemberCount", ";", "regionMemberCount", ".", "reset", "(...
Relabels the image such that all pixels with the same label are a member of the same graph. @param input Labeled input image. @param output Labeled output image. @param regionMemberCount (Input/Output) Number of pixels which belong to each group.
[ "Relabels", "the", "image", "such", "that", "all", "pixels", "with", "the", "same", "label", "are", "a", "member", "of", "the", "same", "graph", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L125-L143
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectInner
protected void connectInner(GrayS32 input, GrayS32 output) { int startX = connectRule == ConnectRule.EIGHT ? 1 : 0; for( int y = 0; y < input.height-1; y++ ) { int indexIn = input.startIndex + y*input.stride + startX; int indexOut = output.startIndex + y*output.stride + startX; for( int x = startX; x < ...
java
protected void connectInner(GrayS32 input, GrayS32 output) { int startX = connectRule == ConnectRule.EIGHT ? 1 : 0; for( int y = 0; y < input.height-1; y++ ) { int indexIn = input.startIndex + y*input.stride + startX; int indexOut = output.startIndex + y*output.stride + startX; for( int x = startX; x < ...
[ "protected", "void", "connectInner", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "int", "startX", "=", "connectRule", "==", "ConnectRule", ".", "EIGHT", "?", "1", ":", "0", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input...
Examines pixels inside the image without the need for bounds checking
[ "Examines", "pixels", "inside", "the", "image", "without", "the", "need", "for", "bounds", "checking" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L148-L178
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectLeftRight
protected void connectLeftRight(GrayS32 input, GrayS32 output) { for( int y = 0; y < input.height; y++ ) { int x = input.width-1; int inputLabel = input.unsafe_get(x, y); int outputLabel = output.unsafe_get(x, y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabe...
java
protected void connectLeftRight(GrayS32 input, GrayS32 output) { for( int y = 0; y < input.height; y++ ) { int x = input.width-1; int inputLabel = input.unsafe_get(x, y); int outputLabel = output.unsafe_get(x, y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabe...
[ "protected", "void", "connectLeftRight", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input", ".", "height", ";", "y", "++", ")", "{", "int", "x", "=", "input", ".", "width", "-", ...
Examines pixels along the left and right border
[ "Examines", "pixels", "along", "the", "left", "and", "right", "border" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L183-L251
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java
ClusterLabeledImage.connectBottom
protected void connectBottom(GrayS32 input, GrayS32 output) { for( int x = 0; x < input.width-1; x++ ) { int y = input.height-1; int inputLabel = input.unsafe_get(x,y); int outputLabel = output.unsafe_get(x,y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabel =...
java
protected void connectBottom(GrayS32 input, GrayS32 output) { for( int x = 0; x < input.width-1; x++ ) { int y = input.height-1; int inputLabel = input.unsafe_get(x,y); int outputLabel = output.unsafe_get(x,y); if( outputLabel == -1 ) { // see if it needs to create a new output segment outputLabel =...
[ "protected", "void", "connectBottom", "(", "GrayS32", "input", ",", "GrayS32", "output", ")", "{", "for", "(", "int", "x", "=", "0", ";", "x", "<", "input", ".", "width", "-", "1", ";", "x", "++", ")", "{", "int", "y", "=", "input", ".", "height"...
Examines pixels along the bottom border
[ "Examines", "pixels", "along", "the", "bottom", "border" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/ClusterLabeledImage.java#L256-L281
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.setImage
public void setImage(I image, D derivX, D derivY) { InputSanityCheck.checkSameShape(image, derivX, derivY); this.image = image; this.interpInput.setImage(image); this.derivX = derivX; this.derivY = derivY; }
java
public void setImage(I image, D derivX, D derivY) { InputSanityCheck.checkSameShape(image, derivX, derivY); this.image = image; this.interpInput.setImage(image); this.derivX = derivX; this.derivY = derivY; }
[ "public", "void", "setImage", "(", "I", "image", ",", "D", "derivX", ",", "D", "derivY", ")", "{", "InputSanityCheck", ".", "checkSameShape", "(", "image", ",", "derivX", ",", "derivY", ")", ";", "this", ".", "image", "=", "image", ";", "this", ".", ...
Sets the current image it should be tracking with. @param image Original input image. @param derivX Image derivative along the x-axis @param derivY Image derivative along the y-axis
[ "Sets", "the", "current", "image", "it", "should", "be", "tracking", "with", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L119-L127
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.setDescription
@SuppressWarnings({"SuspiciousNameCombination"}) public boolean setDescription(KltFeature feature) { setAllowedBounds(feature); if (!isFullyInside(feature.x, feature.y)) { if( isFullyOutside(feature.x,feature.y)) return false; else return internalSetDescriptionBorder(feature); } return internal...
java
@SuppressWarnings({"SuspiciousNameCombination"}) public boolean setDescription(KltFeature feature) { setAllowedBounds(feature); if (!isFullyInside(feature.x, feature.y)) { if( isFullyOutside(feature.x,feature.y)) return false; else return internalSetDescriptionBorder(feature); } return internal...
[ "@", "SuppressWarnings", "(", "{", "\"SuspiciousNameCombination\"", "}", ")", "public", "boolean", "setDescription", "(", "KltFeature", "feature", ")", "{", "setAllowedBounds", "(", "feature", ")", ";", "if", "(", "!", "isFullyInside", "(", "feature", ".", "x", ...
Sets the features description using the current image and the location of the feature stored in the feature. If the feature is an illegal location and cannot be set then false is returned. @param feature Feature description which is to be set. Location must be specified. @return true if the feature's description was m...
[ "Sets", "the", "features", "description", "using", "the", "current", "image", "and", "the", "location", "of", "the", "feature", "stored", "in", "the", "feature", ".", "If", "the", "feature", "is", "an", "illegal", "location", "and", "cannot", "be", "set", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L146-L158
train
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java
KltTracker.internalSetDescriptionBorder
protected boolean internalSetDescriptionBorder(KltFeature feature) { computeSubImageBounds(feature, feature.x, feature.y); ImageMiscOps.fill(feature.desc, Float.NaN); feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); feat...
java
protected boolean internalSetDescriptionBorder(KltFeature feature) { computeSubImageBounds(feature, feature.x, feature.y); ImageMiscOps.fill(feature.desc, Float.NaN); feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage); interpInput.setImage(image); interpInput.region(srcX0, srcY0, subimage); feat...
[ "protected", "boolean", "internalSetDescriptionBorder", "(", "KltFeature", "feature", ")", "{", "computeSubImageBounds", "(", "feature", ",", "feature", ".", "x", ",", "feature", ".", "y", ")", ";", "ImageMiscOps", ".", "fill", "(", "feature", ".", "desc", ","...
Computes the descriptor for border features. All it needs to do is save the pixel value, but derivative information is also computed so that it can reject bad features immediately.
[ "Computes", "the", "descriptor", "for", "border", "features", ".", "All", "it", "needs", "to", "do", "is", "save", "the", "pixel", "value", "but", "derivative", "information", "is", "also", "computed", "so", "that", "it", "can", "reject", "bad", "features", ...
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L198-L240
train