From e7bab669fa213657fe68ac4faee74c6b7df1882c Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Wed, 9 Jan 2013 16:46:21 +0400 Subject: [PATCH] replace cv::Mat to Input/Output arrays --- apps/sft/fpool.cpp | 2 +- apps/sft/include/sft/fpool.hpp | 9 ++++++--- modules/ml/include/opencv2/ml/ml.hpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/sft/fpool.cpp b/apps/sft/fpool.cpp index fafdd0a..39e8156 100644 --- a/apps/sft/fpool.cpp +++ b/apps/sft/fpool.cpp @@ -54,7 +54,7 @@ sft::ICFFeaturePool::ICFFeaturePool(cv::Size m, int n) : FeaturePool(), model(m) fill(nfeatures); } -void sft::ICFFeaturePool::preprocess(const Mat& frame, Mat& integrals) const +void sft::ICFFeaturePool::preprocess(cv::InputArray frame, cv::OutputArray integrals) const { preprocessor.apply(frame, integrals); } diff --git a/apps/sft/include/sft/fpool.hpp b/apps/sft/include/sft/fpool.hpp index 5d5d3b3..3c93e6d 100644 --- a/apps/sft/include/sft/fpool.hpp +++ b/apps/sft/include/sft/fpool.hpp @@ -56,9 +56,12 @@ class Preprocessor public: Preprocessor() {} - void apply(const cv::Mat& frame, cv::Mat& integrals) const + void apply(cv::InputArray _frame, cv::OutputArray _integrals) const //const cv::Mat& frame, cv::Mat& integrals { - CV_Assert(frame.type() == CV_8UC3); + CV_Assert(_frame.type() == CV_8UC3); + + cv::Mat frame = _frame.getMat(); + cv::Mat& integrals = _integrals.getMatRef(); int h = frame.rows; int w = frame.cols; @@ -165,7 +168,7 @@ public: virtual int size() const { return (int)pool.size(); } virtual float apply(int fi, int si, const cv::Mat& integrals) const; - virtual void preprocess(const cv::Mat& frame, cv::Mat& integrals) const; + virtual void preprocess(cv::InputArray _frame, cv::OutputArray _integrals) const; virtual void write( cv::FileStorage& fs, int index) const; virtual ~ICFFeaturePool(); diff --git a/modules/ml/include/opencv2/ml/ml.hpp b/modules/ml/include/opencv2/ml/ml.hpp index 98019eb..e3f3efe 100644 --- a/modules/ml/include/opencv2/ml/ml.hpp +++ b/modules/ml/include/opencv2/ml/ml.hpp @@ -2140,7 +2140,7 @@ public: virtual float apply(int fi, int si, const Mat& integrals) const = 0; virtual void write( cv::FileStorage& fs, int index) const = 0; - virtual void preprocess(const Mat& frame, Mat& integrals) const = 0; + virtual void preprocess(InputArray frame, OutputArray integrals) const = 0; virtual ~FeaturePool(); }; -- 2.7.4