-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6594 from remibettan/android-intrisics-extrinsics…
…-added-to-wrapper Android intrisics extrinsics added to wrapper
- Loading branch information
Showing
8 changed files
with
295 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...s/android/librealsense/src/main/java/com/intel/realsense/librealsense/DistortionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.intel.realsense.librealsense; | ||
|
||
public enum DistortionType { | ||
NONE(0), | ||
MODIFIED_BROWN_CONRADY(1), | ||
INVERSE_BROWN_CONRADY(2), | ||
FTHETA(3), | ||
BROWN_CONRADY(4), | ||
KANNALA_BRANDT4(5), | ||
COUNT(6); | ||
|
||
private final int mValue; | ||
|
||
DistortionType(int value) { mValue = value; } | ||
public int value() { return mValue; } | ||
} |
17 changes: 17 additions & 0 deletions
17
wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Extrinsic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.intel.realsense.librealsense; | ||
|
||
public class Extrinsic { | ||
|
||
private float[] mRotation; // Column-major 3x3 rotation matrix | ||
private float[] mTranslation; // Three-element translation vector, in meters | ||
|
||
public Extrinsic(){ | ||
mRotation = new float[9]; | ||
mTranslation = new float[3]; | ||
} | ||
|
||
public Extrinsic(float[] rotation, float[] translation){ | ||
this.mRotation = rotation; | ||
this.mTranslation = translation; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Intrinsic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.intel.realsense.librealsense; | ||
|
||
public class Intrinsic { | ||
private int mWidth; | ||
private int mHeight; | ||
private float mPpx; | ||
private float mPpy; | ||
private float mFx; | ||
private float mFy; | ||
private DistortionType mModel; | ||
private int mModelValue; | ||
private float[] mCoeffs; | ||
|
||
|
||
public Intrinsic(){ | ||
mCoeffs = new float[5]; | ||
} | ||
|
||
public Intrinsic(int width, int height, | ||
float ppx, float ppy, | ||
float fx, float fy, | ||
int model, | ||
float[] coeffs){ | ||
this.mWidth = width; | ||
this.mHeight = height; | ||
this.mPpx = ppx; | ||
this.mPpy = ppy; | ||
this.mFx = fx; | ||
this.mFy = fy; | ||
this.mModel = DistortionType.values()[model]; | ||
this.mModelValue = model; | ||
this.mCoeffs = coeffs; | ||
} | ||
|
||
public void SetModel(){ | ||
this.mModel = DistortionType.values()[mModelValue]; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../android/librealsense/src/main/java/com/intel/realsense/librealsense/MotionIntrinsic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.intel.realsense.librealsense; | ||
|
||
public class MotionIntrinsic { | ||
|
||
/* mData matrix description: | ||
* Scale X cross axis cross axis Bias X \n | ||
* cross axis Scale Y cross axis Bias Y \n | ||
* cross axis cross axis Scale Z Bias Z */ | ||
private float[][] mData; | ||
private float[] mNoiseVariances; // Variance of noise for X, Y, and Z axis | ||
private float[] mBiasVariances; // Variance of bias for X, Y, and Z axis | ||
|
||
|
||
public MotionIntrinsic(){ | ||
mData = new float[3][4]; | ||
mNoiseVariances = new float[3]; | ||
mBiasVariances = new float[3]; | ||
} | ||
|
||
public MotionIntrinsic(float[][] data, float[] noiseVariances, float[] biasVariances){ | ||
this.mData = data; | ||
this.mNoiseVariances = noiseVariances; | ||
this.mBiasVariances = biasVariances; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...roid/librealsense/src/main/java/com/intel/realsense/librealsense/MotionStreamProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
package com.intel.realsense.librealsense; | ||
|
||
public class MotionStreamProfile extends StreamProfile { | ||
|
||
private MotionIntrinsic mIntrinsic; | ||
|
||
MotionStreamProfile(long handle) { | ||
super(handle); | ||
mOwner = false; | ||
mIntrinsic = null; | ||
} | ||
|
||
public MotionIntrinsic getIntrinsic() throws Exception { | ||
if(mIntrinsic == null){ | ||
mIntrinsic = new MotionIntrinsic(); | ||
nGetIntrinsic(mHandle, mIntrinsic); | ||
} | ||
return mIntrinsic; | ||
} | ||
|
||
private static native void nGetIntrinsic(long handle, MotionIntrinsic intrinsic); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters