astuff / avt_vimba_camera

ROS1/2 Driver for AVT cameras using VIMBA SDK.
Other
21 stars 43 forks source link

Resolution is wrong when using binning / decimation. #28

Closed MaxandreOgeret closed 2 years ago

MaxandreOgeret commented 3 years ago

First of all, what is the difference between binning and decimation ?

I believe decimation_x and binning_x will reduce the width. And I believe decimation_y and binning_y will reduce the height. Am I right ? But

When setting the launch parameters :

I believe that the values of the parameters width and height should be divided by 2 as well. Because those values will be outputted in the camera_info topic. am I right ?

It works fine for the y values (height) but doesn't for the x values (width). Setting the width to half will crop the image half just like if the decimation happened after the cropping which shouldn't be the case.


Config that works :

In the topic /camera_fx/image_raw we get images of good resolution : 1032x772

:warning: But the reported resolution in /camera_fx/camera_info is wrong, giving the values given as parameters : 1032x1544.


Have you ever had this problem ?

Thanks !

icolwell-as commented 3 years ago

Hi @MaxandreOgeret, I found a good description of binning and decimation on the LUCID camera website: https://support.thinklucid.com/knowledgebase/binning-and-decimation-on-lucid-cameras/

Regarding our camera Model (Mako G-319), I also found the following flow chart in the technical manual.

image

According to that chart, it looks like ROI cropping happens before any decimation or binning. I also noticed in the bottom-left there it says "BinningY is supported by Mako G-040C, G-158C, and G-234C only", so it looks like vertical binning isn't supported for you.

Regardless, the part of the code that I believe is responsible for the camera_info output is here: https://github.com/astuff/avt_vimba_camera/blob/master/src/avt_vimba_camera.cpp#L1084

I reviewed the code but don't see anything out of the ordinary, or anything different between x and y. At the bottom of that function it prints a bunch of information out to "ROS_INFO_STREAM". What does that output look like for you when you run the driver?

icolwell-as commented 3 years ago

Another suggestion is to open vimba viewer and try modifying the settings directly on the camera and looking at the output. This removes the ROS driver from the equation and may give you a better feel for what settings result in what type of output from the camera.

MaxandreOgeret commented 3 years ago

Thanks for your answer ! I have more insight now with the links you provided. And I will try the same configuration in Vimba viewer and update here.