#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
Mat replace_and_blend(Mat& frame, Mat& mask);
Mat background_01;
Mat background_02;
int main(int argc, char** argv) {
// start here...
background_01 = imread("D:/vs/test/b.jpg");
background_02 = imread("D:/vs/test/01image.jpg");
VideoCapture capture;
capture.open("D:/vs/test/01.mp4");
if (!capture.isOpened()) {
printf("could not find the video file...\n");
return -1;
}
const char* title = "input video";
const char* resultWin = "result video";
namedWindow(title, WINDOW_AUTOSIZE);
namedWindow(resultWin, WINDOW_AUTOSIZE);
Mat frame, hsv
视频背景替换
最新推荐文章于 2024-09-08 15:08:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)