introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.61k stars 763 forks source link

OAK bug fixes and improvements #1143

Closed borongyuan closed 8 months ago

borongyuan commented 9 months ago

Fix distortion correction problem of small FOV devices. I have been testing with wide FOV devices before. When I tried OAK-D S2 today I found that it didn't work at all. I checked the doc and found that the default configuration does not perform distortion correction on small FOV devices. I can't understand why they do this. We need to force distortion correction on all devices.

Remove deprecated IMU firmware update API. enableFirmwareUpdate() is deprecated since https://github.com/luxonis/depthai-core/commit/12b198a67f9c7a56747666679f00763c35cf64e3. I don't feel the need to deal with firmware updates here. Most devices don't need to be updated. Or the user should have updated it in advance.

Add useSpecTranslation option. We have had some discussions about this parameter before (https://github.com/luxonis/depthai-core/issues/358 & https://github.com/luxonis/depthai-core/issues/847). But most users are probably unaware of this potential problem. Although they insist that the translation information from the board design data will have better accuracy in most cases. But I actually have a development version of OAK that is not for sale. They changed the color camera's FOV, global shutter, and IMU model according to my requirements. The camera modules are all glued on by hand, so I don't think there's any manufacturing precision. I also noticed that the RAE's lens looks a bit skewed as well, although I haven't tested it yet. So let’s use the calibration data by default. It guarantees at least a lower bound of accuracy and meets most users' expectations. From my experience, this parameter may have an impact on the accuracy and robustness of stereo VIO. If you read OpenVINS paper, you will find that mono mode often performs better than stereo mode. The accuracy of the baseline and different feature representations have a certain impact.

Reduce depth image noise and simplify calculation for compressed transport. Depth images have fewer textures than mono images and therefore have higher compression rates when using mjpeg compression. So we can set the quality to the highest level without consuming too much bandwidth. The advantage of this is that it can reduce the noise generated near the sharp edges during depth map compression. Especially at the edges where depth values are missing. These noises are mainly caused by DCT during jpeg encoding. This doesn't completely eliminate the noise, but it's better than before. It should be better to use lossless jpeg mode, but currently OpenCV is unable to decode it. We will see if there are other decoding methods later, such as using ffmpeg or nvjpeg. cv::divide() is supposed to be more efficient than the forEach method. It can handle division by 0.

matlabbe commented 8 months ago

My RAE has been shipped, next weekend I will be able to test more all your updates. Thx a lot keeping depthai integration up to date!