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
cc6a87fc
Commit
cc6a87fc
authored
Nov 16, 2010
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed big in gpu::HOGDescriptor, added property into CPU's HOGDescriptor
parent
e9545773
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
hog.cu
modules/gpu/src/cuda/hog.cu
+4
-4
objdetect.hpp
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
+6
-3
hog.cpp
modules/objdetect/src/hog.cpp
+1
-2
No files found.
modules/gpu/src/cuda/hog.cu
View file @
cc6a87fc
...
...
@@ -446,7 +446,7 @@ __global__ void compute_gradients_8UC4_kernel(int height, int width, const PtrEl
if (threadIdx.x == 0)
{
val = x > 0 ? row[x - 1] : row[
x +
1];
val = x > 0 ? row[x - 1] : row[1];
sh_row[0] = val.x;
sh_row[(nthreads + 2)] = val.y;
sh_row[2 * (nthreads + 2)] = val.z;
...
...
@@ -454,7 +454,7 @@ __global__ void compute_gradients_8UC4_kernel(int height, int width, const PtrEl
if (threadIdx.x == blockDim.x - 1)
{
val = (x < width - 1) ? row[x + 1] : row[
x - 1
];
val = (x < width - 1) ? row[x + 1] : row[
width - 2
];
sh_row[blockDim.x + 1] = val.x;
sh_row[blockDim.x + 1 + (nthreads + 2)] = val.y;
sh_row[blockDim.x + 1 + 2 * (nthreads + 2)] = val.z;
...
...
@@ -553,10 +553,10 @@ __global__ void compute_gradients_8UC1_kernel(int height, int width, const PtrEl
sh_row[threadIdx.x + 1] = row[x - 2];
if (threadIdx.x == 0)
sh_row[0] = x > 0 ? row[x - 1] : row[
x +
1];
sh_row[0] = x > 0 ? row[x - 1] : row[1];
if (threadIdx.x == blockDim.x - 1)
sh_row[blockDim.x + 1] = (x < width - 1) ? row[x + 1] : row[
x - 1
];
sh_row[blockDim.x + 1] = (x < width - 1) ? row[x + 1] : row[
width - 2
];
__syncthreads();
if (x < width)
...
...
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
View file @
cc6a87fc
...
...
@@ -360,20 +360,22 @@ struct CV_EXPORTS_W HOGDescriptor
{
public
:
enum
{
L2Hys
=
0
};
enum
{
DEFAULT_NLEVELS
=
64
};
CV_WRAP
HOGDescriptor
()
:
winSize
(
64
,
128
),
blockSize
(
16
,
16
),
blockStride
(
8
,
8
),
cellSize
(
8
,
8
),
nbins
(
9
),
derivAperture
(
1
),
winSigma
(
-
1
),
histogramNormType
(
HOGDescriptor
::
L2Hys
),
L2HysThreshold
(
0.2
),
gammaCorrection
(
true
)
histogramNormType
(
HOGDescriptor
::
L2Hys
),
L2HysThreshold
(
0.2
),
gammaCorrection
(
true
),
nlevels
(
DEFAULT_NLEVELS
)
{}
CV_WRAP
HOGDescriptor
(
Size
_winSize
,
Size
_blockSize
,
Size
_blockStride
,
Size
_cellSize
,
int
_nbins
,
int
_derivAperture
=
1
,
double
_winSigma
=-
1
,
int
_histogramNormType
=
HOGDescriptor
::
L2Hys
,
double
_L2HysThreshold
=
0.2
,
bool
_gammaCorrection
=
false
)
double
_L2HysThreshold
=
0.2
,
bool
_gammaCorrection
=
false
,
int
_nlevels
=
DEFAULT_NLEVELS
)
:
winSize
(
_winSize
),
blockSize
(
_blockSize
),
blockStride
(
_blockStride
),
cellSize
(
_cellSize
),
nbins
(
_nbins
),
derivAperture
(
_derivAperture
),
winSigma
(
_winSigma
),
histogramNormType
(
_histogramNormType
),
L2HysThreshold
(
_L2HysThreshold
),
gammaCorrection
(
_gammaCorrection
)
gammaCorrection
(
_gammaCorrection
)
,
nlevels
(
_nlevels
)
{}
CV_WRAP
HOGDescriptor
(
const
String
&
filename
)
...
...
@@ -429,6 +431,7 @@ public:
CV_PROP
double
L2HysThreshold
;
CV_PROP
bool
gammaCorrection
;
CV_PROP
vector
<
float
>
svmDetector
;
CV_PROP
int
nlevels
;
};
...
...
modules/objdetect/src/hog.cpp
View file @
cc6a87fc
...
...
@@ -872,11 +872,10 @@ void HOGDescriptor::detectMultiScale(
double
scale0
,
int
groupThreshold
)
const
{
double
scale
=
1.
;
const
int
maxLevels
=
64
;
int
levels
=
0
;
vector
<
double
>
levelScale
;
for
(
levels
=
0
;
levels
<
maxL
evels
;
levels
++
)
for
(
levels
=
0
;
levels
<
nl
evels
;
levels
++
)
{
levelScale
.
push_back
(
scale
);
if
(
cvRound
(
img
.
cols
/
scale
)
<
winSize
.
width
||
...
...
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