[ros-users] cvToImgMsg for ROI images

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Kei Okada
日付:  
To: ros-users
題目: [ros-users] cvToImgMsg for ROI images
Hi,

Does cv_bridge support converting ROI image to ROS msg?

I'm trying to publish ROI cropped image as followings, however the
hoge.ppm and published image message are differ.
hoge.ppm start from (width/2 height/2) of the original image but
published image starts from (0 0).Both image size are width/2 and height/2.

          IplImage *frame = ....;
          int width = frame->width, height = frame->height;
          cvSetImageROI(frame, cvRect(width/2, height/2, width/2, height/2));
          cvSaveImage("hoge.ppm", frame);
          pub_narrow_.publish(bridge.cvToImgMsg(frame, "bgr8"));


==
Kei Okada