microsoft / Azure_Kinect_ROS_Driver

A ROS sensor driver for the Azure Kinect Developer Kit.
MIT License
296 stars 222 forks source link

Dynamic reconfiguration of RGB camera parameters #74

Open shuntaraw opened 4 years ago

shuntaraw commented 4 years ago

Is your feature request related to a problem? Please describe. Currently camera parameters (brightness, exposure, contrast, etc) cannot be adjusted. It would be nice if these parameters can be changed at run time.

Describe the solution you'd like Implement dynamic_reconfigure interface to call the color sensor control commands.

As a reference, realsense2_camera provides such a reconfiguration interface. The interface of rqt_reconfigure looks like this.

Describe alternatives you've considered These parameter may be set on start up via ros parameters. This is not an alternative solution and should be implemented as the way to set the default values.

Additional context When RGB images from multiple kinects are fused, the color can be inconsistent due to exposure mismatch. I would like to disable auto exposure and set the absolute value.

skalldri commented 4 years ago

This seems like a useful feature to have. Triage approved.

Enes1097 commented 2 years ago

Hey, has this been implemented already? :)

ooeygui commented 2 years ago

No this has not been implemented. Can you tell me more about the scenario you are looking to enable?

Enes1097 commented 2 years ago

I'm trying to do an extrinsic Calibration between the Azure Kinect DK Camera and an IMU (not the in-built Kinect IMU) by using the fairly popular ROS1 Node Package kalibr (https://github.com/ethz-asl/kalibr). To get the calibration parameters using this package, both the Camera and IMU have to be rigidly connected with each other to ensure no relative moment between them. Then they have to be moved along the 6 different axis of the IMU (3 for accelerometer and 3 for gyrometer) in front of a target. The target should be in view of the camera during the whole procedure.

The problem that many have been encountering with using rolling shutter cameras instead of global shutter cameras is the increased motion blur in the camera images. This leads to inaccurate calibration parameters, because detecting the features of the target is very important. A proposed solution that I have been seeing quite a few times is, making use of tricks to reduce the motion blur. In the case of Rolling Shutter cameras this could be achieved by increasing the FPS, using a LED floodlight or by reducing the exposure time to a minimum. The FPS I could easily change by changing the value in the launch file, the second one is trivial. Changing the exposure time tho is were I was struggling, cause I didn't know how to change it with ROS.

P.S.: I still figured out a way to change the exposure time and make it work for my measurements. After plugging in the camera and opening the k4aviewer, I changed the exposure time to what I wanted and then closed the k4aviewer. The parameters are now "saved" on the camera and when opening RVIZ with ROS I can see the image with the set exposure time. This way is still very tedious, because it only saves the values as long as the camera is plugged in. And it requires quite a few steps every time.

TheodoroCardoso commented 1 year ago

Hey, Any progress on this issue?

We were also able to change the color control parameters in the k4aviewer, however, losing the configuration every time the USB is unplugged or power is cycled is not an option as we intend to deploy the camera in a production environment and the customer won't be able to retune it.

Instead of dynamic_reconfigure, is there any way to set such parameters through the launch file? Any workaround suggestions would be appreciated.

fdila commented 3 months ago

For anyone still interested I added the "color control" settings as parameters in our fork (in the humble branch): https://github.com/iralabdisco/Azure_Kinect_ROS_Driver