1 // 2 // MainPage.xaml.h 3 // Declaration of the MainPage class. 4 // 5 6 #pragma once 7 8 #include "MainPage.g.h" 9 #include <opencv2\core\core.hpp> 10 #include <opencv2\imgproc\imgproc.hpp> 11 #include <opencv2\features2d\features2d.hpp> 12 13 namespace OcvImageProcessing 14 { 15 /// <summary> 16 /// An empty page that can be used on its own or navigated to within a Frame. 17 /// </summary> 18 public ref class MainPage sealed 19 { 20 public: 21 MainPage(); 22 23 protected: 24 virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; 25 26 private: 27 static const int PREVIEW = 0; 28 static const int GRAY = 1; 29 static const int CANNY = 2; 30 static const int BLUR = 3; 31 static const int FEATURES = 4; 32 static const int SEPIA = 5; 33 34 void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 35 cv::Mat ApplyGrayFilter(const cv::Mat& image); 36 cv::Mat ApplyCannyFilter(const cv::Mat& image); 37 cv::Mat ApplyBlurFilter(const cv::Mat& image); 38 cv::Mat ApplyFindFeaturesFilter(const cv::Mat& image); 39 cv::Mat ApplySepiaFilter(const cv::Mat& image); 40 41 void UpdateImage(const cv::Mat& image); 42 std::string CreateTempFile(const std::string &suffix); 43 bool SaveImage(cv::Mat image); 44 45 std::string StrToWStr(const std::wstring &wstr); 46 cv::String ConvertPath(Platform::String^ path); 47 48 cv::Mat Lena; 49 unsigned int frameWidth, frameHeight; 50 }; 51 } 52