namespace hog
{
-
__constant__ int cnbins;
__constant__ int cblock_stride_x;
__constant__ int cblock_stride_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,
+ 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));
}
//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;
}
- 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;
}
- 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)
{
}
- 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;
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;
}