Skip to content
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

Merged

Conversation

remibettan
Copy link
Contributor

@remibettan remibettan commented Jul 13, 2020

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

Copy link
Collaborator

@ev-mp ev-mp left a 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 Show resolved Hide resolved
src/android/jni/utils.cpp Outdated Show resolved Hide resolved
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];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new

Copy link
Contributor Author

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 Show resolved Hide resolved
src/android/jni/utils.cpp Outdated Show resolved Hide resolved
@@ -0,0 +1,6 @@
# Android Wrapper Code Fragments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


// helper method for retrieving float[3] from Point_3D object
std::shared_ptr<float> retrievePoint3D(JNIEnv *env, jobject point_3D) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

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 );
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// retrieving rs2_intrinsics from intrinsic object
// helper method for retrieving rs2_intrinsics from intrinsic object
rs2_intrinsics retrieveIntrinsic(JNIEnv *env, jobject intrinsic) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

@ev-mp ev-mp left a 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

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ev-mp ev-mp changed the base branch from ac to development July 20, 2020 15:47
@ev-mp ev-mp merged commit 1edff05 into IntelRealSense:development Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants