Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
d0998725
Commit
d0998725
authored
Feb 09, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1549 from alalek:build_cxx17
parents
4cb11f23
af58e08e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
sparse_matching_gpc.cpp
modules/optflow/src/sparse_matching_gpc.cpp
+9
-1
bagofwords_classification.cpp
modules/xfeatures2d/samples/bagofwords_classification.cpp
+10
-0
No files found.
modules/optflow/src/sparse_matching_gpc.cpp
View file @
d0998725
...
...
@@ -40,13 +40,16 @@
//
//M*/
#include "precomp.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/private.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgcodecs.hpp"
#include "precomp.hpp"
#include "opencl_kernels_optflow.hpp"
#include "opencv2/core/hal/intrin.hpp"
#ifdef CV_CXX11
#include <random> // std::mt19937
#endif
/* Disable "from double to float" and "from size_t to int" warnings.
* Fixing these would make the code look ugly by introducing explicit cast all around.
...
...
@@ -402,7 +405,12 @@ void getTrainingSamples( const Mat &from, const Mat &to, const Mat >, GPCSampl
// with a small displacement and train to better distinguish hard pairs.
std
::
nth_element
(
mag
.
begin
(),
mag
.
begin
()
+
n
,
mag
.
end
()
);
mag
.
resize
(
n
);
#ifdef CV_CXX11
std
::
mt19937
std_rng
(
cv
::
theRNG
()());
std
::
shuffle
(
mag
.
begin
(),
mag
.
end
(),
std_rng
);
#else
std
::
random_shuffle
(
mag
.
begin
(),
mag
.
end
()
);
#endif
n
/=
patchRadius
;
mag
.
resize
(
n
);
...
...
modules/xfeatures2d/samples/bagofwords_classification.cpp
View file @
d0998725
...
...
@@ -864,7 +864,12 @@ void VocData::calcPrecRecall_impl(const vector<char>& ground_truth, const vector
{
recall_norm
=
recall_normalization
;
}
else
{
#ifdef CV_CXX11
recall_norm
=
(
int
)
std
::
count_if
(
ground_truth
.
begin
(),
ground_truth
.
end
(),
[](
const
char
a
)
{
return
a
==
(
char
)
1
;
});
#else
recall_norm
=
(
int
)
std
::
count_if
(
ground_truth
.
begin
(),
ground_truth
.
end
(),
std
::
bind2nd
(
std
::
equal_to
<
char
>
(),(
char
)
1
));
#endif
}
ap
=
0
;
...
...
@@ -994,7 +999,12 @@ void VocData::calcClassifierConfMatRow(const string& obj_class, const vector<Obd
/* in order to calculate the total number of relevant images for normalization of recall
it's necessary to extract the ground truth for the images under consideration */
getClassifierGroundTruth
(
obj_class
,
images
,
ground_truth
);
#ifdef CV_CXX11
total_relevant
=
(
int
)
std
::
count_if
(
ground_truth
.
begin
(),
ground_truth
.
end
(),
[](
const
char
a
)
{
return
a
==
(
char
)
1
;
});
#else
total_relevant
=
(
int
)
std
::
count_if
(
ground_truth
.
begin
(),
ground_truth
.
end
(),
std
::
bind2nd
(
std
::
equal_to
<
char
>
(),(
char
)
1
));
#endif
}
/* iterate through images */
...
...
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