ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Here is the example how to copy your ImageConstPtr& object to opencv obj:
void filterImage (const sensor_msgs::ImageConstPtr& rgb_msg) { cv::namedWindow(WINDOW); cv_bridge::CvImagePtr cv_ptr; try { cv_ptr = cv_bridge::toCvCopy(rgb_msg, enc::BGR8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow(WINDOW, cv_ptr->image);
cv::waitKey(10);
2 | No.2 Revision |
Here is the example how to copy your ImageConstPtr& object to opencv obj:
void filterImage (const sensor_msgs::ImageConstPtr& rgb_msg) { cv::namedWindow(WINDOW); cv_bridge::CvImagePtr cv_ptr; try { cv_ptr = cv_bridge::toCvCopy(rgb_msg, enc::BGR8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow(WINDOW, cv_ptr->image);
cv::waitKey(10);
}
3 | No.3 Revision |
Here is the example how to copy your ImageConstPtr& object to opencv obj:
void filterImage (const sensor_msgs::ImageConstPtr& rgb_msg)
{
cv::namedWindow(WINDOW);
cv_bridge::CvImagePtr cv_ptr;
try
{
cv_ptr = cv_bridge::toCvCopy(rgb_msg, enc::BGR8);
enc::BGR8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow(WINDOW, cv_ptr->image);
cv::waitKey(10);
}
4 | No.4 Revision |
Here is the example how to copy your ImageConstPtr& object to opencv obj:
void filterImage (const sensor_msgs::ImageConstPtr& rgb_msg)
{
cv::namedWindow(WINDOW);
rgb_msg)
{
cv::namedWindow(WINDOW);
cv_bridge::CvImagePtr cv_ptr;
cv_ptr;
try
{
{
cv_ptr = cv_bridge::toCvCopy(rgb_msg, enc::BGR8);
}
enc::BGR8);
}
catch (cv_bridge::Exception& e)
{
e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow(WINDOW, cv_ptr->image); }
cv::waitKey(10);
cv::imshow(WINDOW, cv_ptr->image);
cv::waitKey(10);
}