-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
android-intrinsics-extrinsics-utils-functions #6818
android-intrinsics-extrinsics-utils-functions #6818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several comments to review.
Can you add the unit-test as well ?
src/android/jni/utils.cpp
Outdated
jclass pixel_2D_class = env->GetObjectClass(pixel_2D); | ||
jfieldID pixel_x_field = env->GetFieldID(pixel_2D_class, "mX", "I"); | ||
jfieldID pixel_y_field = env->GetFieldID(pixel_2D_class, "mY", "I"); | ||
float* pixel = new float[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,6 @@ | |||
# Android Wrapper Code Fragments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/android/jni/utils.cpp
Outdated
|
||
// helper method for retrieving float[3] from Point_3D object | ||
std::shared_ptr<float> retrievePoint3D(JNIEnv *env, jobject point_3D) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
Log.d(TAG, "depth = " + depthAtMiddleOfFrame); | ||
Pixel depth_pixel = new Pixel(w/2, h/2); | ||
Point_3D depth_point = Utils.deprojectPixelToPoint(depthFrameIntrinsic, depth_pixel, depthAtMiddleOfFrame ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The projection API calls receive distance in meters, not raw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/android/jni/utils.cpp
Outdated
jfieldID to_pixel_y_field = env->GetFieldID(to_pixel_class, "mY", "F"); | ||
env->SetFloatField(toPixel, to_pixel_x_field, to_pixel[0]); | ||
env->SetFloatField(toPixel, to_pixel_y_field, to_pixel[1]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/android/jni/utils.cpp
Outdated
|
||
// retrieving rs2_intrinsics from intrinsic object | ||
// helper method for retrieving rs2_intrinsics from intrinsic object | ||
rs2_intrinsics retrieveIntrinsic(JNIEnv *env, jobject intrinsic) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name retireveIntrinsic
is more appropriate in the context of stream/frame profile.
Can we consider intrinsic_jni2rs
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - changed to intrinsic_jobject2rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comments for the extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Android Wrapper - API functions added:
rs2_deproject_pixel_to_point
rs2_transform_point_to_point
rs2_project_point_to_pixel
rs2_fov
rs2_project_color_pixel_to_depth_pixel
Triggered by jira ticket: DSO-15199