projects
/
experiments
/
opencv_trail_effect.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefile: add a target for an "accumulate" effect
[experiments/opencv_trail_effect.git]
/
opencv_trail_effect.cpp
diff --git
a/opencv_trail_effect.cpp
b/opencv_trail_effect.cpp
index
5a4e928
..
357cc42
100644
(file)
--- a/
opencv_trail_effect.cpp
+++ b/
opencv_trail_effect.cpp
@@
-142,15
+142,15
@@
int main(int argc, char *argv[])
goto out;
}
goto out;
}
- frame_size = cv::Size((int) inputVideo.get(
CV_
CAP_PROP_FRAME_WIDTH),
- (int) inputVideo.get(
CV_
CAP_PROP_FRAME_HEIGHT));
+ frame_size = cv::Size((int) inputVideo.get(
cv::
CAP_PROP_FRAME_WIDTH),
+ (int) inputVideo.get(
cv::
CAP_PROP_FRAME_HEIGHT));
if (output_file) {
if (output_file) {
- int fps = inputVideo.get(
CV_
CAP_PROP_FPS);
+ int fps = inputVideo.get(
cv::
CAP_PROP_FPS);
if (fps < 0)
fps = 25;
if (fps < 0)
fps = 25;
- outputVideo.open(*output_file,
CV_FOURCC
('M','J','P','G'), fps, frame_size, true);
+ outputVideo.open(*output_file,
cv::VideoWriter::fourcc
('M','J','P','G'), fps, frame_size, true);
if (!outputVideo.isOpened()) {
std::cerr << "Could not open the output video for write." << std::endl;
ret = -1;
if (!outputVideo.isOpened()) {
std::cerr << "Could not open the output video for write." << std::endl;
ret = -1;
@@
-176,7
+176,7
@@
int main(int argc, char *argv[])
if (*segmentation_method == "background") {
segmentation = new MOG2Segmentation(inputVideo, background_learn_frames);
if (show_background) {
if (*segmentation_method == "background") {
segmentation = new MOG2Segmentation(inputVideo, background_learn_frames);
if (show_background) {
- cv::Mat background;
+ cv::Mat background
(frame_size, inputVideo.get(cv::CAP_PROP_FORMAT))
;
((MOG2Segmentation *)segmentation)->getBackgroundImage(background);
trail->setBackground(background);
((MOG2Segmentation *)segmentation)->getBackgroundImage(background);
trail->setBackground(background);
@@
-191,7
+191,7
@@
int main(int argc, char *argv[])
goto out_delete_trail;
}
goto out_delete_trail;
}
- cv::namedWindow("Frame",
CV_WINDOW_AUTOSIZE
);
+ cv::namedWindow("Frame",
cv::WINDOW_NORMAL
);
for (;;) {
inputVideo >> input_frame;
for (;;) {
inputVideo >> input_frame;