Getting the depth image from a Real Sense camera

Hi @cansik

I am trying to use your Java wrapper to get a depth image from a Real Sense D435, but I get a NullPointerException when the context is created in line 63 of RealSenseCamera.pde. Any ideas?

this.context = Context.create();

That is a bit offtopic now, but yes, the error is known and fixed in the original library. Iā€™ve uploaded a new prebuilt library to the realsense-processing project which should fix this nullpointer.

1 Like

@cansik

Thanks for updating the prebuilt lib. Sorry for going offtopic again (Iā€™m new here, please do advise me where else to ask a question like this), but Iā€™m still having issues with it. It now gives me the following error messages, while still highlighting the line where the context is created (line 63):

A library used by this sketch is not installed properly.
No library found for org.librealsense.Native
No library found for org.librealsense.Native
No library found for org.librealsense.Native
A library relies on native code thatā€™s not available.
Or only works properly when the sketch is run as a 32-bit application.

Hi! Maybe an admin could move this question to a new thread? Proposed title: ā€œGetting the depth image from a Real Sense cameraā€.

4 Likes

Iā€™ve since fixed the issue using the original wrapper by edwinRNDR and this script.

I found that the produced depth image was incorrect, because it wasnā€™t displaying depth from ā€œdeepest to nearestā€ but rather in multiple steps (you can see it in the background here).

I solved it by swapping line 49:

img.pixels[j] = 0xFF000000 | sArray[j];

to

img.pixels[j] = (sArray[j] / (float)6144) * (float)255;

1 Like

Iā€™ve now split this off into a new topic as requested. The original Kotlin topic has a link-back below the new top post.

3 Likes

You should tell me the at least the OS you are using, otherwise itā€˜s not possible to help you. And it seems you are using windows, which was not supported by the proof of concept.

But there is now a library with prebuilt libs for all OS in the repo.

Sorry, yes, I am using Windows. I have actually implemented a workaround in the form of a C++ executable that I launch from my Processing sketch. Itā€™s ugly but from there I can make the changes to the RealSense devices that I need for my program.

GrĆ¼ezi in d Schwiz