【c++|opencv】三、频率域滤波---7.巴特沃斯高通滤波 - C++ - opencv
1. 巴特沃斯高通滤波12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"#include<math.h>using namespace cv;using namespace std;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"could not load image..."<<endl; return -1; } ...
【c++|opencv】三、频率域滤波---6.高斯高通滤波 - C++ - opencv
1. 高斯高通滤波1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"using namespace cv;using namespace std;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if(img.empty()){ cout<<"can not load image"<<endl; return -1; } imshow("Img",img); ...
【c++|opencv】三、频率域滤波---5.理想高通滤波 - C++ - opencv
1. 理想高通滤波1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"using namespace std;using namespace cv;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if(img.empty()){ cout<<"could not load image..."<<endl; return -1; } imshow("img",img) ...
【c++|opencv】三、频率域滤波---4.巴特沃斯低通滤波 - C++ - opencv
1. 巴特沃斯低通滤波1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"#include"Salt.h"#include<math.h>using namespace std;using namespace cv;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"can not open the image"< ...
【c++|opencv】三、频率域滤波---3.高斯低通滤波 - C++ - opencv
1. 高斯低通滤波12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"#include"Salt.h"using namespace std;using namespace cv;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if(img.empty()){ cout<<"can't open the image"<<endl; return -1; } ...
【c++|opencv】三、频率域滤波---2.理想低通滤波 - C++ - opencv
1. 理想低通滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#include<iostream>#include<opencv2/opencv.hpp>#include"mydft.h"#include"Salt.h"using namespace std;using namespace cv;int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"can't open image"<<endl; return -1; ...
【c++|opencv】三、频率域滤波---1.傅里叶变换及频谱图 - C++ - opencv
1. 傅里叶变换和滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778#include <iostream>#include <opencv2/opencv.hpp>#include <cmath>using namespace cv;using namespace std;// 定义 傅里叶变换函数void mydft(Mat img_input,Mat& out_img,Mat& transform_arr);int main(){ Mat img,img_gray,img_out,img_transform; img = imread("/home/v/home.png"); if (img.empty()){ co ...
【c++|opencv】二、灰度变换和空间滤波---6.锐化空间滤波
1. 锐化空间滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;// 定义滤波函数void myfilter(Mat& img_input,Mat& img_output); // 四邻域void myfilter2(Mat& img_input,Mat& img_output); // 八邻域int main(){ Mat img,img_gray,imt_output,img_output2; img = imread("/home/v/home.png"); if (img.empty()){ cout< ...
【c++|opencv】二、灰度变换和空间滤波---5.中值滤波
1. 中值滤波1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374#include<iostream>#include<opencv2/opencv.hpp>#include"Salt.h"using namespace cv;using namespace std;void myfilter(int filter_size,Mat& img_input,Mat& img_output);int mysort(Mat& sortarray,int filter_size);int main(){ Mat img,img_gray,img_output,img_output2; img = imread("/home/v/home.png"); if ...
【c++|opencv】二、灰度变换和空间滤波---4.高斯滤波
1. 高斯滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include <iostream>#include <opencv2/opencv.hpp>#include"Salt.h"using namespace std;using namespace cv;// 定义高斯滤波函数void myfilter(int filter_size,Mat& img_input,Mat& img_output);int main(){ Mat img,img_gray,img_out,img_out2; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"can't open the ima ...