From dd3655f6a6e4c0af5d93d510ce686a0115315c25 Mon Sep 17 00:00:00 2001 From: Claudio Date: Sat, 25 Mar 2017 15:12:26 +0100 Subject: [PATCH] Align parameter code style between hog .cu and .cpp files --- modules/cudaobjdetect/src/cuda/hog.cu | 43 +++++++++++++++++++-------- modules/cudaobjdetect/src/hog.cpp | 16 ++++++++-- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/modules/cudaobjdetect/src/cuda/hog.cu b/modules/cudaobjdetect/src/cuda/hog.cu index d7dbd4a3d6..40d2dec89c 100644 --- a/modules/cudaobjdetect/src/cuda/hog.cu +++ b/modules/cudaobjdetect/src/cuda/hog.cu @@ -52,7 +52,6 @@ namespace cv { namespace cuda { namespace device namespace hog { - __constant__ int cnbins; __constant__ int cblock_stride_x; __constant__ int cblock_stride_y; @@ -99,8 +98,10 @@ namespace cv { namespace cuda { namespace device } - void set_up_constants(int nbins, int block_stride_x, int block_stride_y, - int nblocks_win_x, int nblocks_win_y, int ncells_block_x, int ncells_block_y, + void set_up_constants(int nbins, + int block_stride_x, int block_stride_y, + int nblocks_win_x, int nblocks_win_y, + int ncells_block_x, int ncells_block_y, const cudaStream_t& stream) { cudaSafeCall(cudaMemcpyToSymbolAsync(cnbins, &nbins, sizeof(nbins), 0, cudaMemcpyHostToDevice, stream)); @@ -232,10 +233,14 @@ namespace cv { namespace cuda { namespace device } //declaration of variables and invoke the kernel with the calculated number of blocks - void compute_hists(int nbins, int block_stride_x, int block_stride_y, - int height, int width, const PtrStepSzf& grad, - const PtrStepSzb& qangle, float sigma, float* block_hists, - int cell_size_x, int cell_size_y, int ncells_block_x, int ncells_block_y, + void compute_hists(int nbins, + int block_stride_x, int block_stride_y, + int height, int width, + const PtrStepSzf& grad, const PtrStepSzb& qangle, + float sigma, + float* block_hists, + int cell_size_x, int cell_size_y, + int ncells_block_x, int ncells_block_y, const cudaStream_t& stream) { const int ncells_block = ncells_block_x * ncells_block_y; @@ -345,8 +350,13 @@ namespace cv { namespace cuda { namespace device } - void normalize_hists(int nbins, int block_stride_x, int block_stride_y, - int height, int width, float* block_hists, float threshold, int cell_size_x, int cell_size_y, int ncells_block_x, int ncells_block_y, + void normalize_hists(int nbins, + int block_stride_x, int block_stride_y, + int height, int width, + float* block_hists, + float threshold, + int cell_size_x, int cell_size_y, + int ncells_block_x, int ncells_block_y, const cudaStream_t& stream) { const int nblocks = 1; @@ -576,8 +586,12 @@ namespace cv { namespace cuda { namespace device } - void extract_descrs_by_cols(int win_height, int win_width, int block_stride_y, int block_stride_x, - int win_stride_y, int win_stride_x, int height, int width, float* block_hists, int cell_size_x, int ncells_block_x, + void extract_descrs_by_cols(int win_height, int win_width, + int block_stride_y, int block_stride_x, + int win_stride_y, int win_stride_x, + int height, int width, + float* block_hists, + int cell_size_x, int ncells_block_x, PtrStepSzf descriptors, const cudaStream_t& stream) { @@ -703,8 +717,11 @@ namespace cv { namespace cuda { namespace device } - void compute_gradients_8UC4(int nbins, int height, int width, const PtrStepSzb& img, - float angle_scale, PtrStepSzf grad, PtrStepSzb qangle, bool correct_gamma, + void compute_gradients_8UC4(int nbins, + int height, int width, const PtrStepSzb& img, + float angle_scale, + PtrStepSzf grad, PtrStepSzb qangle, + bool correct_gamma, const cudaStream_t& stream) { (void)nbins; diff --git a/modules/cudaobjdetect/src/hog.cpp b/modules/cudaobjdetect/src/hog.cpp index a9b4404a67..f59bd0c545 100644 --- a/modules/cudaobjdetect/src/hog.cpp +++ b/modules/cudaobjdetect/src/hog.cpp @@ -515,15 +515,25 @@ namespace GpuMat grad = pool.getBuffer(img.size(), CV_32FC2); GpuMat qangle = pool.getBuffer(img.size(), CV_8UC2); - hog::set_up_constants(nbins_, block_stride_.width, block_stride_.height, blocks_per_win.width, blocks_per_win.height, cells_per_block_.width, cells_per_block_.height, StreamAccessor::getStream(stream)); + hog::set_up_constants(nbins_, + block_stride_.width, block_stride_.height, + blocks_per_win.width, blocks_per_win.height, + cells_per_block_.width, cells_per_block_.height, + StreamAccessor::getStream(stream)); switch (img.type()) { case CV_8UC1: - hog::compute_gradients_8UC1(nbins_, img.rows, img.cols, img, angleScale, grad, qangle, gamma_correction_); + hog::compute_gradients_8UC1(nbins_, img.rows, img.cols, img, + angleScale, grad, qangle, gamma_correction_); break; case CV_8UC4: - hog::compute_gradients_8UC4(nbins_, img.rows, img.cols, img, angleScale, grad, qangle, gamma_correction_, StreamAccessor::getStream(stream)); + hog::compute_gradients_8UC4(nbins_, + img.rows, img.cols, img, + angleScale, + grad, qangle, + gamma_correction_, + StreamAccessor::getStream(stream)); break; }