Realsense2 device is found, but cannot run program
hyeonjang opened this issue · 5 comments
For the RealSense2FrameGrabber
it is necessary to first enable the necessary streams. Here an example (samples/RealSense2DepthMeasuring.java#L44-L59):
// enable the color & depth stream of the realsense camera
rs2.enableColorStream(640, 480, 30);
rs2.enableDepthStream(640, 480, 30);
rs2.start();
I assume procamcalib
needs the start
method to directly enable at least the color input. In my opinion this should be included into the RealSense2FrameGrabber
, if no stream has been activated, instead of the exception. It is possible to activate de default color stream by just passing 0
as parameter for width, height and framerate. Especially on the 515 camera this could be important, because there we have different resolutions and stream formats than on the 400 series.
@saudet Do you think this is a good default behaviour? If so I will create a PR.
That sounds like a good idea, yes. The default imageWidth, imageHeight, and frameRate should be taken from the properties though: https://github.com/bytedeco/javacv/blob/master/src/main/java/org/bytedeco/javacv/FrameGrabber.java#L183
Thanks @cansik for fixing this! @hyeonjang please give it a try by replacing modules/javacv.jar
with this file: https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacv/1.5.8-SNAPSHOT/javacv-1.5.8-20220215.010447-6.jar