Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

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.

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.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.