waitKey(1) freezes display output, is there a fix?
I'm using opencv(4.1.1) with ubuntu(18.04), as I understand my build uses GTK, so it uses that libraries function for reading the keypresses?
My problem now is that when you hold a key down, the frames no longer get drawn on screen. I suspect this has to do with waitkey not getting enough time to do the drawing, but how do you go about solving this?
The reason I want this is to control parameters using key inputs but having a freeze happen when sending many inputs is not preferable.
The code is as follows:
//create rtspsrc gstreamer pipe
std::string pipe = "rtspsrc location=rtsp://192.168.1.113:554/user=admin_password=_channel=1_OSD_stream=1.sdp latency=0 ! decodebin ! videoconvert ! appsink ";
cam = new cv::VideoCapture(pipe, cv::CAP_GSTREAMER);
while(true){
cap->grab();
cap->retrieve(currentframe);
currentFrame = cam->returnFrame();
markerFrame = markerFilter->processFrame(currentFrame);
cv::imshow("out", currentFrame);
cv::imshow("markerInfo", markerFrame);
//control1.pollInput(); //If not using control, use cv::waitKey(10);
//getchar
//char c=getchar();
// if(c=='x'){
// cout << " x is pressed" << endl;
// waitKeyEx(1);
}
waitKeyEx(1);
}