Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
793a8a51
Commit
793a8a51
authored
May 16, 2014
by
Davis King
Browse files
Fixed a potential divide by zero in draw_fhog()
parent
c6d778ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
dlib/image_transforms/fhog.h
dlib/image_transforms/fhog.h
+8
-2
No files found.
dlib/image_transforms/fhog.h
View file @
793a8a51
...
...
@@ -847,7 +847,10 @@ namespace dlib
}
const
double
thresh
=
mean
(
himg
)
+
4
*
stddev
(
himg
);
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
if
(
thresh
!=
0
)
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
else
return
matrix_cast
<
unsigned
char
>
(
himg
);
}
// ----------------------------------------------------------------------------------------
...
...
@@ -927,7 +930,10 @@ namespace dlib
}
const
double
thresh
=
mean
(
himg
)
+
4
*
stddev
(
himg
);
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
if
(
thresh
!=
0
)
return
matrix_cast
<
unsigned
char
>
(
upperbound
(
round
(
himg
*
255
/
thresh
),
255
));
else
return
matrix_cast
<
unsigned
char
>
(
himg
);
}
// ----------------------------------------------------------------------------------------
...
...
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