From 64d6e6a48d4580964a8ce8b589a94e973804c3b9 Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Tue, 2 Oct 2012 16:45:40 +0400 Subject: [PATCH] add getROISize --- modules/gpu/include/opencv2/gpu/gpu.hpp | 6 ++++-- modules/gpu/src/softcascade.cpp | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index f171ad904d..9b59c60041 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -1572,7 +1572,7 @@ public: //! Param objects 4-channel matrix thet contain detected rectangles //! Param rejectfactor used for final object box computing virtual void detectMultiScale(const GpuMat& image, const GpuMat& rois, GpuMat& objects, - int rejectfactor = 1, int specificScale = -1); + int rejectfactor = 1, int specificScale = -1) const; //! detect specific objects on in the input frame for all scales computed flom minScale and maxscale values. //! asynchronous version. @@ -1583,7 +1583,9 @@ public: //! Param ndet retrieves number of detections //! Param stream wrapper for CUDA stream virtual void detectMultiScale(const GpuMat& image, const GpuMat& rois, GpuMat& objects, - int rejectfactor, GpuMat& ndet, Stream stream); + int rejectfactor, GpuMat& ndet, Stream stream) const; + + cv::Size getRoiSize() const; private: struct Filds; diff --git a/modules/gpu/src/softcascade.cpp b/modules/gpu/src/softcascade.cpp index 8868aa5b13..af836695a7 100644 --- a/modules/gpu/src/softcascade.cpp +++ b/modules/gpu/src/softcascade.cpp @@ -49,12 +49,18 @@ cv::gpu::SoftCascade::SoftCascade() : filds(0) { throw_nogpu(); } cv::gpu::SoftCascade::SoftCascade( const string&, const float, const float) : filds(0) { throw_nogpu(); } cv::gpu::SoftCascade::~SoftCascade() { throw_nogpu(); } bool cv::gpu::SoftCascade::load( const string&, const float, const float) { throw_nogpu(); return false; } -void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, const int, int) { throw_nogpu();} -void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, int, GpuMat&, Stream) +void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, const int, int) const { throw_nogpu(); } +void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, int, GpuMat&, Stream) const +{ + throw_nogpu(); +} + +cv::Size cv::gpu::SoftCascade::getRoiSize() const { throw_nogpu(); return cv::Size();} + #else #include @@ -455,8 +461,8 @@ namespace { //================================== synchronous version ============================================================// -void cv::gpu::SoftCascade::detectMultiScale(const GpuMat& colored, const GpuMat& /*rois*/, - GpuMat& objects, const int /*rejectfactor*/, int specificScale) +void cv::gpu::SoftCascade::detectMultiScale(const GpuMat& colored, const GpuMat& rois, + GpuMat& objects, const int /*rejectfactor*/, int specificScale) const { // only color images are supperted CV_Assert(colored.type() == CV_8UC3); @@ -555,10 +561,15 @@ void cv::gpu::SoftCascade::detectMultiScale(const GpuMat& colored, const GpuMat& objects = GpuMat(objects, cv::Rect(0, 0, ndetections * sizeof(Detection), 1)); } -void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, int, GpuMat&, Stream) +void cv::gpu::SoftCascade::detectMultiScale(const GpuMat&, const GpuMat&, GpuMat&, int, GpuMat&, Stream) const { // cudaStream_t stream = StreamAccessor::getStream(s); } +cv::Size cv::gpu::SoftCascade::getRoiSize() const +{ + return cv::Size(Filds::FRAME_WIDTH / 4, Filds::FRAME_HEIGHT / 4); +} + #endif \ No newline at end of file