cv_bridge::Exception bayer_rggb8 vs 8UC3
I'm publishing /camera/image_raw
of type sensor_msgs/Image
from PointgreyDriver :
image_transport::SubscriberStatusCallback cb = boost::bind(&PointGreyCameraNodelet::connectCb, this);
it_pub_ = it_->advertiseCamera("image_raw", 5, cb, cb);
On the other hand I'm subscribing to that topic:
this->sub = new image_transport::Subscriber(this->imageTransport->subscribe("/camera/image_raw",1000,&p_vision_apriltags::callback,this));
imgTmp = cv_bridge::toCvCopy(msg,sensor_msgs::image_encodings::TYPE_8UC3);
The error I'm getting is an exception:
terminate called after throwing an instance of 'cv_bridge::Exception'
what(): [bayer_rggb8] is a color format but [8UC3] is not so they must have the same OpenCV type, CV_8UC3, CV16UC1 ....
[AprilTagsDetector-1] process has died [pid 29207, exit code -6, cmd /home/jaouadros/catkin_ws/devel/lib/p_vision_apriltags/p_vision_apriltags __name:=AprilTagsDetector __log:=/home/jaouadros/.ros/log/da606018-a91e-11e7-80aa-0024d7d045f0/AprilTagsDetector-1.log].
log file: /home/jaouadros/.ros/log/da606018-a91e-11e7-80aa-0024d7d045f0/AprilTagsDetector-1*.log
all processes on machine have died, roslaunch will exit
When I change TYPE_8UC3
to bgr8
it shows frames with random uniform colors.
What types should I be using?
normally TYPE_8UC3
works with image_raw
!