c++ - Can't cat image from the videostream opencv -
other questions did't me, ask mine
can't image videocam using latest opencv library.
void showcam(int cameratobeopened) { int = 0; cv::mat frame; cv::videocapture cap(cameratobeopened); cvnamedwindow("camera", cv_window_normal); while (true) { if (cap.read(frame)) imshow("camera", frame); char c = cvwaitkey(50); if (c == 27) break; if (c == 32) { char filename[200]; sprintf_s(filename, "\test pictures\test_%d.jpg", i); i++; cv::imwrite(filename, frame); std::cout << "image has been captured" << std::endl; } }
it doesn't generate mistakes, can't find images in folder.
Comments
Post a Comment