fixed some bugs, added tests for gpu::HOGDescriptor

This commit is contained in:
Alexey Spizhevoy
2010-11-15 12:51:30 +00:00
parent 13134595fd
commit fada88e100
5 changed files with 213 additions and 9 deletions

View File

@@ -282,7 +282,7 @@ namespace cv
operator GpuMat() const;
//returns if host memory can be mapperd to gpu address space;
static bool can_device_map_to_host();
static bool canMapHostMemory();
// Please see cv::Mat for descriptions
bool isContinuous() const;
@@ -1001,8 +1001,6 @@ namespace cv
double hit_threshold=0, Size win_stride=Size(), Size padding=Size(),
double scale0=1.05, int group_threshold=2);
GpuMat getLastBlockHists() const;
Size win_size;
Size block_size;
Size block_stride;

View File

@@ -142,6 +142,7 @@ __global__ void compute_hists_kernel_many_blocks(const int img_block_width, cons
const float* grad_ptr = grad.ptr(offset_y) + offset_x * 2;
const unsigned char* qangle_ptr = qangle.ptr(offset_y) + offset_x * 2;
// 12 means that 12 pixels affect on block's cell (in one row)
if (cell_thread_x < 12)
{
float* hist = hists + 12 * (cell_y * blockDim.z * CELLS_PER_BLOCK_Y +

View File

@@ -295,11 +295,6 @@ void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& f
}
cv::gpu::GpuMat cv::gpu::HOGDescriptor::getLastBlockHists() const {
return block_hists;
}
int cv::gpu::HOGDescriptor::numPartsWithin(int size, int part_size, int stride)
{
return (size - part_size + stride) / stride;

View File

@@ -68,7 +68,7 @@ namespace cv
void GpuMat::release() { throw_nogpu(); }
void CudaMem::create(int /*_rows*/, int /*_cols*/, int /*_type*/, int /*type_alloc*/) { throw_nogpu(); }
bool CudaMem::can_device_map_to_host() { throw_nogpu(); return false; }
bool CudaMem::canMapHostMemory() { throw_nogpu(); return false; }
void CudaMem::release() { throw_nogpu(); }
GpuMat CudaMem::createGpuMatHeader () const { throw_nogpu(); return GpuMat(); }
}