repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java | CalibrationFiducialDetector.getCenter | @Override
public void getCenter(int which, Point2D_F64 location) {
CalibrationObservation view = detector.getDetectedPoints();
location.set(0,0);
for (int i = 0; i < view.size(); i++) {
PointIndex2D_F64 p = view.get(i);
location.x += p.x;
location.y += p.y;
}
location.x /= view.size();
location.... | java | @Override
public void getCenter(int which, Point2D_F64 location) {
CalibrationObservation view = detector.getDetectedPoints();
location.set(0,0);
for (int i = 0; i < view.size(); i++) {
PointIndex2D_F64 p = view.get(i);
location.x += p.x;
location.y += p.y;
}
location.x /= view.size();
location.... | [
"@",
"Override",
"public",
"void",
"getCenter",
"(",
"int",
"which",
",",
"Point2D_F64",
"location",
")",
"{",
"CalibrationObservation",
"view",
"=",
"detector",
".",
"getDetectedPoints",
"(",
")",
";",
"location",
".",
"set",
"(",
"0",
",",
"0",
")",
";",... | Returns the detection point average location. This will NOT be the same as the geometric center.
@param which Fiducial's index
@param location (output) Storage for the transform. modified. | [
"Returns",
"the",
"detection",
"point",
"average",
"location",
".",
"This",
"will",
"NOT",
"be",
"the",
"same",
"as",
"the",
"geometric",
"center",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/CalibrationFiducialDetector.java#L280-L293 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.setConstraints | public void setConstraints( boolean zeroSkew ,
boolean principlePointOrigin ,
boolean knownAspect,
double aspect )
{
if( knownAspect && !zeroSkew )
throw new IllegalArgumentException("If aspect is known then skew must be zero");
this.zeroSkew = zeroSkew;
this.principlePointOrigin = pr... | java | public void setConstraints( boolean zeroSkew ,
boolean principlePointOrigin ,
boolean knownAspect,
double aspect )
{
if( knownAspect && !zeroSkew )
throw new IllegalArgumentException("If aspect is known then skew must be zero");
this.zeroSkew = zeroSkew;
this.principlePointOrigin = pr... | [
"public",
"void",
"setConstraints",
"(",
"boolean",
"zeroSkew",
",",
"boolean",
"principlePointOrigin",
",",
"boolean",
"knownAspect",
",",
"double",
"aspect",
")",
"{",
"if",
"(",
"knownAspect",
"&&",
"!",
"zeroSkew",
")",
"throw",
"new",
"IllegalArgumentExceptio... | Specifies linear constraints
Known aspect ratio constraint can only be used if zero skew is also assumped.
@param zeroSkew Assume that skew is zero
@param principlePointOrigin Principle point is at the origin
@param knownAspect that the aspect ratio is known
@param aspect If aspect is known then this is the aspect. r... | [
"Specifies",
"linear",
"constraints"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L97-L122 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.extractReferenceW | void extractReferenceW(DMatrixRMaj nv ) {
W0.a11 = nv.data[0];
W0.a12 = W0.a21 = nv.data[1];
W0.a13 = W0.a31 = nv.data[2];
W0.a22 = nv.data[3];
W0.a23 = W0.a32 = nv.data[4];
W0.a33 = nv.data[5];
} | java | void extractReferenceW(DMatrixRMaj nv ) {
W0.a11 = nv.data[0];
W0.a12 = W0.a21 = nv.data[1];
W0.a13 = W0.a31 = nv.data[2];
W0.a22 = nv.data[3];
W0.a23 = W0.a32 = nv.data[4];
W0.a33 = nv.data[5];
} | [
"void",
"extractReferenceW",
"(",
"DMatrixRMaj",
"nv",
")",
"{",
"W0",
".",
"a11",
"=",
"nv",
".",
"data",
"[",
"0",
"]",
";",
"W0",
".",
"a12",
"=",
"W0",
".",
"a21",
"=",
"nv",
".",
"data",
"[",
"1",
"]",
";",
"W0",
".",
"a13",
"=",
"W0",
... | Extracts calibration for the reference frame | [
"Extracts",
"calibration",
"for",
"the",
"reference",
"frame"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L231-L238 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.convertW | void convertW( Homography2D_F64 w , CameraPinhole c ) {
// inv(w) = K*K'
tmp.set(w);
CommonOps_DDF3.divide(tmp,tmp.a33);
CommonOps_DDF3.cholU(tmp);
CommonOps_DDF3.invert(tmp,K);
CommonOps_DDF3.divide(K,K.a33);
c.fx = K.a11;
c.fy = knownAspectRatio ? (K.a22 + c.fx*aspectRatio)/2.0 : K.a22;
c.skew = ze... | java | void convertW( Homography2D_F64 w , CameraPinhole c ) {
// inv(w) = K*K'
tmp.set(w);
CommonOps_DDF3.divide(tmp,tmp.a33);
CommonOps_DDF3.cholU(tmp);
CommonOps_DDF3.invert(tmp,K);
CommonOps_DDF3.divide(K,K.a33);
c.fx = K.a11;
c.fy = knownAspectRatio ? (K.a22 + c.fx*aspectRatio)/2.0 : K.a22;
c.skew = ze... | [
"void",
"convertW",
"(",
"Homography2D_F64",
"w",
",",
"CameraPinhole",
"c",
")",
"{",
"// inv(w) = K*K'",
"tmp",
".",
"set",
"(",
"w",
")",
";",
"CommonOps_DDF3",
".",
"divide",
"(",
"tmp",
",",
"tmp",
".",
"a33",
")",
";",
"CommonOps_DDF3",
".",
"cholU... | Converts W into a pinhole camera model by finding the cholesky decomposition | [
"Converts",
"W",
"into",
"a",
"pinhole",
"camera",
"model",
"by",
"finding",
"the",
"cholesky",
"decomposition"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L245-L258 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.extractCalibration | void extractCalibration( Homography2D_F64 Hinv , CameraPinhole c ) {
CommonOps_DDF3.multTransA(Hinv,W0,tmp);
CommonOps_DDF3.mult(tmp,Hinv,Wi);
convertW(Wi,c);
} | java | void extractCalibration( Homography2D_F64 Hinv , CameraPinhole c ) {
CommonOps_DDF3.multTransA(Hinv,W0,tmp);
CommonOps_DDF3.mult(tmp,Hinv,Wi);
convertW(Wi,c);
} | [
"void",
"extractCalibration",
"(",
"Homography2D_F64",
"Hinv",
",",
"CameraPinhole",
"c",
")",
"{",
"CommonOps_DDF3",
".",
"multTransA",
"(",
"Hinv",
",",
"W0",
",",
"tmp",
")",
";",
"CommonOps_DDF3",
".",
"mult",
"(",
"tmp",
",",
"Hinv",
",",
"Wi",
")",
... | Extracts calibration for the non-reference frames
w = H^-T*w*H^-1 | [
"Extracts",
"calibration",
"for",
"the",
"non",
"-",
"reference",
"frames"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L265-L270 | train |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java | SelfCalibrationLinearRotationMulti.computeInverseH | public boolean computeInverseH(List<Homography2D_F64> homography0toI) {
listHInv.reset();
int N = homography0toI.size();
for (int i = 0; i < N; i++) {
Homography2D_F64 H = homography0toI.get(i);
Homography2D_F64 Hinv = listHInv.grow();
// Ensure the determinant is one
double d = CommonOps_DDF3.det(H)... | java | public boolean computeInverseH(List<Homography2D_F64> homography0toI) {
listHInv.reset();
int N = homography0toI.size();
for (int i = 0; i < N; i++) {
Homography2D_F64 H = homography0toI.get(i);
Homography2D_F64 Hinv = listHInv.grow();
// Ensure the determinant is one
double d = CommonOps_DDF3.det(H)... | [
"public",
"boolean",
"computeInverseH",
"(",
"List",
"<",
"Homography2D_F64",
">",
"homography0toI",
")",
"{",
"listHInv",
".",
"reset",
"(",
")",
";",
"int",
"N",
"=",
"homography0toI",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Ensures the determinant is one then inverts the homogrpahy | [
"Ensures",
"the",
"determinant",
"is",
"one",
"then",
"inverts",
"the",
"homogrpahy"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationLinearRotationMulti.java#L275-L295 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.startCameraTexture | protected void startCameraTexture( TextureView view ) {
if( verbose )
Log.i(TAG,"startCamera(TextureView="+(view!=null)+")");
this.mTextureView = view;
this.mView = null;
this.mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);
} | java | protected void startCameraTexture( TextureView view ) {
if( verbose )
Log.i(TAG,"startCamera(TextureView="+(view!=null)+")");
this.mTextureView = view;
this.mView = null;
this.mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);
} | [
"protected",
"void",
"startCameraTexture",
"(",
"TextureView",
"view",
")",
"{",
"if",
"(",
"verbose",
")",
"Log",
".",
"i",
"(",
"TAG",
",",
"\"startCamera(TextureView=\"",
"+",
"(",
"view",
"!=",
"null",
")",
"+",
"\")\"",
")",
";",
"this",
".",
"mText... | After this function is called the camera will be start. It might not start immediately
and there can be a delay.
@param view The view the camera is displayed inside or null if not displayed | [
"After",
"this",
"function",
"is",
"called",
"the",
"camera",
"will",
"be",
"start",
".",
"It",
"might",
"not",
"start",
"immediately",
"and",
"there",
"can",
"be",
"a",
"delay",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L125-L131 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.configureCamera | protected void configureCamera( CameraDevice device ,
CameraCharacteristics characteristics,
CaptureRequest.Builder captureRequestBuilder ) {
if( verbose )
Log.i(TAG,"configureCamera() default function");
captureRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_C... | java | protected void configureCamera( CameraDevice device ,
CameraCharacteristics characteristics,
CaptureRequest.Builder captureRequestBuilder ) {
if( verbose )
Log.i(TAG,"configureCamera() default function");
captureRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_C... | [
"protected",
"void",
"configureCamera",
"(",
"CameraDevice",
"device",
",",
"CameraCharacteristics",
"characteristics",
",",
"CaptureRequest",
".",
"Builder",
"captureRequestBuilder",
")",
"{",
"if",
"(",
"verbose",
")",
"Log",
".",
"i",
"(",
"TAG",
",",
"\"config... | Override to do custom configuration of the camera's settings. By default the camera
is put into auto mode.
@param device The camera being configured
@param characteristics Used to get information on the device
@param captureRequestBuilder used to configure the camera | [
"Override",
"to",
"do",
"custom",
"configuration",
"of",
"the",
"camera",
"s",
"settings",
".",
"By",
"default",
"the",
"camera",
"is",
"put",
"into",
"auto",
"mode",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L308-L315 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.selectCamera | protected boolean selectCamera( String id , CameraCharacteristics characteristics ) {
if( verbose )
Log.i(TAG,"selectCamera() default function");
Integer facing = characteristics.get(CameraCharacteristics.LENS_FACING);
return facing == null || facing != CameraCharacteristics.LENS_FACING_FRONT;
} | java | protected boolean selectCamera( String id , CameraCharacteristics characteristics ) {
if( verbose )
Log.i(TAG,"selectCamera() default function");
Integer facing = characteristics.get(CameraCharacteristics.LENS_FACING);
return facing == null || facing != CameraCharacteristics.LENS_FACING_FRONT;
} | [
"protected",
"boolean",
"selectCamera",
"(",
"String",
"id",
",",
"CameraCharacteristics",
"characteristics",
")",
"{",
"if",
"(",
"verbose",
")",
"Log",
".",
"i",
"(",
"TAG",
",",
"\"selectCamera() default function\"",
")",
";",
"Integer",
"facing",
"=",
"chara... | By default this will select the backfacing camera. override to change the camera it selects. | [
"By",
"default",
"this",
"will",
"select",
"the",
"backfacing",
"camera",
".",
"override",
"to",
"change",
"the",
"camera",
"it",
"selects",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L320-L325 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.reopenCameraAtResolution | protected void reopenCameraAtResolution(int cameraWidth, int cameraHeight) {
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Attempted to reopenCameraAtResolution main looper thread!");
}
boolean releaseLock = true;
open.mLock.lock();
try {
if (verbose)
... | java | protected void reopenCameraAtResolution(int cameraWidth, int cameraHeight) {
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Attempted to reopenCameraAtResolution main looper thread!");
}
boolean releaseLock = true;
open.mLock.lock();
try {
if (verbose)
... | [
"protected",
"void",
"reopenCameraAtResolution",
"(",
"int",
"cameraWidth",
",",
"int",
"cameraHeight",
")",
"{",
"if",
"(",
"Looper",
".",
"getMainLooper",
"(",
")",
".",
"getThread",
"(",
")",
"!=",
"Thread",
".",
"currentThread",
"(",
")",
")",
"{",
"th... | Re-opens the camera with the same settings at the specified resolution. It is assumed that you know
what you're doing and that this is a valid resolution.
WARNING: UNTESTED | [
"Re",
"-",
"opens",
"the",
"camera",
"with",
"the",
"same",
"settings",
"at",
"the",
"specified",
"resolution",
".",
"It",
"is",
"assumed",
"that",
"you",
"know",
"what",
"you",
"re",
"doing",
"and",
"that",
"this",
"is",
"a",
"valid",
"resolution",
"."
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L487-L534 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.closeCamera | protected boolean closeCamera() {
if( verbose )
Log.i(TAG,"closeCamera() activity="+getClass().getSimpleName());
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Attempted to close camera not on the main looper thread!");
}
boolean closed = false;
// if( v... | java | protected boolean closeCamera() {
if( verbose )
Log.i(TAG,"closeCamera() activity="+getClass().getSimpleName());
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Attempted to close camera not on the main looper thread!");
}
boolean closed = false;
// if( v... | [
"protected",
"boolean",
"closeCamera",
"(",
")",
"{",
"if",
"(",
"verbose",
")",
"Log",
".",
"i",
"(",
"TAG",
",",
"\"closeCamera() activity=\"",
"+",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"if",
"(",
"Looper",
".",
"getMainLoope... | Closes the camera. Returns true if the camera was not already closed and it closed it
@return | [
"Closes",
"the",
"camera",
".",
"Returns",
"true",
"if",
"the",
"camera",
"was",
"not",
"already",
"closed",
"and",
"it",
"closed",
"it"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L540-L583 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.startPreview | private void startPreview() {
// Sanity check. Parts of this code assume it's on this thread. If it has been put into a handle
// that's fine just be careful nothing assumes it's on the main looper
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Not on main loope... | java | private void startPreview() {
// Sanity check. Parts of this code assume it's on this thread. If it has been put into a handle
// that's fine just be careful nothing assumes it's on the main looper
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
throw new RuntimeException("Not on main loope... | [
"private",
"void",
"startPreview",
"(",
")",
"{",
"// Sanity check. Parts of this code assume it's on this thread. If it has been put into a handle",
"// that's fine just be careful nothing assumes it's on the main looper",
"if",
"(",
"Looper",
".",
"getMainLooper",
"(",
")",
".",
"g... | Start the camera preview. | [
"Start",
"the",
"camera",
"preview",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L588-L633 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.cameraIntrinsicNominal | public void cameraIntrinsicNominal(CameraPinhole intrinsic ) {
open.mLock.lock();
try {
// This might be called before the camera is open
if (open.mCameraCharacterstics != null) {
SizeF physicalSize = open.mCameraCharacterstics.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE);
Rect activeSize = op... | java | public void cameraIntrinsicNominal(CameraPinhole intrinsic ) {
open.mLock.lock();
try {
// This might be called before the camera is open
if (open.mCameraCharacterstics != null) {
SizeF physicalSize = open.mCameraCharacterstics.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE);
Rect activeSize = op... | [
"public",
"void",
"cameraIntrinsicNominal",
"(",
"CameraPinhole",
"intrinsic",
")",
"{",
"open",
".",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// This might be called before the camera is open",
"if",
"(",
"open",
".",
"mCameraCharacterstics",
"!=",
"null",... | Returns the camera intrinsic parameters estimated from the physical parameters returned by
the camera2 API | [
"Returns",
"the",
"camera",
"intrinsic",
"parameters",
"estimated",
"from",
"the",
"physical",
"parameters",
"returned",
"by",
"the",
"camera2",
"API"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L917-L950 | train |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java | SimpleCamera2Activity.displayDensityAdjusted | private float displayDensityAdjusted() {
open.mLock.lock();
try {
if (open.mCameraSize == null)
return displayMetrics.density;
int rotation = getWindowManager().getDefaultDisplay().getRotation();
int screenWidth = (rotation == 0 || rotation == 2) ? displayMetrics.widthPixels : displayMetrics.heightPix... | java | private float displayDensityAdjusted() {
open.mLock.lock();
try {
if (open.mCameraSize == null)
return displayMetrics.density;
int rotation = getWindowManager().getDefaultDisplay().getRotation();
int screenWidth = (rotation == 0 || rotation == 2) ? displayMetrics.widthPixels : displayMetrics.heightPix... | [
"private",
"float",
"displayDensityAdjusted",
"(",
")",
"{",
"open",
".",
"mLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
".",
"mCameraSize",
"==",
"null",
")",
"return",
"displayMetrics",
".",
"density",
";",
"int",
"rotation",
"=",
... | Some times the size of a font of stroke needs to be specified in the input image
but then gets scaled to image resolution. This compensates for that. | [
"Some",
"times",
"the",
"size",
"of",
"a",
"font",
"of",
"stroke",
"needs",
"to",
"be",
"specified",
"in",
"the",
"input",
"image",
"but",
"then",
"gets",
"scaled",
"to",
"image",
"resolution",
".",
"This",
"compensates",
"for",
"that",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/SimpleCamera2Activity.java#L1028-L1043 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/disparity/FactoryStereoDisparity.java | FactoryStereoDisparity.regionSparseWta | public static <T extends ImageGray<T>> StereoDisparitySparse<T>
regionSparseWta( int minDisparity , int maxDisparity,
int regionRadiusX, int regionRadiusY ,
double maxPerPixelError ,
double texture ,
boolean subpixelInterpolation ,
Class<T> imageType ) {
double maxError = (regionRadius... | java | public static <T extends ImageGray<T>> StereoDisparitySparse<T>
regionSparseWta( int minDisparity , int maxDisparity,
int regionRadiusX, int regionRadiusY ,
double maxPerPixelError ,
double texture ,
boolean subpixelInterpolation ,
Class<T> imageType ) {
double maxError = (regionRadius... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"StereoDisparitySparse",
"<",
"T",
">",
"regionSparseWta",
"(",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
",",
"int",
"regionRadiusX",
",",
"int",
"regionRadiusY",
",",
"double"... | WTA algorithms that computes disparity on a sparse per-pixel basis as requested..
@param minDisparity Minimum disparity that it will check. Must be ≥ 0 and < maxDisparity
@param maxDisparity Maximum disparity that it will calculate. Must be > 0
@param regionRadiusX Radius of the rectangular region along x-axi... | [
"WTA",
"algorithms",
"that",
"computes",
"disparity",
"on",
"a",
"sparse",
"per",
"-",
"pixel",
"basis",
"as",
"requested",
".."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/disparity/FactoryStereoDisparity.java#L241-L275 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/FeatureSpatialDiversity_F32.java | FeatureSpatialDiversity_F32.addPoint | public void addPoint( float x , float y , float z ) {
norm.grow().set(x/z, y/z);
} | java | public void addPoint( float x , float y , float z ) {
norm.grow().set(x/z, y/z);
} | [
"public",
"void",
"addPoint",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"norm",
".",
"grow",
"(",
")",
".",
"set",
"(",
"x",
"/",
"z",
",",
"y",
"/",
"z",
")",
";",
"}"
] | Adds the estimated 3D location of a feature. | [
"Adds",
"the",
"estimated",
"3D",
"location",
"of",
"a",
"feature",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/FeatureSpatialDiversity_F32.java#L50-L52 | train |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/FeatureSpatialDiversity_F32.java | FeatureSpatialDiversity_F32.process | public void process() {
computeCovarince();
float eigenvalue = smallestEigenvalue();
// eigenvalue is the variance, convert to standard deviation
double stdev = Math.sqrt(eigenvalue);
// System.out.println("stdev "+stdev+" total "+norm.size()+" mean "+meanX+" "+meanY);
// approximate the spread in by d... | java | public void process() {
computeCovarince();
float eigenvalue = smallestEigenvalue();
// eigenvalue is the variance, convert to standard deviation
double stdev = Math.sqrt(eigenvalue);
// System.out.println("stdev "+stdev+" total "+norm.size()+" mean "+meanX+" "+meanY);
// approximate the spread in by d... | [
"public",
"void",
"process",
"(",
")",
"{",
"computeCovarince",
"(",
")",
";",
"float",
"eigenvalue",
"=",
"smallestEigenvalue",
"(",
")",
";",
"// eigenvalue is the variance, convert to standard deviation",
"double",
"stdev",
"=",
"Math",
".",
"sqrt",
"(",
"eigenva... | Computes the worst case spread for how features are laid out | [
"Computes",
"the",
"worst",
"case",
"spread",
"for",
"how",
"features",
"are",
"laid",
"out"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/direct/FeatureSpatialDiversity_F32.java#L57-L72 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/factory/scene/FactoryImageClassifier.java | FactoryImageClassifier.vgg_cifar10 | public static ClassifierAndSource vgg_cifar10() {
List<String> sources = new ArrayList<>();
sources.add( "http://boofcv.org/notwiki/largefiles/likevgg_cifar10.zip" );
ClassifierAndSource ret = new ClassifierAndSource();
ret.data0 = new ImageClassifierVggCifar10();
ret.data1 = sources;
return ret;
} | java | public static ClassifierAndSource vgg_cifar10() {
List<String> sources = new ArrayList<>();
sources.add( "http://boofcv.org/notwiki/largefiles/likevgg_cifar10.zip" );
ClassifierAndSource ret = new ClassifierAndSource();
ret.data0 = new ImageClassifierVggCifar10();
ret.data1 = sources;
return ret;
} | [
"public",
"static",
"ClassifierAndSource",
"vgg_cifar10",
"(",
")",
"{",
"List",
"<",
"String",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"sources",
".",
"add",
"(",
"\"http://boofcv.org/notwiki/largefiles/likevgg_cifar10.zip\"",
")",
";",
"Cla... | VGG trained on CIFAR10 data
@see ImageClassifierVggCifar10
@return The classifier and where to download the model | [
"VGG",
"trained",
"on",
"CIFAR10",
"data"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/scene/FactoryImageClassifier.java#L41-L51 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/factory/scene/FactoryImageClassifier.java | FactoryImageClassifier.nin_imagenet | public static ClassifierAndSource nin_imagenet() {
List<String> sources = new ArrayList<>();
sources.add( "http://boofcv.org/notwiki/largefiles/nin_imagenet.zip" );
ClassifierAndSource ret = new ClassifierAndSource();
ret.data0 = new ImageClassifierNiNImageNet();
ret.data1 = sources;
return ret;
} | java | public static ClassifierAndSource nin_imagenet() {
List<String> sources = new ArrayList<>();
sources.add( "http://boofcv.org/notwiki/largefiles/nin_imagenet.zip" );
ClassifierAndSource ret = new ClassifierAndSource();
ret.data0 = new ImageClassifierNiNImageNet();
ret.data1 = sources;
return ret;
} | [
"public",
"static",
"ClassifierAndSource",
"nin_imagenet",
"(",
")",
"{",
"List",
"<",
"String",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"sources",
".",
"add",
"(",
"\"http://boofcv.org/notwiki/largefiles/nin_imagenet.zip\"",
")",
";",
"Class... | NIN trained on ImageNet data
@see ImageClassifierNiNImageNet
@return The classifier and where to download the model | [
"NIN",
"trained",
"on",
"ImageNet",
"data"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/scene/FactoryImageClassifier.java#L60-L70 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/JavaRuntimeLauncher.java | JavaRuntimeLauncher.launch | public Exit launch( Class mainClass , String ...args ) {
jvmArgs = configureArguments(mainClass,args);
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(jvmArgs);
// If it exits too quickly it might not get any error messages if it crashes right away
... | java | public Exit launch( Class mainClass , String ...args ) {
jvmArgs = configureArguments(mainClass,args);
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(jvmArgs);
// If it exits too quickly it might not get any error messages if it crashes right away
... | [
"public",
"Exit",
"launch",
"(",
"Class",
"mainClass",
",",
"String",
"...",
"args",
")",
"{",
"jvmArgs",
"=",
"configureArguments",
"(",
"mainClass",
",",
"args",
")",
";",
"try",
"{",
"Runtime",
"rt",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
";",
... | Launches the class with the provided arguments. Blocks until the process stops.
@param mainClass Class
@param args it's arguments
@return true if successful or false if it ended on error | [
"Launches",
"the",
"class",
"with",
"the",
"provided",
"arguments",
".",
"Blocks",
"until",
"the",
"process",
"stops",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/JavaRuntimeLauncher.java#L106-L137 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/JavaRuntimeLauncher.java | JavaRuntimeLauncher.monitorSlave | private boolean monitorSlave(Process pr,
BufferedReader input, BufferedReader error)
throws IOException, InterruptedException {
// flush the input buffer
System.in.skip(System.in.available());
// If the total amount of time allocated to the slave ex... | java | private boolean monitorSlave(Process pr,
BufferedReader input, BufferedReader error)
throws IOException, InterruptedException {
// flush the input buffer
System.in.skip(System.in.available());
// If the total amount of time allocated to the slave ex... | [
"private",
"boolean",
"monitorSlave",
"(",
"Process",
"pr",
",",
"BufferedReader",
"input",
",",
"BufferedReader",
"error",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// flush the input buffer",
"System",
".",
"in",
".",
"skip",
"(",
"System",
... | Prints printOut the standard printOut and error from the slave and checks its health. Exits if
the slave has finished or is declared frozen.
@return true if successful or false if it was forced to kill the slave because it was frozen | [
"Prints",
"printOut",
"the",
"standard",
"printOut",
"and",
"error",
"from",
"the",
"slave",
"and",
"checks",
"its",
"health",
".",
"Exits",
"if",
"the",
"slave",
"has",
"finished",
"or",
"is",
"declared",
"frozen",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/JavaRuntimeLauncher.java#L145-L210 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java | DescribeDenseHogAlg.computeWeightBlockPixels | protected void computeWeightBlockPixels() {
int rows = cellsPerBlockY*pixelsPerCell;
int cols = cellsPerBlockX*pixelsPerCell;
weights = new double[ rows*cols ];
double offsetRow=0,offsetCol=0;
int radiusRow=rows/2,radiusCol=cols/2;
if( rows%2 == 0 ) {
offsetRow = 0.5;
}
if( cols%2 == 0 ) {
offs... | java | protected void computeWeightBlockPixels() {
int rows = cellsPerBlockY*pixelsPerCell;
int cols = cellsPerBlockX*pixelsPerCell;
weights = new double[ rows*cols ];
double offsetRow=0,offsetCol=0;
int radiusRow=rows/2,radiusCol=cols/2;
if( rows%2 == 0 ) {
offsetRow = 0.5;
}
if( cols%2 == 0 ) {
offs... | [
"protected",
"void",
"computeWeightBlockPixels",
"(",
")",
"{",
"int",
"rows",
"=",
"cellsPerBlockY",
"*",
"pixelsPerCell",
";",
"int",
"cols",
"=",
"cellsPerBlockX",
"*",
"pixelsPerCell",
";",
"weights",
"=",
"new",
"double",
"[",
"rows",
"*",
"cols",
"]",
... | Compute gaussian weights applied to each pixel in the block | [
"Compute",
"gaussian",
"weights",
"applied",
"to",
"each",
"pixel",
"in",
"the",
"block"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java#L121-L161 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java | DescribeDenseHogAlg.computePixelFeatures | private void computePixelFeatures() {
for (int y = 0; y < derivX.height; y++) {
int pixelIndex = y*derivX.width;
int endIndex = pixelIndex+derivX.width;
for (; pixelIndex < endIndex; pixelIndex++ ) {
float dx = derivX.data[pixelIndex];
float dy = derivY.data[pixelIndex];
// angle from 0 to pi ra... | java | private void computePixelFeatures() {
for (int y = 0; y < derivX.height; y++) {
int pixelIndex = y*derivX.width;
int endIndex = pixelIndex+derivX.width;
for (; pixelIndex < endIndex; pixelIndex++ ) {
float dx = derivX.data[pixelIndex];
float dy = derivY.data[pixelIndex];
// angle from 0 to pi ra... | [
"private",
"void",
"computePixelFeatures",
"(",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"derivX",
".",
"height",
";",
"y",
"++",
")",
"{",
"int",
"pixelIndex",
"=",
"y",
"*",
"derivX",
".",
"width",
";",
"int",
"endIndex",
"=",
... | Computes the orientation and magnitude of each pixel | [
"Computes",
"the",
"orientation",
"and",
"magnitude",
"of",
"each",
"pixel"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java#L179-L193 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java | DescribeDenseHogAlg.addToHistogram | void addToHistogram(int cellX, int cellY, int orientationIndex, double magnitude) {
// see if it's being applied to a valid cell in the histogram
if( cellX < 0 || cellX >= cellsPerBlockX)
return;
if( cellY < 0 || cellY >= cellsPerBlockY)
return;
int index = (cellY*cellsPerBlockX + cellX)*orientationBins ... | java | void addToHistogram(int cellX, int cellY, int orientationIndex, double magnitude) {
// see if it's being applied to a valid cell in the histogram
if( cellX < 0 || cellX >= cellsPerBlockX)
return;
if( cellY < 0 || cellY >= cellsPerBlockY)
return;
int index = (cellY*cellsPerBlockX + cellX)*orientationBins ... | [
"void",
"addToHistogram",
"(",
"int",
"cellX",
",",
"int",
"cellY",
",",
"int",
"orientationIndex",
",",
"double",
"magnitude",
")",
"{",
"// see if it's being applied to a valid cell in the histogram",
"if",
"(",
"cellX",
"<",
"0",
"||",
"cellX",
">=",
"cellsPerBlo... | Adds the magnitude to the histogram at the specified cell and orientation
@param cellX cell coordinate
@param cellY cell coordinate
@param orientationIndex orientation coordinate
@param magnitude edge magnitude | [
"Adds",
"the",
"magnitude",
"to",
"the",
"histogram",
"at",
"the",
"specified",
"cell",
"and",
"orientation"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogAlg.java#L330-L339 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java | Interpolate1D_F32.setInput | public void setInput(float x[], float y[], int size) {
if (x.length < size || y.length < size) {
throw new IllegalArgumentException("Arrays too small for size.");
}
if (size < M) {
throw new IllegalArgumentException("Not enough data points for M");
}
this.x = x;
this.y = y;
this.size = size;
this... | java | public void setInput(float x[], float y[], int size) {
if (x.length < size || y.length < size) {
throw new IllegalArgumentException("Arrays too small for size.");
}
if (size < M) {
throw new IllegalArgumentException("Not enough data points for M");
}
this.x = x;
this.y = y;
this.size = size;
this... | [
"public",
"void",
"setInput",
"(",
"float",
"x",
"[",
"]",
",",
"float",
"y",
"[",
"]",
",",
"int",
"size",
")",
"{",
"if",
"(",
"x",
".",
"length",
"<",
"size",
"||",
"y",
".",
"length",
"<",
"size",
")",
"{",
"throw",
"new",
"IllegalArgumentExc... | Sets the data that is being interpolated.
@param x Where the points are sample at. Not modifed. Reference saved.
@param y The value at the sample points. Not modifed. Reference saved.
@param size The number of points used. | [
"Sets",
"the",
"data",
"that",
"is",
"being",
"interpolated",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java#L80-L93 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java | Interpolate1D_F32.process | public float process(float testX) {
if (doHunt) {
hunt(testX);
} else {
bisectionSearch(testX, 0, size - 1);
}
return compute(testX);
} | java | public float process(float testX) {
if (doHunt) {
hunt(testX);
} else {
bisectionSearch(testX, 0, size - 1);
}
return compute(testX);
} | [
"public",
"float",
"process",
"(",
"float",
"testX",
")",
"{",
"if",
"(",
"doHunt",
")",
"{",
"hunt",
"(",
"testX",
")",
";",
"}",
"else",
"{",
"bisectionSearch",
"(",
"testX",
",",
"0",
",",
"size",
"-",
"1",
")",
";",
"}",
"return",
"compute",
... | Performs interpolation at the sample point.
@param testX Where the interpolated value is done at.
@return The interpolated value at sampleX. | [
"Performs",
"interpolation",
"at",
"the",
"sample",
"point",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java#L101-L109 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java | Interpolate1D_F32.hunt | protected void hunt(float val) {
int lowerLimit = center;
int upperLimit;
int inc = 1;
if (val >= x[lowerLimit] && ascend) {
// hunt up
for (; ; ) {
upperLimit = lowerLimit + inc;
// see if it is outside the table
if (upperLimit >= size - 1) {
upperLimit = size - 1;
break;
} els... | java | protected void hunt(float val) {
int lowerLimit = center;
int upperLimit;
int inc = 1;
if (val >= x[lowerLimit] && ascend) {
// hunt up
for (; ; ) {
upperLimit = lowerLimit + inc;
// see if it is outside the table
if (upperLimit >= size - 1) {
upperLimit = size - 1;
break;
} els... | [
"protected",
"void",
"hunt",
"(",
"float",
"val",
")",
"{",
"int",
"lowerLimit",
"=",
"center",
";",
"int",
"upperLimit",
";",
"int",
"inc",
"=",
"1",
";",
"if",
"(",
"val",
">=",
"x",
"[",
"lowerLimit",
"]",
"&&",
"ascend",
")",
"{",
"// hunt up",
... | To speed up finding the appropriate indexes to use in the interpolation it can use its
previous results to search a smaller region than it would otherwise.
@param val The value that is to be interpolated. | [
"To",
"speed",
"up",
"finding",
"the",
"appropriate",
"indexes",
"to",
"use",
"in",
"the",
"interpolation",
"it",
"can",
"use",
"its",
"previous",
"results",
"to",
"search",
"a",
"smaller",
"region",
"than",
"it",
"would",
"otherwise",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java#L150-L188 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Naive.java | GradientSobel_Naive.process | public static void process( GrayI orig,
GrayI derivX,
GrayI derivY) {
final int width = orig.getWidth();
final int height = orig.getHeight();
for (int y = 1; y < height - 1; y++) {
for (int x = 1; x < width - 1; x++) {
int dy = -(orig.get(x - 1, y - 1) + 2 * orig.get(x, y - 1) + orig.get... | java | public static void process( GrayI orig,
GrayI derivX,
GrayI derivY) {
final int width = orig.getWidth();
final int height = orig.getHeight();
for (int y = 1; y < height - 1; y++) {
for (int x = 1; x < width - 1; x++) {
int dy = -(orig.get(x - 1, y - 1) + 2 * orig.get(x, y - 1) + orig.get... | [
"public",
"static",
"void",
"process",
"(",
"GrayI",
"orig",
",",
"GrayI",
"derivX",
",",
"GrayI",
"derivY",
")",
"{",
"final",
"int",
"width",
"=",
"orig",
".",
"getWidth",
"(",
")",
";",
"final",
"int",
"height",
"=",
"orig",
".",
"getHeight",
"(",
... | Computes the derivative of 'orig' along the x and y axes | [
"Computes",
"the",
"derivative",
"of",
"orig",
"along",
"the",
"x",
"and",
"y",
"axes"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/impl/GradientSobel_Naive.java#L42-L63 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentSuperpixels.java | ExampleSegmentSuperpixels.performSegmentation | public static <T extends ImageBase<T>>
void performSegmentation( ImageSuperpixels<T> alg , T color )
{
// Segmentation often works better after blurring the image. Reduces high frequency image components which
// can cause over segmentation
GBlurImageOps.gaussian(color, color, 0.5, -1, null);
// Storage for... | java | public static <T extends ImageBase<T>>
void performSegmentation( ImageSuperpixels<T> alg , T color )
{
// Segmentation often works better after blurring the image. Reduces high frequency image components which
// can cause over segmentation
GBlurImageOps.gaussian(color, color, 0.5, -1, null);
// Storage for... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"performSegmentation",
"(",
"ImageSuperpixels",
"<",
"T",
">",
"alg",
",",
"T",
"color",
")",
"{",
"// Segmentation often works better after blurring the image. Reduces high frequency ima... | Segments and visualizes the image | [
"Segments",
"and",
"visualizes",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentSuperpixels.java#L53-L69 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentSuperpixels.java | ExampleSegmentSuperpixels.visualize | public static <T extends ImageBase<T>>
void visualize(GrayS32 pixelToRegion , T color , int numSegments )
{
// Computes the mean color inside each region
ImageType<T> type = color.getImageType();
ComputeRegionMeanColor<T> colorize = FactorySegmentationAlg.regionMeanColor(type);
FastQueue<float[]> segmentCol... | java | public static <T extends ImageBase<T>>
void visualize(GrayS32 pixelToRegion , T color , int numSegments )
{
// Computes the mean color inside each region
ImageType<T> type = color.getImageType();
ComputeRegionMeanColor<T> colorize = FactorySegmentationAlg.regionMeanColor(type);
FastQueue<float[]> segmentCol... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"visualize",
"(",
"GrayS32",
"pixelToRegion",
",",
"T",
"color",
",",
"int",
"numSegments",
")",
"{",
"// Computes the mean color inside each region",
"ImageType",
"<",
"T",
">",
... | Visualizes results three ways. 1) Colorized segmented image where each region is given a random color.
2) Each pixel is assigned the mean color through out the region. 3) Black pixels represent the border
between regions. | [
"Visualizes",
"results",
"three",
"ways",
".",
"1",
")",
"Colorized",
"segmented",
"image",
"where",
"each",
"region",
"is",
"given",
"a",
"random",
"color",
".",
"2",
")",
"Each",
"pixel",
"is",
"assigned",
"the",
"mean",
"color",
"through",
"out",
"the",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/segmentation/ExampleSegmentSuperpixels.java#L76-L108 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java | ExampleStereoDisparity.denseDisparity | public static GrayU8 denseDisparity(GrayU8 rectLeft , GrayU8 rectRight ,
int regionSize,
int minDisparity , int maxDisparity )
{
// A slower but more accuracy algorithm is selected
// All of these parameters should be turned
StereoDisparity<GrayU8,GrayU8> disparityAlg =
FactoryStereoDispa... | java | public static GrayU8 denseDisparity(GrayU8 rectLeft , GrayU8 rectRight ,
int regionSize,
int minDisparity , int maxDisparity )
{
// A slower but more accuracy algorithm is selected
// All of these parameters should be turned
StereoDisparity<GrayU8,GrayU8> disparityAlg =
FactoryStereoDispa... | [
"public",
"static",
"GrayU8",
"denseDisparity",
"(",
"GrayU8",
"rectLeft",
",",
"GrayU8",
"rectRight",
",",
"int",
"regionSize",
",",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
")",
"{",
"// A slower but more accuracy algorithm is selected",
"// All of these param... | Computes the dense disparity between between two stereo images. The input images
must be rectified with lens distortion removed to work! Floating point images
are also supported.
@param rectLeft Rectified left camera image
@param rectRight Rectified right camera image
@param regionSize Radius of region being matched... | [
"Computes",
"the",
"dense",
"disparity",
"between",
"between",
"two",
"stereo",
"images",
".",
"The",
"input",
"images",
"must",
"be",
"rectified",
"with",
"lens",
"distortion",
"removed",
"to",
"work!",
"Floating",
"point",
"images",
"are",
"also",
"supported",... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java#L74-L88 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java | ExampleStereoDisparity.denseDisparitySubpixel | public static GrayF32 denseDisparitySubpixel(GrayU8 rectLeft , GrayU8 rectRight ,
int regionSize ,
int minDisparity , int maxDisparity )
{
// A slower but more accuracy algorithm is selected
// All of these parameters should be turned
StereoDisparity<GrayU8,GrayF32> disparityAlg =
F... | java | public static GrayF32 denseDisparitySubpixel(GrayU8 rectLeft , GrayU8 rectRight ,
int regionSize ,
int minDisparity , int maxDisparity )
{
// A slower but more accuracy algorithm is selected
// All of these parameters should be turned
StereoDisparity<GrayU8,GrayF32> disparityAlg =
F... | [
"public",
"static",
"GrayF32",
"denseDisparitySubpixel",
"(",
"GrayU8",
"rectLeft",
",",
"GrayU8",
"rectRight",
",",
"int",
"regionSize",
",",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
")",
"{",
"// A slower but more accuracy algorithm is selected",
"// All of th... | Same as above, but compute disparity to within sub-pixel accuracy. The difference between the
two is more apparent when a 3D point cloud is computed. | [
"Same",
"as",
"above",
"but",
"compute",
"disparity",
"to",
"within",
"sub",
"-",
"pixel",
"accuracy",
".",
"The",
"difference",
"between",
"the",
"two",
"is",
"more",
"apparent",
"when",
"a",
"3D",
"point",
"cloud",
"is",
"computed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java#L94-L108 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java | ExampleStereoDisparity.rectify | public static RectifyCalibrated rectify(GrayU8 origLeft , GrayU8 origRight ,
StereoParameters param ,
GrayU8 rectLeft , GrayU8 rectRight )
{
// Compute rectification
RectifyCalibrated rectifyAlg = RectifyImageOps.createCalibrated();
Se3_F64 leftToRight = param.getRightToLeft().invert(null);... | java | public static RectifyCalibrated rectify(GrayU8 origLeft , GrayU8 origRight ,
StereoParameters param ,
GrayU8 rectLeft , GrayU8 rectRight )
{
// Compute rectification
RectifyCalibrated rectifyAlg = RectifyImageOps.createCalibrated();
Se3_F64 leftToRight = param.getRightToLeft().invert(null);... | [
"public",
"static",
"RectifyCalibrated",
"rectify",
"(",
"GrayU8",
"origLeft",
",",
"GrayU8",
"origRight",
",",
"StereoParameters",
"param",
",",
"GrayU8",
"rectLeft",
",",
"GrayU8",
"rectRight",
")",
"{",
"// Compute rectification",
"RectifyCalibrated",
"rectifyAlg",
... | Rectified the input images using known calibration. | [
"Rectified",
"the",
"input",
"images",
"using",
"known",
"calibration",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleStereoDisparity.java#L113-L151 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.isRangeSet | public boolean isRangeSet() {
for (int i = 0; i < getDimensions(); i++) {
if( valueMin[i] == 0 && valueMax[i] == 0 ) {
return false;
}
}
return true;
} | java | public boolean isRangeSet() {
for (int i = 0; i < getDimensions(); i++) {
if( valueMin[i] == 0 && valueMax[i] == 0 ) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"isRangeSet",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getDimensions",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"valueMin",
"[",
"i",
"]",
"==",
"0",
"&&",
"valueMax",
"[",
"i",
"]",
"==",
"0... | Returns true if the min and max value for each dimension has been set
@return true if range has been set | [
"Returns",
"true",
"if",
"the",
"min",
"and",
"max",
"value",
"for",
"each",
"dimension",
"has",
"been",
"set"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L81-L89 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.setRange | public void setRange( int dimension , double min , double max ) {
valueMin[dimension] = min;
valueMax[dimension] = max;
} | java | public void setRange( int dimension , double min , double max ) {
valueMin[dimension] = min;
valueMax[dimension] = max;
} | [
"public",
"void",
"setRange",
"(",
"int",
"dimension",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"valueMin",
"[",
"dimension",
"]",
"=",
"min",
";",
"valueMax",
"[",
"dimension",
"]",
"=",
"max",
";",
"}"
] | Specifies the minimum and maximum values for a specific dimension
@param dimension Which dimension
@param min The minimum value
@param max The maximum value | [
"Specifies",
"the",
"minimum",
"and",
"maximum",
"values",
"for",
"a",
"specific",
"dimension"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L115-L118 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.getDimensionIndex | public int getDimensionIndex( int dimension , int value ) {
double min = valueMin[dimension];
double max = valueMax[dimension];
double fraction = ((value-min)/(max-min+1.0));
return (int)(fraction*length[dimension]);
} | java | public int getDimensionIndex( int dimension , int value ) {
double min = valueMin[dimension];
double max = valueMax[dimension];
double fraction = ((value-min)/(max-min+1.0));
return (int)(fraction*length[dimension]);
} | [
"public",
"int",
"getDimensionIndex",
"(",
"int",
"dimension",
",",
"int",
"value",
")",
"{",
"double",
"min",
"=",
"valueMin",
"[",
"dimension",
"]",
";",
"double",
"max",
"=",
"valueMax",
"[",
"dimension",
"]",
";",
"double",
"fraction",
"=",
"(",
"(",... | Given a value it returns the corresponding bin index in this histogram for integer values. The discretion
is taken in account and 1 is added to the range.
@param dimension Which dimension the value belongs to
@param value Floating point value between min and max, inclusive.
@return The index/bin | [
"Given",
"a",
"value",
"it",
"returns",
"the",
"corresponding",
"bin",
"index",
"in",
"this",
"histogram",
"for",
"integer",
"values",
".",
"The",
"discretion",
"is",
"taken",
"in",
"account",
"and",
"1",
"is",
"added",
"to",
"the",
"range",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L184-L190 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.getIndex | public final int getIndex( int coordinate[] ) {
int index = coordinate[0]*strides[0];
for (int i = 1; i < coordinate.length; i++) {
index += strides[i]*coordinate[i];
}
return index;
} | java | public final int getIndex( int coordinate[] ) {
int index = coordinate[0]*strides[0];
for (int i = 1; i < coordinate.length; i++) {
index += strides[i]*coordinate[i];
}
return index;
} | [
"public",
"final",
"int",
"getIndex",
"(",
"int",
"coordinate",
"[",
"]",
")",
"{",
"int",
"index",
"=",
"coordinate",
"[",
"0",
"]",
"*",
"strides",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"coordinate",
".",
"length"... | For a N-Dimensional histogram it will return the array index for the N-D coordinate
@param coordinate N-D coordinate
@return index | [
"For",
"a",
"N",
"-",
"Dimensional",
"histogram",
"it",
"will",
"return",
"the",
"array",
"index",
"for",
"the",
"N",
"-",
"D",
"coordinate"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L219-L226 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.copy | public Histogram_F64 copy() {
Histogram_F64 out = newInstance();
System.arraycopy(value,0,out.value,0,length.length);
return out;
} | java | public Histogram_F64 copy() {
Histogram_F64 out = newInstance();
System.arraycopy(value,0,out.value,0,length.length);
return out;
} | [
"public",
"Histogram_F64",
"copy",
"(",
")",
"{",
"Histogram_F64",
"out",
"=",
"newInstance",
"(",
")",
";",
"System",
".",
"arraycopy",
"(",
"value",
",",
"0",
",",
"out",
".",
"value",
",",
"0",
",",
"length",
".",
"length",
")",
";",
"return",
"ou... | Creates an exact copy of "this" histogram | [
"Creates",
"an",
"exact",
"copy",
"of",
"this",
"histogram"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L261-L267 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java | RefinePolygonToGrayLine.refine | @Override
public boolean refine(Polygon2D_F64 input, Polygon2D_F64 output)
{
if( input.size() != output.size())
throw new IllegalArgumentException("Input and output sides do not match. "+input.size()+" "+output.size());
// sanity check input. If it's too small this algorithm won't work
if( checkShapeTooSma... | java | @Override
public boolean refine(Polygon2D_F64 input, Polygon2D_F64 output)
{
if( input.size() != output.size())
throw new IllegalArgumentException("Input and output sides do not match. "+input.size()+" "+output.size());
// sanity check input. If it's too small this algorithm won't work
if( checkShapeTooSma... | [
"@",
"Override",
"public",
"boolean",
"refine",
"(",
"Polygon2D_F64",
"input",
",",
"Polygon2D_F64",
"output",
")",
"{",
"if",
"(",
"input",
".",
"size",
"(",
")",
"!=",
"output",
".",
"size",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",... | Refines the fit a polygon by snapping it to the edges.
@param input (input) Initial estimate for the polygon. CW or CCW ordering doesn't matter.
@param output (output) the fitted polygon | [
"Refines",
"the",
"fit",
"a",
"polygon",
"by",
"snapping",
"it",
"to",
"the",
"edges",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java#L144-L164 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java | RefinePolygonToGrayLine.checkShapeTooSmall | private boolean checkShapeTooSmall(Polygon2D_F64 input) {
// must be longer than the border plus some small fudge factor
double minLength = cornerOffset*2 + 2;
for (int i = 0; i < input.size(); i++) {
int j = (i+1)%input.size();
Point2D_F64 a = input.get(i);
Point2D_F64 b = input.get(j);
if( a.distanc... | java | private boolean checkShapeTooSmall(Polygon2D_F64 input) {
// must be longer than the border plus some small fudge factor
double minLength = cornerOffset*2 + 2;
for (int i = 0; i < input.size(); i++) {
int j = (i+1)%input.size();
Point2D_F64 a = input.get(i);
Point2D_F64 b = input.get(j);
if( a.distanc... | [
"private",
"boolean",
"checkShapeTooSmall",
"(",
"Polygon2D_F64",
"input",
")",
"{",
"// must be longer than the border plus some small fudge factor",
"double",
"minLength",
"=",
"cornerOffset",
"*",
"2",
"+",
"2",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Looks at the distance between each vertex. If that distance is so small the edge can't be measured the
return true.
@param input polygon
@return true if too small or false if not | [
"Looks",
"at",
"the",
"distance",
"between",
"each",
"vertex",
".",
"If",
"that",
"distance",
"is",
"so",
"small",
"the",
"edge",
"can",
"t",
"be",
"measured",
"the",
"return",
"true",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java#L172-L184 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java | RefinePolygonToGrayLine.optimize | protected boolean optimize(Polygon2D_F64 seed , Polygon2D_F64 current ) {
previous.set(seed);
// pixels squares is faster to compute
double convergeTol = convergeTolPixels*convergeTolPixels;
// initialize the lines since they are used to check for corner divergence
for (int i = 0; i < seed.size(); i++) {
... | java | protected boolean optimize(Polygon2D_F64 seed , Polygon2D_F64 current ) {
previous.set(seed);
// pixels squares is faster to compute
double convergeTol = convergeTolPixels*convergeTolPixels;
// initialize the lines since they are used to check for corner divergence
for (int i = 0; i < seed.size(); i++) {
... | [
"protected",
"boolean",
"optimize",
"(",
"Polygon2D_F64",
"seed",
",",
"Polygon2D_F64",
"current",
")",
"{",
"previous",
".",
"set",
"(",
"seed",
")",
";",
"// pixels squares is faster to compute",
"double",
"convergeTol",
"=",
"convergeTolPixels",
"*",
"convergeTolPi... | Refines the initial line estimates using EM. The number of iterations is fixed. | [
"Refines",
"the",
"initial",
"line",
"estimates",
"using",
"EM",
".",
"The",
"number",
"of",
"iterations",
"is",
"fixed",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java#L189-L261 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java | RefinePolygonToGrayLine.optimize | protected boolean optimize( Point2D_F64 a , Point2D_F64 b , LineGeneral2D_F64 found ) {
computeAdjustedEndPoints(a, b);
return snapToEdge.refine(adjA, adjB, found);
} | java | protected boolean optimize( Point2D_F64 a , Point2D_F64 b , LineGeneral2D_F64 found ) {
computeAdjustedEndPoints(a, b);
return snapToEdge.refine(adjA, adjB, found);
} | [
"protected",
"boolean",
"optimize",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"LineGeneral2D_F64",
"found",
")",
"{",
"computeAdjustedEndPoints",
"(",
"a",
",",
"b",
")",
";",
"return",
"snapToEdge",
".",
"refine",
"(",
"adjA",
",",
"adjB",
",",... | Fits a line defined by the two points. When fitting the line the weight of the edge is used to determine
how influential the point is
@param a Corner point in image coordinates.
@param b Corner point in image coordinates.
@param found (output) Line in image coordinates
@return true if successful or false if it failed | [
"Fits",
"a",
"line",
"defined",
"by",
"the",
"two",
"points",
".",
"When",
"fitting",
"the",
"line",
"the",
"weight",
"of",
"the",
"edge",
"is",
"used",
"to",
"determine",
"how",
"influential",
"the",
"point",
"is"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/RefinePolygonToGrayLine.java#L271-L276 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeRegions.java | VisualizeRegions.watersheds | public static BufferedImage watersheds(GrayS32 segments , BufferedImage output , int radius ) {
if( output == null )
output = new BufferedImage(segments.width,segments.height,BufferedImage.TYPE_INT_RGB);
if( radius <= 0 ) {
for (int y = 0; y < segments.height; y++) {
for (int x = 0; x < segments.width; x... | java | public static BufferedImage watersheds(GrayS32 segments , BufferedImage output , int radius ) {
if( output == null )
output = new BufferedImage(segments.width,segments.height,BufferedImage.TYPE_INT_RGB);
if( radius <= 0 ) {
for (int y = 0; y < segments.height; y++) {
for (int x = 0; x < segments.width; x... | [
"public",
"static",
"BufferedImage",
"watersheds",
"(",
"GrayS32",
"segments",
",",
"BufferedImage",
"output",
",",
"int",
"radius",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"BufferedImage",
"(",
"segments",
".",
"width",
",",
... | Sets the pixels of each watershed as red in the output image. Watersheds have a value of 0
@param segments Conversion from pixel to region
@param output Storage for output image. Can be null.
@param radius Thickness of watershed. 0 is 1 pixel wide. 1 is 3 pixels wide.
@return Output image. | [
"Sets",
"the",
"pixels",
"of",
"each",
"watershed",
"as",
"red",
"in",
"the",
"output",
"image",
".",
"Watersheds",
"have",
"a",
"value",
"of",
"0"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeRegions.java#L43-L76 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeRegions.java | VisualizeRegions.regions | public static BufferedImage regions(GrayS32 pixelToRegion , int numRegions , BufferedImage output ) {
return VisualizeBinaryData.renderLabeled(pixelToRegion,numRegions,output);
} | java | public static BufferedImage regions(GrayS32 pixelToRegion , int numRegions , BufferedImage output ) {
return VisualizeBinaryData.renderLabeled(pixelToRegion,numRegions,output);
} | [
"public",
"static",
"BufferedImage",
"regions",
"(",
"GrayS32",
"pixelToRegion",
",",
"int",
"numRegions",
",",
"BufferedImage",
"output",
")",
"{",
"return",
"VisualizeBinaryData",
".",
"renderLabeled",
"(",
"pixelToRegion",
",",
"numRegions",
",",
"output",
")",
... | Draws each region with a random color
@param pixelToRegion Conversion from pixel to region
@param numRegions Total number of regions.
@param output Storage for output image. Can be null.
@return Output image. | [
"Draws",
"each",
"region",
"with",
"a",
"random",
"color"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/feature/VisualizeRegions.java#L85-L87 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/brief/FactoryBriefDefinition.java | FactoryBriefDefinition.randomGaussian | private static void randomGaussian( Random rand , double sigma , int radius , Point2D_I32 pt ) {
int x,y;
while( true ) {
x = (int)(rand.nextGaussian()*sigma);
y = (int)(rand.nextGaussian()*sigma);
if( Math.sqrt(x*x + y*y) < radius )
break;
}
pt.set(x,y);
} | java | private static void randomGaussian( Random rand , double sigma , int radius , Point2D_I32 pt ) {
int x,y;
while( true ) {
x = (int)(rand.nextGaussian()*sigma);
y = (int)(rand.nextGaussian()*sigma);
if( Math.sqrt(x*x + y*y) < radius )
break;
}
pt.set(x,y);
} | [
"private",
"static",
"void",
"randomGaussian",
"(",
"Random",
"rand",
",",
"double",
"sigma",
",",
"int",
"radius",
",",
"Point2D_I32",
"pt",
")",
"{",
"int",
"x",
",",
"y",
";",
"while",
"(",
"true",
")",
"{",
"x",
"=",
"(",
"int",
")",
"(",
"rand... | Randomly selects a point which is inside a square region using a Gaussian distribution. | [
"Randomly",
"selects",
"a",
"point",
"which",
"is",
"inside",
"a",
"square",
"region",
"using",
"a",
"Gaussian",
"distribution",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/brief/FactoryBriefDefinition.java#L73-L85 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/transform/pyramid/FactoryPyramid.java | FactoryPyramid.discreteGaussian | public static <T extends ImageBase<T>>
PyramidDiscrete<T> discreteGaussian( int[] scaleFactors , double sigma , int radius ,
boolean saveOriginalReference, ImageType<T> imageType )
{
Class<Kernel1D> kernelType = FactoryKernel.getKernelType(imageType.getDataType(),1);
Kernel1D kernel = FactoryKernelGau... | java | public static <T extends ImageBase<T>>
PyramidDiscrete<T> discreteGaussian( int[] scaleFactors , double sigma , int radius ,
boolean saveOriginalReference, ImageType<T> imageType )
{
Class<Kernel1D> kernelType = FactoryKernel.getKernelType(imageType.getDataType(),1);
Kernel1D kernel = FactoryKernelGau... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"PyramidDiscrete",
"<",
"T",
">",
"discreteGaussian",
"(",
"int",
"[",
"]",
"scaleFactors",
",",
"double",
"sigma",
",",
"int",
"radius",
",",
"boolean",
"saveOriginalReference",
",",
... | Creates an updater for discrete pyramids where a Gaussian is convolved across the input
prior to sub-sampling.
@param imageType Type of input image.
@param sigma Gaussian sigma. If < 0 then a sigma is selected using the radius. Try -1.
@param radius Radius of the Gaussian kernel. If < 0 then the radius is selected ... | [
"Creates",
"an",
"updater",
"for",
"discrete",
"pyramids",
"where",
"a",
"Gaussian",
"is",
"convolved",
"across",
"the",
"input",
"prior",
"to",
"sub",
"-",
"sampling",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/pyramid/FactoryPyramid.java#L52-L61 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/transform/pyramid/FactoryPyramid.java | FactoryPyramid.floatGaussian | public static <T extends ImageGray<T>>
PyramidFloat<T> floatGaussian( double scaleFactors[], double []sigmas , Class<T> imageType ) {
InterpolatePixelS<T> interp = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
return new PyramidFloatGaussianScale<>(interp, scaleFactors, sigmas, imageType);... | java | public static <T extends ImageGray<T>>
PyramidFloat<T> floatGaussian( double scaleFactors[], double []sigmas , Class<T> imageType ) {
InterpolatePixelS<T> interp = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);
return new PyramidFloatGaussianScale<>(interp, scaleFactors, sigmas, imageType);... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"PyramidFloat",
"<",
"T",
">",
"floatGaussian",
"(",
"double",
"scaleFactors",
"[",
"]",
",",
"double",
"[",
"]",
"sigmas",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
... | Creates a float pyramid where each layer is blurred using a Gaussian with the specified
sigma. Bilinear interpolation is used when sub-sampling.
@param scaleFactors The scale factor of each layer relative to the previous layer.
Layer 0 is relative to the input image.
@param sigmas Gaussian blur magnitude for each lay... | [
"Creates",
"a",
"float",
"pyramid",
"where",
"each",
"layer",
"is",
"blurred",
"using",
"a",
"Gaussian",
"with",
"the",
"specified",
"sigma",
".",
"Bilinear",
"interpolation",
"is",
"used",
"when",
"sub",
"-",
"sampling",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/transform/pyramid/FactoryPyramid.java#L73-L79 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java | LagrangeFormula.process_F64 | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
double result = 0;
for (int i = i0; i <= i1; i++) {
double numerator = 1.0;
for (int j = i0; j <= i1; j++) {
if (i != j)
numerator *= sample - x[j];
}
double denominator = 1.0;
double a = x[i];
... | java | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
double result = 0;
for (int i = i0; i <= i1; i++) {
double numerator = 1.0;
for (int j = i0; j <= i1; j++) {
if (i != j)
numerator *= sample - x[j];
}
double denominator = 1.0;
double a = x[i];
... | [
"public",
"static",
"double",
"process_F64",
"(",
"double",
"sample",
",",
"double",
"x",
"[",
"]",
",",
"double",
"y",
"[",
"]",
",",
"int",
"i0",
",",
"int",
"i1",
")",
"{",
"double",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"i0",
... | UsingLlangrange's formula it interpulates the value of a function at the specified sample
point given discrete samples. Which samples are used and the order of the approximation are
given by i0 and i1.
@param sample Where the estimate is done.
@param x Where the function was sampled.
@param y The function's value... | [
"UsingLlangrange",
"s",
"formula",
"it",
"interpulates",
"the",
"value",
"of",
"a",
"function",
"at",
"the",
"specified",
"sample",
"point",
"given",
"discrete",
"samples",
".",
"Which",
"samples",
"are",
"used",
"and",
"the",
"order",
"of",
"the",
"approximat... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java#L43-L67 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/d3/Polygon3DSequenceViewer.java | Polygon3DSequenceViewer.add | public void add( Color color , Point3D_F64... polygon ) {
final Poly p = new Poly(polygon.length,color);
for( int i = 0; i < polygon.length; i++ )
p.pts[i] = polygon[i].copy();
synchronized (polygons) {
polygons.add( p );
}
} | java | public void add( Color color , Point3D_F64... polygon ) {
final Poly p = new Poly(polygon.length,color);
for( int i = 0; i < polygon.length; i++ )
p.pts[i] = polygon[i].copy();
synchronized (polygons) {
polygons.add( p );
}
} | [
"public",
"void",
"add",
"(",
"Color",
"color",
",",
"Point3D_F64",
"...",
"polygon",
")",
"{",
"final",
"Poly",
"p",
"=",
"new",
"Poly",
"(",
"polygon",
".",
"length",
",",
"color",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pol... | Adds a polygon to the viewer. GUI Thread safe.
@param polygon shape being added | [
"Adds",
"a",
"polygon",
"to",
"the",
"viewer",
".",
"GUI",
"Thread",
"safe",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/d3/Polygon3DSequenceViewer.java#L108-L118 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.checkDeclare | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type )
return new BufferedImage(width,height,type);
if( image.getWidth() != width || image.getHeight() != height )
... | java | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type )
return new BufferedImage(width,height,type);
if( image.getWidth() != width || image.getHeight() != height )
... | [
"public",
"static",
"BufferedImage",
"checkDeclare",
"(",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"image",
",",
"int",
"type",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"return",
"new",
"BufferedImage",
"(",
"width",
",",
"height... | If the provided image does not have the same shape and same type a new one is declared and returned. | [
"If",
"the",
"provided",
"image",
"does",
"not",
"have",
"the",
"same",
"shape",
"and",
"same",
"type",
"a",
"new",
"one",
"is",
"declared",
"and",
"returned",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L43-L51 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.checkCopy | public static BufferedImage checkCopy( BufferedImage original , BufferedImage output ) {
ColorModel cm = original.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
if( output == null || original.getWidth() != output.getWidth() || original.getHeight() != output.getHeight() ||
original... | java | public static BufferedImage checkCopy( BufferedImage original , BufferedImage output ) {
ColorModel cm = original.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
if( output == null || original.getWidth() != output.getWidth() || original.getHeight() != output.getHeight() ||
original... | [
"public",
"static",
"BufferedImage",
"checkCopy",
"(",
"BufferedImage",
"original",
",",
"BufferedImage",
"output",
")",
"{",
"ColorModel",
"cm",
"=",
"original",
".",
"getColorModel",
"(",
")",
";",
"boolean",
"isAlphaPremultiplied",
"=",
"cm",
".",
"isAlphaPremu... | Copies the original image into the output image. If it can't do a copy a new image is created and returned
@param original Original image
@param output (Optional) Storage for copy.
@return The copied image. May be a new instance | [
"Copies",
"the",
"original",
"image",
"into",
"the",
"output",
"image",
".",
"If",
"it",
"can",
"t",
"do",
"a",
"copy",
"a",
"new",
"image",
"is",
"created",
"and",
"returned"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L79-L91 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.stripAlphaChannel | public static BufferedImage stripAlphaChannel( BufferedImage image ) {
int numBands = image.getRaster().getNumBands();
if( numBands == 4 ) {
BufferedImage output = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_RGB);
output.createGraphics().drawImage(image,0,0,null);
return ou... | java | public static BufferedImage stripAlphaChannel( BufferedImage image ) {
int numBands = image.getRaster().getNumBands();
if( numBands == 4 ) {
BufferedImage output = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_RGB);
output.createGraphics().drawImage(image,0,0,null);
return ou... | [
"public",
"static",
"BufferedImage",
"stripAlphaChannel",
"(",
"BufferedImage",
"image",
")",
"{",
"int",
"numBands",
"=",
"image",
".",
"getRaster",
"(",
")",
".",
"getNumBands",
"(",
")",
";",
"if",
"(",
"numBands",
"==",
"4",
")",
"{",
"BufferedImage",
... | Returns an image which doesn't have an alpha channel. If the input image doesn't have an alpha
channel to start then its returned as is. Otherwise a new image is created and the RGB channels are
copied and the new image returned.
@param image Input image
@return Image without an alpha channel | [
"Returns",
"an",
"image",
"which",
"doesn",
"t",
"have",
"an",
"alpha",
"channel",
".",
"If",
"the",
"input",
"image",
"doesn",
"t",
"have",
"an",
"alpha",
"channel",
"to",
"start",
"then",
"its",
"returned",
"as",
"is",
".",
"Otherwise",
"a",
"new",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L101-L111 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.extractInterleavedU8 | public static InterleavedU8 extractInterleavedU8(BufferedImage img) {
DataBuffer buffer = img.getRaster().getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
WritableRaster raster = img.getRaster();
InterleavedU8 ret = new InterleavedU8();
ret.width = img.getW... | java | public static InterleavedU8 extractInterleavedU8(BufferedImage img) {
DataBuffer buffer = img.getRaster().getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
WritableRaster raster = img.getRaster();
InterleavedU8 ret = new InterleavedU8();
ret.width = img.getW... | [
"public",
"static",
"InterleavedU8",
"extractInterleavedU8",
"(",
"BufferedImage",
"img",
")",
"{",
"DataBuffer",
"buffer",
"=",
"img",
".",
"getRaster",
"(",
")",
".",
"getDataBuffer",
"(",
")",
";",
"if",
"(",
"buffer",
".",
"getDataType",
"(",
")",
"==",
... | For BufferedImage stored as a byte array internally it extracts an
interleaved image. The input image and the returned image will both
share the same internal data array. Using this function allows unnecessary
memory copying to be avoided.
@param img Image whose internal data is extracted and wrapped.
@return An ima... | [
"For",
"BufferedImage",
"stored",
"as",
"a",
"byte",
"array",
"internally",
"it",
"extracts",
"an",
"interleaved",
"image",
".",
"The",
"input",
"image",
"and",
"the",
"returned",
"image",
"will",
"both",
"share",
"the",
"same",
"internal",
"data",
"array",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L122-L142 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.extractGrayU8 | public static GrayU8 extractGrayU8(BufferedImage img) {
WritableRaster raster = img.getRaster();
DataBuffer buffer = raster.getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
if (raster.getNumBands() != 1)
throw new IllegalArgumentException("Input image has mor... | java | public static GrayU8 extractGrayU8(BufferedImage img) {
WritableRaster raster = img.getRaster();
DataBuffer buffer = raster.getDataBuffer();
if (buffer.getDataType() == DataBuffer.TYPE_BYTE && isKnownByteFormat(img) ) {
if (raster.getNumBands() != 1)
throw new IllegalArgumentException("Input image has mor... | [
"public",
"static",
"GrayU8",
"extractGrayU8",
"(",
"BufferedImage",
"img",
")",
"{",
"WritableRaster",
"raster",
"=",
"img",
".",
"getRaster",
"(",
")",
";",
"DataBuffer",
"buffer",
"=",
"raster",
".",
"getDataBuffer",
"(",
")",
";",
"if",
"(",
"buffer",
... | For BufferedImage stored as a byte array internally it extracts an
image. The input image and the returned image will both
share the same internal data array. Using this function allows unnecessary
memory copying to be avoided.
@param img Image whose internal data is extracted and wrapped.
@return An image whose int... | [
"For",
"BufferedImage",
"stored",
"as",
"a",
"byte",
"array",
"internally",
"it",
"extracts",
"an",
"image",
".",
"The",
"input",
"image",
"and",
"the",
"returned",
"image",
"will",
"both",
"share",
"the",
"same",
"internal",
"data",
"array",
".",
"Using",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L153-L171 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFromSingle | public static <T extends ImageGray<T>> T convertFromSingle(BufferedImage src, T dst, Class<T> type) {
if (type == GrayU8.class) {
return (T) convertFrom(src, (GrayU8) dst);
} else if( GrayI16.class.isAssignableFrom(type) ) {
return (T) convertFrom(src, (GrayI16) dst,(Class)type);
} else if (type == GrayF32.... | java | public static <T extends ImageGray<T>> T convertFromSingle(BufferedImage src, T dst, Class<T> type) {
if (type == GrayU8.class) {
return (T) convertFrom(src, (GrayU8) dst);
} else if( GrayI16.class.isAssignableFrom(type) ) {
return (T) convertFrom(src, (GrayI16) dst,(Class)type);
} else if (type == GrayF32.... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"convertFromSingle",
"(",
"BufferedImage",
"src",
",",
"T",
"dst",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"GrayU8",
".",
"class",
")",
"... | Converts a buffered image into an image of the specified type. In a 'dst' image is provided
it will be used for output, otherwise a new image will be created. | [
"Converts",
"a",
"buffered",
"image",
"into",
"an",
"image",
"of",
"the",
"specified",
"type",
".",
"In",
"a",
"dst",
"image",
"is",
"provided",
"it",
"will",
"be",
"used",
"for",
"output",
"otherwise",
"a",
"new",
"image",
"will",
"be",
"created",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L343-L353 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertTo | public static BufferedImage convertTo(JComponent comp, BufferedImage storage) {
if (storage == null)
storage = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = storage.createGraphics();
comp.paintComponents(g2);
return storage;
} | java | public static BufferedImage convertTo(JComponent comp, BufferedImage storage) {
if (storage == null)
storage = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = storage.createGraphics();
comp.paintComponents(g2);
return storage;
} | [
"public",
"static",
"BufferedImage",
"convertTo",
"(",
"JComponent",
"comp",
",",
"BufferedImage",
"storage",
")",
"{",
"if",
"(",
"storage",
"==",
"null",
")",
"storage",
"=",
"new",
"BufferedImage",
"(",
"comp",
".",
"getWidth",
"(",
")",
",",
"comp",
".... | Draws the component into a BufferedImage.
@param comp The component being drawn into an image.
@param storage if not null the component is drawn into it, if null a new BufferedImage is created.
@return image of the component | [
"Draws",
"the",
"component",
"into",
"a",
"BufferedImage",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L915-L924 | train |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.orderBandsIntoBuffered | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )
return src;
Planar tmp = new Planar(src.type, src.getNumBands());
tmp.width = src.width;
tmp.height = src.height;
tmp.stride = src.stride;
tmp.... | java | public static Planar orderBandsIntoBuffered(Planar src, BufferedImage dst) {
// see if no change is required
if( dst.getType() == BufferedImage.TYPE_INT_RGB )
return src;
Planar tmp = new Planar(src.type, src.getNumBands());
tmp.width = src.width;
tmp.height = src.height;
tmp.stride = src.stride;
tmp.... | [
"public",
"static",
"Planar",
"orderBandsIntoBuffered",
"(",
"Planar",
"src",
",",
"BufferedImage",
"dst",
")",
"{",
"// see if no change is required",
"if",
"(",
"dst",
".",
"getType",
"(",
")",
"==",
"BufferedImage",
".",
"TYPE_INT_RGB",
")",
"return",
"src",
... | Returns a new image with the color bands in the appropriate ordering. The returned image will
reference the original image's image arrays. | [
"Returns",
"a",
"new",
"image",
"with",
"the",
"color",
"bands",
"in",
"the",
"appropriate",
"ordering",
".",
"The",
"returned",
"image",
"will",
"reference",
"the",
"original",
"image",
"s",
"image",
"arrays",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L930-L945 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java | DenoiseVisualizeApp.computeError | public static double computeError(GrayF32 imgA, GrayF32 imgB ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
double difference = Math.abs(imgA.get(x,y)-imgB.get(x,y));
total += difference;
}
}
... | java | public static double computeError(GrayF32 imgA, GrayF32 imgB ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
double difference = Math.abs(imgA.get(x,y)-imgB.get(x,y));
total += difference;
}
}
... | [
"public",
"static",
"double",
"computeError",
"(",
"GrayF32",
"imgA",
",",
"GrayF32",
"imgB",
")",
"{",
"final",
"int",
"h",
"=",
"imgA",
".",
"getHeight",
"(",
")",
";",
"final",
"int",
"w",
"=",
"imgA",
".",
"getWidth",
"(",
")",
";",
"double",
"to... | todo push to what ops? Also what is this error called again? | [
"todo",
"push",
"to",
"what",
"ops?",
"Also",
"what",
"is",
"this",
"error",
"called",
"again?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java#L285-L299 | train |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java | DenoiseVisualizeApp.computeWeightedError | public static double computeWeightedError(GrayF32 imgA, GrayF32 imgB ,
GrayF32 imgWeight ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
double totalWeight = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
float weight = imgWeight.get(x... | java | public static double computeWeightedError(GrayF32 imgA, GrayF32 imgB ,
GrayF32 imgWeight ) {
final int h = imgA.getHeight();
final int w = imgA.getWidth();
double total = 0;
double totalWeight = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
float weight = imgWeight.get(x... | [
"public",
"static",
"double",
"computeWeightedError",
"(",
"GrayF32",
"imgA",
",",
"GrayF32",
"imgB",
",",
"GrayF32",
"imgWeight",
")",
"{",
"final",
"int",
"h",
"=",
"imgA",
".",
"getHeight",
"(",
")",
";",
"final",
"int",
"w",
"=",
"imgA",
".",
"getWid... | todo push to what ops? | [
"todo",
"push",
"to",
"what",
"ops?"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/enhance/DenoiseVisualizeApp.java#L302-L320 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/geometry/ExampleVideoMosaic.java | ExampleVideoMosaic.nearBorder | private static boolean nearBorder( Point2D_F64 p , StitchingFromMotion2D<?,?> stitch ) {
int r = 10;
if( p.x < r || p.y < r )
return true;
if( p.x >= stitch.getStitchedImage().width-r )
return true;
if( p.y >= stitch.getStitchedImage().height-r )
return true;
return false;
} | java | private static boolean nearBorder( Point2D_F64 p , StitchingFromMotion2D<?,?> stitch ) {
int r = 10;
if( p.x < r || p.y < r )
return true;
if( p.x >= stitch.getStitchedImage().width-r )
return true;
if( p.y >= stitch.getStitchedImage().height-r )
return true;
return false;
} | [
"private",
"static",
"boolean",
"nearBorder",
"(",
"Point2D_F64",
"p",
",",
"StitchingFromMotion2D",
"<",
"?",
",",
"?",
">",
"stitch",
")",
"{",
"int",
"r",
"=",
"10",
";",
"if",
"(",
"p",
".",
"x",
"<",
"r",
"||",
"p",
".",
"y",
"<",
"r",
")",
... | Checks to see if the point is near the image border | [
"Checks",
"to",
"see",
"if",
"the",
"point",
"is",
"near",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleVideoMosaic.java#L162-L172 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.setShape | public void setShape(double width , double height ) {
points2D3D.get(0).location.set(-width/2,-height/2,0);
points2D3D.get(1).location.set(-width/2, height/2,0);
points2D3D.get(2).location.set( width/2, height/2,0);
points2D3D.get(3).location.set( width/2,-height/2,0);
} | java | public void setShape(double width , double height ) {
points2D3D.get(0).location.set(-width/2,-height/2,0);
points2D3D.get(1).location.set(-width/2, height/2,0);
points2D3D.get(2).location.set( width/2, height/2,0);
points2D3D.get(3).location.set( width/2,-height/2,0);
} | [
"public",
"void",
"setShape",
"(",
"double",
"width",
",",
"double",
"height",
")",
"{",
"points2D3D",
".",
"get",
"(",
"0",
")",
".",
"location",
".",
"set",
"(",
"-",
"width",
"/",
"2",
",",
"-",
"height",
"/",
"2",
",",
"0",
")",
";",
"points2... | Specifes how big the fiducial is along two axises
@param width Length along x-axis
@param height Length along y-axis | [
"Specifes",
"how",
"big",
"the",
"fiducial",
"is",
"along",
"two",
"axises"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L95-L100 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.computeStability | public void computeStability(Se3_F64 targetToCamera ,
double disturbance,
FiducialStability results) {
targetToCamera.invert(referenceCameraToTarget);
maxOrientation = 0;
maxLocation = 0;
Point3D_F64 cameraPt = new Point3D_F64();
for (int i = 0; i < points2D3D.size(); i++) {
Point2D3D ... | java | public void computeStability(Se3_F64 targetToCamera ,
double disturbance,
FiducialStability results) {
targetToCamera.invert(referenceCameraToTarget);
maxOrientation = 0;
maxLocation = 0;
Point3D_F64 cameraPt = new Point3D_F64();
for (int i = 0; i < points2D3D.size(); i++) {
Point2D3D ... | [
"public",
"void",
"computeStability",
"(",
"Se3_F64",
"targetToCamera",
",",
"double",
"disturbance",
",",
"FiducialStability",
"results",
")",
"{",
"targetToCamera",
".",
"invert",
"(",
"referenceCameraToTarget",
")",
";",
"maxOrientation",
"=",
"0",
";",
"maxLocat... | Estimate how sensitive this observation is to pixel noise
@param targetToCamera Observed target to camera pose estimate
@param disturbance How much the observation should be noised up, in pixels
@param results description how how sensitive the stability estimate is
@return true if stability could be computed | [
"Estimate",
"how",
"sensitive",
"this",
"observation",
"is",
"to",
"pixel",
"noise"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L109-L140 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java | FourPointSyntheticStability.perturb | private void perturb(double disturbance , Point2D_F64 pixel , Point2D3D p23 ) {
double x;
double y = pixel.y;
x = pixel.x + disturbance;
computeDisturbance( x,y, p23);
x = pixel.x - disturbance;
computeDisturbance( x,y, p23);
x = pixel.x;
y = pixel.y + disturbance;
computeDisturbance( x,y, p23);
y ... | java | private void perturb(double disturbance , Point2D_F64 pixel , Point2D3D p23 ) {
double x;
double y = pixel.y;
x = pixel.x + disturbance;
computeDisturbance( x,y, p23);
x = pixel.x - disturbance;
computeDisturbance( x,y, p23);
x = pixel.x;
y = pixel.y + disturbance;
computeDisturbance( x,y, p23);
y ... | [
"private",
"void",
"perturb",
"(",
"double",
"disturbance",
",",
"Point2D_F64",
"pixel",
",",
"Point2D3D",
"p23",
")",
"{",
"double",
"x",
";",
"double",
"y",
"=",
"pixel",
".",
"y",
";",
"x",
"=",
"pixel",
".",
"x",
"+",
"disturbance",
";",
"computeDi... | Perturb the observation in 4 different ways
@param disturbance distance of pixel the observed point will be offset by
@param pixel observed pixel
@param p23 observation plugged into PnP | [
"Perturb",
"the",
"observation",
"in",
"4",
"different",
"ways"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/FourPointSyntheticStability.java#L149-L162 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java | ExampleLineDetection.detectLines | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... | java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"detectLines",
"(",
"BufferedImage",
"image",
",",
"Class",
"<",
"T",
">",
"imageType",
",",
"Class",
"<",
"D",
">",
"d... | Detects lines inside the image using different types of Hough detectors
@param image Input image.
@param imageType Type of image processed by line detector.
@param derivType Type of image derivative. | [
"Detects",
"lines",
"inside",
"the",
"image",
"using",
"different",
"types",
"of",
"Hough",
"detectors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java#L63-L88 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java | ExampleLineDetection.detectLineSegments | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLineSegments( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment t... | java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLineSegments( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment t... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"detectLineSegments",
"(",
"BufferedImage",
"image",
",",
"Class",
"<",
"T",
">",
"imageType",
",",
"Class",
"<",
"D",
">... | Detects segments inside the image
@param image Input image.
@param imageType Type of image processed by line detector.
@param derivType Type of image derivative. | [
"Detects",
"segments",
"inside",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java#L97-L117 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledHueSat | public static List<double[]> coupledHueSat( List<String> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
Planar<GrayF32> hsv = new Planar<>(GrayF32.class,1,1,3);
for( String path : images ) {
BufferedImage buffered = UtilImageIO.loadImage(path... | java | public static List<double[]> coupledHueSat( List<String> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
Planar<GrayF32> hsv = new Planar<>(GrayF32.class,1,1,3);
for( String path : images ) {
BufferedImage buffered = UtilImageIO.loadImage(path... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledHueSat",
"(",
"List",
"<",
"String",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
... | HSV stores color information in Hue and Saturation while intensity is in Value. This computes a 2D histogram
from hue and saturation only, which makes it lighting independent. | [
"HSV",
"stores",
"color",
"information",
"in",
"Hue",
"and",
"Saturation",
"while",
"intensity",
"is",
"in",
"Value",
".",
"This",
"computes",
"a",
"2D",
"histogram",
"from",
"hue",
"and",
"saturation",
"only",
"which",
"makes",
"it",
"lighting",
"independent"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L70-L102 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.independentHueSat | public static List<double[]> independentHueSat( List<File> images ) {
List<double[]> points = new ArrayList<>();
// The number of bins is an important parameter. Try adjusting it
TupleDesc_F64 histogramHue = new TupleDesc_F64(30);
TupleDesc_F64 histogramValue = new TupleDesc_F64(30);
List<TupleDesc_F64> h... | java | public static List<double[]> independentHueSat( List<File> images ) {
List<double[]> points = new ArrayList<>();
// The number of bins is an important parameter. Try adjusting it
TupleDesc_F64 histogramHue = new TupleDesc_F64(30);
TupleDesc_F64 histogramValue = new TupleDesc_F64(30);
List<TupleDesc_F64> h... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"independentHueSat",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// The number of bins is an i... | Computes two independent 1D histograms from hue and saturation. Less affects by sparsity, but can produce
worse results since the basic assumption that hue and saturation are decoupled is most of the time false. | [
"Computes",
"two",
"independent",
"1D",
"histograms",
"from",
"hue",
"and",
"saturation",
".",
"Less",
"affects",
"by",
"sparsity",
"but",
"can",
"produce",
"worse",
"results",
"since",
"the",
"basic",
"assumption",
"that",
"hue",
"and",
"saturation",
"are",
"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L108-L142 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledRGB | public static List<double[]> coupledRGB( List<File> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't ... | java | public static List<double[]> coupledRGB( List<File> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't ... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledRGB",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
">",
... | Constructs a 3D histogram using RGB. RGB is a popular color space, but the resulting histogram will
depend on lighting conditions and might not produce the accurate results. | [
"Constructs",
"a",
"3D",
"histogram",
"using",
"RGB",
".",
"RGB",
"is",
"a",
"popular",
"color",
"space",
"but",
"the",
"resulting",
"histogram",
"will",
"depend",
"on",
"lighting",
"conditions",
"and",
"might",
"not",
"produce",
"the",
"accurate",
"results",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L148-L174 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.histogramGray | public static List<double[]> histogramGray( List<File> images ) {
List<double[]> points = new ArrayList<>();
GrayU8 gray = new GrayU8(1,1);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't load image!");
gray.... | java | public static List<double[]> histogramGray( List<File> images ) {
List<double[]> points = new ArrayList<>();
GrayU8 gray = new GrayU8(1,1);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't load image!");
gray.... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"histogramGray",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"GrayU8",
"gray",
"=",
"new"... | Computes a histogram from the gray scale intensity image alone. Probably the least effective at looking up
similar images. | [
"Computes",
"a",
"histogram",
"from",
"the",
"gray",
"scale",
"intensity",
"image",
"alone",
".",
"Probably",
"the",
"least",
"effective",
"at",
"looking",
"up",
"similar",
"images",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L180-L200 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/misc/DiscretizedCircle.java | DiscretizedCircle.imageOffsets | public static int[] imageOffsets(double radius, int imgWidth) {
double PI2 = Math.PI * 2.0;
double circumference = PI2 * radius;
int num = (int) Math.ceil(circumference);
num = num - num % 4;
double angleStep = PI2 / num;
int temp[] = new int[(int) Math.ceil(circumference)];
int i = 0;
int prev =... | java | public static int[] imageOffsets(double radius, int imgWidth) {
double PI2 = Math.PI * 2.0;
double circumference = PI2 * radius;
int num = (int) Math.ceil(circumference);
num = num - num % 4;
double angleStep = PI2 / num;
int temp[] = new int[(int) Math.ceil(circumference)];
int i = 0;
int prev =... | [
"public",
"static",
"int",
"[",
"]",
"imageOffsets",
"(",
"double",
"radius",
",",
"int",
"imgWidth",
")",
"{",
"double",
"PI2",
"=",
"Math",
".",
"PI",
"*",
"2.0",
";",
"double",
"circumference",
"=",
"PI2",
"*",
"radius",
";",
"int",
"num",
"=",
"(... | Computes the offsets for a discretized circle of the specified radius for an
image with the specified width.
@param radius The radius of the circle in pixels.
@param imgWidth The row step of the image
@return A list of offsets that describe the circle | [
"Computes",
"the",
"offsets",
"for",
"a",
"discretized",
"circle",
"of",
"the",
"specified",
"radius",
"for",
"an",
"image",
"with",
"the",
"specified",
"width",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/DiscretizedCircle.java#L36-L74 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java | ExampleDetectDescribe.createFromPremade | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromPremade( Class<T> imageType ) {
return (DetectDescribePoint)FactoryDetectDescribe.surfStable(
new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null,null, imageType);
// return (DetectDescribePoint)FactoryDetectDescrib... | java | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromPremade( Class<T> imageType ) {
return (DetectDescribePoint)FactoryDetectDescribe.surfStable(
new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null,null, imageType);
// return (DetectDescribePoint)FactoryDetectDescrib... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"TD",
"extends",
"TupleDesc",
">",
"DetectDescribePoint",
"<",
"T",
",",
"TD",
">",
"createFromPremade",
"(",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"return",
"(",
"DetectD... | For some features, there are pre-made implementations of DetectDescribePoint. This has only been done
in situations where there was a performance advantage or that it was a very common combination. | [
"For",
"some",
"features",
"there",
"are",
"pre",
"-",
"made",
"implementations",
"of",
"DetectDescribePoint",
".",
"This",
"has",
"only",
"been",
"done",
"in",
"situations",
"where",
"there",
"was",
"a",
"performance",
"advantage",
"or",
"that",
"it",
"was",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java#L61-L66 | train |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java | ExampleDetectDescribe.createFromComponents | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromComponents( Class<T> imageType ) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneral... | java | public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromComponents( Class<T> imageType ) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneral... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"TD",
"extends",
"TupleDesc",
">",
"DetectDescribePoint",
"<",
"T",
",",
"TD",
">",
"createFromComponents",
"(",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"// create a corner dete... | Any arbitrary implementation of InterestPointDetector, OrientationImage, DescribeRegionPoint
can be combined into DetectDescribePoint. The syntax is more complex, but the end result is more flexible.
This should only be done if there isn't a pre-made DetectDescribePoint. | [
"Any",
"arbitrary",
"implementation",
"of",
"InterestPointDetector",
"OrientationImage",
"DescribeRegionPoint",
"can",
"be",
"combined",
"into",
"DetectDescribePoint",
".",
"The",
"syntax",
"is",
"more",
"complex",
"but",
"the",
"end",
"result",
"is",
"more",
"flexibl... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleDetectDescribe.java#L73-L86 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeWeights | protected void computeWeights(int numSamples, double numSigmas) {
weights = new float[ numSamples*numSamples ];
float w[] = new float[ numSamples ];
for( int i = 0; i < numSamples; i++ ) {
float x = i/(float)(numSamples-1);
w[i] = (float) UtilGaussian.computePDF(0, 1, 2f*numSigmas * (x - 0.5f));
}
for... | java | protected void computeWeights(int numSamples, double numSigmas) {
weights = new float[ numSamples*numSamples ];
float w[] = new float[ numSamples ];
for( int i = 0; i < numSamples; i++ ) {
float x = i/(float)(numSamples-1);
w[i] = (float) UtilGaussian.computePDF(0, 1, 2f*numSigmas * (x - 0.5f));
}
for... | [
"protected",
"void",
"computeWeights",
"(",
"int",
"numSamples",
",",
"double",
"numSigmas",
")",
"{",
"weights",
"=",
"new",
"float",
"[",
"numSamples",
"*",
"numSamples",
"]",
";",
"float",
"w",
"[",
"]",
"=",
"new",
"float",
"[",
"numSamples",
"]",
";... | compute the weights by convolving 1D gaussian kernel | [
"compute",
"the",
"weights",
"by",
"convolving",
"1D",
"gaussian",
"kernel"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L97-L111 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.createSamplePoints | protected void createSamplePoints(int numSamples) {
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x++ ) {
float regionX = (x/(numSamples-1.0f) - 0.5f);
samplePts.add( new Point2D_F32(regionX,regionY));
}
}
} | java | protected void createSamplePoints(int numSamples) {
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x++ ) {
float regionX = (x/(numSamples-1.0f) - 0.5f);
samplePts.add( new Point2D_F32(regionX,regionY));
}
}
} | [
"protected",
"void",
"createSamplePoints",
"(",
"int",
"numSamples",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"numSamples",
";",
"y",
"++",
")",
"{",
"float",
"regionY",
"=",
"(",
"y",
"/",
"(",
"numSamples",
"-",
"1.0f",
")",
"-"... | create the list of points in square coordinates that it will sample. values will range
from -0.5 to 0.5 along each axis. | [
"create",
"the",
"list",
"of",
"points",
"in",
"square",
"coordinates",
"that",
"it",
"will",
"sample",
".",
"values",
"will",
"range",
"from",
"-",
"0",
".",
"5",
"to",
"0",
".",
"5",
"along",
"each",
"axis",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L117-L126 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramInside | protected void computeHistogramInside( RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
interpolate.get_fast(imageX,imageY,value);
int indexHistogram = computeHistogramBin(value);
sampleHistIndex[ i ... | java | protected void computeHistogramInside( RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
interpolate.get_fast(imageX,imageY,value);
int indexHistogram = computeHistogramBin(value);
sampleHistIndex[ i ... | [
"protected",
"void",
"computeHistogramInside",
"(",
"RectangleRotate_F32",
"region",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"samplePts",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Point2D_F32",
"p",
"=",
"samplePts",
".",
"ge... | Computes the histogram quickly inside the image | [
"Computes",
"the",
"histogram",
"quickly",
"inside",
"the",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L158-L171 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramBorder | protected void computeHistogramBorder(T image, RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
// make sure its inside the image
if( !BoofMiscOps.checkInside(image, imageX, imageY)) {
sampleHistIndex... | java | protected void computeHistogramBorder(T image, RectangleRotate_F32 region) {
for( int i = 0; i < samplePts.size(); i++ ) {
Point2D_F32 p = samplePts.get(i);
squareToImageSample(p.x, p.y, region);
// make sure its inside the image
if( !BoofMiscOps.checkInside(image, imageX, imageY)) {
sampleHistIndex... | [
"protected",
"void",
"computeHistogramBorder",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"region",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"samplePts",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Point2D_F32",
"p",
"=",
... | Computes the histogram and skips pixels which are outside the image border | [
"Computes",
"the",
"histogram",
"and",
"skips",
"pixels",
"which",
"are",
"outside",
"the",
"image",
"border"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L176-L195 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.computeHistogramBin | protected int computeHistogramBin( float value[] ) {
int indexHistogram = 0;
int binStride = 1;
for( int bandIndex = 0; bandIndex < value.length; bandIndex++ ) {
int bin = (int)(numBins*value[bandIndex]/maxPixelValue);
indexHistogram += bin*binStride;
binStride *= numBins;
}
return indexHistogram;
... | java | protected int computeHistogramBin( float value[] ) {
int indexHistogram = 0;
int binStride = 1;
for( int bandIndex = 0; bandIndex < value.length; bandIndex++ ) {
int bin = (int)(numBins*value[bandIndex]/maxPixelValue);
indexHistogram += bin*binStride;
binStride *= numBins;
}
return indexHistogram;
... | [
"protected",
"int",
"computeHistogramBin",
"(",
"float",
"value",
"[",
"]",
")",
"{",
"int",
"indexHistogram",
"=",
"0",
";",
"int",
"binStride",
"=",
"1",
";",
"for",
"(",
"int",
"bandIndex",
"=",
"0",
";",
"bandIndex",
"<",
"value",
".",
"length",
";... | Given the value of a pixel, compute which bin in the histogram it belongs in | [
"Given",
"the",
"value",
"of",
"a",
"pixel",
"compute",
"which",
"bin",
"in",
"the",
"histogram",
"it",
"belongs",
"in"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L200-L210 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.isInFastBounds | protected boolean isInFastBounds(RectangleRotate_F32 region) {
squareToImageSample(-0.5f, -0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(-0.5f, 0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(0.5f, 0.5... | java | protected boolean isInFastBounds(RectangleRotate_F32 region) {
squareToImageSample(-0.5f, -0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(-0.5f, 0.5f, region);
if( !interpolate.isInFastBounds(imageX, imageY))
return false;
squareToImageSample(0.5f, 0.5... | [
"protected",
"boolean",
"isInFastBounds",
"(",
"RectangleRotate_F32",
"region",
")",
"{",
"squareToImageSample",
"(",
"-",
"0.5f",
",",
"-",
"0.5f",
",",
"region",
")",
";",
"if",
"(",
"!",
"interpolate",
".",
"isInFastBounds",
"(",
"imageX",
",",
"imageY",
... | Checks to see if the region can be sampled using the fast algorithm | [
"Checks",
"to",
"see",
"if",
"the",
"region",
"can",
"be",
"sampled",
"using",
"the",
"fast",
"algorithm"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L215-L231 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.squareToImageSample | protected void squareToImageSample(float x, float y, RectangleRotate_F32 region) {
// -1 because it starts counting at 0. otherwise width+1 samples are made
x *= region.width-1;
y *= region.height-1;
imageX = x*c - y*s + region.cx;
imageY = x*s + y*c + region.cy;
} | java | protected void squareToImageSample(float x, float y, RectangleRotate_F32 region) {
// -1 because it starts counting at 0. otherwise width+1 samples are made
x *= region.width-1;
y *= region.height-1;
imageX = x*c - y*s + region.cx;
imageY = x*s + y*c + region.cy;
} | [
"protected",
"void",
"squareToImageSample",
"(",
"float",
"x",
",",
"float",
"y",
",",
"RectangleRotate_F32",
"region",
")",
"{",
"// -1 because it starts counting at 0. otherwise width+1 samples are made",
"x",
"*=",
"region",
".",
"width",
"-",
"1",
";",
"y",
"*=",... | Converts a point from square coordinates into image coordinates | [
"Converts",
"a",
"point",
"from",
"square",
"coordinates",
"into",
"image",
"coordinates"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L246-L253 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.createSparseDerivatives | private void createSparseDerivatives() {
Kernel1D_F32 kernelD = new Kernel1D_F32(new float[]{-1,0,1},3);
Kernel1D_F32 kernelDD = KernelMath.convolve1D_F32(kernelD, kernelD);
Kernel2D_F32 kernelXY = KernelMath.convolve2D(kernelD, kernelD);
derivXX = FactoryConvolveSparse.horizontal1D(GrayF32.class, kernelDD);
... | java | private void createSparseDerivatives() {
Kernel1D_F32 kernelD = new Kernel1D_F32(new float[]{-1,0,1},3);
Kernel1D_F32 kernelDD = KernelMath.convolve1D_F32(kernelD, kernelD);
Kernel2D_F32 kernelXY = KernelMath.convolve2D(kernelD, kernelD);
derivXX = FactoryConvolveSparse.horizontal1D(GrayF32.class, kernelDD);
... | [
"private",
"void",
"createSparseDerivatives",
"(",
")",
"{",
"Kernel1D_F32",
"kernelD",
"=",
"new",
"Kernel1D_F32",
"(",
"new",
"float",
"[",
"]",
"{",
"-",
"1",
",",
"0",
",",
"1",
"}",
",",
"3",
")",
";",
"Kernel1D_F32",
"kernelDD",
"=",
"KernelMath",
... | Define sparse image derivative operators. | [
"Define",
"sparse",
"image",
"derivative",
"operators",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L143-L158 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.process | public void process( GrayF32 input ) {
scaleSpace.initialize(input);
detections.reset();
do {
// scale from octave to input image
pixelScaleToInput = scaleSpace.pixelScaleCurrentToInput();
// detect features in the image
for (int j = 1; j < scaleSpace.getNumScales()+1; j++) {
// not really sur... | java | public void process( GrayF32 input ) {
scaleSpace.initialize(input);
detections.reset();
do {
// scale from octave to input image
pixelScaleToInput = scaleSpace.pixelScaleCurrentToInput();
// detect features in the image
for (int j = 1; j < scaleSpace.getNumScales()+1; j++) {
// not really sur... | [
"public",
"void",
"process",
"(",
"GrayF32",
"input",
")",
"{",
"scaleSpace",
".",
"initialize",
"(",
"input",
")",
";",
"detections",
".",
"reset",
"(",
")",
";",
"do",
"{",
"// scale from octave to input image",
"pixelScaleToInput",
"=",
"scaleSpace",
".",
"... | Detects SIFT features inside the input image
@param input Input image. Not modified. | [
"Detects",
"SIFT",
"features",
"inside",
"the",
"input",
"image"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L165-L191 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.detectFeatures | protected void detectFeatures( int scaleIndex ) {
extractor.process(dogTarget);
FastQueue<NonMaxLimiter.LocalExtreme> found = extractor.getLocalExtreme();
derivXX.setImage(dogTarget);
derivXY.setImage(dogTarget);
derivYY.setImage(dogTarget);
for (int i = 0; i < found.size; i++) {
NonMaxLimiter.LocalExt... | java | protected void detectFeatures( int scaleIndex ) {
extractor.process(dogTarget);
FastQueue<NonMaxLimiter.LocalExtreme> found = extractor.getLocalExtreme();
derivXX.setImage(dogTarget);
derivXY.setImage(dogTarget);
derivYY.setImage(dogTarget);
for (int i = 0; i < found.size; i++) {
NonMaxLimiter.LocalExt... | [
"protected",
"void",
"detectFeatures",
"(",
"int",
"scaleIndex",
")",
"{",
"extractor",
".",
"process",
"(",
"dogTarget",
")",
";",
"FastQueue",
"<",
"NonMaxLimiter",
".",
"LocalExtreme",
">",
"found",
"=",
"extractor",
".",
"getLocalExtreme",
"(",
")",
";",
... | Detect features inside the Difference-of-Gaussian image at the current scale
@param scaleIndex Which scale in the octave is it detecting features inside up.
Primarily provided here for use in child classes. | [
"Detect",
"features",
"inside",
"the",
"Difference",
"-",
"of",
"-",
"Gaussian",
"image",
"at",
"the",
"current",
"scale"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L199-L218 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.isScaleSpaceExtremum | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
if( c_x <= 1 || c_y <= 1 || c_x >= dogLower.width-1 || c_y >= dogLower.height-1)
return false;
float v;
value *= signAdj;
for( int y = -1; y <= 1; y++ ) {
for( int x = -1; x <= 1; x++ ) {
v = dogLower.unsafe_get(c_x+x,c... | java | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
if( c_x <= 1 || c_y <= 1 || c_x >= dogLower.width-1 || c_y >= dogLower.height-1)
return false;
float v;
value *= signAdj;
for( int y = -1; y <= 1; y++ ) {
for( int x = -1; x <= 1; x++ ) {
v = dogLower.unsafe_get(c_x+x,c... | [
"boolean",
"isScaleSpaceExtremum",
"(",
"int",
"c_x",
",",
"int",
"c_y",
",",
"float",
"value",
",",
"float",
"signAdj",
")",
"{",
"if",
"(",
"c_x",
"<=",
"1",
"||",
"c_y",
"<=",
"1",
"||",
"c_x",
">=",
"dogLower",
".",
"width",
"-",
"1",
"||",
"c_... | See if the point is a local extremum in scale-space above and below.
@param c_x x-coordinate of extremum
@param c_y y-coordinate of extremum
@param value The maximum value it is checking
@param signAdj Adjust the sign so that it can check for maximums
@return true if its a local extremum | [
"See",
"if",
"the",
"point",
"is",
"a",
"local",
"extremum",
"in",
"scale",
"-",
"space",
"above",
"and",
"below",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L229-L249 | train |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java | DistortSupport.transformScale | public static PixelTransformAffine_F32 transformScale(ImageBase from, ImageBase to,
PixelTransformAffine_F32 distort)
{
if( distort == null )
distort = new PixelTransformAffine_F32();
float scaleX = (float)(to.width)/(float)(from.width);
float scaleY = (float)(to.height)/(float)(from.height);... | java | public static PixelTransformAffine_F32 transformScale(ImageBase from, ImageBase to,
PixelTransformAffine_F32 distort)
{
if( distort == null )
distort = new PixelTransformAffine_F32();
float scaleX = (float)(to.width)/(float)(from.width);
float scaleY = (float)(to.height)/(float)(from.height);... | [
"public",
"static",
"PixelTransformAffine_F32",
"transformScale",
"(",
"ImageBase",
"from",
",",
"ImageBase",
"to",
",",
"PixelTransformAffine_F32",
"distort",
")",
"{",
"if",
"(",
"distort",
"==",
"null",
")",
"distort",
"=",
"new",
"PixelTransformAffine_F32",
"(",... | Computes a transform which is used to rescale an image. The scale is computed
directly from the size of the two input images and independently scales
the x and y axises. | [
"Computes",
"a",
"transform",
"which",
"is",
"used",
"to",
"rescale",
"an",
"image",
".",
"The",
"scale",
"is",
"computed",
"directly",
"from",
"the",
"size",
"of",
"the",
"two",
"input",
"images",
"and",
"independently",
"scales",
"the",
"x",
"and",
"y",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java#L47-L60 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java | FundamentalLinear.projectOntoEssential | protected boolean projectOntoEssential( DMatrixRMaj E ) {
if( !svdConstraints.decompose(E) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// project... | java | protected boolean projectOntoEssential( DMatrixRMaj E ) {
if( !svdConstraints.decompose(E) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// project... | [
"protected",
"boolean",
"projectOntoEssential",
"(",
"DMatrixRMaj",
"E",
")",
"{",
"if",
"(",
"!",
"svdConstraints",
".",
"decompose",
"(",
"E",
")",
")",
"{",
"return",
"false",
";",
"}",
"svdV",
"=",
"svdConstraints",
".",
"getV",
"(",
"svdV",
",",
"fa... | Projects the found estimate of E onto essential space.
@return true if svd returned true. | [
"Projects",
"the",
"found",
"estimate",
"of",
"E",
"onto",
"essential",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java#L84-L106 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java | FundamentalLinear.projectOntoFundamentalSpace | protected boolean projectOntoFundamentalSpace( DMatrixRMaj F ) {
if( !svdConstraints.decompose(F) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// ... | java | protected boolean projectOntoFundamentalSpace( DMatrixRMaj F ) {
if( !svdConstraints.decompose(F) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// ... | [
"protected",
"boolean",
"projectOntoFundamentalSpace",
"(",
"DMatrixRMaj",
"F",
")",
"{",
"if",
"(",
"!",
"svdConstraints",
".",
"decompose",
"(",
"F",
")",
")",
"{",
"return",
"false",
";",
"}",
"svdV",
"=",
"svdConstraints",
".",
"getV",
"(",
"svdV",
","... | Projects the found estimate of F onto Fundamental space.
@return true if svd returned true. | [
"Projects",
"the",
"found",
"estimate",
"of",
"F",
"onto",
"Fundamental",
"space",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalLinear.java#L113-L131 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.learnFern | public void learnFern(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2f;
float c_y = r.y0+(rectHeight-1)/2f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeFernValue(... | java | public void learnFern(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2f;
float c_y = r.y0+(rectHeight-1)/2f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeFernValue(... | [
"public",
"void",
"learnFern",
"(",
"boolean",
"positive",
",",
"ImageRectangle",
"r",
")",
"{",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")",
";",
"float",
"c_x",
"=",
"r",... | Learns a fern from the specified region. No noise is added. | [
"Learns",
"a",
"fern",
"from",
"the",
"specified",
"region",
".",
"No",
"noise",
"is",
"added",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L106-L121 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.learnFernNoise | public void learnFernNoise(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeF... | java | public void learnFernNoise(boolean positive, ImageRectangle r) {
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
for( int i = 0; i < ferns.length; i++ ) {
// first learn it with no noise
int value = computeF... | [
"public",
"void",
"learnFernNoise",
"(",
"boolean",
"positive",
",",
"ImageRectangle",
"r",
")",
"{",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")",
";",
"float",
"c_x",
"=",
... | Computes the value for each fern inside the region and update's their P and N value. Noise is added
to the image measurements to take in account the variability. | [
"Computes",
"the",
"value",
"for",
"each",
"fern",
"inside",
"the",
"region",
"and",
"update",
"s",
"their",
"P",
"and",
"N",
"value",
".",
"Noise",
"is",
"added",
"to",
"the",
"image",
"measurements",
"to",
"take",
"in",
"account",
"the",
"variability",
... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L127-L148 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.increment | private void increment( TldFernFeature f , boolean positive ) {
if( positive ) {
f.incrementP();
if( f.numP > maxP )
maxP = f.numP;
} else {
f.incrementN();
if( f.numN > maxN )
maxN = f.numN;
}
} | java | private void increment( TldFernFeature f , boolean positive ) {
if( positive ) {
f.incrementP();
if( f.numP > maxP )
maxP = f.numP;
} else {
f.incrementN();
if( f.numN > maxN )
maxN = f.numN;
}
} | [
"private",
"void",
"increment",
"(",
"TldFernFeature",
"f",
",",
"boolean",
"positive",
")",
"{",
"if",
"(",
"positive",
")",
"{",
"f",
".",
"incrementP",
"(",
")",
";",
"if",
"(",
"f",
".",
"numP",
">",
"maxP",
")",
"maxP",
"=",
"f",
".",
"numP",
... | Increments the P and N value for a fern. Also updates the maxP and maxN statistics so that it
knows when to re-normalize data structures. | [
"Increments",
"the",
"P",
"and",
"N",
"value",
"for",
"a",
"fern",
".",
"Also",
"updates",
"the",
"maxP",
"and",
"maxN",
"statistics",
"so",
"that",
"it",
"knows",
"when",
"to",
"re",
"-",
"normalize",
"data",
"structures",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L154-L164 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.lookupFernPN | public boolean lookupFernPN( TldRegionFernInfo info ) {
ImageRectangle r = info.r;
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
int sumP = 0;
int sumN = 0;
for( int i = 0; i < ferns.length; i++ ) {
Tl... | java | public boolean lookupFernPN( TldRegionFernInfo info ) {
ImageRectangle r = info.r;
float rectWidth = r.getWidth();
float rectHeight = r.getHeight();
float c_x = r.x0+(rectWidth-1)/2.0f;
float c_y = r.y0+(rectHeight-1)/2.0f;
int sumP = 0;
int sumN = 0;
for( int i = 0; i < ferns.length; i++ ) {
Tl... | [
"public",
"boolean",
"lookupFernPN",
"(",
"TldRegionFernInfo",
"info",
")",
"{",
"ImageRectangle",
"r",
"=",
"info",
".",
"r",
";",
"float",
"rectWidth",
"=",
"r",
".",
"getWidth",
"(",
")",
";",
"float",
"rectHeight",
"=",
"r",
".",
"getHeight",
"(",
")... | For the specified regions, computes the values of each fern inside of it and then retrives their P and N values.
The sum of which is stored inside of info.
@param info (Input) Location/Rectangle (output) P and N values
@return true if a known value for any of the ferns was observed in this region | [
"For",
"the",
"specified",
"regions",
"computes",
"the",
"values",
"of",
"each",
"fern",
"inside",
"of",
"it",
"and",
"then",
"retrives",
"their",
"P",
"and",
"N",
"values",
".",
"The",
"sum",
"of",
"which",
"is",
"stored",
"inside",
"of",
"info",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L172-L201 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.computeFernValue | protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) {
rectWidth -= 1;
rectHeight -= 1;
int desc = 0;
for( int i = 0; i < fern.pairs.length; i++ ) {
Point2D_F32 p_a = fern.pairs[i].a;
Point2D_F32 p_b = fern.pairs[i].b;
float valA = inter... | java | protected int computeFernValue(float c_x, float c_y, float rectWidth , float rectHeight , TldFernDescription fern ) {
rectWidth -= 1;
rectHeight -= 1;
int desc = 0;
for( int i = 0; i < fern.pairs.length; i++ ) {
Point2D_F32 p_a = fern.pairs[i].a;
Point2D_F32 p_b = fern.pairs[i].b;
float valA = inter... | [
"protected",
"int",
"computeFernValue",
"(",
"float",
"c_x",
",",
"float",
"c_y",
",",
"float",
"rectWidth",
",",
"float",
"rectHeight",
",",
"TldFernDescription",
"fern",
")",
"{",
"rectWidth",
"-=",
"1",
";",
"rectHeight",
"-=",
"1",
";",
"int",
"desc",
... | Computes the value of the specified fern at the specified location in the image. | [
"Computes",
"the",
"value",
"of",
"the",
"specified",
"fern",
"at",
"the",
"specified",
"location",
"in",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L206-L227 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.renormalizeP | public void renormalizeP() {
int targetMax = maxP/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numP = targetMax*f.numP/maxP;
}
}
maxP = targetMax;... | java | public void renormalizeP() {
int targetMax = maxP/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numP = targetMax*f.numP/maxP;
}
}
maxP = targetMax;... | [
"public",
"void",
"renormalizeP",
"(",
")",
"{",
"int",
"targetMax",
"=",
"maxP",
"/",
"20",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"managers",
".",
"length",
";",
"i",
"++",
")",
"{",
"TldFernManager",
"m",
"=",
"managers",
"[",
"... | Renormalizes fern.numP to avoid overflow | [
"Renormalizes",
"fern",
".",
"numP",
"to",
"avoid",
"overflow"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L261-L274 | train |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java | TldFernClassifier.renormalizeN | public void renormalizeN() {
int targetMax = maxN/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numN = targetMax*f.numN/maxN;
}
}
maxN = targetMax;... | java | public void renormalizeN() {
int targetMax = maxN/20;
for( int i = 0; i < managers.length; i++ ) {
TldFernManager m = managers[i];
for( int j = 0; j < m.table.length; j++ ) {
TldFernFeature f = m.table[j];
if( f == null )
continue;
f.numN = targetMax*f.numN/maxN;
}
}
maxN = targetMax;... | [
"public",
"void",
"renormalizeN",
"(",
")",
"{",
"int",
"targetMax",
"=",
"maxN",
"/",
"20",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"managers",
".",
"length",
";",
"i",
"++",
")",
"{",
"TldFernManager",
"m",
"=",
"managers",
"[",
"... | Renormalizes fern.numN to avoid overflow | [
"Renormalizes",
"fern",
".",
"numN",
"to",
"avoid",
"overflow"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldFernClassifier.java#L279-L292 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java | DescribePointSurf.describe | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret)
{
double c = Math.cos(angle),s=Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
bool... | java | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret)
{
double c = Math.cos(angle),s=Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
bool... | [
"public",
"void",
"describe",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"angle",
",",
"double",
"scale",
",",
"TupleDesc_F64",
"ret",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
",",
"s",
"=",
"Math",
".",
"sin... | Compute SURF descriptor, but without laplacian sign
@param x Location of interest point.
@param y Location of interest point.
@param angle The angle the feature is pointing at in radians.
@param scale Scale of the interest point. Null is returned if the feature goes outside the image border.
@param ret storage for the... | [
"Compute",
"SURF",
"descriptor",
"but",
"without",
"laplacian",
"sign"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L190-L213 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java | DescribePointSurf.computeLaplaceSign | public boolean computeLaplaceSign(int x, int y, double scale) {
int s = (int)Math.ceil(scale);
kerXX = DerivativeIntegralImage.kernelDerivXX(9*s,kerXX);
kerYY = DerivativeIntegralImage.kernelDerivYY(9*s,kerYY);
double lap = GIntegralImageOps.convolveSparse(ii,kerXX,x,y);
lap += GIntegralImageOps.convolveSpars... | java | public boolean computeLaplaceSign(int x, int y, double scale) {
int s = (int)Math.ceil(scale);
kerXX = DerivativeIntegralImage.kernelDerivXX(9*s,kerXX);
kerYY = DerivativeIntegralImage.kernelDerivYY(9*s,kerYY);
double lap = GIntegralImageOps.convolveSparse(ii,kerXX,x,y);
lap += GIntegralImageOps.convolveSpars... | [
"public",
"boolean",
"computeLaplaceSign",
"(",
"int",
"x",
",",
"int",
"y",
",",
"double",
"scale",
")",
"{",
"int",
"s",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"scale",
")",
";",
"kerXX",
"=",
"DerivativeIntegralImage",
".",
"kernelDerivXX",
... | Compute the sign of the Laplacian using a sparse convolution.
@param x center
@param y center
@param scale scale of the feature
@return true if positive | [
"Compute",
"the",
"sign",
"of",
"the",
"Laplacian",
"using",
"a",
"sparse",
"convolution",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L305-L313 | train |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/line/FactoryDetectLineAlgs.java | FactoryDetectLineAlgs.houghPolar | public static <I extends ImageGray<I>, D extends ImageGray<D>>
DetectLineHoughPolar<I,D> houghPolar(ConfigHoughPolar config ,
Class<I> imageType ,
Class<D> derivType ) {
if( config == null )
throw new IllegalArgumentException("This is no default since minCounts must be specified");
Image... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
DetectLineHoughPolar<I,D> houghPolar(ConfigHoughPolar config ,
Class<I> imageType ,
Class<D> derivType ) {
if( config == null )
throw new IllegalArgumentException("This is no default since minCounts must be specified");
Image... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"DetectLineHoughPolar",
"<",
"I",
",",
"D",
">",
"houghPolar",
"(",
"ConfigHoughPolar",
"config",
",",
"Class",
"<",
"I",
">",
"i... | Creates a Hough line detector based on polar parametrization.
@see DetectLineHoughPolar
@param config Configuration for line detector. Can't be null.
@param imageType Type of single band input image.
@param derivType Image derivative type.
@param <I> Input image type.
@param <D> Image derivative type.
@return Line d... | [
"Creates",
"a",
"Hough",
"line",
"detector",
"based",
"on",
"polar",
"parametrization",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/line/FactoryDetectLineAlgs.java#L161-L173 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderContours | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
if( out == null ) {
out = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
} else {
Graphics2D g2 = out.createGraphics();
g2.set... | java | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
if( out == null ) {
out = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
} else {
Graphics2D g2 = out.createGraphics();
g2.set... | [
"public",
"static",
"BufferedImage",
"renderContours",
"(",
"List",
"<",
"Contour",
">",
"contours",
",",
"int",
"colorExternal",
",",
"int",
"colorInternal",
",",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"out",
")",
"{",
"if",
"(",
"out",... | Draws contours. Internal and external contours are different user specified colors.
@param contours List of contours
@param colorExternal RGB color
@param colorInternal RGB color
@param width Image width
@param height Image height
@param out (Optional) storage for output image
@return Rendered contours | [
"Draws",
"contours",
".",
"Internal",
"and",
"external",
"contours",
"are",
"different",
"user",
"specified",
"colors",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L77-L100 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.render | public static void render(List<Contour> contours , int colors[] , BufferedImage out) {
colors = checkColors(colors,contours.size());
for( int i = 0; i < contours.size(); i++ ) {
Contour c = contours.get(i);
int color = colors[i];
for(Point2D_I32 p : c.external ) {
out.setRGB(p.x,p.y,color);
}
}... | java | public static void render(List<Contour> contours , int colors[] , BufferedImage out) {
colors = checkColors(colors,contours.size());
for( int i = 0; i < contours.size(); i++ ) {
Contour c = contours.get(i);
int color = colors[i];
for(Point2D_I32 p : c.external ) {
out.setRGB(p.x,p.y,color);
}
}... | [
"public",
"static",
"void",
"render",
"(",
"List",
"<",
"Contour",
">",
"contours",
",",
"int",
"colors",
"[",
"]",
",",
"BufferedImage",
"out",
")",
"{",
"colors",
"=",
"checkColors",
"(",
"colors",
",",
"contours",
".",
"size",
"(",
")",
")",
";",
... | Renders only the external contours. Each contour is individually colored as specified by 'colors'
@param contours List of contours
@param colors List of RGB colors for each element in contours. If null then random colors will be used.
@param out (Optional) Storage for output | [
"Renders",
"only",
"the",
"external",
"contours",
".",
"Each",
"contour",
"is",
"individually",
"colored",
"as",
"specified",
"by",
"colors"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L149-L161 | train |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderBinary | public static BufferedImage renderBinary(GrayU8 binaryImage, boolean invert, BufferedImage out) {
if( out == null || ( out.getWidth() != binaryImage.width || out.getHeight() != binaryImage.height) ) {
out = new BufferedImage(binaryImage.getWidth(),binaryImage.getHeight(),BufferedImage.TYPE_BYTE_GRAY);
}
try ... | java | public static BufferedImage renderBinary(GrayU8 binaryImage, boolean invert, BufferedImage out) {
if( out == null || ( out.getWidth() != binaryImage.width || out.getHeight() != binaryImage.height) ) {
out = new BufferedImage(binaryImage.getWidth(),binaryImage.getHeight(),BufferedImage.TYPE_BYTE_GRAY);
}
try ... | [
"public",
"static",
"BufferedImage",
"renderBinary",
"(",
"GrayU8",
"binaryImage",
",",
"boolean",
"invert",
",",
"BufferedImage",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
"||",
"(",
"out",
".",
"getWidth",
"(",
")",
"!=",
"binaryImage",
".",
"widt... | Renders a binary image. 0 = black and 1 = white.
@param binaryImage (Input) Input binary image.
@param invert (Input) if true it will invert the image on output
@param out (Output) optional storage for output image
@return Output rendered binary image | [
"Renders",
"a",
"binary",
"image",
".",
"0",
"=",
"black",
"and",
"1",
"=",
"white",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L382-L404 | train |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java | HomographyInducedStereoLinePt.process | public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
... | java | public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
... | [
"public",
"void",
"process",
"(",
"PairLineNorm",
"line",
",",
"AssociatedPair",
"point",
")",
"{",
"// t0 = (F*x) cross l'",
"GeometryMath_F64",
".",
"mult",
"(",
"F",
",",
"point",
".",
"p1",
",",
"Fx",
")",
";",
"GeometryMath_F64",
".",
"cross",
"(",
"Fx"... | Computes the homography based on a line and point on the plane
@param line Line on the plane
@param point Point on the plane | [
"Computes",
"the",
"homography",
"based",
"on",
"a",
"line",
"and",
"point",
"on",
"the",
"plane"
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java#L93-L115 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.