当前位置:网站首页>Opencv learning log 33 Gaussian mean filtering

Opencv learning log 33 Gaussian mean filtering

2022-07-06 15:43:00 @Spring sauce

Preface

This article is mainly about opencv Gaussian mean filtering in image processing .

One 、 Gaussian mean filtering

// Third question   Gaussian mean filtering 
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
int main()
{
    
	VideoCapture cap;

	cap.open("C://Users//john//Desktop//VID.mp4");
	cv::Size rect;
	rect.width = 5;
	rect.height = 5;
	if (!cap.isOpened())
	{
    
		std::cout << " Cannot open video file " << std::endl;
		return -1;
	}

	double fps = cap.get(CAP_PROP_FPS);
	std::cout << "fps" << fps << std::endl;
	while (1)
	{
    
		cv::Mat frame;
		cv::Mat resframe;
		bool rSucess = cap.read(frame);
		cv::imshow("frame", frame);
		GaussianBlur(frame, resframe, rect,5,5);
		cv::imshow("resframe", resframe);
		waitKey(0);



	}
}

summary

1. The code can run directly , If you don't understand, please leave a message .

原网站

版权声明
本文为[@Spring sauce]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131317244776.html