@@ -64,19 +64,29 @@ namespace cv { namespace cuda { namespace device
64
64
{
65
65
namespace hog
66
66
{
67
- void set_up_constants (int nbins, int block_stride_x, int block_stride_y,
67
+ void set_up_constants (int nbins,
68
+ int block_stride_x, int block_stride_y,
68
69
int nblocks_win_x, int nblocks_win_y,
69
70
int ncells_block_x, int ncells_block_y,
70
71
const cudaStream_t& stream);
71
72
72
- void compute_hists (int nbins, int block_stride_x, int block_stride_y,
73
- int height, int width, const PtrStepSzf& grad,
74
- const PtrStepSzb& qangle, float sigma, float * block_hists,
75
- int cell_size_x, int cell_size_y, int ncells_block_x, int ncells_block_y,
73
+ void compute_hists (int nbins,
74
+ int block_stride_x, int block_stride_y,
75
+ int height, int width,
76
+ const PtrStepSzf& grad, const PtrStepSzb& qangle,
77
+ float sigma,
78
+ float * block_hists,
79
+ int cell_size_x, int cell_size_y,
80
+ int ncells_block_x, int ncells_block_y,
76
81
const cudaStream_t& stream);
77
82
78
- void normalize_hists (int nbins, int block_stride_x, int block_stride_y,
79
- 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,
83
+ void normalize_hists (int nbins,
84
+ int block_stride_x, int block_stride_y,
85
+ int height, int width,
86
+ float * block_hists,
87
+ float threshold,
88
+ int cell_size_x, int cell_size_y,
89
+ int ncells_block_x, int ncells_block_y,
80
90
const cudaStream_t& stream);
81
91
82
92
void classify_hists (int win_height, int win_width, int block_stride_y,
@@ -85,21 +95,37 @@ namespace cv { namespace cuda { namespace device
85
95
float threshold, int cell_size_x, int ncells_block_x, unsigned char * labels);
86
96
87
97
void compute_confidence_hists (int win_height, int win_width, int block_stride_y, int block_stride_x,
88
- int win_stride_y, int win_stride_x, int height, int width, float * block_hists,
89
- float * coefs, float free_coef, float threshold, int cell_size_x, int ncells_block_x, float *confidences);
90
-
91
- void extract_descrs_by_rows (int win_height, int win_width, int block_stride_y, int block_stride_x,
92
- int win_stride_y, int win_stride_x, int height, int width, float * block_hists, int cell_size_x, int ncells_block_x,
93
- cv::cuda::PtrStepSzf descriptors);
94
- void extract_descrs_by_cols (int win_height, int win_width, int block_stride_y, int block_stride_x,
95
- int win_stride_y, int win_stride_x, int height, int width, float * block_hists, int cell_size_x, int ncells_block_x,
98
+ int win_stride_y, int win_stride_x, int height, int width, float * block_hists,
99
+ float * coefs, float free_coef, float threshold, int cell_size_x, int ncells_block_x, float *confidences);
100
+
101
+ void extract_descrs_by_rows (int win_height, int win_width,
102
+ int block_stride_y, int block_stride_x,
103
+ int win_stride_y, int win_stride_x,
104
+ int height, int width,
105
+ float * block_hists,
106
+ int cell_size_x, int ncells_block_x,
107
+ cv::cuda::PtrStepSzf descriptors,
108
+ const cudaStream_t& stream);
109
+ void extract_descrs_by_cols (int win_height, int win_width,
110
+ int block_stride_y, int block_stride_x,
111
+ int win_stride_y, int win_stride_x,
112
+ int height, int width,
113
+ float * block_hists,
114
+ int cell_size_x, int ncells_block_x,
96
115
cv::cuda::PtrStepSzf descriptors,
97
116
const cudaStream_t& stream);
98
117
99
- void compute_gradients_8UC1 (int nbins, int height, int width, const cv::cuda::PtrStepSzb& img,
100
- float angle_scale, cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle, bool correct_gamma);
101
- void compute_gradients_8UC4 (int nbins, int height, int width, const cv::cuda::PtrStepSzb& img,
102
- float angle_scale, cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle, bool correct_gamma,
118
+ void compute_gradients_8UC1 (int nbins,
119
+ int height, int width, const cv::cuda::PtrStepSzb& img,
120
+ float angle_scale,
121
+ cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle,
122
+ bool correct_gamma,
123
+ const cudaStream_t& stream);
124
+ void compute_gradients_8UC4 (int nbins,
125
+ int height, int width, const cv::cuda::PtrStepSzb& img,
126
+ float angle_scale,
127
+ cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle,
128
+ bool correct_gamma,
103
129
const cudaStream_t& stream);
104
130
105
131
void resize_8UC1 (const cv::cuda::PtrStepSzb& src, cv::cuda::PtrStepSzb dst);
@@ -483,7 +509,8 @@ namespace
483
509
img.rows , img.cols ,
484
510
block_hists.ptr <float >(),
485
511
cell_size_.width , cells_per_block_.width ,
486
- descriptors);
512
+ descriptors,
513
+ StreamAccessor::getStream (stream));
487
514
break ;
488
515
case DESCR_FORMAT_COL_BY_COL:
489
516
hog::extract_descrs_by_cols (win_size_.height , win_size_.width ,
@@ -524,8 +551,12 @@ namespace
524
551
switch (img.type ())
525
552
{
526
553
case CV_8UC1:
527
- hog::compute_gradients_8UC1 (nbins_, img.rows , img.cols , img,
528
- angleScale, grad, qangle, gamma_correction_);
554
+ hog::compute_gradients_8UC1 (nbins_,
555
+ img.rows , img.cols , img,
556
+ angleScale,
557
+ grad, qangle,
558
+ gamma_correction_,
559
+ StreamAccessor::getStream (stream));
529
560
break ;
530
561
case CV_8UC4:
531
562
hog::compute_gradients_8UC4 (nbins_,
0 commit comments