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
c05595e4
Commit
c05595e4
authored
Aug 23, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15382 from alalek:fix_15287
parents
d4d7ab06
5a497077
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
hog.cpp
modules/objdetect/src/hog.cpp
+11
-6
No files found.
modules/objdetect/src/hog.cpp
View file @
c05595e4
...
...
@@ -68,6 +68,7 @@ enum {DESCR_FORMAT_COL_BY_COL, DESCR_FORMAT_ROW_BY_ROW};
static
int
numPartsWithin
(
int
size
,
int
part_size
,
int
stride
)
{
CV_Assert
(
stride
!=
0
);
return
(
size
-
part_size
+
stride
)
/
stride
;
}
...
...
@@ -80,6 +81,7 @@ static Size numPartsWithin(cv::Size size, cv::Size part_size,
static
size_t
getBlockHistogramSize
(
Size
block_size
,
Size
cell_size
,
int
nbins
)
{
CV_Assert
(
!
cell_size
.
empty
());
Size
cells_per_block
=
Size
(
block_size
.
width
/
cell_size
.
width
,
block_size
.
height
/
cell_size
.
height
);
return
(
size_t
)(
nbins
*
cells_per_block
.
area
());
...
...
@@ -87,6 +89,9 @@ static size_t getBlockHistogramSize(Size block_size, Size cell_size, int nbins)
size_t
HOGDescriptor
::
getDescriptorSize
()
const
{
CV_Assert
(
!
cellSize
.
empty
());
CV_Assert
(
!
blockStride
.
empty
());
CV_Assert
(
blockSize
.
width
%
cellSize
.
width
==
0
&&
blockSize
.
height
%
cellSize
.
height
==
0
);
CV_Assert
((
winSize
.
width
-
blockSize
.
width
)
%
blockStride
.
width
==
0
&&
...
...
@@ -144,20 +149,20 @@ bool HOGDescriptor::read(FileNode& obj)
if
(
!
obj
.
isMap
()
)
return
false
;
FileNodeIterator
it
=
obj
[
"winSize"
].
begin
();
it
>>
winSize
.
width
>>
winSize
.
height
;
it
>>
winSize
.
width
>>
winSize
.
height
;
CV_Assert
(
!
winSize
.
empty
());
it
=
obj
[
"blockSize"
].
begin
();
it
>>
blockSize
.
width
>>
blockSize
.
height
;
it
>>
blockSize
.
width
>>
blockSize
.
height
;
CV_Assert
(
!
blockSize
.
empty
());
it
=
obj
[
"blockStride"
].
begin
();
it
>>
blockStride
.
width
>>
blockStride
.
height
;
it
>>
blockStride
.
width
>>
blockStride
.
height
;
CV_Assert
(
!
blockStride
.
empty
());
it
=
obj
[
"cellSize"
].
begin
();
it
>>
cellSize
.
width
>>
cellSize
.
height
;
obj
[
"nbins"
]
>>
nbins
;
it
>>
cellSize
.
width
>>
cellSize
.
height
;
CV_Assert
(
!
cellSize
.
empty
());
obj
[
"nbins"
]
>>
nbins
;
CV_Assert
(
nbins
>
0
);
obj
[
"derivAperture"
]
>>
derivAperture
;
obj
[
"winSigma"
]
>>
winSigma
;
obj
[
"histogramNormType"
]
>>
histogramNormType
;
obj
[
"L2HysThreshold"
]
>>
L2HysThreshold
;
obj
[
"gammaCorrection"
]
>>
gammaCorrection
;
obj
[
"nlevels"
]
>>
nlevels
;
obj
[
"nlevels"
]
>>
nlevels
;
CV_Assert
(
nlevels
>
0
);
if
(
obj
[
"signedGradient"
].
empty
())
signedGradient
=
false
;
else
...
...
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