-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Android intrisics extrinsics added to wrapper #6594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ev-mp
merged 7 commits into
IntelRealSense:development
from
remibettan:android-intrisics-extrinsics-added-to-wrapper
Jun 16, 2020
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
614d623
GetIntrinsics added - model is int instead of enum
remibettan d7b0bd7
intrinsics with the enum, but crashes after 2 calls to GetIntrinsics
remibettan d207174
video and motion intrinsics API added in android wrapper
remibettan 5d111a4
Extrinsics added to Wrapper, Intrinsics JNI functions corrected
remibettan 26a2c4b
pedantic comments corrections, from PR review
remibettan 05c4875
add api method rs2_register_extrinsics to android wrapper
remibettan d5ef9ec
pedantic changes
remibettan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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/Extrinsics.java
This file contains hidden or 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 Extrinsics { | ||
|
||
private float[] mRotation; // Column-major 3x3 rotation matrix | ||
private float[] mTranslation; // Three-element translation vector, in meters | ||
|
||
public Extrinsics(){ | ||
mRotation = new float[9]; | ||
mTranslation = new float[3]; | ||
} | ||
|
||
public Extrinsics(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/Intrinsics.java
This file contains hidden or 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 Intrinsics { | ||
remibettan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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 Intrinsics(){ | ||
mCoeffs = new float[5]; | ||
} | ||
|
||
public Intrinsics(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/MotionIntrinsics.java
This file contains hidden or 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 MotionIntrinsics { | ||
|
||
/* 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 MotionIntrinsics(){ | ||
mData = new float[3][4]; | ||
mNoiseVariances = new float[3]; | ||
mBiasVariances = new float[3]; | ||
} | ||
|
||
public MotionIntrinsics(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 hidden or 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 MotionIntrinsics mIntrinsics; | ||
|
||
MotionStreamProfile(long handle) { | ||
super(handle); | ||
mOwner = false; | ||
mIntrinsics = null; | ||
} | ||
|
||
public MotionIntrinsics getIntrinsics() throws Exception { | ||
if(mIntrinsics == null){ | ||
mIntrinsics = new MotionIntrinsics(); | ||
nGetIntrinsics(mHandle, mIntrinsics); | ||
} | ||
return mIntrinsics; | ||
} | ||
|
||
private static native void nGetIntrinsics(long handle, MotionIntrinsics intrinsics); | ||
} |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.