-
Notifications
You must be signed in to change notification settings - Fork 26
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
Realsense2: ClassNotFoundException #25
Comments
…for librealsense2 (issue bytedeco/procamcalib#25)
That's a bug in JavaCV, thanks for reporting! I've fixed it in the latest commit, but to make it work, /cc @cansik |
Hi! Thanks for the quick reply, I hadn't had a chance to try it before. While the original error is now fixed it seems like that procamcalib does not enable any streams of the Realsense2 device and I haven't seen an option where I could do that. Specifically the following line throws: https://github.com/bytedeco/javacv/blob/00793cc82ad94112971623e72093a854c87f2c92/src/main/java/org/bytedeco/javacv/RealSense2FrameGrabber.java#L187 Since procamcalib only works on CameraDevices and FrameGrabbers no stream is enabled. Is there currently a way to do this via the UI? Below is my current settings file. Furthermore: How would I calibrate multiple D435 cameras at once? E.g left and right IR as well as RGB. <?xml version="1.0" encoding="UTF-8"?>
<java version="15.0.1" class="java.beans.XMLDecoder">
<object class="org.bytedeco.javacv.CameraSettings" id="CameraSettings0">
<void method="add">
<object class="org.bytedeco.javacv.CameraDevice$CalibrationSettings" id="CameraDevice$CalibrationSettings0">
<void property="beanContext">
<object idref="CameraSettings0"/>
</void>
<void id="Integer0" property="bitsPerPixel"/>
<void property="deviceNumber">
<object idref="Integer0"/>
</void>
<void property="format">
<string>RS2_STREAM_INFRARED</string>
</void>
<void property="frameGrabber">
<class>org.bytedeco.javacv.RealSense2FrameGrabber</class>
</void>
<void property="frameRate">
<double>30.0</double>
</void>
<void property="imageHeight">
<int>1280</int>
</void>
<void property="imageWidth">
<int>720</int>
</void>
</object>
</void>
<void property="frameGrabber">
<class>org.bytedeco.javacv.RealSense2FrameGrabber</class>
</void>
</object>
<object class="org.bytedeco.javacv.ProjectorSettings" id="ProjectorSettings0">
<void method="add">
<object class="org.bytedeco.javacv.ProjectorDevice$CalibrationSettings">
<void property="beanContext">
<object idref="ProjectorSettings0"/>
</void>
</object>
</void>
</object>
<object class="org.bytedeco.javacv.Marker$ArraySettings"/>
<object class="org.bytedeco.javacv.MarkerDetector$Settings"/>
<object class="org.bytedeco.procamcalib.CalibrationWorker$GeometricSettings"/>
<object class="org.bytedeco.procamcalib.CalibrationWorker$ColorSettings"/>
</java>
Cheers, |
We'd have to implement using the As for supporting multiple cameras, simply increase the "quantity" property to 2 or more. |
That would be awesome! Thanks again for the quick reply. As for multiple cameras let me rephrase: |
The bug fix has been released with version 1.5.5, but work to support multiple video streams hasn't started yet, so I'll leave this issue opened for that. Contributions are welcome! |
Just for clarification, the I am thinking about how this would be implemented for the RealSense2FrameGrabber. The problem there is that the user has to enable the different streams, so And what about the stream format, because the color stream is currently @saudet Is there a similar FrameGrabber with different input channels that already implements |
videoStream gets used by FFmpegFrameGrabber, but there it makes sense because there is actually an order in the streams. It looks like the streams already have numbers in the case of RealSense too so let's just use those: https://github.com/bytedeco/javacpp-presets/blob/master/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java#L2683 As for the video format, well, don't worry about it. ProCamCalib might not be able to use them all, but calibration only makes sense for unprocessed images (color and IR), and it can use both RGB24 and GRAY8, so that's not an issue. |
We could use the stream order defined by realsense, but there are cameras with two infrared cameras or two colour cameras. There would then be no way to switch the stream from the left to the right channel. But we could implement it like that for now. Thank you for the clarification on the image formats. |
How can we differentiate between 2 cameras if they have the same stream number? |
Ok, sorry, In the RS terminology there is a
By default no stream is active and has to be enabled by the user of the library. I have now added the default color stream with the PR (will add the width / height setting). So the question is now how to index these different streams, because depending on the enabled streams, the camera may send us different streams which are not identifiable by a single number. Of course we could just define the order on our own. |
Ok, I see. Well, I think videoStream for FFmpeg sort works like the default value for your streams in grab(), so instead of picking streams.get(0), you'd do streams.get(videoStream) and that'd be good enough for our purposes. That said, it wouldn't allow a user to enable the streams, and that's not something that is part of the interface for FrameGrabber, so if none are selected by default, let's just enable the ones that are most used like RS2_STREAM_DEPTH, RS2_STREAM_COLOR, and RS2_STREAM_INFRARED. Does that make sense? |
Sounds good to me, I just changed the order of the streams. Color should be index |
Thanks @cansik for implementing support for video stream selection! @Faaux please give it a try by replacing |
@saudet Do you think it would make sense to release a new version with the fix applied in 1.5.8? At the moment, calibration with realsense cameras is not possible (except if you manually replace the jar). |
It's going to be released as 1.5.8, yes. |
@saudet I tried to calibrate a RealSense D455 with a projector and it seems that there are still problems. As mentioned in this comment, the order of the streams if And second, it seems that ProCamCalib expects a gray-8bit image, but what the RealSense2 delivers (if |
That's probably something that we need to add, yes. It shouldn't be too hard. Would you mind giving it a try?
Everything gets converted to grayscale since the ImageMode is set to GRAY here: |
Hi :),
I am trying to use procamcalib (latest) with a Realsense D435 device. Sadly I cannot pick Realsense2 for the frameGrabber dropdown (it wont select). When changing a settings file (see attached file settings.log) manually to use the Realsense2 Framegrabber and then loading it, I get an
ClassNotFoundException
.settings.log
The module folder does contain the librealsense2 module as well as the needed DLL so I dont think i need to install additional dependencies.
Any help would be much appreciated.
Best,
Faaux
The text was updated successfully, but these errors were encountered: