Ask Your Question
0

imshow() not working in while loop

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

SimonKirkman gravatar image

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

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);
        waitKey(100);
    }

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
0

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

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

Stats

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

Seen: 2,056 times

Last updated: Mar 06 '20