Ask Your Question

imshow() not working in while loop

asked 2020-03-05 10:40:50 -0500

SimonKirkman gravatar image

updated 2020-03-06 07:28:37 -0500

I am trying to write an imshow command in a while loop which is part of a void thread but the debugger wont pick it up saying there is no instance of an overloaded function "imshow" in argument list.

void* Display(void* params) {
    Mat *pImg = (Mat*)params;
    namedWindow("video", WINDOW_AUTOSIZE);
    while (bDisplay)
        imshow("Video", pImg);

that is the code for the void thread. Any ideas on why it wont allow me to put an imshow in?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-03-05 23:59:39 -0500

berak gravatar image

no it is not about loops, there is indeed no overload for imshow(), that takes a pointer to a cv::Mat, you have to dereference it:

 imshow("Video", *pImg);
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-03-05 10:40:50 -0500

Seen: 467 times

Last updated: Mar 06 '20