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
d102ea96
Commit
d102ea96
authored
Sep 02, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7210 from mshabunin:fix-warnings
parents
8104db22
dc704d77
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
106 additions
and
138 deletions
+106
-138
CMakeLists.txt
3rdparty/libtiff/CMakeLists.txt
+1
-1
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+1
-0
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+1
-1
perf_umat.cpp
modules/core/perf/perf_umat.cpp
+0
-3
test_ds.cpp
modules/core/test/test_ds.cpp
+1
-1
features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+1
-1
flann.hpp
modules/flann/include/opencv2/flann.hpp
+101
-131
No files found.
3rdparty/libtiff/CMakeLists.txt
View file @
d102ea96
...
...
@@ -95,7 +95,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4703
)
# vs2012
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312
)
# vs2015
ocv_warnings_disable
(
CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018
)
ocv_warnings_disable
(
CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018
/wd4311 /wd4312
)
if
(
UNIX
AND
(
CMAKE_COMPILER_IS_GNUCXX OR CV_ICC
))
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fPIC"
)
...
...
cmake/OpenCVCompilerOptions.cmake
View file @
d102ea96
...
...
@@ -97,6 +97,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option
(
-Wno-narrowing
)
add_extra_compiler_option
(
-Wno-delete-non-virtual-dtor
)
add_extra_compiler_option
(
-Wno-unnamed-type-template-args
)
add_extra_compiler_option
(
-Wno-comment
)
endif
()
add_extra_compiler_option
(
-fdiagnostics-show-option
)
...
...
modules/core/include/opencv2/core/utility.hpp
View file @
d102ea96
...
...
@@ -1126,7 +1126,7 @@ CV_EXPORTS InstrNode* getTrace();
CV_EXPORTS
void
resetTrace
();
CV_EXPORTS
void
setFlags
(
int
modeFlags
);
CV_EXPORTS
int
getFlags
();
}
;
}
}
//namespace cv
...
...
modules/core/perf/perf_umat.cpp
View file @
d102ea96
...
...
@@ -13,7 +13,6 @@ using namespace ::testing;
using
std
::
tr1
::
tuple
;
using
std
::
tr1
::
get
;
namespace
{
struct
OpenCLState
{
...
...
@@ -64,5 +63,3 @@ OCL_PERF_TEST_P(UMatTest, CustomPtr, Combine(Values(sz1080p, sz2160p), Bool(), :
SANITY_CHECK_NOTHING
();
}
}
// namespace cvtest
modules/core/test/test_ds.cpp
View file @
d102ea96
...
...
@@ -56,7 +56,7 @@ static void cvTsSimpleSeqShiftAndCopy( CvTsSimpleSeq* seq, int from_idx, int to_
(
seq
->
count
-
from_idx
)
*
elem_size
);
}
seq
->
count
+=
to_idx
-
from_idx
;
if
(
elem
&&
to_idx
>
from_idx
)
if
(
elem
)
memcpy
(
seq
->
array
+
from_idx
*
elem_size
,
elem
,
(
to_idx
-
from_idx
)
*
elem_size
);
}
...
...
modules/features2d/include/opencv2/features2d.hpp
View file @
d102ea96
...
...
@@ -1022,7 +1022,7 @@ protected:
/** @brief Flann-based descriptor matcher.
This matcher trains
flann::Index_
on a train descriptor collection and calls its nearest search
This matcher trains
cv::flann::Index
on a train descriptor collection and calls its nearest search
methods to find the best matches. So, this matcher may be faster when matching a large train
collection than the brute force matcher. FlannBasedMatcher does not support masking permissible
matches of descriptor sets because flann::Index does not support this. :
...
...
modules/flann/include/opencv2/flann.hpp
View file @
d102ea96
...
...
@@ -338,164 +338,134 @@ int GenericIndex<Distance>::radiusSearch(const Mat& query, Mat& indices, Mat& di
* @deprecated Use GenericIndex class instead
*/
template
<
typename
T
>
class
#ifndef _MSC_VER
FLANN_DEPRECATED
#endif
Index_
{
class
Index_
{
public
:
typedef
typename
L2
<
T
>::
ElementType
ElementType
;
typedef
typename
L2
<
T
>::
ResultType
DistanceType
;
Index_
(
const
Mat
&
features
,
const
::
cvflann
::
IndexParams
&
params
);
~
Index_
();
typedef
typename
L2
<
T
>::
ElementType
ElementType
;
typedef
typename
L2
<
T
>::
ResultType
DistanceType
;
void
knnSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
params
);
void
knnSearch
(
const
Mat
&
queries
,
Mat
&
indices
,
Mat
&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
params
);
int
radiusSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
params
);
int
radiusSearch
(
const
Mat
&
query
,
Mat
&
indices
,
Mat
&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
params
);
void
save
(
String
filename
)
{
if
(
nnIndex_L1
)
nnIndex_L1
->
save
(
filename
);
if
(
nnIndex_L2
)
nnIndex_L2
->
save
(
filename
);
}
int
veclen
()
const
FLANN_DEPRECATED
Index_
(
const
Mat
&
dataset
,
const
::
cvflann
::
IndexParams
&
params
)
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
veclen
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
veclen
();
}
printf
(
"[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead
\n
"
);
int
size
()
const
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
size
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
size
();
}
::
cvflann
::
IndexParams
getParameters
()
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
getParameters
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
getParameters
();
CV_Assert
(
dataset
.
type
()
==
CvType
<
ElementType
>::
type
());
CV_Assert
(
dataset
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_dataset
((
ElementType
*
)
dataset
.
ptr
<
ElementType
>
(
0
),
dataset
.
rows
,
dataset
.
cols
);
if
(
::
cvflann
::
flann_distance_type
()
==
cvflann
::
FLANN_DIST_L2
)
{
nnIndex_L1
=
NULL
;
nnIndex_L2
=
new
::
cvflann
::
Index
<
L2
<
ElementType
>
>
(
m_dataset
,
params
);
}
FLANN_DEPRECATED
const
::
cvflann
::
IndexParams
*
getIndexParameters
()
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
getIndexParameters
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
getIndexParameters
();
else
if
(
::
cvflann
::
flann_distance_type
()
==
cvflann
::
FLANN_DIST_L1
)
{
nnIndex_L1
=
new
::
cvflann
::
Index
<
L1
<
ElementType
>
>
(
m_dataset
,
params
);
nnIndex_L2
=
NULL
;
}
else
{
printf
(
"[ERROR] cv::flann::Index_<T> only provides backwards compatibility for the L1 and L2 distances. "
"For other distance types you must use cv::flann::GenericIndex<Distance>
\n
"
);
CV_Assert
(
0
);
}
if
(
nnIndex_L1
)
nnIndex_L1
->
buildIndex
();
if
(
nnIndex_L2
)
nnIndex_L2
->
buildIndex
();
}
FLANN_DEPRECATED
~
Index_
()
{
if
(
nnIndex_L1
)
delete
nnIndex_L1
;
if
(
nnIndex_L2
)
delete
nnIndex_L2
;
}
private
:
// providing backwards compatibility for L2 and L1 distances (most common)
::
cvflann
::
Index
<
L2
<
ElementType
>
>*
nnIndex_L2
;
::
cvflann
::
Index
<
L1
<
ElementType
>
>*
nnIndex_L1
;
};
#ifdef _MSC_VER
template
<
typename
T
>
class
FLANN_DEPRECATED
Index_
;
#endif
FLANN_DEPRECATED
void
knnSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
&
query
[
0
],
1
,
query
.
size
());
::
cvflann
::
Matrix
<
int
>
m_indices
(
&
indices
[
0
],
1
,
indices
.
size
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
(
&
dists
[
0
],
1
,
dists
.
size
());
//! @cond IGNORED
if
(
nnIndex_L1
)
nnIndex_L1
->
knnSearch
(
m_query
,
m_indices
,
m_dists
,
knn
,
searchParams
);
if
(
nnIndex_L2
)
nnIndex_L2
->
knnSearch
(
m_query
,
m_indices
,
m_dists
,
knn
,
searchParams
);
}
FLANN_DEPRECATED
void
knnSearch
(
const
Mat
&
queries
,
Mat
&
indices
,
Mat
&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
CV_Assert
(
queries
.
type
()
==
CvType
<
ElementType
>::
type
());
CV_Assert
(
queries
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_queries
((
ElementType
*
)
queries
.
ptr
<
ElementType
>
(
0
),
queries
.
rows
,
queries
.
cols
);
template
<
typename
T
>
Index_
<
T
>::
Index_
(
const
Mat
&
dataset
,
const
::
cvflann
::
IndexParams
&
params
)
{
printf
(
"[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead
\n
"
);
CV_Assert
(
indices
.
type
()
==
CV_32S
);
CV_Assert
(
indices
.
isContinuous
());
::
cvflann
::
Matrix
<
int
>
m_indices
((
int
*
)
indices
.
ptr
<
int
>
(
0
),
indices
.
rows
,
indices
.
cols
);
CV_Assert
(
dataset
.
type
()
==
CvType
<
Element
Type
>::
type
());
CV_Assert
(
dataset
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_dataset
((
ElementType
*
)
dataset
.
ptr
<
ElementType
>
(
0
),
dataset
.
rows
,
dataset
.
cols
);
CV_Assert
(
dists
.
type
()
==
CvType
<
Distance
Type
>::
type
());
CV_Assert
(
dists
.
isContinuous
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
((
DistanceType
*
)
dists
.
ptr
<
DistanceType
>
(
0
),
dists
.
rows
,
dists
.
cols
);
if
(
::
cvflann
::
flann_distance_type
()
==
cvflann
::
FLANN_DIST_L2
)
{
nnIndex_L1
=
NULL
;
nnIndex_L2
=
new
::
cvflann
::
Index
<
L2
<
ElementType
>
>
(
m_dataset
,
params
);
}
else
if
(
::
cvflann
::
flann_distance_type
()
==
cvflann
::
FLANN_DIST_L1
)
{
nnIndex_L1
=
new
::
cvflann
::
Index
<
L1
<
ElementType
>
>
(
m_dataset
,
params
);
nnIndex_L2
=
NULL
;
if
(
nnIndex_L1
)
nnIndex_L1
->
knnSearch
(
m_queries
,
m_indices
,
m_dists
,
knn
,
searchParams
);
if
(
nnIndex_L2
)
nnIndex_L2
->
knnSearch
(
m_queries
,
m_indices
,
m_dists
,
knn
,
searchParams
);
}
else
{
printf
(
"[ERROR] cv::flann::Index_<T> only provides backwards compatibility for the L1 and L2 distances. "
"For other distance types you must use cv::flann::GenericIndex<Distance>
\n
"
);
CV_Assert
(
0
);
}
if
(
nnIndex_L1
)
nnIndex_L1
->
buildIndex
();
if
(
nnIndex_L2
)
nnIndex_L2
->
buildIndex
();
}
template
<
typename
T
>
Index_
<
T
>::~
Index_
()
{
if
(
nnIndex_L1
)
delete
nnIndex_L1
;
if
(
nnIndex_L2
)
delete
nnIndex_L2
;
}
template
<
typename
T
>
void
Index_
<
T
>::
knnSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
&
query
[
0
],
1
,
query
.
size
());
::
cvflann
::
Matrix
<
int
>
m_indices
(
&
indices
[
0
],
1
,
indices
.
size
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
(
&
dists
[
0
],
1
,
dists
.
size
());
FLANN_DEPRECATED
int
radiusSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
&
query
[
0
],
1
,
query
.
size
());
::
cvflann
::
Matrix
<
int
>
m_indices
(
&
indices
[
0
],
1
,
indices
.
size
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
(
&
dists
[
0
],
1
,
dists
.
size
());
if
(
nnIndex_L1
)
nnIndex_L1
->
knnSearch
(
m_query
,
m_indices
,
m_dists
,
knn
,
searchParams
);
if
(
nnIndex_L2
)
nnIndex_L2
->
knnSearch
(
m_query
,
m_indices
,
m_dists
,
knn
,
searchParams
);
}
if
(
nnIndex_L1
)
return
nnIndex_L1
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
if
(
nnIndex_L2
)
return
nnIndex_L2
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
}
FLANN_DEPRECATED
int
radiusSearch
(
const
Mat
&
query
,
Mat
&
indices
,
Mat
&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
CV_Assert
(
query
.
type
()
==
CvType
<
ElementType
>::
type
());
CV_Assert
(
query
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
query
.
ptr
<
ElementType
>
(
0
),
query
.
rows
,
query
.
cols
);
template
<
typename
T
>
void
Index_
<
T
>::
knnSearch
(
const
Mat
&
queries
,
Mat
&
indices
,
Mat
&
dists
,
int
knn
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
CV_Assert
(
queries
.
type
()
==
CvType
<
ElementType
>::
type
());
CV_Assert
(
queries
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_queries
((
ElementType
*
)
queries
.
ptr
<
ElementType
>
(
0
),
queries
.
rows
,
queries
.
cols
);
CV_Assert
(
indices
.
type
()
==
CV_32S
);
CV_Assert
(
indices
.
isContinuous
());
::
cvflann
::
Matrix
<
int
>
m_indices
((
int
*
)
indices
.
ptr
<
int
>
(
0
),
indices
.
rows
,
indices
.
cols
);
CV_Assert
(
indices
.
type
()
==
CV_32S
);
CV_Assert
(
indice
s
.
isContinuous
());
::
cvflann
::
Matrix
<
int
>
m_indices
((
int
*
)
indices
.
ptr
<
int
>
(
0
),
indices
.
rows
,
indice
s
.
cols
);
CV_Assert
(
dists
.
type
()
==
CvType
<
DistanceType
>::
type
()
);
CV_Assert
(
dist
s
.
isContinuous
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
((
DistanceType
*
)
dists
.
ptr
<
DistanceType
>
(
0
),
dists
.
rows
,
dist
s
.
cols
);
CV_Assert
(
dists
.
type
()
==
CvType
<
DistanceType
>::
type
()
);
CV_Assert
(
dists
.
isContinuous
()
);
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
((
DistanceType
*
)
dists
.
ptr
<
DistanceType
>
(
0
),
dists
.
rows
,
dists
.
cols
);
if
(
nnIndex_L1
)
return
nnIndex_L1
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
if
(
nnIndex_L2
)
return
nnIndex_L2
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
}
if
(
nnIndex_L1
)
nnIndex_L1
->
knnSearch
(
m_queries
,
m_indices
,
m_dists
,
knn
,
searchParams
);
if
(
nnIndex_L2
)
nnIndex_L2
->
knnSearch
(
m_queries
,
m_indices
,
m_dists
,
knn
,
searchParams
);
}
FLANN_DEPRECATED
void
save
(
String
filename
)
{
if
(
nnIndex_L1
)
nnIndex_L1
->
save
(
filename
);
if
(
nnIndex_L2
)
nnIndex_L2
->
save
(
filename
);
}
template
<
typename
T
>
int
Index_
<
T
>::
radiusSearch
(
const
std
::
vector
<
ElementType
>&
query
,
std
::
vector
<
int
>&
indices
,
std
::
vector
<
DistanceType
>&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
&
query
[
0
],
1
,
query
.
size
());
::
cvflann
::
Matrix
<
int
>
m_indices
(
&
indices
[
0
],
1
,
indices
.
size
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
(
&
dists
[
0
],
1
,
dists
.
size
());
FLANN_DEPRECATED
int
veclen
()
const
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
veclen
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
veclen
();
}
if
(
nnIndex_L1
)
return
nnIndex_L1
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
if
(
nnIndex_L2
)
return
nnIndex_L2
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
}
FLANN_DEPRECATED
int
size
()
const
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
size
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
size
();
}
template
<
typename
T
>
int
Index_
<
T
>::
radiusSearch
(
const
Mat
&
query
,
Mat
&
indices
,
Mat
&
dists
,
DistanceType
radius
,
const
::
cvflann
::
SearchParams
&
searchParams
)
{
CV_Assert
(
query
.
type
()
==
CvType
<
ElementType
>::
type
());
CV_Assert
(
query
.
isContinuous
());
::
cvflann
::
Matrix
<
ElementType
>
m_query
((
ElementType
*
)
query
.
ptr
<
ElementType
>
(
0
),
query
.
rows
,
query
.
cols
);
FLANN_DEPRECATED
::
cvflann
::
IndexParams
getParameters
()
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
getParameters
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
getParameters
();
CV_Assert
(
indices
.
type
()
==
CV_32S
);
CV_Assert
(
indices
.
isContinuous
());
::
cvflann
::
Matrix
<
int
>
m_indices
((
int
*
)
indices
.
ptr
<
int
>
(
0
),
indices
.
rows
,
indices
.
cols
);
}
CV_Assert
(
dists
.
type
()
==
CvType
<
DistanceType
>::
type
());
CV_Assert
(
dists
.
isContinuous
());
::
cvflann
::
Matrix
<
DistanceType
>
m_dists
((
DistanceType
*
)
dists
.
ptr
<
DistanceType
>
(
0
),
dists
.
rows
,
dists
.
cols
);
FLANN_DEPRECATED
const
::
cvflann
::
IndexParams
*
getIndexParameters
()
{
if
(
nnIndex_L1
)
return
nnIndex_L1
->
getIndexParameters
();
if
(
nnIndex_L2
)
return
nnIndex_L2
->
getIndexParameters
();
}
if
(
nnIndex_L1
)
return
nnIndex_L1
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
if
(
nnIndex_L2
)
return
nnIndex_L2
->
radiusSearch
(
m_query
,
m_indices
,
m_dists
,
radius
,
searchParams
);
}
private
:
// providing backwards compatibility for L2 and L1 distances (most common)
::
cvflann
::
Index
<
L2
<
ElementType
>
>*
nnIndex_L2
;
::
cvflann
::
Index
<
L1
<
ElementType
>
>*
nnIndex_L1
;
};
//! @endcond
/** @brief Clusters features using hierarchical k-means algorithm.
...
...
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