CUDA callers

This commit is contained in:
marina.kolpakova 2012-09-20 19:35:04 +04:00
parent 4aac1444ad
commit a3af5ede80
3 changed files with 25 additions and 9 deletions

View File

@ -40,4 +40,15 @@
//
//M*/
#include <icf.hpp>
#include <icf.hpp>
void icf::Cascade::detect(const cv::gpu::PtrStepSzb& hogluv) const
{
// detection kernel
}
void icf::ChannelStorage::frame(const cv::gpu::PtrStepSz<uchar4>& image)
{
// color convertin kernel
// hog calculation kernel
}

View File

@ -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<uchar4>& image);
PtrStepSzb dmem;
PtrStepSzb shrunk;

View File

@ -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<icf::Octave>& 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