pnarvor / oculus_ros

ROS1 node for the Blueprint Oculus front scan sonar.
0 stars 0 forks source link

There is a bright line on the sonar image #1

Open django010 opened 1 year ago

django010 commented 1 year ago

Hello, there is a bright line of approximately two pixels on the left side of my sonar image. Do you know what could be causing this? 2023-07-15 10-30-35 的屏幕截图

pnarvor commented 1 year ago

This line is actually 4 pixels (bytes) wide. It is actually a 4 bytes wide little endian unsigned int "vertical" array representing the gain of the respective data rows.

In your case, a row should be 260 bytes wide. The actual data is 256 bytes wide (one for each bearing direction), the first 4 being the gain value.

To obtain gain corrected data (You should use gain corrected data if you plan to use the sonar for anything other than visualisation), divide the pixel values of each row by the square root of its associated gain value (don't forget to convert the array to floating point values beforehand).

Note that this gain is not per say a physical gain. It probably correspond to a rescaling of the acoustical data before encoding it on 8bits (256) values. Therefore, if you do not compensate for this gain, you will end up with non-physical artifacts on your sonar data (typical artifact is a dark strip around point-like powerful scatterers)

Note 2: It seems that this "encoding gain" and the time varying gain of the sonar are both encoded into this 4 bytes gain value.