Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
dd3655f6
Unverified
Commit
dd3655f6
authored
Mar 25, 2017
by
Claudio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align parameter code style between hog .cu and .cpp files
parent
35f66340
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
16 deletions
+43
-16
hog.cu
modules/cudaobjdetect/src/cuda/hog.cu
+30
-13
hog.cpp
modules/cudaobjdetect/src/hog.cpp
+13
-3
No files found.
modules/cudaobjdetect/src/cuda/hog.cu
View file @
dd3655f6
...
...
@@ -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;
...
...
modules/cudaobjdetect/src/hog.cpp
View file @
dd3655f6
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment