Another Calibration Method

Post Reply
MiguelArgolo
Posts: 8
Joined: Thu Feb 20, 2020 6:41 pm

Another Calibration Method

Post by MiguelArgolo »

Hi, I'm working with other calibration method to compensate some underwater distortions, I need to know if it's possible to bypass the original nerian's calibration process and send a pair of rectified images through API and get the disparity map to generete a 3d point cloud.

Regards

Miguel Argolo
k.schauwecker
Posts: 125
Joined: Mon Mar 25, 2019 1:12 pm

Re: Another Calibration Method

Post by k.schauwecker »

It is possible to send input image data to SceneScan through the API. If you press "reset calibration" in the web interface, SceneScan will forget it's calibration and process the input image data without rectification.

Please be aware that when streaming input data through the network, the performance will be significantly reduced due to bandwidth limitations. It is highly recommended to switch to TCP protocol in this case, as significant packet loss will be expected.

If your own calibration model matches the commonly used Brown's distortion model, you could also upload your own calibration file. Our lens distortion parameters match the parameter order that is used by OpenCV (see https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html)
MiguelArgolo
Posts: 8
Joined: Thu Feb 20, 2020 6:41 pm

Re: Another Calibration Method

Post by MiguelArgolo »

Thank you for the answer. Is it possible to upload the calibration file through API?
Regards
Miguel Argolo
k.schauwecker
Posts: 125
Joined: Mon Mar 25, 2019 1:12 pm

Re: Another Calibration Method

Post by k.schauwecker »

Unfortunately this is not possible. The calibration file can only be uploaded through the web interface. I guess the web-interface itself could be called by a script to automate this. We did use "curl" before for similar scripting.
MiguelArgolo
Posts: 8
Joined: Thu Feb 20, 2020 6:41 pm

Re: Another Calibration Method

Post by MiguelArgolo »

When I try to send images using TCP I received this message from log:
daemon.info stereod: Connection from 192.168.10.2:40065
02:03:09 daemon.info stereod: Fps: 0.01
02:03:11 daemon.err stereod: Received invalid header!
02:03:11 daemon.info stereod: WebSocket connection closed
I'm using basically the same code from library example to connect.

Code: Select all

asyncTrans.reset(new AsyncTransfer(devices[0]));
and I've changed the network settings to TCP and enabled Jumbo frames
Using Nvcom I can send without problems.

P.S:Using UDP works but due to high resolution images(1920x1200) consume high bandwith and freeze sometimes.
By the way how to use the plugins on new firmware? :geek:

Regards
Miguel Argolo
k.schauwecker
Posts: 125
Joined: Mon Mar 25, 2019 1:12 pm

Re: Another Calibration Method

Post by k.schauwecker »

Hi Miguel,

according to your log, you seem to also be connected through a window of the web interface. Please close any web interface video display, as video data cannot be streamed to both at the same time.

However, this is unlikely the cause of the invalid header error. Which firmware version and client software version are you running?

Switching to TCP will consume just as much bandwidth as with UDP. If you want to reduce the bandwidth you should reduce the frame rate by reducing the trigger rate. If transmission freezes occasionally, then this suggests a reliability issue with your network. Please monitor the number of dropped frames which is a good indicator for network reliability problems.
MiguelArgolo
Posts: 8
Joined: Thu Feb 20, 2020 6:41 pm

Re: Another Calibration Method

Post by MiguelArgolo »

I'm using: Firmware 5.02, libvisiontransfer 7.2.1, ROS nerian-Vision 3.7.0. The web interface it isn't showing the preview, I'm just using it as log monitor, my frame rate is set to 2 fps. I've made the test with the browser closed, same error. I put my code inside a try-catch, receiving a exception: Connection reset by peers, and same status message: invalid header. My setup is simple a Ethernet cable plugged directly from my computer to SceneScan.
When I use Nvcom(libvisiontranfer 7.2.1) with the same folder I can perform everything. Send images from folder and catch them with nerian's Ros package.

Regards
Miguel Argolo
k.schauwecker
Posts: 125
Joined: Mon Mar 25, 2019 1:12 pm

Re: Another Calibration Method

Post by k.schauwecker »

Hi Miguel,

The connection reset error can occur with TCP, as the TCP connection needs to be closed by SceneScan whenever the image processing is restarted (e.g. whenever changing a device parameter).

I'm surprised that it works with NVCom but not your own code. Are you able to record a failure case with wireshark?

Btw, the plug-in mechanism was added for us to write and deploy custom features for specific customers.
MiguelArgolo
Posts: 8
Joined: Thu Feb 20, 2020 6:41 pm

Re: Another Calibration Method

Post by MiguelArgolo »

Hi, maybe I figured out what's going on:
Checking the wireshark's messages with my code I receive a TCP_FULL_WINDOW follow by TCP_ZERO_WINDOW many times.
I realized that I was sending from a connection and trying to read from another connection. Nerian's device does not allow multiple connections am I right?
Nvcom send and receive in a same tcp connection, right?

I'm using ROS kinetic, my ros package send images from folder and I'm trying to read the disparity map using nerian_stereo ROS package using a tcp connection.

Regards
Miguel Argolo
k.schauwecker
Posts: 125
Joined: Mon Mar 25, 2019 1:12 pm

Re: Another Calibration Method

Post by k.schauwecker »

Hi Miguel,

yes, SceneScan can only handle one connection at a time. You could insert your sending code into our ros node. The code is available on github:
https://github.com/nerian-vision/nerian_stereo

Regards,
Konstantin
Post Reply