Gazebo | Ignition | Community
Ask Your Question

RGBD camera noise model

asked 2015-10-09 02:20:07 -0500

I saw there are many sensor models and plugins in order to simulate an RGB camera (either Asus, Kinect, etc). However, I do not see any way to include noise in both RGB and Depth, neither in Gazebo nor in the available plugins. I tried the <noise> tag in the sensor but it seems to have no effect.

Is there any gazebo_ros plugin (or Gazebo plugin) somewhere to simulate the RGB camera more accurately?

Thank you!

For completeness, I include the part of the sensor of my model:

    <sensor type="depth" name="rgbd_camera">
            <noise>   <!-- This does apparently nothing neither RGB nor depth-->
        <plugin name="multirotor_rgbd_plugin" filename="">
edit retag flag offensive close merge delete


Any ideas anyone?

asdfjkl gravatar imageasdfjkl ( 2016-05-26 18:43:36 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-05-27 11:10:03 -0500

nkoenig gravatar image

You will need to implement your own plugin to add depth noise.

edit flag offensive delete link more


Hi @nkoenig Is it the recommended way to achieve this? I think someone can simply add noise to camera sensor using noise model. But this feature is aparently not available in DepthCamera sensor. Any specific reasons to omit that or can we expect this feature in a future release? Note: This requirement is also reported in

AravindaDP gravatar imageAravindaDP ( 2017-01-26 07:55:18 -0500 )edit

Hi, did you manage to add noise to the depth point cloud? If so, did you write your own plugin or did you find another (easier) way? I'm stuck at the same problem.

RedJohn gravatar imageRedJohn ( 2018-06-01 08:06:12 -0500 )edit

answered 2018-07-12 03:57:46 -0500

RedJohn gravatar image

updated 2018-07-12 03:59:03 -0500

I had to add my own implementation to add noise to a depth image from a kinect camera. I did this in my python program, not in a custom C++ sensor plugin. I simply added some gaussian noise to it and set some random pixels to zero. Can't really tell if this is a good solution or anyhow approximating the noise of a real camera, but anyway this is how I've done it:

data = rospy.wait_for_message('/camera/depth/image_raw', Image, timeout=5)
# change encoding of the image
bridge = CvBridge()
cv_image = bridge.imgmsg_to_cv2(data, desired_encoding="32FC1")
# convert to a numpy array
image = np.array(cv_image, dtype=np.float)
# adding noise to (simulated) depth image
image = image + np.random.normal(0.0, 10.0, image.shape)
# set approx. 5% of all pixels to zero
mask = (np.random.uniform(0,1,size=image.shape) > 0.95).astype(np.bool)
image[mask] = 0
# normalizing image
cv2.normalize(image, image, 0, 255, cv2.NORM_MINMAX)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-10-09 02:20:07 -0500

Seen: 2,961 times

Last updated: Jul 12 '18