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

Private member variable in Intrinsic class in Android Wrapper #7386

Closed
YichaoW opened this issue Sep 22, 2020 · 14 comments
Closed

Private member variable in Intrinsic class in Android Wrapper #7386

YichaoW opened this issue Sep 22, 2020 · 14 comments
Labels

Comments

@YichaoW
Copy link

YichaoW commented Sep 22, 2020

Hi,

I noticed that all member variables in intrinsic class are private and they don't have getter except for width and height. Is there any other way to get intrinsic value such as ppx and ppy?

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Intrinsic.java

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 22, 2020

Hi @YichaoW There is a very long and detailed discussion about reading instrinsics in the link below, so I will link to the part of the discussion that I think may be of particular interest to you, as it discusses printing the value of ppx and ppy in the Android log. You can of course return to the start and go through the entire discussion.

#6522 (comment)

@YichaoW
Copy link
Author

YichaoW commented Sep 22, 2020

Thanks @MartyG-RealSense ! Is there any java solution? I am not very familiar with C++ and the NDK wrapper.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 22, 2020

Hi again @YichaoW Intrinsics and extrinsics were added to the Android wrapper in SDK 2.37.0.

#4580
#6915

image

@YichaoW
Copy link
Author

YichaoW commented Sep 22, 2020

@MartyG-RealSense I knew they were added. But the variables stored in Intrinsics are private and I cannot access them.

@MartyG-RealSense
Copy link
Collaborator

A "pull" was submitted a week ago to add intrinsic private property getters to the Android wrapper. The submission has passed build checks but it looks as though it is not merged into the SDK yet.

#7342

@YichaoW
Copy link
Author

YichaoW commented Sep 25, 2020

Got it thanks

@YichaoW YichaoW closed this as completed Sep 25, 2020
@electro-logic
Copy link

Hello,
I can't get a StreamProfiles of type VideoStreamProfile using v2.50 on Android 9.

        var sensors = device.QuerySensors();
        foreach (var sensor in sensors)
        {                
            foreach (var sp in sensor.StreamProfiles)
            {
                // sp can't cast to VideoStreamProfile 
            }
        }

I am trying to get the intrinsic.

@MartyG-RealSense
Copy link
Collaborator

Hi @electro-logic There are very few references about obtaining intrinsics in Android, unfortunately.

A RealSense user at #6522 (comment) took the approach of storing intrinsics and extrinsics using C++ Native code in their Android application.

@electro-logic
Copy link

Any chance to get a Java compatible API?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 26, 2023

There is not an official Java wrapper or plans to create one, but a RealSense user created an unofficial Java wrapper several years ago.

https://github.com/edwinRNDR/librealsense/tree/master/wrappers/java

@electro-logic
Copy link

Hello, I'm on Android and I'm using the official library binding with Java, but I can't access the Intrinsic api

@MartyG-RealSense
Copy link
Collaborator

#6594 states that the API instruction for accessing intrinsics on Android is rs2_get_video_stream_intrinsics

@electro-logic
Copy link

Hello,
From my understanding (

rs2_get_video_stream_intrinsics(reinterpret_cast<const rs2_stream_profile *>(handle), &intr, &e);
) the API rs2_get_video_stream_intrinsics is not directly exposed, but can be used by calling GetIntrinsic() on a VideoStreamProfile instance. The problem I'm facing is that there is no way to get that instance (see my first post).

@MartyG-RealSense
Copy link
Collaborator

I will tag @remibettan into this discussion in case they can provide insight about your problem described at #7386 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants