ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

XTion/Openni2 image flipped

asked 2014-12-28 11:23:53 -0500

MarkyMark2012 gravatar image

updated 2014-12-30 07:41:04 -0500

Hi all,

This will be a simple question I'm sure. Currently using XTIon running a openni2_camera_node. This depth and rgb images are coming through fine, but that flipped about the Y axis. Is there something I need to set to correct this?

I am using the command below, with the resulting output. The last be is my modification to the code as it wasn't detecting the resolution on the pi

pi@toeminator ~ $ rosrun openni2_camera openni2_camera_node
[ INFO] [1419945763.946308307]: creating image_transport... this might take a while...
[ERROR] [1419945766.605981936]: Tried to advertise a service that is already advertised in this node [/openni2_camera/set_camera_info]
[ INFO] [1419945766.627862571]: using default calibration URL
[ INFO] [1419945766.641525343]: camera calibration URL: file:///home/pi/.ros/camera_info/rgb.yaml
[ERROR] [1419945766.655618108]: Unable to open camera calibration file [/home/pi/.ros/camera_info/rgb.yaml]
[ WARN] [1419945766.668209898]: Camera calibration file /home/pi/.ros/camera_info/rgb.yaml not found.
[ WARN] [1419945766.678064734]: Using default parameters for RGB camera calibration.
[ INFO] [1419945766.683336646]: using default calibration URL
[ INFO] [1419945766.693109483]: camera calibration URL: file:///home/pi/.ros/camera_info/depth.yaml
[ERROR] [1419945766.701483343]: Unable to open camera calibration file [/home/pi/.ros/camera_info/depth.yaml]
[ WARN] [1419945766.711815171]: Camera calibration file /home/pi/.ros/camera_info/depth.yaml not found.
[ WARN] [1419945766.724518959]: Using default parameters for IR camera calibration.
Warning: USB events thread - failed to set priority. This might cause loss of data...
Available depth modes
0: 320x240, 30 fps, 100 format
1: 320x240, 30 fps, 101 format
2: 320x240, 60 fps, 100 format
3: 320x240, 60 fps, 101 format
4: 640x480, 30 fps, 100 format
5: 640x480, 30 fps, 101 format
6: 160x120, 30 fps, 100 format
7: 160x120, 30 fps, 101 format
[ INFO] [1419945768.719023684]: Everything set up... lets stream some images

The images below show the image streamed back as viewed in rqt (top) and bottom is how the scene really looks (I've flipped is manually)

image description

Many Thanks


edit retag flag offensive close merge delete


Please clarify what you mean by flipped and which axis you are referring to.

tfoote gravatar image tfoote  ( 2014-12-28 20:55:31 -0500 )edit

It's flipped about the Y axis as you look at it. i.e. the left is on the right and the right is on the left. The image is the correct re top and bottom

MarkyMark2012 gravatar image MarkyMark2012  ( 2014-12-29 03:27:32 -0500 )edit

Please explain yoiur full setup so we can reproduce it? What are you running with what parameters? What visualizer are you running with what settings? Commands and console outputs are useful. A screen capture would be helpful as well.

tfoote gravatar image tfoote  ( 2014-12-29 10:53:35 -0500 )edit

Please see guidelines for asking questions at:

tfoote gravatar image tfoote  ( 2014-12-29 11:02:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-30 01:52:15 -0500

MarkyMark2012 gravatar image

updated 2015-05-30 01:54:14 -0500

Ok finally found the solution to this. For some reason the VideoStream in Openni2 (not sure about 1) has mirroring enabled as default. i.e the image is shown as if seen in a mirror. To correct this the openni2_camera.cpp file needs to be updated with the lines:


This means that this image will go from being this (mirrored)

image description

to non-mirrored

image description

Additional I've built all the underlying drivered et al from source as this runs on a raspberry pi

Hopefully this will be of use some time...


edit flag offensive delete link more



Thanks so much for this, been wondering why my laserscan was upside down for months now and never realized the image was inverted! Solved my issue!

miguel gravatar image miguel  ( 2015-10-05 10:38:14 -0500 )edit

Question Tools

1 follower


Asked: 2014-12-28 11:23:53 -0500

Seen: 1,257 times

Last updated: May 30 '15