add preview video
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user