-1

I'm working with OpenCV programs in C++ and calling them in Matlab using calllib.

The thing is that when the program exits the cvNamedWindows does not close.

I've tried DestroyWindow and DestroyAllWindows but inside Matlab it won't close.

Here is some code

int main()
{
  int device = 0;
  vCap = VideoCapture( device );

  Mat img;
  vCap >> img;

  imshow("colour", img);
  cv::waitKey(1);

  namedWindow("colour",1);
  cv::destroyWindow("colour");
  return 0;
}
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102

1 Answers1

0

The post @AlexandreBizeau posted in comments has the answer,

cvStartWindowThread();
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102