Ask Your Question

rasmusskov's profile - activity

2015-09-25 11:43:26 -0600 received badge  Student (source)
2015-09-09 09:27:00 -0600 received badge  Editor (source)
2015-09-09 09:19:51 -0600 asked a question OpenCV namedWindow hangs when ROS ImageTransport is included

Hi everybody,

I have a problem with cv::namedWindow never returning when specific files are included in a project. I'm using OpenCV 2.4.10.

Minimal example that compiles and opens a window correctly:

main.cpp

#include <opencv/highgui.h>

int main( int argc, char** argv )
{
     cv::namedWindow( "window", CV_WINDOW_NORMAL|CV_GUI_NORMAL );
     cv::waitKey(0);
     return 0;
}

Additional files that causes the program to hang at cv::namedWindow:

grapper.h

#include <image_transport/subscriber_filter.h>

class Grabber {
public:
  Grabber(ros::NodeHandle n);
  image_transport::ImageTransport it_;
};

grapper.cpp

#include "grapper.hpp"

Grabber(ros::NodeHandle n)
    : it_(n)
  {
  }

The program hangs at namedWindow when grapper.cpp is compiled into the project, even though it is not used or referenced from main.cpp.

Does anyone have any idea on what's wrong and/or how to debug it? I would apreciate any help.