id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
50,700 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java | SquaresIntoRegularClusters.areMiddlePointsClose | boolean areMiddlePointsClose( Point2D_F64 p0 , Point2D_F64 p1 , Point2D_F64 p2 , Point2D_F64 p3 ) {
UtilLine2D_F64.convert(p0,p3,line);
// (computed expected length of a square) * (fractional tolerance)
double tol1 = p0.distance(p1)*distanceTol;
// see if inner points are close to the line
if(Distance2D_F64... | java | boolean areMiddlePointsClose( Point2D_F64 p0 , Point2D_F64 p1 , Point2D_F64 p2 , Point2D_F64 p3 ) {
UtilLine2D_F64.convert(p0,p3,line);
// (computed expected length of a square) * (fractional tolerance)
double tol1 = p0.distance(p1)*distanceTol;
// see if inner points are close to the line
if(Distance2D_F64... | [
"boolean",
"areMiddlePointsClose",
"(",
"Point2D_F64",
"p0",
",",
"Point2D_F64",
"p1",
",",
"Point2D_F64",
"p2",
",",
"Point2D_F64",
"p3",
")",
"{",
"UtilLine2D_F64",
".",
"convert",
"(",
"p0",
",",
"p3",
",",
"line",
")",
";",
"// (computed expected length of a... | Returns true if point p1 and p2 are close to the line defined by points p0 and p3. | [
"Returns",
"true",
"if",
"point",
"p1",
"and",
"p2",
"are",
"close",
"to",
"the",
"line",
"defined",
"by",
"points",
"p0",
"and",
"p3",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java#L204-L230 |
50,701 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.process | public boolean process( T left , T right ) {
// System.out.println("----------- Process --------------");
this.inputLeft = left;
this.inputRight = right;
tick++;
trackerLeft.process(left);
trackerRight.process(right);
if( first ) {
addNewTracks();
first = false;
} else {
mutualTrackDrop();
... | java | public boolean process( T left , T right ) {
// System.out.println("----------- Process --------------");
this.inputLeft = left;
this.inputRight = right;
tick++;
trackerLeft.process(left);
trackerRight.process(right);
if( first ) {
addNewTracks();
first = false;
} else {
mutualTrackDrop();
... | [
"public",
"boolean",
"process",
"(",
"T",
"left",
",",
"T",
"right",
")",
"{",
"//\t\tSystem.out.println(\"----------- Process --------------\");",
"this",
".",
"inputLeft",
"=",
"left",
";",
"this",
".",
"inputRight",
"=",
"right",
";",
"tick",
"++",
";",
"trac... | Updates motion estimate using the stereo pair.
@param left Image from left camera
@param right Image from right camera
@return true if motion estimate was updated and false if not | [
"Updates",
"motion",
"estimate",
"using",
"the",
"stereo",
"pair",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L181-L214 |
50,702 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.refineMotionEstimate | private void refineMotionEstimate() {
// use observations from the inlier set
List<Stereo2D3D> data = new ArrayList<>();
int N = matcher.getMatchSet().size();
for( int i = 0; i < N; i++ ) {
int index = matcher.getInputIndex(i);
PointTrack l = candidates.get(index);
LeftTrackInfo info = l.getCookie()... | java | private void refineMotionEstimate() {
// use observations from the inlier set
List<Stereo2D3D> data = new ArrayList<>();
int N = matcher.getMatchSet().size();
for( int i = 0; i < N; i++ ) {
int index = matcher.getInputIndex(i);
PointTrack l = candidates.get(index);
LeftTrackInfo info = l.getCookie()... | [
"private",
"void",
"refineMotionEstimate",
"(",
")",
"{",
"// use observations from the inlier set",
"List",
"<",
"Stereo2D3D",
">",
"data",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"N",
"=",
"matcher",
".",
"getMatchSet",
"(",
")",
".",
"size",
... | Non-linear refinement of motion estimate | [
"Non",
"-",
"linear",
"refinement",
"of",
"motion",
"estimate"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L219-L246 |
50,703 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.estimateMotion | private boolean estimateMotion() {
// organize the data
List<Stereo2D3D> data = new ArrayList<>();
for( PointTrack l : candidates ) {
LeftTrackInfo info = l.getCookie();
PointTrack r = info.right;
Stereo2D3D stereo = info.location;
// compute normalized image coordinate for track in left and right i... | java | private boolean estimateMotion() {
// organize the data
List<Stereo2D3D> data = new ArrayList<>();
for( PointTrack l : candidates ) {
LeftTrackInfo info = l.getCookie();
PointTrack r = info.right;
Stereo2D3D stereo = info.location;
// compute normalized image coordinate for track in left and right i... | [
"private",
"boolean",
"estimateMotion",
"(",
")",
"{",
"// organize the data",
"List",
"<",
"Stereo2D3D",
">",
"data",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"PointTrack",
"l",
":",
"candidates",
")",
"{",
"LeftTrackInfo",
"info",
"=",
"... | Given the set of active tracks, estimate the cameras motion robustly
@return | [
"Given",
"the",
"set",
"of",
"active",
"tracks",
"estimate",
"the",
"cameras",
"motion",
"robustly"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L252-L286 |
50,704 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.mutualTrackDrop | private void mutualTrackDrop() {
for( PointTrack t : trackerLeft.getDroppedTracks(null) ) {
LeftTrackInfo info = t.getCookie();
trackerRight.dropTrack(info.right);
}
for( PointTrack t : trackerRight.getDroppedTracks(null) ) {
RightTrackInfo info = t.getCookie();
// a track could be dropped twice here,... | java | private void mutualTrackDrop() {
for( PointTrack t : trackerLeft.getDroppedTracks(null) ) {
LeftTrackInfo info = t.getCookie();
trackerRight.dropTrack(info.right);
}
for( PointTrack t : trackerRight.getDroppedTracks(null) ) {
RightTrackInfo info = t.getCookie();
// a track could be dropped twice here,... | [
"private",
"void",
"mutualTrackDrop",
"(",
")",
"{",
"for",
"(",
"PointTrack",
"t",
":",
"trackerLeft",
".",
"getDroppedTracks",
"(",
"null",
")",
")",
"{",
"LeftTrackInfo",
"info",
"=",
"t",
".",
"getCookie",
"(",
")",
";",
"trackerRight",
".",
"dropTrack... | If a track was dropped in one image make sure it was dropped in the other image | [
"If",
"a",
"track",
"was",
"dropped",
"in",
"one",
"image",
"make",
"sure",
"it",
"was",
"dropped",
"in",
"the",
"other",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L291-L301 |
50,705 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.selectCandidateTracks | private void selectCandidateTracks() {
// mark tracks in right frame that are active
List<PointTrack> activeRight = trackerRight.getActiveTracks(null);
for( PointTrack t : activeRight ) {
RightTrackInfo info = t.getCookie();
info.lastActiveList = tick;
}
int mutualActive = 0;
List<PointTrack> activeL... | java | private void selectCandidateTracks() {
// mark tracks in right frame that are active
List<PointTrack> activeRight = trackerRight.getActiveTracks(null);
for( PointTrack t : activeRight ) {
RightTrackInfo info = t.getCookie();
info.lastActiveList = tick;
}
int mutualActive = 0;
List<PointTrack> activeL... | [
"private",
"void",
"selectCandidateTracks",
"(",
")",
"{",
"// mark tracks in right frame that are active",
"List",
"<",
"PointTrack",
">",
"activeRight",
"=",
"trackerRight",
".",
"getActiveTracks",
"(",
"null",
")",
";",
"for",
"(",
"PointTrack",
"t",
":",
"active... | Searches for tracks which are active and meet the epipolar constraints | [
"Searches",
"for",
"tracks",
"which",
"are",
"active",
"and",
"meet",
"the",
"epipolar",
"constraints"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L307-L344 |
50,706 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java | VisOdomDualTrackPnP.addNewTracks | private void addNewTracks() {
trackerLeft.spawnTracks();
trackerRight.spawnTracks();
List<PointTrack> newLeft = trackerLeft.getNewTracks(null);
List<PointTrack> newRight = trackerRight.getNewTracks(null);
// get a list of new tracks and their descriptions
addNewToList(inputLeft, newLeft, pointsLeft, descL... | java | private void addNewTracks() {
trackerLeft.spawnTracks();
trackerRight.spawnTracks();
List<PointTrack> newLeft = trackerLeft.getNewTracks(null);
List<PointTrack> newRight = trackerRight.getNewTracks(null);
// get a list of new tracks and their descriptions
addNewToList(inputLeft, newLeft, pointsLeft, descL... | [
"private",
"void",
"addNewTracks",
"(",
")",
"{",
"trackerLeft",
".",
"spawnTracks",
"(",
")",
";",
"trackerRight",
".",
"spawnTracks",
"(",
")",
";",
"List",
"<",
"PointTrack",
">",
"newLeft",
"=",
"trackerLeft",
".",
"getNewTracks",
"(",
"null",
")",
";"... | Spawns tracks in each image and associates features together. | [
"Spawns",
"tracks",
"in",
"each",
"image",
"and",
"associates",
"features",
"together",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L392-L480 |
50,707 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/imageprocessing/ExampleImageConvert.java | ExampleImageConvert.createImages | public void createImages() {
image = UtilImageIO.loadImage(UtilIO.pathExample("standard/barbara.jpg"));
gray = ConvertBufferedImage.convertFromSingle(image, null, GrayU8.class);
derivX = GeneralizedImageOps.createSingleBand(GrayS16.class, gray.getWidth(), gray.getHeight());
derivY = GeneralizedImageOps.createS... | java | public void createImages() {
image = UtilImageIO.loadImage(UtilIO.pathExample("standard/barbara.jpg"));
gray = ConvertBufferedImage.convertFromSingle(image, null, GrayU8.class);
derivX = GeneralizedImageOps.createSingleBand(GrayS16.class, gray.getWidth(), gray.getHeight());
derivY = GeneralizedImageOps.createS... | [
"public",
"void",
"createImages",
"(",
")",
"{",
"image",
"=",
"UtilImageIO",
".",
"loadImage",
"(",
"UtilIO",
".",
"pathExample",
"(",
"\"standard/barbara.jpg\"",
")",
")",
";",
"gray",
"=",
"ConvertBufferedImage",
".",
"convertFromSingle",
"(",
"image",
",",
... | Load and generate images | [
"Load",
"and",
"generate",
"images"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/imageprocessing/ExampleImageConvert.java#L98-L106 |
50,708 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.fillRectangle | public static void fillRectangle(InterleavedS32 img, int value, int x0, int y0, int width, int height) {
int x1 = x0 + width;
int y1 = y0 + height;
if( x0 < 0 ) x0 = 0; if( x1 > img.width ) x1 = img.width;
if( y0 < 0 ) y0 = 0; if( y1 > img.height ) y1 = img.height;
int length = (x1-x0)*img.numBands;
for (... | java | public static void fillRectangle(InterleavedS32 img, int value, int x0, int y0, int width, int height) {
int x1 = x0 + width;
int y1 = y0 + height;
if( x0 < 0 ) x0 = 0; if( x1 > img.width ) x1 = img.width;
if( y0 < 0 ) y0 = 0; if( y1 > img.height ) y1 = img.height;
int length = (x1-x0)*img.numBands;
for (... | [
"public",
"static",
"void",
"fillRectangle",
"(",
"InterleavedS32",
"img",
",",
"int",
"value",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"x1",
"=",
"x0",
"+",
"width",
";",
"int",
"y1",
"=",
"y... | Draws a filled rectangle that is aligned along the image axis inside the image. All bands
are filled with the same value.
@param img Image the rectangle is drawn in. Modified
@param value Value of the rectangle
@param x0 Top left x-coordinate
@param y0 Top left y-coordinate
@param width Rectangle width
@param height... | [
"Draws",
"a",
"filled",
"rectangle",
"that",
"is",
"aligned",
"along",
"the",
"image",
"axis",
"inside",
"the",
"image",
".",
"All",
"bands",
"are",
"filled",
"with",
"the",
"same",
"value",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L1355-L1370 |
50,709 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.flipVertical | public static void flipVertical( GrayS32 input ) {
int h2 = input.height/2;
for( int y = 0; y < h2; y++ ) {
int index1 = input.getStartIndex() + y * input.getStride();
int index2 = input.getStartIndex() + (input.height - y - 1) * input.getStride();
int end = index1 + input.width;
while( index1 < end ... | java | public static void flipVertical( GrayS32 input ) {
int h2 = input.height/2;
for( int y = 0; y < h2; y++ ) {
int index1 = input.getStartIndex() + y * input.getStride();
int index2 = input.getStartIndex() + (input.height - y - 1) * input.getStride();
int end = index1 + input.width;
while( index1 < end ... | [
"public",
"static",
"void",
"flipVertical",
"(",
"GrayS32",
"input",
")",
"{",
"int",
"h2",
"=",
"input",
".",
"height",
"/",
"2",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"h2",
";",
"y",
"++",
")",
"{",
"int",
"index1",
"=",
"inpu... | Flips the image from top to bottom | [
"Flips",
"the",
"image",
"from",
"top",
"to",
"bottom"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L1471-L1486 |
50,710 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.flipHorizontal | public static void flipHorizontal( GrayS32 input ) {
int w2 = input.width/2;
for( int y = 0; y < input.height; y++ ) {
int index1 = input.getStartIndex() + y * input.getStride();
int index2 = index1 + input.width-1;
int end = index1 + w2;
while( index1 < end ) {
int tmp = input.data[index1];
... | java | public static void flipHorizontal( GrayS32 input ) {
int w2 = input.width/2;
for( int y = 0; y < input.height; y++ ) {
int index1 = input.getStartIndex() + y * input.getStride();
int index2 = index1 + input.width-1;
int end = index1 + w2;
while( index1 < end ) {
int tmp = input.data[index1];
... | [
"public",
"static",
"void",
"flipHorizontal",
"(",
"GrayS32",
"input",
")",
"{",
"int",
"w2",
"=",
"input",
".",
"width",
"/",
"2",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",
".",
"height",
";",
"y",
"++",
")",
"{",
"int",
"... | Flips the image from left to right | [
"Flips",
"the",
"image",
"from",
"left",
"to",
"right"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L1491-L1506 |
50,711 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.rotateCCW | public static void rotateCCW( GrayS64 image ) {
if( image.width != image.height )
throw new IllegalArgumentException("Image must be square");
int w = image.height/2 + image.height%2;
int h = image.height/2;
for( int y0 = 0; y0 < h; y0++ ) {
int y1 = image.height-y0-1;
for( int x0 = 0; x0 < w; x0++ )... | java | public static void rotateCCW( GrayS64 image ) {
if( image.width != image.height )
throw new IllegalArgumentException("Image must be square");
int w = image.height/2 + image.height%2;
int h = image.height/2;
for( int y0 = 0; y0 < h; y0++ ) {
int y1 = image.height-y0-1;
for( int x0 = 0; x0 < w; x0++ )... | [
"public",
"static",
"void",
"rotateCCW",
"(",
"GrayS64",
"image",
")",
"{",
"if",
"(",
"image",
".",
"width",
"!=",
"image",
".",
"height",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Image must be square\"",
")",
";",
"int",
"w",
"=",
"image",
... | In-place 90 degree image rotation in the counter-clockwise direction. Only works on
square images. | [
"In",
"-",
"place",
"90",
"degree",
"image",
"rotation",
"in",
"the",
"counter",
"-",
"clockwise",
"direction",
".",
"Only",
"works",
"on",
"square",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2121-L2147 |
50,712 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.rotateCCW | public static void rotateCCW( GrayS64 input , GrayS64 output ) {
if( input.width != output.height || input.height != output.width )
throw new IllegalArgumentException("Incompatible shapes");
int w = input.width-1;
for( int y = 0; y < input.height; y++ ) {
int indexIn = input.startIndex + y*input.stride;
... | java | public static void rotateCCW( GrayS64 input , GrayS64 output ) {
if( input.width != output.height || input.height != output.width )
throw new IllegalArgumentException("Incompatible shapes");
int w = input.width-1;
for( int y = 0; y < input.height; y++ ) {
int indexIn = input.startIndex + y*input.stride;
... | [
"public",
"static",
"void",
"rotateCCW",
"(",
"GrayS64",
"input",
",",
"GrayS64",
"output",
")",
"{",
"if",
"(",
"input",
".",
"width",
"!=",
"output",
".",
"height",
"||",
"input",
".",
"height",
"!=",
"output",
".",
"width",
")",
"throw",
"new",
"Ill... | Rotates the image 90 degrees in the counter-clockwise direction. | [
"Rotates",
"the",
"image",
"90",
"degrees",
"in",
"the",
"counter",
"-",
"clockwise",
"direction",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2152-L2164 |
50,713 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.fillBand | public static void fillBand(InterleavedF64 input, int band , double value) {
final int numBands = input.numBands;
for (int y = 0; y < input.height; y++) {
int index = input.getStartIndex() + y * input.getStride() + band;
int end = index + input.width*numBands - band;
for (; index < end; index += numBands ... | java | public static void fillBand(InterleavedF64 input, int band , double value) {
final int numBands = input.numBands;
for (int y = 0; y < input.height; y++) {
int index = input.getStartIndex() + y * input.getStride() + band;
int end = index + input.width*numBands - band;
for (; index < end; index += numBands ... | [
"public",
"static",
"void",
"fillBand",
"(",
"InterleavedF64",
"input",
",",
"int",
"band",
",",
"double",
"value",
")",
"{",
"final",
"int",
"numBands",
"=",
"input",
".",
"numBands",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",
".... | Fills one band in the image with the specified value
@param input An image.
@param band Which band is to be filled with the specified value
@param value The value that the image is being filled with. | [
"Fills",
"one",
"band",
"in",
"the",
"image",
"with",
"the",
"specified",
"value"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2847-L2857 |
50,714 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.fillBorder | public static void fillBorder(GrayF64 input, double value, int radius ) {
// top and bottom
for (int y = 0; y < radius; y++) {
int indexTop = input.startIndex + y * input.stride;
int indexBottom = input.startIndex + (input.height-y-1) * input.stride;
for (int x = 0; x < input.width; x++) {
input.data[... | java | public static void fillBorder(GrayF64 input, double value, int radius ) {
// top and bottom
for (int y = 0; y < radius; y++) {
int indexTop = input.startIndex + y * input.stride;
int indexBottom = input.startIndex + (input.height-y-1) * input.stride;
for (int x = 0; x < input.width; x++) {
input.data[... | [
"public",
"static",
"void",
"fillBorder",
"(",
"GrayF64",
"input",
",",
"double",
"value",
",",
"int",
"radius",
")",
"{",
"// top and bottom",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"radius",
";",
"y",
"++",
")",
"{",
"int",
"indexTop",
"=... | Fills the outside border with the specified value
@param input An image.
@param value The value that the image is being filled with.
@param radius Border width. | [
"Fills",
"the",
"outside",
"border",
"with",
"the",
"specified",
"value"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2906-L2932 |
50,715 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.fillRectangle | public static void fillRectangle(GrayF64 img, double value, int x0, int y0, int width, int height) {
int x1 = x0 + width;
int y1 = y0 + height;
if( x0 < 0 ) x0 = 0; if( x1 > img.width ) x1 = img.width;
if( y0 < 0 ) y0 = 0; if( y1 > img.height ) y1 = img.height;
for (int y = y0; y < y1; y++) {
for (int x ... | java | public static void fillRectangle(GrayF64 img, double value, int x0, int y0, int width, int height) {
int x1 = x0 + width;
int y1 = y0 + height;
if( x0 < 0 ) x0 = 0; if( x1 > img.width ) x1 = img.width;
if( y0 < 0 ) y0 = 0; if( y1 > img.height ) y1 = img.height;
for (int y = y0; y < y1; y++) {
for (int x ... | [
"public",
"static",
"void",
"fillRectangle",
"(",
"GrayF64",
"img",
",",
"double",
"value",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"x1",
"=",
"x0",
"+",
"width",
";",
"int",
"y1",
"=",
"y0",
... | Draws a filled rectangle that is aligned along the image axis inside the image.
@param img Image the rectangle is drawn in. Modified
@param value Value of the rectangle
@param x0 Top left x-coordinate
@param y0 Top left y-coordinate
@param width Rectangle width
@param height Rectangle height | [
"Draws",
"a",
"filled",
"rectangle",
"that",
"is",
"aligned",
"along",
"the",
"image",
"axis",
"inside",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2944-L2956 |
50,716 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F32.java | LensDistortionOps_F32.boundBoxInside | public static RectangleLength2D_F32 boundBoxInside(int srcWidth, int srcHeight,
PixelTransform<Point2D_F32> transform,
Point2D_F32 work )
{
List<Point2D_F32> points = computeBoundingPoints(srcWidth, srcHeight, transform, work);
Point2D_F32 center = new Point2D_F32();
UtilPoint2D_F... | java | public static RectangleLength2D_F32 boundBoxInside(int srcWidth, int srcHeight,
PixelTransform<Point2D_F32> transform,
Point2D_F32 work )
{
List<Point2D_F32> points = computeBoundingPoints(srcWidth, srcHeight, transform, work);
Point2D_F32 center = new Point2D_F32();
UtilPoint2D_F... | [
"public",
"static",
"RectangleLength2D_F32",
"boundBoxInside",
"(",
"int",
"srcWidth",
",",
"int",
"srcHeight",
",",
"PixelTransform",
"<",
"Point2D_F32",
">",
"transform",
",",
"Point2D_F32",
"work",
")",
"{",
"List",
"<",
"Point2D_F32",
">",
"points",
"=",
"co... | Ensures that the entire box will be inside
@param srcWidth Width of the source image
@param srcHeight Height of the source image
@param transform Transform being applied to the image
@return Bounding box | [
"Ensures",
"that",
"the",
"entire",
"box",
"will",
"be",
"inside"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/LensDistortionOps_F32.java#L140-L201 |
50,717 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.initialize | public void initialize( T image , RectangleRotate_F32 initial ) {
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcHistogram.getHistogram(),0,keyHistogram,0,keyHistogram.length);
this.minimumWidth = initial.width*minimumSizeRatio;
} | java | public void initialize( T image , RectangleRotate_F32 initial ) {
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcHistogram.getHistogram(),0,keyHistogram,0,keyHistogram.length);
this.minimumWidth = initial.width*minimumSizeRatio;
} | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"initial",
")",
"{",
"this",
".",
"region",
".",
"set",
"(",
"initial",
")",
";",
"calcHistogram",
".",
"computeHistogram",
"(",
"image",
",",
"initial",
")",
";",
"System",
"."... | Specifies the initial image to learn the target description
@param image Image
@param initial Initial image which contains the target | [
"Specifies",
"the",
"initial",
"image",
"to",
"learn",
"the",
"target",
"description"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L141-L147 |
50,718 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.track | public void track( T image ) {
// configure the different regions based on size
region0.set( region );
region1.set( region );
region2.set( region );
region0.width *= 1-scaleChange;
region0.height *= 1-scaleChange;
region2.width *= 1+scaleChange;
region2.height *= 1+scaleChange;
// distance from h... | java | public void track( T image ) {
// configure the different regions based on size
region0.set( region );
region1.set( region );
region2.set( region );
region0.width *= 1-scaleChange;
region0.height *= 1-scaleChange;
region2.width *= 1+scaleChange;
region2.height *= 1+scaleChange;
// distance from h... | [
"public",
"void",
"track",
"(",
"T",
"image",
")",
"{",
"// configure the different regions based on size",
"region0",
".",
"set",
"(",
"region",
")",
";",
"region1",
".",
"set",
"(",
"region",
")",
";",
"region2",
".",
"set",
"(",
"region",
")",
";",
"reg... | Searches for the target in the most recent image.
@param image Most recent image in the sequence | [
"Searches",
"for",
"the",
"target",
"in",
"the",
"most",
"recent",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L162-L219 |
50,719 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.selectBest | private int selectBest( double a , double b , double c ) {
if( a < b ) {
if( a < c )
return 0;
else
return 2;
} else if( b <= c ) {
return 1;
} else {
return 2;
}
} | java | private int selectBest( double a , double b , double c ) {
if( a < b ) {
if( a < c )
return 0;
else
return 2;
} else if( b <= c ) {
return 1;
} else {
return 2;
}
} | [
"private",
"int",
"selectBest",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
")",
"{",
"if",
"(",
"a",
"<",
"b",
")",
"{",
"if",
"(",
"a",
"<",
"c",
")",
"return",
"0",
";",
"else",
"return",
"2",
";",
"}",
"else",
"if",
"(",
... | Given the 3 scores return the index of the best | [
"Given",
"the",
"3",
"scores",
"return",
"the",
"index",
"of",
"the",
"best"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L224-L235 |
50,720 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.updateLocation | protected void updateLocation( T image , RectangleRotate_F32 region ) {
double bestHistScore = Double.MAX_VALUE;
float bestX = -1, bestY = -1;
for( int i = 0; i < maxIterations; i++ ) {
calcHistogram.computeHistogram(image,region);
float histogram[] = calcHistogram.getHistogram();
updateWeights(histog... | java | protected void updateLocation( T image , RectangleRotate_F32 region ) {
double bestHistScore = Double.MAX_VALUE;
float bestX = -1, bestY = -1;
for( int i = 0; i < maxIterations; i++ ) {
calcHistogram.computeHistogram(image,region);
float histogram[] = calcHistogram.getHistogram();
updateWeights(histog... | [
"protected",
"void",
"updateLocation",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"region",
")",
"{",
"double",
"bestHistScore",
"=",
"Double",
".",
"MAX_VALUE",
";",
"float",
"bestX",
"=",
"-",
"1",
",",
"bestY",
"=",
"-",
"1",
";",
"for",
"(",
"int... | Updates the region's location using the standard mean-shift algorithm | [
"Updates",
"the",
"region",
"s",
"location",
"using",
"the",
"standard",
"mean",
"-",
"shift",
"algorithm"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L240-L303 |
50,721 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.updateWeights | private void updateWeights(float[] histogram) {
for( int j = 0; j < weightHistogram.length; j++ ) {
float h = histogram[j];
if( h != 0 ) {
weightHistogram[j] = (float)Math.sqrt(keyHistogram[j]/h);
}
}
} | java | private void updateWeights(float[] histogram) {
for( int j = 0; j < weightHistogram.length; j++ ) {
float h = histogram[j];
if( h != 0 ) {
weightHistogram[j] = (float)Math.sqrt(keyHistogram[j]/h);
}
}
} | [
"private",
"void",
"updateWeights",
"(",
"float",
"[",
"]",
"histogram",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"weightHistogram",
".",
"length",
";",
"j",
"++",
")",
"{",
"float",
"h",
"=",
"histogram",
"[",
"j",
"]",
";",
"i... | Update the weights for each element in the histogram. Weights are used to favor colors which are
less than expected. | [
"Update",
"the",
"weights",
"for",
"each",
"element",
"in",
"the",
"histogram",
".",
"Weights",
"are",
"used",
"to",
"favor",
"colors",
"which",
"are",
"less",
"than",
"expected",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L309-L316 |
50,722 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.distanceHistogram | protected double distanceHistogram(float histogramA[], float histogramB[]) {
double sumP = 0;
for( int i = 0; i < histogramA.length; i++ ) {
float q = histogramA[i];
float p = histogramB[i];
sumP += Math.abs(q-p);
}
return sumP;
} | java | protected double distanceHistogram(float histogramA[], float histogramB[]) {
double sumP = 0;
for( int i = 0; i < histogramA.length; i++ ) {
float q = histogramA[i];
float p = histogramB[i];
sumP += Math.abs(q-p);
}
return sumP;
} | [
"protected",
"double",
"distanceHistogram",
"(",
"float",
"histogramA",
"[",
"]",
",",
"float",
"histogramB",
"[",
"]",
")",
"{",
"double",
"sumP",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogramA",
".",
"length",
";",
"i",... | Computes the difference between two histograms using SAD.
This is a change from the paper, which uses Bhattacharyya. Bhattacharyya could give poor performance
even with perfect data since two errors can cancel each other out. For example, part of the histogram
is too small and another part is too large. | [
"Computes",
"the",
"difference",
"between",
"two",
"histograms",
"using",
"SAD",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L325-L333 |
50,723 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java | DescribePointSift.setImageGradient | public void setImageGradient(Deriv derivX , Deriv derivY ) {
this.imageDerivX.wrap(derivX);
this.imageDerivY.wrap(derivY);
} | java | public void setImageGradient(Deriv derivX , Deriv derivY ) {
this.imageDerivX.wrap(derivX);
this.imageDerivY.wrap(derivY);
} | [
"public",
"void",
"setImageGradient",
"(",
"Deriv",
"derivX",
",",
"Deriv",
"derivY",
")",
"{",
"this",
".",
"imageDerivX",
".",
"wrap",
"(",
"derivX",
")",
";",
"this",
".",
"imageDerivY",
".",
"wrap",
"(",
"derivY",
")",
";",
"}"
] | Sets the image spacial derivatives. These should be computed from an image at the appropriate scale
in scale-space.
@param derivX x-derivative of input image
@param derivY y-derivative of input image | [
"Sets",
"the",
"image",
"spacial",
"derivatives",
".",
"These",
"should",
"be",
"computed",
"from",
"an",
"image",
"at",
"the",
"appropriate",
"scale",
"in",
"scale",
"-",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java#L91-L94 |
50,724 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java | DescribePointSift.process | public void process( double c_x , double c_y , double sigma , double orientation , TupleDesc_F64 descriptor )
{
descriptor.fill(0);
computeRawDescriptor(c_x, c_y, sigma, orientation, descriptor);
normalizeDescriptor(descriptor,maxDescriptorElementValue);
} | java | public void process( double c_x , double c_y , double sigma , double orientation , TupleDesc_F64 descriptor )
{
descriptor.fill(0);
computeRawDescriptor(c_x, c_y, sigma, orientation, descriptor);
normalizeDescriptor(descriptor,maxDescriptorElementValue);
} | [
"public",
"void",
"process",
"(",
"double",
"c_x",
",",
"double",
"c_y",
",",
"double",
"sigma",
",",
"double",
"orientation",
",",
"TupleDesc_F64",
"descriptor",
")",
"{",
"descriptor",
".",
"fill",
"(",
"0",
")",
";",
"computeRawDescriptor",
"(",
"c_x",
... | Computes the SIFT descriptor for the specified key point
@param c_x center of key point. x-axis
@param c_y center of key point. y-axis
@param sigma Computed sigma in scale-space for this point
@param orientation Orientation of keypoint in radians
@param descriptor (output) Storage for computed descriptor. Make sure... | [
"Computes",
"the",
"SIFT",
"descriptor",
"for",
"the",
"specified",
"key",
"point"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java#L105-L112 |
50,725 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java | DescribePointSift.computeRawDescriptor | void computeRawDescriptor(double c_x, double c_y, double sigma, double orientation, TupleDesc_F64 descriptor) {
double c = Math.cos(orientation);
double s = Math.sin(orientation);
float fwidthSubregion = widthSubregion;
int sampleWidth = widthGrid*widthSubregion;
double sampleRadius = sampleWidth/2;
doubl... | java | void computeRawDescriptor(double c_x, double c_y, double sigma, double orientation, TupleDesc_F64 descriptor) {
double c = Math.cos(orientation);
double s = Math.sin(orientation);
float fwidthSubregion = widthSubregion;
int sampleWidth = widthGrid*widthSubregion;
double sampleRadius = sampleWidth/2;
doubl... | [
"void",
"computeRawDescriptor",
"(",
"double",
"c_x",
",",
"double",
"c_y",
",",
"double",
"sigma",
",",
"double",
"orientation",
",",
"TupleDesc_F64",
"descriptor",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"cos",
"(",
"orientation",
")",
";",
"double",
... | Computes the descriptor by sampling the input image. This is raw because the descriptor hasn't been massaged
yet. | [
"Computes",
"the",
"descriptor",
"by",
"sampling",
"the",
"input",
"image",
".",
"This",
"is",
"raw",
"because",
"the",
"descriptor",
"hasn",
"t",
"been",
"massaged",
"yet",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java#L118-L165 |
50,726 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java | DescribeSiftCommon.normalizeDescriptor | public static void normalizeDescriptor(TupleDesc_F64 descriptor , double maxDescriptorElementValue ) {
// normalize descriptor to unit length
UtilFeature.normalizeL2(descriptor);
// clip the values
for (int i = 0; i < descriptor.size(); i++) {
double value = descriptor.value[i];
if( value > maxDescriptor... | java | public static void normalizeDescriptor(TupleDesc_F64 descriptor , double maxDescriptorElementValue ) {
// normalize descriptor to unit length
UtilFeature.normalizeL2(descriptor);
// clip the values
for (int i = 0; i < descriptor.size(); i++) {
double value = descriptor.value[i];
if( value > maxDescriptor... | [
"public",
"static",
"void",
"normalizeDescriptor",
"(",
"TupleDesc_F64",
"descriptor",
",",
"double",
"maxDescriptorElementValue",
")",
"{",
"// normalize descriptor to unit length",
"UtilFeature",
".",
"normalizeL2",
"(",
"descriptor",
")",
";",
"// clip the values",
"for"... | Adjusts the descriptor. This adds lighting invariance and reduces the affects of none-affine changes
in lighting.
1) Apply L2 normalization
2) Clip using max descriptor value
3) Apply L2 normalization again | [
"Adjusts",
"the",
"descriptor",
".",
"This",
"adds",
"lighting",
"invariance",
"and",
"reduces",
"the",
"affects",
"of",
"none",
"-",
"affine",
"changes",
"in",
"lighting",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java#L84-L98 |
50,727 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java | DescribeSiftCommon.createGaussianWeightKernel | protected static float[] createGaussianWeightKernel( double sigma , int radius ) {
Kernel2D_F32 ker = FactoryKernelGaussian.gaussian2D_F32(sigma,radius,false,false);
float maxValue = KernelMath.maxAbs(ker.data,4*radius*radius);
KernelMath.divide(ker,maxValue);
return ker.data;
} | java | protected static float[] createGaussianWeightKernel( double sigma , int radius ) {
Kernel2D_F32 ker = FactoryKernelGaussian.gaussian2D_F32(sigma,radius,false,false);
float maxValue = KernelMath.maxAbs(ker.data,4*radius*radius);
KernelMath.divide(ker,maxValue);
return ker.data;
} | [
"protected",
"static",
"float",
"[",
"]",
"createGaussianWeightKernel",
"(",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"Kernel2D_F32",
"ker",
"=",
"FactoryKernelGaussian",
".",
"gaussian2D_F32",
"(",
"sigma",
",",
"radius",
",",
"false",
",",
"false",
... | Creates a gaussian weighting kernel with an even number of elements along its width | [
"Creates",
"a",
"gaussian",
"weighting",
"kernel",
"with",
"an",
"even",
"number",
"of",
"elements",
"along",
"its",
"width"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java#L103-L108 |
50,728 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java | DescribeSiftCommon.trilinearInterpolation | protected void trilinearInterpolation( float weight , float sampleX , float sampleY , double angle , TupleDesc_F64 descriptor )
{
for (int i = 0; i < widthGrid; i++) {
double weightGridY = 1.0 - Math.abs(sampleY-i);
if( weightGridY <= 0) continue;
for (int j = 0; j < widthGrid; j++) {
double weightGridX... | java | protected void trilinearInterpolation( float weight , float sampleX , float sampleY , double angle , TupleDesc_F64 descriptor )
{
for (int i = 0; i < widthGrid; i++) {
double weightGridY = 1.0 - Math.abs(sampleY-i);
if( weightGridY <= 0) continue;
for (int j = 0; j < widthGrid; j++) {
double weightGridX... | [
"protected",
"void",
"trilinearInterpolation",
"(",
"float",
"weight",
",",
"float",
"sampleX",
",",
"float",
"sampleY",
",",
"double",
"angle",
",",
"TupleDesc_F64",
"descriptor",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"widthGrid",
";"... | Applies trilinear interpolation across the descriptor | [
"Applies",
"trilinear",
"interpolation",
"across",
"the",
"descriptor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java#L113-L131 |
50,729 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java | QrCodeCodeWordLocations.computeFeatureMask | private void computeFeatureMask(int numModules, int[] alignment, boolean hasVersion) {
// mark alignment patterns + format info
markSquare(0,0,9);
markRectangle(numModules-8,0,9,8);
markRectangle(0,numModules-8,8,9);
// timing pattern
markRectangle(8,6,1,numModules-8-8);
markRectangle(6,8,numModules-8-8,... | java | private void computeFeatureMask(int numModules, int[] alignment, boolean hasVersion) {
// mark alignment patterns + format info
markSquare(0,0,9);
markRectangle(numModules-8,0,9,8);
markRectangle(0,numModules-8,8,9);
// timing pattern
markRectangle(8,6,1,numModules-8-8);
markRectangle(6,8,numModules-8-8,... | [
"private",
"void",
"computeFeatureMask",
"(",
"int",
"numModules",
",",
"int",
"[",
"]",
"alignment",
",",
"boolean",
"hasVersion",
")",
"{",
"// mark alignment patterns + format info",
"markSquare",
"(",
"0",
",",
"0",
",",
"9",
")",
";",
"markRectangle",
"(",
... | Blocks out the location of features in the image. Needed for codeworld location extraction
@param numModules
@param alignment
@param hasVersion | [
"Blocks",
"out",
"the",
"location",
"of",
"features",
"in",
"the",
"image",
".",
"Needed",
"for",
"codeworld",
"location",
"extraction"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java#L54-L86 |
50,730 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java | QrCodeCodeWordLocations.computeBitLocations | private void computeBitLocations() {
int N = numRows;
int row = N-1;
int col = N-1;
int direction = -1;
while (col > 0) {
if (col == 6)
col -= 1;
if (!get(row,col)) {
bits.add( new Point2D_I32(col,row));
}
if (!get(row,col-1)) {
bits.add( new Point2D_I32(col-1,row));
}
row += ... | java | private void computeBitLocations() {
int N = numRows;
int row = N-1;
int col = N-1;
int direction = -1;
while (col > 0) {
if (col == 6)
col -= 1;
if (!get(row,col)) {
bits.add( new Point2D_I32(col,row));
}
if (!get(row,col-1)) {
bits.add( new Point2D_I32(col-1,row));
}
row += ... | [
"private",
"void",
"computeBitLocations",
"(",
")",
"{",
"int",
"N",
"=",
"numRows",
";",
"int",
"row",
"=",
"N",
"-",
"1",
";",
"int",
"col",
"=",
"N",
"-",
"1",
";",
"int",
"direction",
"=",
"-",
"1",
";",
"while",
"(",
"col",
">",
"0",
")",
... | Snakes through and specifies the location of each bit for all the code words in the grid. | [
"Snakes",
"through",
"and",
"specifies",
"the",
"location",
"of",
"each",
"bit",
"for",
"all",
"the",
"code",
"words",
"in",
"the",
"grid",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java#L107-L132 |
50,731 | lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeShapes.java | VisualizeShapes.drawRectangle | public static void drawRectangle( Rectangle2D_I32 rect , Graphics2D g2 ) {
g2.drawLine(rect.x0, rect.y0, rect.x1, rect.y0);
g2.drawLine(rect.x1, rect.y0, rect.x1, rect.y1);
g2.drawLine(rect.x0, rect.y1, rect.x1, rect.y1);
g2.drawLine(rect.x0, rect.y1, rect.x0, rect.y0);
} | java | public static void drawRectangle( Rectangle2D_I32 rect , Graphics2D g2 ) {
g2.drawLine(rect.x0, rect.y0, rect.x1, rect.y0);
g2.drawLine(rect.x1, rect.y0, rect.x1, rect.y1);
g2.drawLine(rect.x0, rect.y1, rect.x1, rect.y1);
g2.drawLine(rect.x0, rect.y1, rect.x0, rect.y0);
} | [
"public",
"static",
"void",
"drawRectangle",
"(",
"Rectangle2D_I32",
"rect",
",",
"Graphics2D",
"g2",
")",
"{",
"g2",
".",
"drawLine",
"(",
"rect",
".",
"x0",
",",
"rect",
".",
"y0",
",",
"rect",
".",
"x1",
",",
"rect",
".",
"y0",
")",
";",
"g2",
"... | Draws an axis aligned rectangle
@param rect Rectangle
@param g2 Graphics object | [
"Draws",
"an",
"axis",
"aligned",
"rectangle"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeShapes.java#L335-L340 |
50,732 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerCoefficients.java | FactorySteerCoefficients.polynomial | public static SteerableCoefficients polynomial( int order ) {
if( order == 1 )
return new PolyOrder1();
else if( order == 2 )
return new PolyOrder2();
else if( order == 3 )
return new PolyOrder3();
else if( order == 4 )
return new PolyOrder4();
else
throw new IllegalArgumentException("Only supp... | java | public static SteerableCoefficients polynomial( int order ) {
if( order == 1 )
return new PolyOrder1();
else if( order == 2 )
return new PolyOrder2();
else if( order == 3 )
return new PolyOrder3();
else if( order == 4 )
return new PolyOrder4();
else
throw new IllegalArgumentException("Only supp... | [
"public",
"static",
"SteerableCoefficients",
"polynomial",
"(",
"int",
"order",
")",
"{",
"if",
"(",
"order",
"==",
"1",
")",
"return",
"new",
"PolyOrder1",
"(",
")",
";",
"else",
"if",
"(",
"order",
"==",
"2",
")",
"return",
"new",
"PolyOrder2",
"(",
... | Coefficients for even or odd parity polynomials.
@param order order of the polynomial.
@return Steering coeficient. | [
"Coefficients",
"for",
"even",
"or",
"odd",
"parity",
"polynomials",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactorySteerCoefficients.java#L46-L57 |
50,733 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateThreeByPairs.java | AssociateThreeByPairs.pruneMatches | private void pruneMatches() {
int index = 0;
while( index < matches.size ) {
AssociatedTripleIndex a = matches.get(index);
// not matched. Remove it from the list by copying that last element over it
if( a.c == -1 ) {
a.set(matches.get(matches.size-1));
matches.size--;
} else {
index++;
}... | java | private void pruneMatches() {
int index = 0;
while( index < matches.size ) {
AssociatedTripleIndex a = matches.get(index);
// not matched. Remove it from the list by copying that last element over it
if( a.c == -1 ) {
a.set(matches.get(matches.size-1));
matches.size--;
} else {
index++;
}... | [
"private",
"void",
"pruneMatches",
"(",
")",
"{",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"matches",
".",
"size",
")",
"{",
"AssociatedTripleIndex",
"a",
"=",
"matches",
".",
"get",
"(",
"index",
")",
";",
"// not matched. Remove it from... | Removes by swapping all elements with a 'c' index of -1 | [
"Removes",
"by",
"swapping",
"all",
"elements",
"with",
"a",
"c",
"index",
"of",
"-",
"1"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateThreeByPairs.java#L151-L163 |
50,734 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java | Relinearlize.setNumberControl | public void setNumberControl( int numControl ) {
this.numControl = numControl;
if( numControl == 4 ) {
x0.reshape(10,1,false);
AA.reshape(10,9,false);
yy.reshape(10,1,false);
xx.reshape(9,1,false);
numNull = 3;
} else {
x0.reshape(6,1,false);
AA.reshape(4,2,false);
yy.reshape(4,1,false);
... | java | public void setNumberControl( int numControl ) {
this.numControl = numControl;
if( numControl == 4 ) {
x0.reshape(10,1,false);
AA.reshape(10,9,false);
yy.reshape(10,1,false);
xx.reshape(9,1,false);
numNull = 3;
} else {
x0.reshape(6,1,false);
AA.reshape(4,2,false);
yy.reshape(4,1,false);
... | [
"public",
"void",
"setNumberControl",
"(",
"int",
"numControl",
")",
"{",
"this",
".",
"numControl",
"=",
"numControl",
";",
"if",
"(",
"numControl",
"==",
"4",
")",
"{",
"x0",
".",
"reshape",
"(",
"10",
",",
"1",
",",
"false",
")",
";",
"AA",
".",
... | Specified the number of control points.
@param numControl 3 = planar, 4 = general | [
"Specified",
"the",
"number",
"of",
"control",
"points",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java#L78-L101 |
50,735 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java | Relinearlize.process | public void process( DMatrixRMaj L_full , DMatrixRMaj y , double betas[] ) {
svd.decompose(L_full);
// extract null space
V = svd.getV(null,true);
// compute one possible solution
pseudo.setA(L_full);
pseudo.solve(y,x0);
// add additional constraints to reduce the number of possible solutions
DMatri... | java | public void process( DMatrixRMaj L_full , DMatrixRMaj y , double betas[] ) {
svd.decompose(L_full);
// extract null space
V = svd.getV(null,true);
// compute one possible solution
pseudo.setA(L_full);
pseudo.solve(y,x0);
// add additional constraints to reduce the number of possible solutions
DMatri... | [
"public",
"void",
"process",
"(",
"DMatrixRMaj",
"L_full",
",",
"DMatrixRMaj",
"y",
",",
"double",
"betas",
"[",
"]",
")",
"{",
"svd",
".",
"decompose",
"(",
"L_full",
")",
";",
"// extract null space",
"V",
"=",
"svd",
".",
"getV",
"(",
"null",
",",
"... | Estimates betas using relinearization.
@param L_full Linear constraint matrix
@param y distances between world control points
@param betas Estimated betas. Output. | [
"Estimates",
"betas",
"using",
"relinearization",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java#L110-L141 |
50,736 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java | Relinearlize.solveConstraintMatrix | protected DMatrixRMaj solveConstraintMatrix() {
int rowAA = 0;
for( int i = 0; i < numControl; i++ ) {
for( int j = i+1; j < numControl; j++ ) {
for( int k = j; k < numControl; k++ , rowAA++ ) {
// x_{ii}*x_{jk} = x_{ik}*x_{ji}
extractXaXb(getIndex(i, i), getIndex(j, k), XiiXjk);
extractXaXb(... | java | protected DMatrixRMaj solveConstraintMatrix() {
int rowAA = 0;
for( int i = 0; i < numControl; i++ ) {
for( int j = i+1; j < numControl; j++ ) {
for( int k = j; k < numControl; k++ , rowAA++ ) {
// x_{ii}*x_{jk} = x_{ik}*x_{ji}
extractXaXb(getIndex(i, i), getIndex(j, k), XiiXjk);
extractXaXb(... | [
"protected",
"DMatrixRMaj",
"solveConstraintMatrix",
"(",
")",
"{",
"int",
"rowAA",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numControl",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"i",
"+",
"1",
";",
"j",
"<... | Apply additional constraints to reduce the number of possible solutions
x(k) = x_{ij} = bi*bj = x0(k) + a1*V0(k) + a2*V1(k) + a3*V2(k)
constraint:
x_{ii}*x_{jk} = x_{ik}*x_{ji} | [
"Apply",
"additional",
"constraints",
"to",
"reduce",
"the",
"number",
"of",
"possible",
"solutions"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/Relinearlize.java#L152-L173 |
50,737 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertRaster.java | ConvertRaster.orderBandsIntoRGB | public static <T extends ImageGray<T>>
void orderBandsIntoRGB(Planar<T> image , BufferedImage input ) {
boolean swap = swapBandOrder(input);
// Output formats are: RGB and RGBA
if( swap ) {
if( image.getNumBands() == 3 ) {
int bufferedImageType = input.getType();
if( bufferedImageType == BufferedIm... | java | public static <T extends ImageGray<T>>
void orderBandsIntoRGB(Planar<T> image , BufferedImage input ) {
boolean swap = swapBandOrder(input);
// Output formats are: RGB and RGBA
if( swap ) {
if( image.getNumBands() == 3 ) {
int bufferedImageType = input.getType();
if( bufferedImageType == BufferedIm... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"orderBandsIntoRGB",
"(",
"Planar",
"<",
"T",
">",
"image",
",",
"BufferedImage",
"input",
")",
"{",
"boolean",
"swap",
"=",
"swapBandOrder",
"(",
"input",
")",
";",
"// Ou... | If a Planar was created from a BufferedImage its colors might not be in the expected order.
Invoking this function ensures that the image will have the expected ordering. For images with
3 bands it will be RGB and for 4 bands it will be ARGB. | [
"If",
"a",
"Planar",
"was",
"created",
"from",
"a",
"BufferedImage",
"its",
"colors",
"might",
"not",
"be",
"in",
"the",
"expected",
"order",
".",
"Invoking",
"this",
"function",
"ensures",
"that",
"the",
"image",
"will",
"have",
"the",
"expected",
"ordering... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertRaster.java#L309-L348 |
50,738 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertRaster.java | ConvertRaster.isKnownByteFormat | public static boolean isKnownByteFormat( BufferedImage image ) {
int type = image.getType();
return type != BufferedImage.TYPE_BYTE_INDEXED &&
type != BufferedImage.TYPE_BYTE_BINARY &&
type != BufferedImage.TYPE_CUSTOM;
} | java | public static boolean isKnownByteFormat( BufferedImage image ) {
int type = image.getType();
return type != BufferedImage.TYPE_BYTE_INDEXED &&
type != BufferedImage.TYPE_BYTE_BINARY &&
type != BufferedImage.TYPE_CUSTOM;
} | [
"public",
"static",
"boolean",
"isKnownByteFormat",
"(",
"BufferedImage",
"image",
")",
"{",
"int",
"type",
"=",
"image",
".",
"getType",
"(",
")",
";",
"return",
"type",
"!=",
"BufferedImage",
".",
"TYPE_BYTE_INDEXED",
"&&",
"type",
"!=",
"BufferedImage",
"."... | Checks to see if it is a known byte format | [
"Checks",
"to",
"see",
"if",
"it",
"is",
"a",
"known",
"byte",
"format"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertRaster.java#L696-L701 |
50,739 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadImages | public static List<BufferedImage> loadImages( String directory , final String regex ) {
List<String> paths = UtilIO.listByRegex(directory,regex);
List<BufferedImage> ret = new ArrayList<>();
if( paths.size() == 0 )
return ret;
// Sort so that the order is deterministic
Collections.sort(paths);
for( ... | java | public static List<BufferedImage> loadImages( String directory , final String regex ) {
List<String> paths = UtilIO.listByRegex(directory,regex);
List<BufferedImage> ret = new ArrayList<>();
if( paths.size() == 0 )
return ret;
// Sort so that the order is deterministic
Collections.sort(paths);
for( ... | [
"public",
"static",
"List",
"<",
"BufferedImage",
">",
"loadImages",
"(",
"String",
"directory",
",",
"final",
"String",
"regex",
")",
"{",
"List",
"<",
"String",
">",
"paths",
"=",
"UtilIO",
".",
"listByRegex",
"(",
"directory",
",",
"regex",
")",
";",
... | Loads all the image in the specified directory which match the provided regex
@param directory File directory
@param regex Regex used to match file names
@return List of found images. | [
"Loads",
"all",
"the",
"image",
"in",
"the",
"specified",
"directory",
"which",
"match",
"the",
"provided",
"regex"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L60-L79 |
50,740 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadImage | public static BufferedImage loadImage(URL url) {
if( url == null )
return null;
try {
BufferedImage buffered = ImageIO.read(url);
if( buffered != null )
return buffered;
if( url.getProtocol().equals("file")) {
String path = URLDecoder.decode(url.getPath(), "UTF-8");
if( !new File(path).exist... | java | public static BufferedImage loadImage(URL url) {
if( url == null )
return null;
try {
BufferedImage buffered = ImageIO.read(url);
if( buffered != null )
return buffered;
if( url.getProtocol().equals("file")) {
String path = URLDecoder.decode(url.getPath(), "UTF-8");
if( !new File(path).exist... | [
"public",
"static",
"BufferedImage",
"loadImage",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"BufferedImage",
"buffered",
"=",
"ImageIO",
".",
"read",
"(",
"url",
")",
";",
"if",
"(",
"buffered"... | A function that load the specified image. If anything goes wrong it returns a
null. | [
"A",
"function",
"that",
"load",
"the",
"specified",
"image",
".",
"If",
"anything",
"goes",
"wrong",
"it",
"returns",
"a",
"null",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L85-L112 |
50,741 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadImage | public static <T extends ImageGray<T>> T loadImage(String fileName, Class<T> imageType ) {
BufferedImage img = loadImage(fileName);
if( img == null )
return null;
return ConvertBufferedImage.convertFromSingle(img, (T) null, imageType);
} | java | public static <T extends ImageGray<T>> T loadImage(String fileName, Class<T> imageType ) {
BufferedImage img = loadImage(fileName);
if( img == null )
return null;
return ConvertBufferedImage.convertFromSingle(img, (T) null, imageType);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"loadImage",
"(",
"String",
"fileName",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"BufferedImage",
"img",
"=",
"loadImage",
"(",
"fileName",
")",
";",
"if",
"(",
... | Loads the image and converts into the specified image type.
@param fileName Path to image file.
@param imageType Type of image that should be returned.
@return The image or null if the image could not be loaded. | [
"Loads",
"the",
"image",
"and",
"converts",
"into",
"the",
"specified",
"image",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L121-L127 |
50,742 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPPM | public static BufferedImage loadPPM( String fileName , BufferedImage storage ) throws IOException {
return loadPPM(new FileInputStream(fileName),storage);
} | java | public static BufferedImage loadPPM( String fileName , BufferedImage storage ) throws IOException {
return loadPPM(new FileInputStream(fileName),storage);
} | [
"public",
"static",
"BufferedImage",
"loadPPM",
"(",
"String",
"fileName",
",",
"BufferedImage",
"storage",
")",
"throws",
"IOException",
"{",
"return",
"loadPPM",
"(",
"new",
"FileInputStream",
"(",
"fileName",
")",
",",
"storage",
")",
";",
"}"
] | Loads a PPM image from a file.
@param fileName Location of PPM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_INT_RGB. If null or width/height incorrect a new image
will be declared.
@return The read in ima... | [
"Loads",
"a",
"PPM",
"image",
"from",
"a",
"file",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L203-L205 |
50,743 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPGM | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
return loadPGM(new FileInputStream(fileName), storage);
} | java | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
return loadPGM(new FileInputStream(fileName), storage);
} | [
"public",
"static",
"BufferedImage",
"loadPGM",
"(",
"String",
"fileName",
",",
"BufferedImage",
"storage",
")",
"throws",
"IOException",
"{",
"return",
"loadPGM",
"(",
"new",
"FileInputStream",
"(",
"fileName",
")",
",",
"storage",
")",
";",
"}"
] | Loads a PGM image from a file.
@param fileName Location of PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_BYTE_GRAY. If null or width/height incorrect a new image
will be declared.
@return The image
@th... | [
"Loads",
"a",
"PGM",
"image",
"from",
"a",
"file",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L217-L219 |
50,744 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.savePPM | public static void savePPM(Planar<GrayU8> rgb , String fileName , GrowQueue_I8 temp ) throws IOException {
File out = new File(fileName);
DataOutputStream os = new DataOutputStream(new FileOutputStream(out));
String header = String.format("P6\n%d %d\n255\n", rgb.width, rgb.height);
os.write(header.getBytes());... | java | public static void savePPM(Planar<GrayU8> rgb , String fileName , GrowQueue_I8 temp ) throws IOException {
File out = new File(fileName);
DataOutputStream os = new DataOutputStream(new FileOutputStream(out));
String header = String.format("P6\n%d %d\n255\n", rgb.width, rgb.height);
os.write(header.getBytes());... | [
"public",
"static",
"void",
"savePPM",
"(",
"Planar",
"<",
"GrayU8",
">",
"rgb",
",",
"String",
"fileName",
",",
"GrowQueue_I8",
"temp",
")",
"throws",
"IOException",
"{",
"File",
"out",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"DataOutputStream",
"o... | Saves an image in PPM format.
@param rgb 3-band RGB image
@param fileName Location where the image is to be written to.
@param temp (Optional) Used internally to store the image. Can be null.
@throws IOException Thrown if there is a problem reading the image | [
"Saves",
"an",
"image",
"in",
"PPM",
"format",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L462-L491 |
50,745 | lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.savePGM | public static void savePGM(GrayU8 gray , String fileName ) throws IOException {
File out = new File(fileName);
DataOutputStream os = new DataOutputStream(new FileOutputStream(out));
String header = String.format("P5\n%d %d\n255\n", gray.width, gray.height);
os.write(header.getBytes());
os.write(gray.data,0,... | java | public static void savePGM(GrayU8 gray , String fileName ) throws IOException {
File out = new File(fileName);
DataOutputStream os = new DataOutputStream(new FileOutputStream(out));
String header = String.format("P5\n%d %d\n255\n", gray.width, gray.height);
os.write(header.getBytes());
os.write(gray.data,0,... | [
"public",
"static",
"void",
"savePGM",
"(",
"GrayU8",
"gray",
",",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"File",
"out",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"DataOutputStream",
"os",
"=",
"new",
"DataOutputStream",
"(",
"new",
... | Saves an image in PGM format.
@param gray Gray scale image
@param fileName Location where the image is to be written to.
@throws IOException Thrown if there is a problem reading the image | [
"Saves",
"an",
"image",
"in",
"PGM",
"format",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L500-L510 |
50,746 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussian | public static <T extends KernelBase> T gaussian(Class<T> kernelType, double sigma, int radius )
{
if (Kernel1D_F32.class == kernelType) {
return gaussian(1, true, 32, sigma, radius);
} else if (Kernel1D_F64.class == kernelType) {
return gaussian(1,true, 64, sigma,radius);
} else if (Kernel1D_S32.class == k... | java | public static <T extends KernelBase> T gaussian(Class<T> kernelType, double sigma, int radius )
{
if (Kernel1D_F32.class == kernelType) {
return gaussian(1, true, 32, sigma, radius);
} else if (Kernel1D_F64.class == kernelType) {
return gaussian(1,true, 64, sigma,radius);
} else if (Kernel1D_S32.class == k... | [
"public",
"static",
"<",
"T",
"extends",
"KernelBase",
">",
"T",
"gaussian",
"(",
"Class",
"<",
"T",
">",
"kernelType",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"if",
"(",
"Kernel1D_F32",
".",
"class",
"==",
"kernelType",
")",
"{",
"retu... | Creates a Gaussian kernel of the specified type.
@param kernelType The type of kernel which is to be created.
@param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius.
@param radius Number of pixels in the kernel's radius. If ≤ 0 then the sigma will be computed from the sigm... | [
"Creates",
"a",
"Gaussian",
"kernel",
"of",
"the",
"specified",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L50-L67 |
50,747 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussian1D | public static <T extends ImageGray<T>, K extends Kernel1D>
K gaussian1D(Class<T> imageType, double sigma, int radius )
{
boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType);
int numBits = GeneralizedImageOps.getNumBits(imageType);
if( numBits < 32 )
numBits = 32;
return gaussian(1,isFloat, num... | java | public static <T extends ImageGray<T>, K extends Kernel1D>
K gaussian1D(Class<T> imageType, double sigma, int radius )
{
boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType);
int numBits = GeneralizedImageOps.getNumBits(imageType);
if( numBits < 32 )
numBits = 32;
return gaussian(1,isFloat, num... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"K",
"extends",
"Kernel1D",
">",
"K",
"gaussian1D",
"(",
"Class",
"<",
"T",
">",
"imageType",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"boolean",
"isFloat",
"=",
... | Creates a 1D Gaussian kernel of the specified type.
@param imageType The type of image which is to be convolved by this kernel.
@param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius.
@param radius Number of pixels in the kernel's radius. If ≤ 0 then the sigma will be comp... | [
"Creates",
"a",
"1D",
"Gaussian",
"kernel",
"of",
"the",
"specified",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L77-L85 |
50,748 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussian2D | public static <T extends ImageGray<T>, K extends Kernel2D>
K gaussian2D(Class<T> imageType, double sigma, int radius )
{
boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType);
int numBits = Math.max(32, GeneralizedImageOps.getNumBits(imageType));
return gaussian(2,isFloat, numBits, sigma,radius);
} | java | public static <T extends ImageGray<T>, K extends Kernel2D>
K gaussian2D(Class<T> imageType, double sigma, int radius )
{
boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType);
int numBits = Math.max(32, GeneralizedImageOps.getNumBits(imageType));
return gaussian(2,isFloat, numBits, sigma,radius);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"K",
"extends",
"Kernel2D",
">",
"K",
"gaussian2D",
"(",
"Class",
"<",
"T",
">",
"imageType",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"boolean",
"isFloat",
"=",
... | Creates a 2D Gaussian kernel of the specified type.
@param imageType The type of image which is to be convolved by this kernel.
@param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius.
@param radius Number of pixels in the kernel's radius. If ≤ 0 then the sigma will be comp... | [
"Creates",
"a",
"2D",
"Gaussian",
"kernel",
"of",
"the",
"specified",
"type",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L95-L101 |
50,749 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussian | public static <T extends KernelBase> T gaussian(int DOF, boolean isFloat, int numBits, double sigma, int radius)
{
if( radius <= 0 )
radius = FactoryKernelGaussian.radiusForSigma(sigma,0);
else if( sigma <= 0 )
sigma = FactoryKernelGaussian.sigmaForRadius(radius,0);
if( DOF == 2 ) {
if( numBits == 32 )... | java | public static <T extends KernelBase> T gaussian(int DOF, boolean isFloat, int numBits, double sigma, int radius)
{
if( radius <= 0 )
radius = FactoryKernelGaussian.radiusForSigma(sigma,0);
else if( sigma <= 0 )
sigma = FactoryKernelGaussian.sigmaForRadius(radius,0);
if( DOF == 2 ) {
if( numBits == 32 )... | [
"public",
"static",
"<",
"T",
"extends",
"KernelBase",
">",
"T",
"gaussian",
"(",
"int",
"DOF",
",",
"boolean",
"isFloat",
",",
"int",
"numBits",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"if",
"(",
"radius",
"<=",
"0",
")",
"radius",
"... | Creates a Gaussian kernel with the specified properties.
@param DOF 1 for 1D kernel and 2 for 2D kernel.
@param isFloat True for F32 kernel and false for I32.
@param numBits Number of bits in each data element. 32 or 64
@param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius.
@... | [
"Creates",
"a",
"Gaussian",
"kernel",
"with",
"the",
"specified",
"properties",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L120-L159 |
50,750 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.derivative | public static <T extends Kernel1D> T derivative( int order, boolean isFloat,
double sigma, int radius )
{
// zero order is a regular gaussian
if( order == 0 ) {
return gaussian(1,isFloat, 32, sigma,radius);
}
if( radius <= 0 )
radius = FactoryKernelGaussian.radiusForSigma(sigma,order);
e... | java | public static <T extends Kernel1D> T derivative( int order, boolean isFloat,
double sigma, int radius )
{
// zero order is a regular gaussian
if( order == 0 ) {
return gaussian(1,isFloat, 32, sigma,radius);
}
if( radius <= 0 )
radius = FactoryKernelGaussian.radiusForSigma(sigma,order);
e... | [
"public",
"static",
"<",
"T",
"extends",
"Kernel1D",
">",
"T",
"derivative",
"(",
"int",
"order",
",",
"boolean",
"isFloat",
",",
"double",
"sigma",
",",
"int",
"radius",
")",
"{",
"// zero order is a regular gaussian",
"if",
"(",
"order",
"==",
"0",
")",
... | Creates a 1D Gaussian kernel with the specified properties.
@param order The order of the gaussian derivative.
@param isFloat True for F32 kernel and false for I32.
@param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius.
@param radius Number of pixels in the kernel's radius. ... | [
"Creates",
"a",
"1D",
"Gaussian",
"kernel",
"with",
"the",
"specified",
"properties",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L187-L206 |
50,751 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussian2D_F32 | public static Kernel2D_F32 gaussian2D_F32(double sigma, int radius, boolean odd, boolean normalize) {
Kernel1D_F32 kernel1D = gaussian1D_F32(sigma,radius, odd, false);
Kernel2D_F32 ret = KernelMath.convolve2D(kernel1D, kernel1D);
if (normalize) {
KernelMath.normalizeSumToOne(ret);
}
return ret;
} | java | public static Kernel2D_F32 gaussian2D_F32(double sigma, int radius, boolean odd, boolean normalize) {
Kernel1D_F32 kernel1D = gaussian1D_F32(sigma,radius, odd, false);
Kernel2D_F32 ret = KernelMath.convolve2D(kernel1D, kernel1D);
if (normalize) {
KernelMath.normalizeSumToOne(ret);
}
return ret;
} | [
"public",
"static",
"Kernel2D_F32",
"gaussian2D_F32",
"(",
"double",
"sigma",
",",
"int",
"radius",
",",
"boolean",
"odd",
",",
"boolean",
"normalize",
")",
"{",
"Kernel1D_F32",
"kernel1D",
"=",
"gaussian1D_F32",
"(",
"sigma",
",",
"radius",
",",
"odd",
",",
... | Creates a kernel for a 2D convolution. This should only be used for validation purposes.
@param sigma Distributions standard deviation.
@param radius Kernel's radius.
@param odd Does the kernel have an even or add width
@param normalize If the kernel should be normalized to one or not. | [
"Creates",
"a",
"kernel",
"for",
"a",
"2D",
"convolution",
".",
"This",
"should",
"only",
"be",
"used",
"for",
"validation",
"purposes",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L269-L278 |
50,752 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.derivative1D_F32 | protected static Kernel1D_F32 derivative1D_F32(int order, double sigma, int radius, boolean normalize) {
Kernel1D_F32 ret = new Kernel1D_F32(radius * 2 + 1);
float[] gaussian = ret.data;
int index = 0;
switch( order ) {
case 1:
for (int i = radius; i >= -radius; i--) {
gaussian[index++] = (float) U... | java | protected static Kernel1D_F32 derivative1D_F32(int order, double sigma, int radius, boolean normalize) {
Kernel1D_F32 ret = new Kernel1D_F32(radius * 2 + 1);
float[] gaussian = ret.data;
int index = 0;
switch( order ) {
case 1:
for (int i = radius; i >= -radius; i--) {
gaussian[index++] = (float) U... | [
"protected",
"static",
"Kernel1D_F32",
"derivative1D_F32",
"(",
"int",
"order",
",",
"double",
"sigma",
",",
"int",
"radius",
",",
"boolean",
"normalize",
")",
"{",
"Kernel1D_F32",
"ret",
"=",
"new",
"Kernel1D_F32",
"(",
"radius",
"*",
"2",
"+",
"1",
")",
... | Computes the derivative of a Gaussian kernel.
@param sigma Distributions standard deviation.
@param radius Kernel's radius.
@param normalize
@return The derivative of the gaussian | [
"Computes",
"the",
"derivative",
"of",
"a",
"Gaussian",
"kernel",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L299-L346 |
50,753 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java | FactoryKernelGaussian.gaussianWidth | public static Kernel2D_F64 gaussianWidth( double sigma , int width )
{
if( sigma <= 0 )
sigma = sigmaForRadius(width/2,0);
else if( width <= 0 )
throw new IllegalArgumentException("Must specify the width since it doesn't know if it should be even or odd");
if( width % 2 == 0 ) {
int r = width/2-1;
K... | java | public static Kernel2D_F64 gaussianWidth( double sigma , int width )
{
if( sigma <= 0 )
sigma = sigmaForRadius(width/2,0);
else if( width <= 0 )
throw new IllegalArgumentException("Must specify the width since it doesn't know if it should be even or odd");
if( width % 2 == 0 ) {
int r = width/2-1;
K... | [
"public",
"static",
"Kernel2D_F64",
"gaussianWidth",
"(",
"double",
"sigma",
",",
"int",
"width",
")",
"{",
"if",
"(",
"sigma",
"<=",
"0",
")",
"sigma",
"=",
"sigmaForRadius",
"(",
"width",
"/",
"2",
",",
"0",
")",
";",
"else",
"if",
"(",
"width",
"<... | Create a gaussian kernel based on its width. Supports kernels of even or odd widths
.
@param sigma Sigma of the Gaussian distribution. If ≤ 0 then the width will be used.
@param width How wide the kernel is. Can be even or odd.
@return Gaussian convolution kernel. | [
"Create",
"a",
"gaussian",
"kernel",
"based",
"on",
"its",
"width",
".",
"Supports",
"kernels",
"of",
"even",
"or",
"odd",
"widths",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L386-L416 |
50,754 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.process | public boolean process(List<AssociatedTriple> associated , int width , int height ) {
init(width, height);
// Fit a trifocal tensor to the input observations
if (!robustFitTrifocal(associated) )
return false;
// estimate the scene's structure
if( !estimateProjectiveScene())
return false;
if( !proje... | java | public boolean process(List<AssociatedTriple> associated , int width , int height ) {
init(width, height);
// Fit a trifocal tensor to the input observations
if (!robustFitTrifocal(associated) )
return false;
// estimate the scene's structure
if( !estimateProjectiveScene())
return false;
if( !proje... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedTriple",
">",
"associated",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"init",
"(",
"width",
",",
"height",
")",
";",
"// Fit a trifocal tensor to the input observations",
"if",
"(",
"!",
"... | Determines the metric scene. The principle point is assumed to be zero in the passed in pixel coordinates.
Typically this is done by subtracting the image center from each pixel coordinate for each view.
@param associated List of associated features from 3 views. pixels
@param width width of all images
@param height h... | [
"Determines",
"the",
"metric",
"scene",
".",
"The",
"principle",
"point",
"is",
"assumed",
"to",
"be",
"zero",
"in",
"the",
"passed",
"in",
"pixel",
"coordinates",
".",
"Typically",
"this",
"is",
"done",
"by",
"subtracting",
"the",
"image",
"center",
"from",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L157-L181 |
50,755 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.robustFitTrifocal | private boolean robustFitTrifocal(List<AssociatedTriple> associated) {
// Fit a trifocal tensor to the observations robustly
ransac.process(associated);
inliers = ransac.getMatchSet();
TrifocalTensor model = ransac.getModelParameters();
if( verbose != null )
verbose.println("Remaining after RANSAC "+inlie... | java | private boolean robustFitTrifocal(List<AssociatedTriple> associated) {
// Fit a trifocal tensor to the observations robustly
ransac.process(associated);
inliers = ransac.getMatchSet();
TrifocalTensor model = ransac.getModelParameters();
if( verbose != null )
verbose.println("Remaining after RANSAC "+inlie... | [
"private",
"boolean",
"robustFitTrifocal",
"(",
"List",
"<",
"AssociatedTriple",
">",
"associated",
")",
"{",
"// Fit a trifocal tensor to the observations robustly",
"ransac",
".",
"process",
"(",
"associated",
")",
";",
"inliers",
"=",
"ransac",
".",
"getMatchSet",
... | Fits a trifocal tensor to the list of matches features using a robust method | [
"Fits",
"a",
"trifocal",
"tensor",
"to",
"the",
"list",
"of",
"matches",
"features",
"using",
"a",
"robust",
"method"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L195-L213 |
50,756 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.pruneOutliers | private void pruneOutliers(BundleAdjustment<SceneStructureMetric> bundleAdjustment) {
// see if it's configured to not prune
if( pruneFraction == 1.0 )
return;
PruneStructureFromSceneMetric pruner = new PruneStructureFromSceneMetric(structure,observations);
pruner.pruneObservationsByErrorRank(pruneFraction);... | java | private void pruneOutliers(BundleAdjustment<SceneStructureMetric> bundleAdjustment) {
// see if it's configured to not prune
if( pruneFraction == 1.0 )
return;
PruneStructureFromSceneMetric pruner = new PruneStructureFromSceneMetric(structure,observations);
pruner.pruneObservationsByErrorRank(pruneFraction);... | [
"private",
"void",
"pruneOutliers",
"(",
"BundleAdjustment",
"<",
"SceneStructureMetric",
">",
"bundleAdjustment",
")",
"{",
"// see if it's configured to not prune",
"if",
"(",
"pruneFraction",
"==",
"1.0",
")",
"return",
";",
"PruneStructureFromSceneMetric",
"pruner",
"... | Prunes the features with the largest reprojection error | [
"Prunes",
"the",
"features",
"with",
"the",
"largest",
"reprojection",
"error"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L218-L240 |
50,757 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.estimateProjectiveScene | private boolean estimateProjectiveScene() {
List<AssociatedTriple> inliers = ransac.getMatchSet();
TrifocalTensor model = ransac.getModelParameters();
MultiViewOps.extractCameraMatrices(model,P2,P3);
// Most of the time this makes little difference, but in some edges cases this enables it to
// converge cor... | java | private boolean estimateProjectiveScene() {
List<AssociatedTriple> inliers = ransac.getMatchSet();
TrifocalTensor model = ransac.getModelParameters();
MultiViewOps.extractCameraMatrices(model,P2,P3);
// Most of the time this makes little difference, but in some edges cases this enables it to
// converge cor... | [
"private",
"boolean",
"estimateProjectiveScene",
"(",
")",
"{",
"List",
"<",
"AssociatedTriple",
">",
"inliers",
"=",
"ransac",
".",
"getMatchSet",
"(",
")",
";",
"TrifocalTensor",
"model",
"=",
"ransac",
".",
"getModelParameters",
"(",
")",
";",
"MultiViewOps",... | Estimate the projective scene from the trifocal tensor | [
"Estimate",
"the",
"projective",
"scene",
"from",
"the",
"trifocal",
"tensor"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L318-L334 |
50,758 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.setupMetricBundleAdjustment | private void setupMetricBundleAdjustment(List<AssociatedTriple> inliers) {
// Construct bundle adjustment data structure
structure = new SceneStructureMetric(false);
observations = new SceneObservations(3);
structure.initialize(3,3,inliers.size());
for (int i = 0; i < listPinhole.size(); i++) {
CameraPinh... | java | private void setupMetricBundleAdjustment(List<AssociatedTriple> inliers) {
// Construct bundle adjustment data structure
structure = new SceneStructureMetric(false);
observations = new SceneObservations(3);
structure.initialize(3,3,inliers.size());
for (int i = 0; i < listPinhole.size(); i++) {
CameraPinh... | [
"private",
"void",
"setupMetricBundleAdjustment",
"(",
"List",
"<",
"AssociatedTriple",
">",
"inliers",
")",
"{",
"// Construct bundle adjustment data structure",
"structure",
"=",
"new",
"SceneStructureMetric",
"(",
"false",
")",
";",
"observations",
"=",
"new",
"Scene... | Using the initial metric reconstruction, provide the initial configurations for bundle adjustment | [
"Using",
"the",
"initial",
"metric",
"reconstruction",
"provide",
"the",
"initial",
"configurations",
"for",
"bundle",
"adjustment"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L339-L368 |
50,759 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.checkBehindCamera | private boolean checkBehindCamera(SceneStructureMetric structure ) {
int totalBehind = 0;
Point3D_F64 X = new Point3D_F64();
for (int i = 0; i < structure.points.length; i++) {
structure.points[i].get(X);
if( X.z < 0 )
totalBehind++;
}
if( verbose != null ) {
verbose.println("points behind "+to... | java | private boolean checkBehindCamera(SceneStructureMetric structure ) {
int totalBehind = 0;
Point3D_F64 X = new Point3D_F64();
for (int i = 0; i < structure.points.length; i++) {
structure.points[i].get(X);
if( X.z < 0 )
totalBehind++;
}
if( verbose != null ) {
verbose.println("points behind "+to... | [
"private",
"boolean",
"checkBehindCamera",
"(",
"SceneStructureMetric",
"structure",
")",
"{",
"int",
"totalBehind",
"=",
"0",
";",
"Point3D_F64",
"X",
"=",
"new",
"Point3D_F64",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"structure",
... | Checks to see if a solution was converged to where the points are behind the camera. This is
pysically impossible | [
"Checks",
"to",
"see",
"if",
"a",
"solution",
"was",
"converged",
"to",
"where",
"the",
"points",
"are",
"behind",
"the",
"camera",
".",
"This",
"is",
"pysically",
"impossible"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L462-L477 |
50,760 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.flipAround | private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
// The first view will be identity
for (int i = 1; i < structure.views.length; i++) {
Se3_F64 w2v = structure.views[i].worldToView;
w2v.set(w2v.invert(null));
}
triangulatePoints(structure,observations);
} | java | private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
// The first view will be identity
for (int i = 1; i < structure.views.length; i++) {
Se3_F64 w2v = structure.views[i].worldToView;
w2v.set(w2v.invert(null));
}
triangulatePoints(structure,observations);
} | [
"private",
"static",
"void",
"flipAround",
"(",
"SceneStructureMetric",
"structure",
",",
"SceneObservations",
"observations",
")",
"{",
"// The first view will be identity",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"structure",
".",
"views",
".",
"length"... | Flip the camera pose around. This seems to help it converge to a valid solution if it got it backwards
even if it's not technically something which can be inverted this way | [
"Flip",
"the",
"camera",
"pose",
"around",
".",
"This",
"seems",
"to",
"help",
"it",
"converge",
"to",
"a",
"valid",
"solution",
"if",
"it",
"got",
"it",
"backwards",
"even",
"if",
"it",
"s",
"not",
"technically",
"something",
"which",
"can",
"be",
"inve... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L483-L490 |
50,761 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurfPlanar.java | DescribePointSurfPlanar.setImage | public void setImage( II grayII , Planar<II> colorII ) {
InputSanityCheck.checkSameShape(grayII,colorII);
if( colorII.getNumBands() != numBands )
throw new IllegalArgumentException("Expected planar images to have "
+numBands+" not "+colorII.getNumBands());
this.grayII = grayII;
this.colorII = colorII;
... | java | public void setImage( II grayII , Planar<II> colorII ) {
InputSanityCheck.checkSameShape(grayII,colorII);
if( colorII.getNumBands() != numBands )
throw new IllegalArgumentException("Expected planar images to have "
+numBands+" not "+colorII.getNumBands());
this.grayII = grayII;
this.colorII = colorII;
... | [
"public",
"void",
"setImage",
"(",
"II",
"grayII",
",",
"Planar",
"<",
"II",
">",
"colorII",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"grayII",
",",
"colorII",
")",
";",
"if",
"(",
"colorII",
".",
"getNumBands",
"(",
")",
"!=",
"numBands... | Specifies input image shapes.
@param grayII integral image of gray scale image
@param colorII integral image of color image | [
"Specifies",
"input",
"image",
"shapes",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurfPlanar.java#L87-L95 |
50,762 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java | ColorHsv.hsvToRgb | public static void hsvToRgb( double h , double s , double v , double []rgb ) {
if( s == 0 ) {
rgb[0] = v;
rgb[1] = v;
rgb[2] = v;
return;
}
h /= d60_F64;
int h_int = (int)h;
double remainder = h - h_int;
double p = v * ( 1 - s );
double q = v * ( 1 - s * remainder );
double t = v * ( 1 - s *... | java | public static void hsvToRgb( double h , double s , double v , double []rgb ) {
if( s == 0 ) {
rgb[0] = v;
rgb[1] = v;
rgb[2] = v;
return;
}
h /= d60_F64;
int h_int = (int)h;
double remainder = h - h_int;
double p = v * ( 1 - s );
double q = v * ( 1 - s * remainder );
double t = v * ( 1 - s *... | [
"public",
"static",
"void",
"hsvToRgb",
"(",
"double",
"h",
",",
"double",
"s",
",",
"double",
"v",
",",
"double",
"[",
"]",
"rgb",
")",
"{",
"if",
"(",
"s",
"==",
"0",
")",
"{",
"rgb",
"[",
"0",
"]",
"=",
"v",
";",
"rgb",
"[",
"1",
"]",
"=... | Convert HSV color into RGB color
@param h Hue [0,2*PI]
@param s Saturation [0,1]
@param v Value
@param rgb (Output) RGB value | [
"Convert",
"HSV",
"color",
"into",
"RGB",
"color"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java#L109-L148 |
50,763 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadView.java | CreateSyntheticOverheadView.configure | public void configure( CameraPinholeBrown intrinsic ,
Se3_F64 planeToCamera ,
double centerX, double centerY, double cellSize ,
int overheadWidth , int overheadHeight )
{
this.overheadWidth = overheadWidth;
this.overheadHeight = overheadHeight;
Point2Transform2_F64 normToPixel = LensD... | java | public void configure( CameraPinholeBrown intrinsic ,
Se3_F64 planeToCamera ,
double centerX, double centerY, double cellSize ,
int overheadWidth , int overheadHeight )
{
this.overheadWidth = overheadWidth;
this.overheadHeight = overheadHeight;
Point2Transform2_F64 normToPixel = LensD... | [
"public",
"void",
"configure",
"(",
"CameraPinholeBrown",
"intrinsic",
",",
"Se3_F64",
"planeToCamera",
",",
"double",
"centerX",
",",
"double",
"centerY",
",",
"double",
"cellSize",
",",
"int",
"overheadWidth",
",",
"int",
"overheadHeight",
")",
"{",
"this",
".... | Specifies camera configurations.
@param intrinsic Intrinsic camera parameters
@param planeToCamera Transform from the plane to the camera. This is the extrinsic parameters.
@param centerX X-coordinate of camera center in the overhead image in world units.
@param centerY Y-coordinate of camera center in the overhead im... | [
"Specifies",
"camera",
"configurations",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadView.java#L81-L133 |
50,764 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java | DetectFiducialSquareGrid.detect | public boolean detect( T input ) {
detections.reset();
detector.process(input);
FastQueue<FoundFiducial> found = detector.getFound();
for (int i = 0; i < found.size(); i++) {
FoundFiducial fid = found.get(i);
int gridIndex = isExpected(fid.id);
if( gridIndex >= 0 ) {
Detection d = lookupDetect... | java | public boolean detect( T input ) {
detections.reset();
detector.process(input);
FastQueue<FoundFiducial> found = detector.getFound();
for (int i = 0; i < found.size(); i++) {
FoundFiducial fid = found.get(i);
int gridIndex = isExpected(fid.id);
if( gridIndex >= 0 ) {
Detection d = lookupDetect... | [
"public",
"boolean",
"detect",
"(",
"T",
"input",
")",
"{",
"detections",
".",
"reset",
"(",
")",
";",
"detector",
".",
"process",
"(",
"input",
")",
";",
"FastQueue",
"<",
"FoundFiducial",
">",
"found",
"=",
"detector",
".",
"getFound",
"(",
")",
";",... | Searches for the fiducial inside the image.
If at least a partial match is found true is returned.
@param input Input image
@return true if at least one of the component fiducials is detected. False otherwise | [
"Searches",
"for",
"the",
"fiducial",
"inside",
"the",
"image",
".",
"If",
"at",
"least",
"a",
"partial",
"match",
"is",
"found",
"true",
"is",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L87-L113 |
50,765 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java | DetectFiducialSquareGrid.isExpected | private int isExpected( long found ) {
int bestHamming = 2;
int bestNumber = -1;
for (int i = 0; i < numbers.length; i++) {
int hamming = DescriptorDistance.hamming((int)found^(int)numbers[i]);
if( hamming < bestHamming ) {
bestHamming = hamming;
bestNumber = i;
}
}
return bestNumber;
} | java | private int isExpected( long found ) {
int bestHamming = 2;
int bestNumber = -1;
for (int i = 0; i < numbers.length; i++) {
int hamming = DescriptorDistance.hamming((int)found^(int)numbers[i]);
if( hamming < bestHamming ) {
bestHamming = hamming;
bestNumber = i;
}
}
return bestNumber;
} | [
"private",
"int",
"isExpected",
"(",
"long",
"found",
")",
"{",
"int",
"bestHamming",
"=",
"2",
";",
"int",
"bestNumber",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numbers",
".",
"length",
";",
"i",
"++",
")",
"{",
"... | Checks to see if the provided ID number is expected or not
@param found Fiducial ID number
@return true if it's looking for this ID number | [
"Checks",
"to",
"see",
"if",
"the",
"provided",
"ID",
"number",
"is",
"expected",
"or",
"not"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L121-L135 |
50,766 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java | DetectFiducialSquareGrid.lookupDetection | private Detection lookupDetection( long found , int gridIndex) {
for (int i = 0; i < detections.size(); i++) {
Detection d = detections.get(i);
if( d.id == found ) {
return d;
}
}
Detection d = detections.grow();
d.reset();
d.id = found;
d.gridIndex = gridIndex;
return d;
} | java | private Detection lookupDetection( long found , int gridIndex) {
for (int i = 0; i < detections.size(); i++) {
Detection d = detections.get(i);
if( d.id == found ) {
return d;
}
}
Detection d = detections.grow();
d.reset();
d.id = found;
d.gridIndex = gridIndex;
return d;
} | [
"private",
"Detection",
"lookupDetection",
"(",
"long",
"found",
",",
"int",
"gridIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"detections",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Detection",
"d",
"=",
"detections",
... | Looks up a detection given the fiducial ID number. If not seen before the gridIndex is saved and
a new instance returned. | [
"Looks",
"up",
"a",
"detection",
"given",
"the",
"fiducial",
"ID",
"number",
".",
"If",
"not",
"seen",
"before",
"the",
"gridIndex",
"is",
"saved",
"and",
"a",
"new",
"instance",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L141-L155 |
50,767 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java | LinearContourLabelChang2004.process | public void process(GrayU8 binary , GrayS32 labeled ) {
// initialize data structures
labeled.reshape(binary.width,binary.height);
// ensure that the image border pixels are filled with zero by enlarging the image
if( border.width != binary.width+2 || border.height != binary.height+2) {
border.reshape(bina... | java | public void process(GrayU8 binary , GrayS32 labeled ) {
// initialize data structures
labeled.reshape(binary.width,binary.height);
// ensure that the image border pixels are filled with zero by enlarging the image
if( border.width != binary.width+2 || border.height != binary.height+2) {
border.reshape(bina... | [
"public",
"void",
"process",
"(",
"GrayU8",
"binary",
",",
"GrayS32",
"labeled",
")",
"{",
"// initialize data structures",
"labeled",
".",
"reshape",
"(",
"binary",
".",
"width",
",",
"binary",
".",
"height",
")",
";",
"// ensure that the image border pixels are fi... | Processes the binary image to find the contour of and label blobs.
@param binary Input binary image. Not modified.
@param labeled Output. Labeled image. Modified. | [
"Processes",
"the",
"binary",
"image",
"to",
"find",
"the",
"contour",
"of",
"and",
"label",
"blobs",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java#L96-L152 |
50,768 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java | LinearContourLabelChang2004.scanForOne | private int scanForOne(byte[] data , int index , int end ) {
while (index < end && data[index] != 1) {
index++;
}
return index;
} | java | private int scanForOne(byte[] data , int index , int end ) {
while (index < end && data[index] != 1) {
index++;
}
return index;
} | [
"private",
"int",
"scanForOne",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"index",
",",
"int",
"end",
")",
"{",
"while",
"(",
"index",
"<",
"end",
"&&",
"data",
"[",
"index",
"]",
"!=",
"1",
")",
"{",
"index",
"++",
";",
"}",
"return",
"index",
... | Faster when there's a specialized function which searches for one pixels | [
"Faster",
"when",
"there",
"s",
"a",
"specialized",
"function",
"which",
"searches",
"for",
"one",
"pixels"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/LinearContourLabelChang2004.java#L157-L162 |
50,769 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducial.java | FactoryFiducial.qrcode | public static <T extends ImageGray<T>>
QrCodePreciseDetector<T> qrcode(ConfigQrCode config, Class<T> imageType) {
if( config == null )
config = new ConfigQrCode();
config.checkValidity();
InputToBinary<T> inputToBinary = FactoryThresholdBinary.threshold(config.threshold,imageType);
DetectPolygonBinaryGra... | java | public static <T extends ImageGray<T>>
QrCodePreciseDetector<T> qrcode(ConfigQrCode config, Class<T> imageType) {
if( config == null )
config = new ConfigQrCode();
config.checkValidity();
InputToBinary<T> inputToBinary = FactoryThresholdBinary.threshold(config.threshold,imageType);
DetectPolygonBinaryGra... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"QrCodePreciseDetector",
"<",
"T",
">",
"qrcode",
"(",
"ConfigQrCode",
"config",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"conf... | Returns a QR Code detector
@param config Configuration
@param imageType type of input image
@return the detector | [
"Returns",
"a",
"QR",
"Code",
"detector"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducial.java#L174-L188 |
50,770 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.initialize | public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) {
if( imagePyramid == null ||
imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) {
int minSize = (config.trackerFeatureRadius*2+1)*5;
int scales[] = selectPyramidScale(image.width,image.height,... | java | public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) {
if( imagePyramid == null ||
imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) {
int minSize = (config.trackerFeatureRadius*2+1)*5;
int scales[] = selectPyramidScale(image.width,image.height,... | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"if",
"(",
"imagePyramid",
"==",
"null",
"||",
"imagePyramid",
".",
"getInputWidth",
"(",
")",
"!=",
"image",
".",
... | Starts tracking the rectangular region.
@param image First image in the sequence.
@param x0 Top-left corner of rectangle. x-axis
@param y0 Top-left corner of rectangle. y-axis
@param x1 Bottom-right corner of rectangle. x-axis
@param y1 Bottom-right corner of rectangle. y-axis | [
"Starts",
"tracking",
"the",
"rectangular",
"region",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L148-L175 |
50,771 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.createCascadeRegion | private void createCascadeRegion( int imageWidth , int imageHeight ) {
cascadeRegions.reset();
int rectWidth = (int)(targetRegion.getWidth()+0.5);
int rectHeight = (int)(targetRegion.getHeight()+0.5);
for( int scaleInt = -config.scaleSpread; scaleInt <= config.scaleSpread; scaleInt++ ) {
// try several sc... | java | private void createCascadeRegion( int imageWidth , int imageHeight ) {
cascadeRegions.reset();
int rectWidth = (int)(targetRegion.getWidth()+0.5);
int rectHeight = (int)(targetRegion.getHeight()+0.5);
for( int scaleInt = -config.scaleSpread; scaleInt <= config.scaleSpread; scaleInt++ ) {
// try several sc... | [
"private",
"void",
"createCascadeRegion",
"(",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"{",
"cascadeRegions",
".",
"reset",
"(",
")",
";",
"int",
"rectWidth",
"=",
"(",
"int",
")",
"(",
"targetRegion",
".",
"getWidth",
"(",
")",
"+",
"0.5",
... | Creates a list containing all the regions which need to be tested | [
"Creates",
"a",
"list",
"containing",
"all",
"the",
"regions",
"which",
"need",
"to",
"be",
"tested"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L205-L250 |
50,772 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.track | public boolean track( T image ) {
boolean success = true;
valid = false;
imagePyramid.process(image);
template.setImage(image);
variance.setImage(image);
fern.setImage(image);
if( reacquiring ) {
// It can reinitialize if there is a single detection
detection.detectionCascade(cascadeRegions);
... | java | public boolean track( T image ) {
boolean success = true;
valid = false;
imagePyramid.process(image);
template.setImage(image);
variance.setImage(image);
fern.setImage(image);
if( reacquiring ) {
// It can reinitialize if there is a single detection
detection.detectionCascade(cascadeRegions);
... | [
"public",
"boolean",
"track",
"(",
"T",
"image",
")",
"{",
"boolean",
"success",
"=",
"true",
";",
"valid",
"=",
"false",
";",
"imagePyramid",
".",
"process",
"(",
"image",
")",
";",
"template",
".",
"setImage",
"(",
"image",
")",
";",
"variance",
".",... | Updates track region.
@param image Next image in the sequence.
@return true if the object could be found and false if not | [
"Updates",
"track",
"region",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L258-L314 |
50,773 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.hypothesisFusion | protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) {
valid = false;
boolean uniqueDetection = detectionWorked && !detection.isAmbiguous();
TldRegion detectedRegion = detection.getBest();
double confidenceTarget;
if( trackingWorked ) {
// get the scores from tracking... | java | protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) {
valid = false;
boolean uniqueDetection = detectionWorked && !detection.isAmbiguous();
TldRegion detectedRegion = detection.getBest();
double confidenceTarget;
if( trackingWorked ) {
// get the scores from tracking... | [
"protected",
"boolean",
"hypothesisFusion",
"(",
"boolean",
"trackingWorked",
",",
"boolean",
"detectionWorked",
")",
"{",
"valid",
"=",
"false",
";",
"boolean",
"uniqueDetection",
"=",
"detectionWorked",
"&&",
"!",
"detection",
".",
"isAmbiguous",
"(",
")",
";",
... | Combines hypotheses from tracking and detection.
@param trackingWorked If the sequential tracker updated the track region successfully or not
@return true a hypothesis was found, false if it failed to find a hypothesis | [
"Combines",
"hypotheses",
"from",
"tracking",
"and",
"detection",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L332-L385 |
50,774 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.selectPyramidScale | public static int[] selectPyramidScale( int imageWidth , int imageHeight, int minSize ) {
int w = Math.max(imageWidth,imageHeight);
int maxScale = w/minSize;
int n = 1;
int scale = 1;
while( scale*2 < maxScale ) {
n++;
scale *= 2;
}
int ret[] = new int[n];
scale = 1;
for( int i = 0; i < n; i++... | java | public static int[] selectPyramidScale( int imageWidth , int imageHeight, int minSize ) {
int w = Math.max(imageWidth,imageHeight);
int maxScale = w/minSize;
int n = 1;
int scale = 1;
while( scale*2 < maxScale ) {
n++;
scale *= 2;
}
int ret[] = new int[n];
scale = 1;
for( int i = 0; i < n; i++... | [
"public",
"static",
"int",
"[",
"]",
"selectPyramidScale",
"(",
"int",
"imageWidth",
",",
"int",
"imageHeight",
",",
"int",
"minSize",
")",
"{",
"int",
"w",
"=",
"Math",
".",
"max",
"(",
"imageWidth",
",",
"imageHeight",
")",
";",
"int",
"maxScale",
"=",... | Selects the scale for the image pyramid based on image size and feature size
@return scales for image pyramid | [
"Selects",
"the",
"scale",
"for",
"the",
"image",
"pyramid",
"based",
"on",
"image",
"size",
"and",
"feature",
"size"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L391-L410 |
50,775 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java | QrCodeBinaryGridReader.imageToGrid | public void imageToGrid( Point2D_F64 pixel , Point2D_F64 grid ) {
transformGrid.imageToGrid(pixel.x, pixel.y, grid);
} | java | public void imageToGrid( Point2D_F64 pixel , Point2D_F64 grid ) {
transformGrid.imageToGrid(pixel.x, pixel.y, grid);
} | [
"public",
"void",
"imageToGrid",
"(",
"Point2D_F64",
"pixel",
",",
"Point2D_F64",
"grid",
")",
"{",
"transformGrid",
".",
"imageToGrid",
"(",
"pixel",
".",
"x",
",",
"pixel",
".",
"y",
",",
"grid",
")",
";",
"}"
] | Converts a pixel coordinate into a grid coordinate. | [
"Converts",
"a",
"pixel",
"coordinate",
"into",
"a",
"grid",
"coordinate",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java#L105-L107 |
50,776 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java | QrCodeBinaryGridReader.readBit | public int readBit( int row , int col ) {
// todo use adjustments from near by alignment patterns
float center = 0.5f;
// if( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight )
// return -1;
transformGrid.gridToImage(row+center-0.2f, col+center, pixel);
float pixel01 = int... | java | public int readBit( int row , int col ) {
// todo use adjustments from near by alignment patterns
float center = 0.5f;
// if( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight )
// return -1;
transformGrid.gridToImage(row+center-0.2f, col+center, pixel);
float pixel01 = int... | [
"public",
"int",
"readBit",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"// todo use adjustments from near by alignment patterns",
"float",
"center",
"=",
"0.5f",
";",
"//\t\tif( pixel.x < -0.5 || pixel.y < -0.5 || pixel.x > imageWidth || pixel.y > imageHeight )",
"//\t\t\tre... | Reads a bit from the qr code's data matrix while adjusting for location distortions using known
feature locations.
@param row grid row
@param col grid column
@return | [
"Reads",
"a",
"bit",
"from",
"the",
"qr",
"code",
"s",
"data",
"matrix",
"while",
"adjusting",
"for",
"location",
"distortions",
"using",
"known",
"feature",
"locations",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeBinaryGridReader.java#L132-L191 |
50,777 | lessthanoptimal/BoofCV | integration/boofcv-WebcamCapture/src/main/java/boofcv/io/webcamcapture/UtilWebcamCapture.java | UtilWebcamCapture.openDefault | public static Webcam openDefault( int desiredWidth , int desiredHeight) {
Webcam webcam = Webcam.getDefault();
// Webcam doesn't list all available resolutions. Just pass in a custom
// resolution and hope it works
adjustResolution(webcam,desiredWidth,desiredHeight);
webcam.open();
return webcam;
} | java | public static Webcam openDefault( int desiredWidth , int desiredHeight) {
Webcam webcam = Webcam.getDefault();
// Webcam doesn't list all available resolutions. Just pass in a custom
// resolution and hope it works
adjustResolution(webcam,desiredWidth,desiredHeight);
webcam.open();
return webcam;
} | [
"public",
"static",
"Webcam",
"openDefault",
"(",
"int",
"desiredWidth",
",",
"int",
"desiredHeight",
")",
"{",
"Webcam",
"webcam",
"=",
"Webcam",
".",
"getDefault",
"(",
")",
";",
"// Webcam doesn't list all available resolutions. Just pass in a custom",
"// resolution a... | Opens the default camera while adjusting its resolution | [
"Opens",
"the",
"default",
"camera",
"while",
"adjusting",
"its",
"resolution"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-WebcamCapture/src/main/java/boofcv/io/webcamcapture/UtilWebcamCapture.java#L37-L46 |
50,778 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.process | public void process(List<EllipseInfo> ellipses , List<List<Node>> output ) {
init(ellipses);
connect(ellipses);
output.clear();
for (int i = 0; i < clusters.size(); i++) {
List<Node> c = clusters.get(i);
// remove noise
removeSingleConnections(c);
if( c.size() >= minimumClusterSize) {
outpu... | java | public void process(List<EllipseInfo> ellipses , List<List<Node>> output ) {
init(ellipses);
connect(ellipses);
output.clear();
for (int i = 0; i < clusters.size(); i++) {
List<Node> c = clusters.get(i);
// remove noise
removeSingleConnections(c);
if( c.size() >= minimumClusterSize) {
outpu... | [
"public",
"void",
"process",
"(",
"List",
"<",
"EllipseInfo",
">",
"ellipses",
",",
"List",
"<",
"List",
"<",
"Node",
">",
">",
"output",
")",
"{",
"init",
"(",
"ellipses",
")",
";",
"connect",
"(",
"ellipses",
")",
";",
"output",
".",
"clear",
"(",
... | Processes the ellipses and creates clusters.
@param ellipses Set of unordered ellipses
@param output Resulting found clusters. Cleared automatically. Returned lists are recycled on next call. | [
"Processes",
"the",
"ellipses",
"and",
"creates",
"clusters",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L95-L112 |
50,779 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.removeSingleConnections | static void removeSingleConnections( List<Node> cluster ) {
List<Node> open = new ArrayList<>();
List<Node> future = new ArrayList<>();
open.addAll(cluster);
while( !open.isEmpty() ) {
for (int i = open.size()-1; i >= 0; i--) {
Node n = open.get(i);
if( n.connections.size == 1 ) {
// clear it... | java | static void removeSingleConnections( List<Node> cluster ) {
List<Node> open = new ArrayList<>();
List<Node> future = new ArrayList<>();
open.addAll(cluster);
while( !open.isEmpty() ) {
for (int i = open.size()-1; i >= 0; i--) {
Node n = open.get(i);
if( n.connections.size == 1 ) {
// clear it... | [
"static",
"void",
"removeSingleConnections",
"(",
"List",
"<",
"Node",
">",
"cluster",
")",
"{",
"List",
"<",
"Node",
">",
"open",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Node",
">",
"future",
"=",
"new",
"ArrayList",
"<>",
"(",
"... | Removes stray connections that are highly likely to be noise. If a node has one connection it then removed.
Then it's only connection is considered for removal. | [
"Removes",
"stray",
"connections",
"that",
"are",
"highly",
"likely",
"to",
"be",
"noise",
".",
"If",
"a",
"node",
"has",
"one",
"connection",
"it",
"then",
"removed",
".",
"Then",
"it",
"s",
"only",
"connection",
"is",
"considered",
"for",
"removal",
"."
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L221-L256 |
50,780 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.init | void init(List<EllipseInfo> ellipses) {
nodes.resize(ellipses.size());
clusters.reset();
for (int i = 0; i < ellipses.size(); i++) {
Node n = nodes.get(i);
n.connections.reset();
n.which = i;
n.cluster = -1;
}
nn.setPoints(ellipses,true);
} | java | void init(List<EllipseInfo> ellipses) {
nodes.resize(ellipses.size());
clusters.reset();
for (int i = 0; i < ellipses.size(); i++) {
Node n = nodes.get(i);
n.connections.reset();
n.which = i;
n.cluster = -1;
}
nn.setPoints(ellipses,true);
} | [
"void",
"init",
"(",
"List",
"<",
"EllipseInfo",
">",
"ellipses",
")",
"{",
"nodes",
".",
"resize",
"(",
"ellipses",
".",
"size",
"(",
")",
")",
";",
"clusters",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ell... | Recycles and initializes all internal data structures | [
"Recycles",
"and",
"initializes",
"all",
"internal",
"data",
"structures"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L290-L302 |
50,781 | lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.joinClusters | void joinClusters( int mouth , int food ) {
List<Node> listMouth = clusters.get(mouth);
List<Node> listFood = clusters.get(food);
// put all members of food into mouth
for (int i = 0; i < listFood.size(); i++) {
listMouth.add( listFood.get(i) );
listFood.get(i).cluster = mouth;
}
// zero food membe... | java | void joinClusters( int mouth , int food ) {
List<Node> listMouth = clusters.get(mouth);
List<Node> listFood = clusters.get(food);
// put all members of food into mouth
for (int i = 0; i < listFood.size(); i++) {
listMouth.add( listFood.get(i) );
listFood.get(i).cluster = mouth;
}
// zero food membe... | [
"void",
"joinClusters",
"(",
"int",
"mouth",
",",
"int",
"food",
")",
"{",
"List",
"<",
"Node",
">",
"listMouth",
"=",
"clusters",
".",
"get",
"(",
"mouth",
")",
";",
"List",
"<",
"Node",
">",
"listFood",
"=",
"clusters",
".",
"get",
"(",
"food",
"... | Moves all the members of 'food' into 'mouth'
@param mouth The group which will not be changed.
@param food All members of this group are put into mouth | [
"Moves",
"all",
"the",
"members",
"of",
"food",
"into",
"mouth"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L309-L322 |
50,782 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/GrayI8.java | GrayI8.set | @Override
public void set(int x, int y, int value) {
if (!isInBounds(x, y))
throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y);
data[getIndex(x, y)] = (byte) value;
} | java | @Override
public void set(int x, int y, int value) {
if (!isInBounds(x, y))
throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y);
data[getIndex(x, y)] = (byte) value;
} | [
"@",
"Override",
"public",
"void",
"set",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"value",
")",
"{",
"if",
"(",
"!",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"throw",
"new",
"ImageAccessException",
"(",
"\"Requested pixel is out of bounds: \"",
... | Sets the value of the specified pixel.
@param x pixel coordinate.
@param y pixel coordinate.
@param value The pixel's new value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"pixel",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/GrayI8.java#L72-L78 |
50,783 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java | GradientSobel_Outer.process | public static void process(GrayU8 orig,
GrayS16 derivX,
GrayS16 derivY) {
final byte[] data = orig.data;
final short[] imgX = derivX.data;
final short[] imgY = derivY.data;
final int width = orig.getWidth();
final int height = orig.getHeight() - 1;
//CONCURRENT_BELOW BoofConcurrency.lo... | java | public static void process(GrayU8 orig,
GrayS16 derivX,
GrayS16 derivY) {
final byte[] data = orig.data;
final short[] imgX = derivX.data;
final short[] imgY = derivY.data;
final int width = orig.getWidth();
final int height = orig.getHeight() - 1;
//CONCURRENT_BELOW BoofConcurrency.lo... | [
"public",
"static",
"void",
"process",
"(",
"GrayU8",
"orig",
",",
"GrayS16",
"derivX",
",",
"GrayS16",
"derivY",
")",
"{",
"final",
"byte",
"[",
"]",
"data",
"=",
"orig",
".",
"data",
";",
"final",
"short",
"[",
"]",
"imgX",
"=",
"derivX",
".",
"dat... | Computes derivative of GrayU8. None of the images can be sub-images. | [
"Computes",
"derivative",
"of",
"GrayU8",
".",
"None",
"of",
"the",
"images",
"can",
"be",
"sub",
"-",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java#L47-L71 |
50,784 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java | GradientSobel_Outer.process_sub | public static void process_sub(GrayU8 orig,
GrayS16 derivX,
GrayS16 derivY) {
final byte[] data = orig.data;
final short[] imgX = derivX.data;
final short[] imgY = derivY.data;
final int width = orig.getWidth();
final int height = orig.getHeight() - 1;
final int strideSrc = orig.getSt... | java | public static void process_sub(GrayU8 orig,
GrayS16 derivX,
GrayS16 derivY) {
final byte[] data = orig.data;
final short[] imgX = derivX.data;
final short[] imgY = derivY.data;
final int width = orig.getWidth();
final int height = orig.getHeight() - 1;
final int strideSrc = orig.getSt... | [
"public",
"static",
"void",
"process_sub",
"(",
"GrayU8",
"orig",
",",
"GrayS16",
"derivX",
",",
"GrayS16",
"derivY",
")",
"{",
"final",
"byte",
"[",
"]",
"data",
"=",
"orig",
".",
"data",
";",
"final",
"short",
"[",
"]",
"imgX",
"=",
"derivX",
".",
... | Computes derivative of GrayU8. Inputs can be sub-images. | [
"Computes",
"derivative",
"of",
"GrayU8",
".",
"Inputs",
"can",
"be",
"sub",
"-",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Outer.java#L76-L105 |
50,785 | lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidFloat.java | PyramidFloat.setScaleFactors | public void setScaleFactors( double ...scaleFactors ) {
// see if the scale factors have not changed
if( scale != null && scale.length == scaleFactors.length ) {
boolean theSame = true;
for( int i = 0; i < scale.length; i++ ) {
if( scale[i] != scaleFactors[i] ) {
theSame = false;
break;
}
... | java | public void setScaleFactors( double ...scaleFactors ) {
// see if the scale factors have not changed
if( scale != null && scale.length == scaleFactors.length ) {
boolean theSame = true;
for( int i = 0; i < scale.length; i++ ) {
if( scale[i] != scaleFactors[i] ) {
theSame = false;
break;
}
... | [
"public",
"void",
"setScaleFactors",
"(",
"double",
"...",
"scaleFactors",
")",
"{",
"// see if the scale factors have not changed",
"if",
"(",
"scale",
"!=",
"null",
"&&",
"scale",
".",
"length",
"==",
"scaleFactors",
".",
"length",
")",
"{",
"boolean",
"theSame"... | Specifies the pyramid's structure.
@param scaleFactors Change in scale factor for each layer in the pyramid. | [
"Specifies",
"the",
"pyramid",
"s",
"structure",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/pyramid/PyramidFloat.java#L62-L81 |
50,786 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java | HistogramStatistics.variance | public static double variance(int[] histogram, double mean , int N ) {
return variance(histogram, mean, count(histogram,N), N);
} | java | public static double variance(int[] histogram, double mean , int N ) {
return variance(histogram, mean, count(histogram,N), N);
} | [
"public",
"static",
"double",
"variance",
"(",
"int",
"[",
"]",
"histogram",
",",
"double",
"mean",
",",
"int",
"N",
")",
"{",
"return",
"variance",
"(",
"histogram",
",",
"mean",
",",
"count",
"(",
"histogram",
",",
"N",
")",
",",
"N",
")",
";",
"... | Computes the variance of pixel intensity values for a GrayU8 image represented by the given histogram.
@param histogram Histogram with N bins
@param mean Mean of the image.
@param N number of bins in the histogram.
@return variance | [
"Computes",
"the",
"variance",
"of",
"pixel",
"intensity",
"values",
"for",
"a",
"GrayU8",
"image",
"represented",
"by",
"the",
"given",
"histogram",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L36-L38 |
50,787 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java | HistogramStatistics.variance | public static double variance(int[] histogram, double mean, int counts , int N) {
double sum = 0.0;
for(int i=0;i<N;i++) {
double d = i - mean;
sum += (d*d) * histogram[i];
}
return sum / counts;
} | java | public static double variance(int[] histogram, double mean, int counts , int N) {
double sum = 0.0;
for(int i=0;i<N;i++) {
double d = i - mean;
sum += (d*d) * histogram[i];
}
return sum / counts;
} | [
"public",
"static",
"double",
"variance",
"(",
"int",
"[",
"]",
"histogram",
",",
"double",
"mean",
",",
"int",
"counts",
",",
"int",
"N",
")",
"{",
"double",
"sum",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i... | Computes the variance of elements in the histogram
@param histogram Histogram with N bins
@param mean Histogram's mean.
@param counts Sum of all bins in the histogram.
@param N number of bins in the histogram.
@return variance of values inside the histogram | [
"Computes",
"the",
"variance",
"of",
"elements",
"in",
"the",
"histogram"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L49-L57 |
50,788 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java | HistogramStatistics.count | public static int count(int[] histogram, int N) {
int counts = 0;
for(int i=0;i<N;i++) {
counts += histogram[i];
}
return counts;
} | java | public static int count(int[] histogram, int N) {
int counts = 0;
for(int i=0;i<N;i++) {
counts += histogram[i];
}
return counts;
} | [
"public",
"static",
"int",
"count",
"(",
"int",
"[",
"]",
"histogram",
",",
"int",
"N",
")",
"{",
"int",
"counts",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"counts",
"+=",
"histogram",
"["... | Counts sum of all the bins inside the histogram
@param histogram Histogram with N bins
@param N number of bins in the histogram.
@return Sum of all values in the histogram array. | [
"Counts",
"sum",
"of",
"all",
"the",
"bins",
"inside",
"the",
"histogram"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/HistogramStatistics.java#L66-L72 |
50,789 | lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java | GradientReduceToSingle.maxf | public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY )
{
// input and output should be the same shape
InputSanityCheck.checkSameShape(inX,inY);
InputSanityCheck.reshapeOneIn(inX,outX,outY);
// make sure that the pixel index is the same
InputSanityCheck.checkIndexin... | java | public static void maxf(Planar<GrayF32> inX , Planar<GrayF32> inY , GrayF32 outX , GrayF32 outY )
{
// input and output should be the same shape
InputSanityCheck.checkSameShape(inX,inY);
InputSanityCheck.reshapeOneIn(inX,outX,outY);
// make sure that the pixel index is the same
InputSanityCheck.checkIndexin... | [
"public",
"static",
"void",
"maxf",
"(",
"Planar",
"<",
"GrayF32",
">",
"inX",
",",
"Planar",
"<",
"GrayF32",
">",
"inY",
",",
"GrayF32",
"outX",
",",
"GrayF32",
"outY",
")",
"{",
"// input and output should be the same shape",
"InputSanityCheck",
".",
"checkSam... | Reduces the number of bands by selecting the band with the largest Frobenius norm and using
its gradient to be the output gradient on a pixel-by-pixel basis
@param inX Input gradient X
@param inY Input gradient Y
@param outX Output gradient X
@param outY Output gradient Y | [
"Reduces",
"the",
"number",
"of",
"bands",
"by",
"selecting",
"the",
"band",
"with",
"the",
"largest",
"Frobenius",
"norm",
"and",
"using",
"its",
"gradient",
"to",
"be",
"the",
"output",
"gradient",
"on",
"a",
"pixel",
"-",
"by",
"-",
"pixel",
"basis"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/GradientReduceToSingle.java#L42-L77 |
50,790 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java | ExampleImageEnhancement.histogram | public static void histogram() {
BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath));
GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null);
GrayU8 adjusted = gray.createSameShape();
int histogram[] = new int[256];
int transform[] = new int[256];
ListDisplayPanel ... | java | public static void histogram() {
BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath));
GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null);
GrayU8 adjusted = gray.createSameShape();
int histogram[] = new int[256];
int transform[] = new int[256];
ListDisplayPanel ... | [
"public",
"static",
"void",
"histogram",
"(",
")",
"{",
"BufferedImage",
"buffered",
"=",
"UtilImageIO",
".",
"loadImage",
"(",
"UtilIO",
".",
"pathExample",
"(",
"imagePath",
")",
")",
";",
"GrayU8",
"gray",
"=",
"ConvertBufferedImage",
".",
"convertFrom",
"(... | Histogram adjustment algorithms aim to spread out pixel intensity values uniformly across the allowed range.
This if an image is dark, it will have greater contrast and be brighter. | [
"Histogram",
"adjustment",
"algorithms",
"aim",
"to",
"spread",
"out",
"pixel",
"intensity",
"values",
"uniformly",
"across",
"the",
"allowed",
"range",
".",
"This",
"if",
"an",
"image",
"is",
"dark",
"it",
"will",
"have",
"greater",
"contrast",
"and",
"be",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java#L50-L72 |
50,791 | lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java | ExampleImageEnhancement.sharpen | public static void sharpen() {
BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath));
GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null);
GrayU8 adjusted = gray.createSameShape();
ListDisplayPanel panel = new ListDisplayPanel();
EnhanceImageOps.sharpen4(gray, adju... | java | public static void sharpen() {
BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath));
GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null);
GrayU8 adjusted = gray.createSameShape();
ListDisplayPanel panel = new ListDisplayPanel();
EnhanceImageOps.sharpen4(gray, adju... | [
"public",
"static",
"void",
"sharpen",
"(",
")",
"{",
"BufferedImage",
"buffered",
"=",
"UtilImageIO",
".",
"loadImage",
"(",
"UtilIO",
".",
"pathExample",
"(",
"imagePath",
")",
")",
";",
"GrayU8",
"gray",
"=",
"ConvertBufferedImage",
".",
"convertFrom",
"(",... | When an image is sharpened the intensity of edges are made more extreme while flat regions remain unchanged. | [
"When",
"an",
"image",
"is",
"sharpened",
"the",
"intensity",
"of",
"edges",
"are",
"made",
"more",
"extreme",
"while",
"flat",
"regions",
"remain",
"unchanged",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/enhance/ExampleImageEnhancement.java#L77-L95 |
50,792 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java | VisOdomPixelDepthPnP.process | public boolean process( T image ) {
tracker.process(image);
tick++;
inlierTracks.clear();
if( first ) {
addNewTracks();
first = false;
} else {
if( !estimateMotion() ) {
return false;
}
dropUnusedTracks();
int N = motionEstimator.getMatchSet().size();
if( thresholdAdd <= 0 || N < ... | java | public boolean process( T image ) {
tracker.process(image);
tick++;
inlierTracks.clear();
if( first ) {
addNewTracks();
first = false;
} else {
if( !estimateMotion() ) {
return false;
}
dropUnusedTracks();
int N = motionEstimator.getMatchSet().size();
if( thresholdAdd <= 0 || N < ... | [
"public",
"boolean",
"process",
"(",
"T",
"image",
")",
"{",
"tracker",
".",
"process",
"(",
"image",
")",
";",
"tick",
"++",
";",
"inlierTracks",
".",
"clear",
"(",
")",
";",
"if",
"(",
"first",
")",
"{",
"addNewTracks",
"(",
")",
";",
"first",
"=... | Estimates the motion given the left camera image. The latest information required by ImagePixelTo3D
should be passed to the class before invoking this function.
@param image Camera image.
@return true if successful or false if it failed | [
"Estimates",
"the",
"motion",
"given",
"the",
"left",
"camera",
"image",
".",
"The",
"latest",
"information",
"required",
"by",
"ImagePixelTo3D",
"should",
"be",
"passed",
"to",
"the",
"class",
"before",
"invoking",
"this",
"function",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L154-L180 |
50,793 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java | VisOdomPixelDepthPnP.addNewTracks | private void addNewTracks() {
// System.out.println("----------- Adding new tracks ---------------");
tracker.spawnTracks();
List<PointTrack> spawned = tracker.getNewTracks(null);
// estimate 3D coordinate using stereo vision
for( PointTrack t : spawned ) {
Point2D3DTrack p = t.getCookie();
if( p == nu... | java | private void addNewTracks() {
// System.out.println("----------- Adding new tracks ---------------");
tracker.spawnTracks();
List<PointTrack> spawned = tracker.getNewTracks(null);
// estimate 3D coordinate using stereo vision
for( PointTrack t : spawned ) {
Point2D3DTrack p = t.getCookie();
if( p == nu... | [
"private",
"void",
"addNewTracks",
"(",
")",
"{",
"//\t\tSystem.out.println(\"----------- Adding new tracks ---------------\");",
"tracker",
".",
"spawnTracks",
"(",
")",
";",
"List",
"<",
"PointTrack",
">",
"spawned",
"=",
"tracker",
".",
"getNewTracks",
"(",
"null",
... | Detects new features and computes their 3D coordinates | [
"Detects",
"new",
"features",
"and",
"computes",
"their",
"3D",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L224-L254 |
50,794 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java | VisOdomPixelDepthPnP.estimateMotion | private boolean estimateMotion() {
List<PointTrack> active = tracker.getActiveTracks(null);
List<Point2D3D> obs = new ArrayList<>();
for( PointTrack t : active ) {
Point2D3D p = t.getCookie();
pixelToNorm.compute( t.x , t.y , p.observation );
obs.add( p );
}
// estimate the motion up to a scale fac... | java | private boolean estimateMotion() {
List<PointTrack> active = tracker.getActiveTracks(null);
List<Point2D3D> obs = new ArrayList<>();
for( PointTrack t : active ) {
Point2D3D p = t.getCookie();
pixelToNorm.compute( t.x , t.y , p.observation );
obs.add( p );
}
// estimate the motion up to a scale fac... | [
"private",
"boolean",
"estimateMotion",
"(",
")",
"{",
"List",
"<",
"PointTrack",
">",
"active",
"=",
"tracker",
".",
"getActiveTracks",
"(",
"null",
")",
";",
"List",
"<",
"Point2D3D",
">",
"obs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"... | Estimates motion from the set of tracks and their 3D location
@return true if successful. | [
"Estimates",
"motion",
"from",
"the",
"set",
"of",
"tracks",
"and",
"their",
"3D",
"location"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomPixelDepthPnP.java#L261-L302 |
50,795 | lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneUncalibrated.java | EstimateSceneUncalibrated.scoreForTriangulation | double scoreForTriangulation( Motion motion ) {
DMatrixRMaj H = new DMatrixRMaj(3,3);
View viewA = motion.viewSrc;
View viewB = motion.viewDst;
// Compute initial estimate for H
pairs.reset();
for (int i = 0; i < motion.associated.size(); i++) {
AssociatedIndex ai = motion.associated.get(i);
pairs.g... | java | double scoreForTriangulation( Motion motion ) {
DMatrixRMaj H = new DMatrixRMaj(3,3);
View viewA = motion.viewSrc;
View viewB = motion.viewDst;
// Compute initial estimate for H
pairs.reset();
for (int i = 0; i < motion.associated.size(); i++) {
AssociatedIndex ai = motion.associated.get(i);
pairs.g... | [
"double",
"scoreForTriangulation",
"(",
"Motion",
"motion",
")",
"{",
"DMatrixRMaj",
"H",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
")",
";",
"View",
"viewA",
"=",
"motion",
".",
"viewSrc",
";",
"View",
"viewB",
"=",
"motion",
".",
"viewDst",
";",
... | Compute score to decide which motion to initialize structure from. A homography is fit to the
observations and the error compute. The homography should be a poor fit if the scene had 3D structure.
The 50% homography error is then scaled by the number of pairs to bias the score good matches
@param motion input
@return f... | [
"Compute",
"score",
"to",
"decide",
"which",
"motion",
"to",
"initialize",
"structure",
"from",
".",
"A",
"homography",
"is",
"fit",
"to",
"the",
"observations",
"and",
"the",
"error",
"compute",
".",
"The",
"homography",
"should",
"be",
"a",
"poor",
"fit",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneUncalibrated.java#L217-L245 |
50,796 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java | WorldToCameraToPixel.configure | public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) {
this.worldToCamera = worldToCamera;
normToPixel = distortion.distort_F64(false,true);
} | java | public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) {
this.worldToCamera = worldToCamera;
normToPixel = distortion.distort_F64(false,true);
} | [
"public",
"void",
"configure",
"(",
"LensDistortionNarrowFOV",
"distortion",
",",
"Se3_F64",
"worldToCamera",
")",
"{",
"this",
".",
"worldToCamera",
"=",
"worldToCamera",
";",
"normToPixel",
"=",
"distortion",
".",
"distort_F64",
"(",
"false",
",",
"true",
")",
... | Specifies intrinsic camera parameters and the transform from world to camera.
@param distortion camera parameters
@param worldToCamera transform from world to camera | [
"Specifies",
"intrinsic",
"camera",
"parameters",
"and",
"the",
"transform",
"from",
"world",
"to",
"camera",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L67-L71 |
50,797 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java | WorldToCameraToPixel.transform | public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) {
SePointOps_F64.transform(worldToCamera,worldPt,cameraPt);
// can't see the point
if( cameraPt.z <= 0 )
return false;
normToPixel.compute(cameraPt.x/cameraPt.z, cameraPt.y/cameraPt.z, pixelPt);
return true;
} | java | public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) {
SePointOps_F64.transform(worldToCamera,worldPt,cameraPt);
// can't see the point
if( cameraPt.z <= 0 )
return false;
normToPixel.compute(cameraPt.x/cameraPt.z, cameraPt.y/cameraPt.z, pixelPt);
return true;
} | [
"public",
"boolean",
"transform",
"(",
"Point3D_F64",
"worldPt",
",",
"Point2D_F64",
"pixelPt",
")",
"{",
"SePointOps_F64",
".",
"transform",
"(",
"worldToCamera",
",",
"worldPt",
",",
"cameraPt",
")",
";",
"// can't see the point",
"if",
"(",
"cameraPt",
".",
"... | Computes the observed location of the specified point in world coordinates in the camera pixel. If
the object can't be viewed because it is behind the camera then false is returned.
@param worldPt Location of point in world frame
@param pixelPt Pixel observation of point.
@return True if visible (+z) or false if not v... | [
"Computes",
"the",
"observed",
"location",
"of",
"the",
"specified",
"point",
"in",
"world",
"coordinates",
"in",
"the",
"camera",
"pixel",
".",
"If",
"the",
"object",
"can",
"t",
"be",
"viewed",
"because",
"it",
"is",
"behind",
"the",
"camera",
"then",
"f... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L80-L89 |
50,798 | lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java | WorldToCameraToPixel.transform | public Point2D_F64 transform( Point3D_F64 worldPt ) {
Point2D_F64 out = new Point2D_F64();
if( transform(worldPt,out))
return out;
else
return null;
} | java | public Point2D_F64 transform( Point3D_F64 worldPt ) {
Point2D_F64 out = new Point2D_F64();
if( transform(worldPt,out))
return out;
else
return null;
} | [
"public",
"Point2D_F64",
"transform",
"(",
"Point3D_F64",
"worldPt",
")",
"{",
"Point2D_F64",
"out",
"=",
"new",
"Point2D_F64",
"(",
")",
";",
"if",
"(",
"transform",
"(",
"worldPt",
",",
"out",
")",
")",
"return",
"out",
";",
"else",
"return",
"null",
"... | Computes location of 3D point in world as observed in the camera. Point is returned if visible or null
if not visible.
@param worldPt Location of point on world reference frame
@return Pixel coordinate of point or null if not visible | [
"Computes",
"location",
"of",
"3D",
"point",
"in",
"world",
"as",
"observed",
"in",
"the",
"camera",
".",
"Point",
"is",
"returned",
"if",
"visible",
"or",
"null",
"if",
"not",
"visible",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L112-L118 |
50,799 | lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java | SplitMergeLineFitLoop.splitPixels | protected void splitPixels(int indexStart, int length) {
// too short to split
if( length < minimumSideLengthPixel)
return;
// end points of the line
int indexEnd = (indexStart+length)%N;
int splitOffset = selectSplitOffset(indexStart,length);
if( splitOffset >= 0 ) {
// System.out.println(" splitt... | java | protected void splitPixels(int indexStart, int length) {
// too short to split
if( length < minimumSideLengthPixel)
return;
// end points of the line
int indexEnd = (indexStart+length)%N;
int splitOffset = selectSplitOffset(indexStart,length);
if( splitOffset >= 0 ) {
// System.out.println(" splitt... | [
"protected",
"void",
"splitPixels",
"(",
"int",
"indexStart",
",",
"int",
"length",
")",
"{",
"// too short to split",
"if",
"(",
"length",
"<",
"minimumSideLengthPixel",
")",
"return",
";",
"// end points of the line",
"int",
"indexEnd",
"=",
"(",
"indexStart",
"... | Recursively splits pixels between indexStart to indexStart+length. A split happens if there is a pixel
more than the desired distance away from the two end points. Results are placed into 'splits' | [
"Recursively",
"splits",
"pixels",
"between",
"indexStart",
"to",
"indexStart",
"+",
"length",
".",
"A",
"split",
"happens",
"if",
"there",
"is",
"a",
"pixel",
"more",
"than",
"the",
"desired",
"distance",
"away",
"from",
"the",
"two",
"end",
"points",
".",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L98-L115 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.