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
a66f7cb9
Commit
a66f7cb9
authored
Feb 22, 2013
by
Eric Christiansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allows building with -std=c++11 under G++
parent
0b8a6da8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
_random.hpp
modules/softcascade/src/_random.hpp
+6
-0
integral_channel_builder.cpp
modules/softcascade/src/integral_channel_builder.cpp
+14
-0
No files found.
modules/softcascade/src/_random.hpp
View file @
a66f7cb9
...
...
@@ -67,7 +67,13 @@ namespace cv { namespace softcascade { namespace internal
struct
Random
{
typedef
std
::
mt19937
engine
;
// True if we're using C++11.
#if __cplusplus >= 201103L
// C++11 removes uniform_int.
typedef
std
::
uniform_int_distribution
<
int
>
uniform
;
#else
typedef
std
::
uniform_int
<
int
>
uniform
;
#endif
};
}}}
...
...
modules/softcascade/src/integral_channel_builder.cpp
View file @
a66f7cb9
...
...
@@ -233,8 +233,22 @@ void ChannelFeaturePool::fill(int desired)
int
x
=
xRand
(
eng
);
int
y
=
yRand
(
eng
);
#if __cplusplus >= 201103L
// The interface changed slightly going from uniform_int to
// uniform_int_distribution. See this page to understand
// the old behavior:
// http://www.boost.org/doc/libs/1_47_0/boost/random/uniform_int.hpp
int
w
=
1
+
wRand
(
eng
,
// This extra "- 1" appears to be necessary, based on the Boost docs.
Random
::
uniform
::
param_type
(
0
,
(
model
.
width
-
x
-
1
)
-
1
));
int
h
=
1
+
hRand
(
eng
,
Random
::
uniform
::
param_type
(
0
,
(
model
.
height
-
y
-
1
)
-
1
));
#else
int
w
=
1
+
wRand
(
eng
,
model
.
width
-
x
-
1
);
int
h
=
1
+
hRand
(
eng
,
model
.
height
-
y
-
1
);
#endif
CV_Assert
(
w
>
0
);
CV_Assert
(
h
>
0
);
...
...
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