#include<opencv2/imgcodecs.hpp>
#include<opencv2/highgui.hpp>
#include<string>
int main()
{
std::string path = "wallpaperflare.jpg";
cv::Mat img=cv::imread(path);
cv::imshow("Frame",img);
cv::waitKey(5000);
cv::VideoCapture cam(0);
while (1)
{
cam.read(img);
cv::imshow("VideoFrame",img);
cv::waitKey(1);
}
return 0;
}
I opened the first frame “Frame” for 5 seconds, but the program didn’t close the frame after 5 seconds before proceeding with the next line. Instead after 5 secs The Second frame “VideoFrame” is also opened but the first frame wasn’t closed yet. The first frame is open till the program exits. why the “Frame” is not closing?
I’m a beginner in OpenCV, please clarify my doubts.