Unable to display image with cvbridge
Hi,
I am reading an image using the cv-bridge API with ROS and I just want to display the image to see what cv_bridge is processing as I need to debug the algorithm. My code is :
static const std::string OPENCV_WINDOW = "Image window";
class abc
{
public:
abc() { cv::namedWindow(OPENCV_WINDOW); }
void function();
};
void function()
{
cv_bridge::CvImagePtr cv_ptr(new cv_bridge::CvImage);
std::vector<cv::Mat> channels;
std::vector<cv::Mat> a_ch(3);
cv_ptr->image = cv::imread("jackal_flipped_image.png",CV_LOAD_IMAGE_COLOR);
cv_ptr->encoding = "bgr8";
....blah...
cv::imshow(OPENCV_WINDOW,cv_ptr->image);
cv::waitKey(10);
}
The image window comes up but does not show anything. It is just white in color. What am I missing or doing wrong?
Regards, rsmitha.