diff --git a/modules/gpu/src/cuda/isf-sc.cu b/modules/gpu/src/cuda/isf-sc.cu index f36f86f963..a6418c1d31 100644 --- a/modules/gpu/src/cuda/isf-sc.cu +++ b/modules/gpu/src/cuda/isf-sc.cu @@ -40,4 +40,15 @@ // //M*/ -#include \ No newline at end of file +#include + +void icf::Cascade::detect(const cv::gpu::PtrStepSzb& hogluv) const +{ + // detection kernel +} + +void icf::ChannelStorage::frame(const cv::gpu::PtrStepSz& image) +{ + // color convertin kernel + // hog calculation kernel +} \ No newline at end of file diff --git a/modules/gpu/src/icf.hpp b/modules/gpu/src/icf.hpp index 8cc4395c32..7183fc0ac4 100644 --- a/modules/gpu/src/icf.hpp +++ b/modules/gpu/src/icf.hpp @@ -64,6 +64,8 @@ struct Cascade const cv::gpu::PtrStepSzf& lvs, const cv::gpu::PtrStepSzb& fts, const cv::gpu::PtrStepSzb& lls) : octaves(octs), stages(sts), nodes(nds), leaves(lvs), features(fts), levels(lls) {} + void detect(const cv::gpu::PtrStepSzb& hogluv) const; + PtrStepSzb octaves; PtrStepSzf stages; PtrStepSzb nodes; @@ -81,7 +83,7 @@ struct ChannelStorage const cv::gpu::PtrStepSzb& itg, const int s) : dmem (buff), shrunk(shr), hogluv(itg), shrinkage(s) {} - void frame(const cv::gpu::PtrStepSzb& image) {} + void frame(const cv::gpu::PtrStepSz& image); PtrStepSzb dmem; PtrStepSzb shrunk; diff --git a/modules/gpu/src/softcascade.cpp b/modules/gpu/src/softcascade.cpp index 54f37cd178..80473da95b 100644 --- a/modules/gpu/src/softcascade.cpp +++ b/modules/gpu/src/softcascade.cpp @@ -74,7 +74,7 @@ struct cv::gpu::SoftCascade::Filds GpuMat features; GpuMat levels; - // preallocated buffer 640x480x10 + // preallocated buffer 640x480x10 + 640x480 GpuMat dmem; // 160x120x10 GpuMat shrunk; @@ -86,9 +86,6 @@ struct cv::gpu::SoftCascade::Filds icf::Cascade cascade; icf::ChannelStorage storage; - bool fill(const FileNode &root, const float mins, const float maxs); - void detect() const {} - enum { BOOST = 0 }; enum { @@ -102,6 +99,12 @@ struct cv::gpu::SoftCascade::Filds HOG_LUV_BINS = 10 }; + bool fill(const FileNode &root, const float mins, const float maxs); + void detect() const + { + cascade.detect(hogluv); + } + private: void calcLevels(const std::vector& octs, int frameW, int frameH, int nscales); @@ -278,7 +281,7 @@ inline bool cv::gpu::SoftCascade::Filds::fill(const FileNode &root, const float cascade = icf::Cascade(octaves, stages, nodes, leaves, features, levels); // allocate buffers - dmem.create(FRAME_HEIGHT * HOG_LUV_BINS, FRAME_WIDTH, CV_8UC1); + dmem.create(FRAME_HEIGHT * (HOG_LUV_BINS + 1), FRAME_WIDTH, CV_8UC1); shrunk.create(FRAME_HEIGHT / shrinkage * HOG_LUV_BINS, FRAME_WIDTH / shrinkage, CV_8UC1); hogluv.create( (FRAME_HEIGHT / shrinkage * HOG_LUV_BINS) + 1, (FRAME_WIDTH / shrinkage) + 1, CV_16UC1); @@ -395,7 +398,7 @@ void cv::gpu::SoftCascade::detectMultiScale(const GpuMat& image, const GpuMat& / GpuMat& /*objects*/, const int /*rejectfactor*/, Stream /*stream*/) { // only color images are supperted - CV_Assert(image.type() == CV_8UC3); + CV_Assert(image.type() == CV_8UC4); // only this window size allowed CV_Assert(image.cols == 640 && image.rows == 480); @@ -406,4 +409,4 @@ void cv::gpu::SoftCascade::detectMultiScale(const GpuMat& image, const GpuMat& / flds.detect(); } -#endif +#endif \ No newline at end of file