Visual Studio 2013 Express Visual C++( アンマネージドコード ) OpenCV 3.1 |
■251.OpenCV 分離型線形フィルタ | Prev Top Next | |
|
今回は画像に分離型線形フィルタを適用します。効果がいまいちわからんです。
#include <iostream> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #pragma comment( lib, "opencv_world300d.lib" ) int main(int argc, const char* argv[]) { int hr = -1; try { cv::Mat src, dest; src = cv::imread("D:/TEMP/MaverickProj/Image/OpenCV/13/Texture.png", cv::IMREAD_COLOR); cv::sepFilter2D( src, dest, -1, 1.5, 1.5, cv::Size(-1, -1), 0, cv::BORDER_DEFAULT ); std::cout << "Successed" << std::endl; // 元画像のウィンドウ表示 cv::namedWindow("Source", 1); imshow("Source", src); // フィルタ適用後の画像のウィンドウ表示 cv::namedWindow("sepFilter2D", 1); imshow("sepFilter2D", dest); cv::waitKey(0); hr = 0; } catch (cv::Exception ex) { std::cout << ex.err << std::endl; } // ウィンドウの破棄 cv::destroyAllWindows(); return hr; }
rowKernel = 1.5 columnKernel = 1.5