Commit cb63046d authored by Anatoly Baksheev's avatar Anatoly Baksheev

gpu face detetcion:

1) fixed bug with error codes (enum NppStStatus) shift.
2) added some asserts
parent 6f87567e
......@@ -188,14 +188,14 @@ struct NppStSize32u
enum NppStStatus
{
//already present in NPP
//NPP_SUCCESS = 0, ///< Successful operation (same as NPP_NO_ERROR)
//NPP_ERROR = -1, ///< Unknown error
//NPP_CUDA_KERNEL_EXECUTION_ERROR = -3, ///< CUDA kernel execution error
//NPP_NULL_POINTER_ERROR = -4, ///< NULL pointer argument error
//NPP_TEXTURE_BIND_ERROR = -24, ///< CUDA texture binding error or non-zero offset returned
//NPP_MEMCPY_ERROR = -13, ///< CUDA memory copy error
//NPP_MEM_ALLOC_ERR = -12, ///< CUDA memory allocation error
//NPP_MEMFREE_ERR = -15, ///< CUDA memory deallocation error
__NPP_SUCCESS = 0, ///< Successful operation (same as NPP_NO_ERROR)
__NPP_ERROR = -1, ///< Unknown error
__NPP_CUDA_KERNEL_EXECUTION_ERROR = -3, ///< CUDA kernel execution error
__NPP_NULL_POINTER_ERROR = -4, ///< NULL pointer argument error
__NPP_TEXTURE_BIND_ERROR = -24, ///< CUDA texture binding error or non-zero offset returned
__NPP_MEMCPY_ERROR = -13, ///< CUDA memory copy error
__NPP_MEM_ALLOC_ERR = -12, ///< CUDA memory allocation error
__NPP_MEMFREE_ERR = -15, ///< CUDA memory deallocation error
//to be added
NPP_INVALID_ROI, ///< Invalid region of interest argument
......
......@@ -89,6 +89,7 @@ struct cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
src_seg.size = src.step * src.rows;
NCVMatrixReuse<Ncv8u> d_src(src_seg, devProp.textureAlignment, src.cols, src.rows, src.step, true);
ncvAssertReturn(d_src.isMemReused(), NCV_ALLOCATOR_BAD_REUSE);
//NCVMatrixAlloc<Ncv8u> d_src(*gpuAllocator, src.cols, src.rows);
//ncvAssertReturn(d_src.isMemAllocated(), NCV_ALLOCATOR_BAD_ALLOC);
......@@ -106,6 +107,7 @@ struct cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
objects_seg.begin = objects_beg;
objects_seg.size = objects.step * objects.rows;
NCVVectorReuse<NcvRect32u> d_rects(objects_seg, objects.cols);
ncvAssertReturn(d_rects.isMemReused(), NCV_ALLOCATOR_BAD_REUSE);
//NCVVectorAlloc<NcvRect32u> d_rects(*gpuAllocator, 100);
//ncvAssertReturn(d_rects.isMemAllocated(), NCV_ALLOCATOR_BAD_ALLOC);
......
......@@ -84,7 +84,7 @@ int main( int argc, const char** argv )
/* parameters */
bool useGPU = true;
double scale_factor = 2;
double scale_factor = 1;
bool visualizeInPlace = false;
bool findLargestObject = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment