Skip to content

Commit f8b2406

Browse files
committed
Merge branch 'master' of https://github.com/opencv/opencv
2 parents 6d49a6a + da41ac9 commit f8b2406

File tree

323 files changed

+16770
-6914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+16770
-6914
lines changed

3rdparty/ittnotify/src/ittnotify/ittnotify_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
335335
#ifdef SDL_STRNCPY_S
336336
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
337337
#else
338-
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, l)
338+
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
339339
#endif /* SDL_STRNCPY_S */
340340

341341
#define __itt_fstrdup(s) strdup(s)

3rdparty/openexr/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -W
4747
-Wsuggest-override -Winconsistent-missing-override
4848
-Wimplicit-fallthrough
4949
)
50+
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
51+
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
52+
endif()
53+
5054
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
5155
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
5256
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008

3rdparty/openvx/hal/openvx_hal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, int ah,
431431
return CV_HAL_ERROR_OK;
432432
}
433433

434-
int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4])
434+
int ovx_hal_warpPerspective(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4])
435435
{
436436
if (skipSmallImages<VX_KERNEL_WARP_PERSPECTIVE>(aw, ah))
437437
return CV_HAL_ERROR_NOT_IMPLEMENTED;

3rdparty/openvx/hal/openvx_hal.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int ovx_hal_mul(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t
2727
int ovx_hal_merge8u(const uchar **src_data, uchar *dst_data, int len, int cn);
2828
int ovx_hal_resize(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, double inv_scale_x, double inv_scale_y, int interpolation);
2929
int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[6], int interpolation, int borderType, const double borderValue[4]);
30-
int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4]);
30+
int ovx_hal_warpPerspective(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4]);
3131

3232
struct cvhalFilter2D;
3333
int ovx_hal_filterInit(cvhalFilter2D **filter_context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
@@ -97,7 +97,7 @@ int ovx_hal_integral(int depth, int sdepth, int, const uchar * a, size_t astep,
9797
//#undef cv_hal_warpAffine
9898
//#define cv_hal_warpAffine ovx_hal_warpAffine
9999
//#undef cv_hal_warpPerspective
100-
//#define cv_hal_warpPerspective ovx_hal_warpPerspectve
100+
//#define cv_hal_warpPerspective ovx_hal_warpPerspective
101101

102102
#undef cv_hal_filterInit
103103
#define cv_hal_filterInit ovx_hal_filterInit

3rdparty/protobuf/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if(CV_ICC)
2929
-wd265 -wd858 -wd873 -wd2196
3030
)
3131
endif()
32+
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
33+
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
34+
endif()
3235

3336
# Easier to support different versions of protobufs
3437
function(append_if_exist OUTPUT_LIST)

CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,22 @@ if(WITH_HALIDE OR HAVE_HALIDE)
14021402
status(" Halide:" HAVE_HALIDE THEN "YES (${HALIDE_LIBRARIES} ${HALIDE_INCLUDE_DIRS})" ELSE NO)
14031403
endif()
14041404

1405-
if(WITH_INF_ENGINE OR HAVE_INF_ENGINE)
1406-
status(" Inference Engine:" HAVE_INF_ENGINE THEN "YES (${INF_ENGINE_LIBRARIES} ${INF_ENGINE_INCLUDE_DIRS})" ELSE NO)
1405+
if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
1406+
if(INF_ENGINE_TARGET)
1407+
set(__msg "YES (${INF_ENGINE_RELEASE} / ${INF_ENGINE_VERSION})")
1408+
get_target_property(_lib ${INF_ENGINE_TARGET} IMPORTED_LOCATION)
1409+
if(NOT _lib)
1410+
get_target_property(_lib_rel ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_RELEASE)
1411+
get_target_property(_lib_dbg ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_DEBUG)
1412+
set(_lib "${_lib_rel} / ${_lib_dbg}")
1413+
endif()
1414+
get_target_property(_inc ${INF_ENGINE_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
1415+
status(" Inference Engine:" "${__msg}")
1416+
status(" libs:" "${_lib}")
1417+
status(" includes:" "${_inc}")
1418+
else()
1419+
status(" Inference Engine:" "NO")
1420+
endif()
14071421
endif()
14081422

14091423
if(WITH_EIGEN OR HAVE_EIGEN)

apps/createsamples/utility.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#include "opencv2/highgui.hpp"
5555
#include "opencv2/calib3d.hpp"
5656

57+
#if defined __GNUC__ && __GNUC__ >= 8
58+
#pragma GCC diagnostic ignored "-Wclass-memaccess"
59+
#endif
60+
5761
using namespace cv;
5862

5963
#ifndef PATH_MAX
@@ -1040,12 +1044,10 @@ void cvCreateTrainingSamples( const char* filename,
10401044
output = fopen( filename, "wb" );
10411045
if( output != NULL )
10421046
{
1043-
int hasbg;
10441047
int i;
10451048
int inverse;
10461049

1047-
hasbg = 0;
1048-
hasbg = (bgfilename != NULL && icvInitBackgroundReaders( bgfilename,
1050+
const int hasbg = (bgfilename != NULL && icvInitBackgroundReaders( bgfilename,
10491051
Size( winwidth,winheight ) ) );
10501052

10511053
Mat sample( winheight, winwidth, CV_8UC1 );
@@ -1372,7 +1374,7 @@ int icvGetTraininDataFromVec( Mat& img, CvVecFile& userdata )
13721374

13731375
size_t elements_read = fread( &tmp, sizeof( tmp ), 1, userdata.input );
13741376
CV_Assert(elements_read == 1);
1375-
elements_read = fread( vector, sizeof( short ), userdata.vecsize, userdata.input );
1377+
elements_read = fread(vector.data(), sizeof(short), userdata.vecsize, userdata.input);
13761378
CV_Assert(elements_read == (size_t)userdata.vecsize);
13771379

13781380
if( feof( userdata.input ) || userdata.last++ >= userdata.count )

apps/traincascade/HOGfeatures.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void CvHOGEvaluator::integralHistogram(const Mat &img, vector<Mat> &histogram, M
165165
Mat qangle(gradSize, CV_8U);
166166

167167
AutoBuffer<int> mapbuf(gradSize.width + gradSize.height + 4);
168-
int* xmap = (int*)mapbuf + 1;
168+
int* xmap = mapbuf.data() + 1;
169169
int* ymap = xmap + gradSize.width + 2;
170170

171171
const int borderType = (int)BORDER_REPLICATE;
@@ -177,7 +177,7 @@ void CvHOGEvaluator::integralHistogram(const Mat &img, vector<Mat> &histogram, M
177177

178178
int width = gradSize.width;
179179
AutoBuffer<float> _dbuf(width*4);
180-
float* dbuf = _dbuf;
180+
float* dbuf = _dbuf.data();
181181
Mat Dx(1, width, CV_32F, dbuf);
182182
Mat Dy(1, width, CV_32F, dbuf + width);
183183
Mat Mag(1, width, CV_32F, dbuf + width*2);

apps/traincascade/boost.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
383383
int ci = get_var_type(vi);
384384
CV_Assert( ci < 0 );
385385

386-
int *src_idx_buf = (int*)(uchar*)inn_buf;
386+
int *src_idx_buf = (int*)inn_buf.data();
387387
float *src_val_buf = (float*)(src_idx_buf + sample_count);
388388
int* sample_indices_buf = (int*)(src_val_buf + sample_count);
389389
const int* src_idx = 0;
@@ -423,7 +423,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
423423
}
424424

425425
// subsample cv_lables
426-
const int* src_lbls = get_cv_labels(data_root, (int*)(uchar*)inn_buf);
426+
const int* src_lbls = get_cv_labels(data_root, (int*)inn_buf.data());
427427
if (is_buf_16u)
428428
{
429429
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
@@ -440,7 +440,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
440440
}
441441

442442
// subsample sample_indices
443-
const int* sample_idx_src = get_sample_indices(data_root, (int*)(uchar*)inn_buf);
443+
const int* sample_idx_src = get_sample_indices(data_root, (int*)inn_buf.data());
444444
if (is_buf_16u)
445445
{
446446
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
@@ -815,7 +815,7 @@ struct FeatureIdxOnlyPrecalc : ParallelLoopBody
815815
void operator()( const Range& range ) const
816816
{
817817
cv::AutoBuffer<float> valCache(sample_count);
818-
float* valCachePtr = (float*)valCache;
818+
float* valCachePtr = valCache.data();
819819
for ( int fi = range.start; fi < range.end; fi++)
820820
{
821821
for( int si = 0; si < sample_count; si++ )
@@ -1084,7 +1084,7 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
10841084
CvMat* buf = data->buf;
10851085
size_t length_buf_row = data->get_length_subbuf();
10861086
cv::AutoBuffer<uchar> inn_buf(n*(3*sizeof(int)+sizeof(float)));
1087-
int* tempBuf = (int*)(uchar*)inn_buf;
1087+
int* tempBuf = (int*)inn_buf.data();
10881088
bool splitInputData;
10891089

10901090
complete_node_dir(node);
@@ -1398,7 +1398,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
13981398
int inn_buf_size = ((params.boost_type == LOGIT) || (params.boost_type == GENTLE) ? n*sizeof(int) : 0) +
13991399
( !tree ? n*sizeof(int) : 0 );
14001400
cv::AutoBuffer<uchar> inn_buf(inn_buf_size);
1401-
uchar* cur_inn_buf_pos = (uchar*)inn_buf;
1401+
uchar* cur_inn_buf_pos = inn_buf.data();
14021402
if ( (params.boost_type == LOGIT) || (params.boost_type == GENTLE) )
14031403
{
14041404
step = CV_IS_MAT_CONT(data->responses_copy->type) ?

apps/traincascade/old_ml_boost.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ CvBoostTree::try_split_node( CvDTreeNode* node )
168168
// store the responses for the corresponding training samples
169169
double* weak_eval = ensemble->get_weak_response()->data.db;
170170
cv::AutoBuffer<int> inn_buf(node->sample_count);
171-
const int* labels = data->get_cv_labels( node, (int*)inn_buf );
171+
const int* labels = data->get_cv_labels(node, inn_buf.data());
172172
int i, count = node->sample_count;
173173
double value = node->value;
174174

@@ -191,7 +191,7 @@ CvBoostTree::calc_node_dir( CvDTreeNode* node )
191191
if( data->get_var_type(vi) >= 0 ) // split on categorical var
192192
{
193193
cv::AutoBuffer<int> inn_buf(n);
194-
const int* cat_labels = data->get_cat_var_data( node, vi, (int*)inn_buf );
194+
const int* cat_labels = data->get_cat_var_data(node, vi, inn_buf.data());
195195
const int* subset = node->split->subset;
196196
double sum = 0, sum_abs = 0;
197197

@@ -210,7 +210,7 @@ CvBoostTree::calc_node_dir( CvDTreeNode* node )
210210
else // split on ordered var
211211
{
212212
cv::AutoBuffer<uchar> inn_buf(2*n*sizeof(int)+n*sizeof(float));
213-
float* values_buf = (float*)(uchar*)inn_buf;
213+
float* values_buf = (float*)inn_buf.data();
214214
int* sorted_indices_buf = (int*)(values_buf + n);
215215
int* sample_indices_buf = sorted_indices_buf + n;
216216
const float* values = 0;
@@ -260,7 +260,7 @@ CvBoostTree::find_split_ord_class( CvDTreeNode* node, int vi, float init_quality
260260
cv::AutoBuffer<uchar> inn_buf;
261261
if( !_ext_buf )
262262
inn_buf.allocate(n*(3*sizeof(int)+sizeof(float)));
263-
uchar* ext_buf = _ext_buf ? _ext_buf : (uchar*)inn_buf;
263+
uchar* ext_buf = _ext_buf ? _ext_buf : inn_buf.data();
264264
float* values_buf = (float*)ext_buf;
265265
int* sorted_indices_buf = (int*)(values_buf + n);
266266
int* sample_indices_buf = sorted_indices_buf + n;
@@ -369,7 +369,7 @@ CvBoostTree::find_split_cat_class( CvDTreeNode* node, int vi, float init_quality
369369
cv::AutoBuffer<uchar> inn_buf((2*mi+3)*sizeof(double) + mi*sizeof(double*));
370370
if( !_ext_buf)
371371
inn_buf.allocate( base_size + 2*n*sizeof(int) );
372-
uchar* base_buf = (uchar*)inn_buf;
372+
uchar* base_buf = inn_buf.data();
373373
uchar* ext_buf = _ext_buf ? _ext_buf : base_buf + base_size;
374374

375375
int* cat_labels_buf = (int*)ext_buf;
@@ -490,7 +490,7 @@ CvBoostTree::find_split_ord_reg( CvDTreeNode* node, int vi, float init_quality,
490490
cv::AutoBuffer<uchar> inn_buf;
491491
if( !_ext_buf )
492492
inn_buf.allocate(2*n*(sizeof(int)+sizeof(float)));
493-
uchar* ext_buf = _ext_buf ? _ext_buf : (uchar*)inn_buf;
493+
uchar* ext_buf = _ext_buf ? _ext_buf : inn_buf.data();
494494

495495
float* values_buf = (float*)ext_buf;
496496
int* indices_buf = (int*)(values_buf + n);
@@ -559,7 +559,7 @@ CvBoostTree::find_split_cat_reg( CvDTreeNode* node, int vi, float init_quality,
559559
cv::AutoBuffer<uchar> inn_buf(base_size);
560560
if( !_ext_buf )
561561
inn_buf.allocate(base_size + n*(2*sizeof(int) + sizeof(float)));
562-
uchar* base_buf = (uchar*)inn_buf;
562+
uchar* base_buf = inn_buf.data();
563563
uchar* ext_buf = _ext_buf ? _ext_buf : base_buf + base_size;
564564

565565
int* cat_labels_buf = (int*)ext_buf;
@@ -652,7 +652,7 @@ CvBoostTree::find_surrogate_split_ord( CvDTreeNode* node, int vi, uchar* _ext_bu
652652
cv::AutoBuffer<uchar> inn_buf;
653653
if( !_ext_buf )
654654
inn_buf.allocate(n*(2*sizeof(int)+sizeof(float)));
655-
uchar* ext_buf = _ext_buf ? _ext_buf : (uchar*)inn_buf;
655+
uchar* ext_buf = _ext_buf ? _ext_buf : inn_buf.data();
656656
float* values_buf = (float*)ext_buf;
657657
int* indices_buf = (int*)(values_buf + n);
658658
int* sample_indices_buf = indices_buf + n;
@@ -733,7 +733,7 @@ CvBoostTree::find_surrogate_split_cat( CvDTreeNode* node, int vi, uchar* _ext_bu
733733
cv::AutoBuffer<uchar> inn_buf(base_size);
734734
if( !_ext_buf )
735735
inn_buf.allocate(base_size + n*sizeof(int));
736-
uchar* ext_buf = _ext_buf ? _ext_buf : (uchar*)inn_buf;
736+
uchar* ext_buf = _ext_buf ? _ext_buf : inn_buf.data();
737737
int* cat_labels_buf = (int*)ext_buf;
738738
const int* cat_labels = data->get_cat_var_data(node, vi, cat_labels_buf);
739739

@@ -797,7 +797,7 @@ CvBoostTree::calc_node_value( CvDTreeNode* node )
797797
int i, n = node->sample_count;
798798
const double* weights = ensemble->get_weights()->data.db;
799799
cv::AutoBuffer<uchar> inn_buf(n*(sizeof(int) + ( data->is_classifier ? sizeof(int) : sizeof(int) + sizeof(float))));
800-
int* labels_buf = (int*)(uchar*)inn_buf;
800+
int* labels_buf = (int*)inn_buf.data();
801801
const int* labels = data->get_cv_labels(node, labels_buf);
802802
double* subtree_weights = ensemble->get_subtree_weights()->data.db;
803803
double rcw[2] = {0,0};
@@ -1147,7 +1147,7 @@ CvBoost::update_weights( CvBoostTree* tree )
11471147
_buf_size += data->get_length_subbuf()*(sizeof(float)+sizeof(uchar));
11481148
}
11491149
inn_buf.allocate(_buf_size);
1150-
uchar* cur_buf_pos = (uchar*)inn_buf;
1150+
uchar* cur_buf_pos = inn_buf.data();
11511151

11521152
if ( (params.boost_type == LOGIT) || (params.boost_type == GENTLE) )
11531153
{

0 commit comments

Comments
 (0)