Ask Your Question

can image_proc/rectify nodelet process the image before image_proc/crop_decimate nodelet?

asked 2012-10-09 07:04:05 -0500

aldo85ita gravatar image

updated 2012-10-10 22:47:13 -0500

Hi guys, image_proc/rectify can't public any camera_info message, but image_proc/crop_decimate can do it. So, it seems that I can process a raw image before with crop_decimate and after with rectify, but not viceversa. Is it right?

Note: I tried to process rectifying before cropping with the following commands:

rosrun nodelet nodelet standalone image_proc/rectify /image_mono:=gscam/image_raw /camera_info:=gscam/camera_info
rosrun nolet nodelet standalone image_proc/crop_decimate _x_offset=1 _y_offset=1 _width=639 _height=439 /camera/image_raw:=image_rect /camera/camera_info:=gscam/camera_info

But this latest nodelet gives me back the following errors:

[ WARN] [1349944791.310821026]: [image_transport] Topics '/image_rect' and '/camera_info' do not appear to be synchronized. In the last 10s:
    Image messages received:      288
    CameraInfo messages received: 0
    Synchronized pairs:           0

Node [/image_proc_crop_decimate]
 * /camera_out/camera_info [sensor_msgs/CameraInfo]
 * /camera_out/image_raw/compressed [sensor_msgs/CompressedImage]
 * /image_proc_crop_decimate/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera_out/image_raw/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /image_proc_crop_decimate/parameter_updates [dynamic_reconfigure/Config]
 * /rosout [rosgraph_msgs/Log]
 * /camera_out/image_raw [sensor_msgs/Image]
 * /camera_out/image_raw/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera_out/image_raw/theora/parameter_updates [dynamic_reconfigure/Config]
 * /camera_out/image_raw/theora [theora_image_transport/Packet]
 * /camera_out/image_raw/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]

 * /image_rect [sensor_msgs/Image]
 * /camera_info [unknown type]

 * /camera_out/image_raw/theora/set_parameters
 * /camera_out/image_raw/compressed/set_parameters
 * /image_proc_crop_decimate/set_parameters
 * /image_proc_crop_decimate/set_logger_level
 * /image_proc_crop_decimate/get_loggers
Pid: 9120
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /camera_out/image_raw
    * to: /mbn_visualizer
    * direction: outbound
    * transport: TCPROS
 * topic: /image_rect
    * to: http://aldo-ubuntu:44836/
    * direction: inbound
    * transport: TCPROS

Note: this is my node connections: image description

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-10-09 07:54:36 -0500

joq gravatar image

updated 2012-10-11 02:24:13 -0500

I don't see why you should not be able to run rectify first. The original camera_info topic is still available, so rectify need not duplicate it.

If you tried that and it did not work, please update your question with whatever error messages you received.

EDIT: looks like your topic names got mixed up with all the remapping. It looks like /gscam/camera_info was not passed to your mbn_visualizer node correctly.

It might work better to follow the mini-tutorial for image_proc recommendation of running image_proc in the camera's namespace:

$ ROS_NAMESPACE=/gscam rosrun image_proc image_proc

This runs image_proc in the /gscam namespace, so it publishes /gscam/image_rect while leaving /gscam/camera_info intact. That is generally less confusing than remapping all those topics. The timestamps should remain unaltered.

You might be able to run the image_crop nodelet by remapping camera:=gscam. It seems to follow different conventions than the other image_proc nodelets.

edit flag offensive delete link more


Hi @joq, I edited my post ading more information. I suspect that the origin of timestamp problem (showed in the Warning above) is due to "/camera_info [unknown type]" topic subscription. Have you got any idea to fix it? Thank you

aldo85ita gravatar image aldo85ita  ( 2012-10-10 22:55:14 -0500 )edit

Hi @joq, you're right: I need to specify the ROS_NAMESPACE=/gscam for rectify nodelet. If I don't do it and I merely remap input topic of proc_decimate, this last can't get gscam/camera_info. Below I 'll put the summay of the used commands.

aldo85ita gravatar image aldo85ita  ( 2012-10-11 04:37:15 -0500 )edit

answered 2012-10-11 04:39:54 -0500

aldo85ita gravatar image

Follow the suggestion of @joq, these are the commands used to run image_proc nodelets properly:


export GSCAM_CONFIG="v4l2src num-buffers=-1 device=/dev/video1 caps=\"video/x-raw-yuv,width=640,height=480,format=(fourcc)YUY2\" ! ffmpegcolorspace"
roscd gscam
cd bin
rosrun gscam gscam


export ROS_NAMESPACE=/gscam
rosrun image_proc image_proc


rosrun nodelet nodelet standalone image_proc/crop_decimate _x_offset=0 _y_offset=0 _width=638 _height=438  /camera/image_raw:=gscam/image_rect_color /camera/image_info:=gscam/camera_info


rosrun mbn_visualizer mbn_visualizer /image_topic:=camera_out/image_raw
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-10-09 07:04:05 -0500

Seen: 1,277 times

Last updated: Oct 11 '12