add preview video

This commit is contained in:
2023-05-12 17:09:03 +02:00
parent ab566b209a
commit 7ffa5e29ea
5 changed files with 21 additions and 10 deletions

View File

@@ -36,8 +36,8 @@ int main() {
const string contoursWindow = "Contours";
const string thresholdWindow = "Threshold";
namedWindow(contoursWindow, WINDOW_FREERATIO);
namedWindow(thresholdWindow, WINDOW_FREERATIO);
namedWindow(contoursWindow, WINDOW_AUTOSIZE);
namedWindow(thresholdWindow, WINDOW_AUTOSIZE);
const string UI = "Threshold";
int threshold = 65;
@@ -47,6 +47,11 @@ int main() {
Mat imgFiltered;
Detector detector;
//VIDEO
//VideoWriter threshOut("threshold.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 24, Size(cap.get(3), cap.get(4)));
//VideoWriter imgOut("makerDetection.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 24, Size(cap.get(3), cap.get(4)));
while (cap.read(frame)) {
// --- Process Frame ---
@@ -63,11 +68,21 @@ int main() {
imshow(contoursWindow, imgFiltered);
imshow(thresholdWindow, videoStreamFrameGray);
//VIDEO
//threshOut.write(videoStreamFrameGray);
//imgOut.write(imgFiltered);
if (waitKey(10) == 27) {
break;
}
}
cap.release();
//VIDEO
//threshOut.release();
//imgOut.release();
destroyAllWindows();
return (0);