Skip to content

Commit 597b3f4

Browse files
committed
Merge pull request opencv#9580 from mshabunin:fix-static-6
2 parents 26ad229 + 248e2c7 commit 597b3f4

File tree

41 files changed

+252
-218
lines changed

Some content is hidden

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

41 files changed

+252
-218
lines changed

3rdparty/carotene/hal/tegra_hal.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
size_t src2_step;
6868

6969
#define DST_ARG1 DT * dst1_data_, size_t dst1_step_,
70-
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
70+
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
7171
#define DST_VAR1 DT * dst1_data; \
7272
size_t dst1_step;
7373

@@ -1073,7 +1073,7 @@ struct FilterCtx
10731073
inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
10741074
int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace)
10751075
{
1076-
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
1076+
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
10771077
src_type != CV_8UC1 || dst_type != CV_8UC1 ||
10781078
delta != 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2 )
10791079
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1105,7 +1105,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
11051105
return CV_HAL_ERROR_NOT_IMPLEMENTED;
11061106
}
11071107

1108-
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
1108+
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
11091109
{
11101110
delete ctx;
11111111
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1212,7 +1212,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
12121212
return CV_HAL_ERROR_NOT_IMPLEMENTED;
12131213
}
12141214

1215-
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
1215+
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
12161216
{
12171217
delete ctx;
12181218
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1341,8 +1341,8 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
13411341
ctx->anchor_y = anchor_y;
13421342
switch(operation)
13431343
{
1344-
case MORPH_ERODE:
1345-
case MORPH_DILATE:
1344+
case CV_HAL_MORPH_ERODE:
1345+
case CV_HAL_MORPH_DILATE:
13461346
ctx->operation = operation;
13471347
break;
13481348
default:
@@ -1355,7 +1355,7 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
13551355
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
13561356
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
13571357
{
1358-
if( operation == MORPH_ERODE )
1358+
if( operation == CV_HAL_MORPH_ERODE )
13591359
for(int i = 0; i < ctx->channels; ++i)
13601360
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
13611361
else
@@ -1404,14 +1404,14 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
14041404
( \
14051405
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
14061406
context && CAROTENE_NS::isSupportedConfiguration() ? \
1407-
((MorphCtx*)context)->operation == MORPH_ERODE ? \
1407+
((MorphCtx*)context)->operation == CV_HAL_MORPH_ERODE ? \
14081408
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
14091409
src_data, src_step, dst_data, dst_step, \
14101410
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
14111411
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
14121412
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
14131413
CV_HAL_ERROR_OK : \
1414-
((MorphCtx*)context)->operation == MORPH_DILATE ? \
1414+
((MorphCtx*)context)->operation == CV_HAL_MORPH_DILATE ? \
14151415
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
14161416
src_data, src_step, dst_data, dst_step, \
14171417
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \

3rdparty/openvx/hal/openvx_hal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ int ovx_hal_morphInit(cvhalFilter2D **filter_context, int operation, int src_typ
702702
case CV_HAL_BORDER_CONSTANT:
703703
if (borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX)
704704
{
705-
if (operation == MORPH_ERODE)
705+
if (operation == CV_HAL_MORPH_ERODE)
706706
setConstantBorder(border, UCHAR_MAX);
707707
else
708708
setConstantBorder(border, 0);
@@ -779,10 +779,10 @@ int ovx_hal_morphInit(cvhalFilter2D **filter_context, int operation, int src_typ
779779
MorphCtx* mat;
780780
switch (operation)
781781
{
782-
case MORPH_ERODE:
782+
case CV_HAL_MORPH_ERODE:
783783
mat = new MorphCtx(ctx, kernel_mat, kernel_width, kernel_height, VX_NONLINEAR_FILTER_MIN, border);
784784
break;
785-
case MORPH_DILATE:
785+
case CV_HAL_MORPH_DILATE:
786786
mat = new MorphCtx(ctx, kernel_mat, kernel_width, kernel_height, VX_NONLINEAR_FILTER_MAX, border);
787787
break;
788788
default:

modules/calib3d/src/circlesgrid.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,10 @@ void Graph::removeEdge(size_t id1, size_t id2)
467467

468468
bool Graph::areVerticesAdjacent(size_t id1, size_t id2) const
469469
{
470-
CV_Assert( doesVertexExist( id1 ) );
471-
CV_Assert( doesVertexExist( id2 ) );
472-
473470
Vertices::const_iterator it = vertices.find(id1);
474-
return it->second.neighbors.find(id2) != it->second.neighbors.end();
471+
CV_Assert(it != vertices.end());
472+
const Neighbors & neighbors = it->second.neighbors;
473+
return neighbors.find(id2) != neighbors.end();
475474
}
476475

477476
size_t Graph::getVerticesCount() const
@@ -481,9 +480,8 @@ size_t Graph::getVerticesCount() const
481480

482481
size_t Graph::getDegree(size_t id) const
483482
{
484-
CV_Assert( doesVertexExist(id) );
485-
486483
Vertices::const_iterator it = vertices.find(id);
484+
CV_Assert( it != vertices.end() );
487485
return it->second.neighbors.size();
488486
}
489487

@@ -528,9 +526,8 @@ void Graph::floydWarshall(cv::Mat &distanceMatrix, int infinity) const
528526

529527
const Graph::Neighbors& Graph::getNeighbors(size_t id) const
530528
{
531-
CV_Assert( doesVertexExist(id) );
532-
533529
Vertices::const_iterator it = vertices.find(id);
530+
CV_Assert( it != vertices.end() );
534531
return it->second.neighbors;
535532
}
536533

modules/calib3d/src/epnp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class epnp {
1717

1818
void compute_pose(cv::Mat& R, cv::Mat& t);
1919
private:
20+
epnp(const epnp &); // copy disabled
21+
epnp& operator=(const epnp &); // assign disabled
2022
template <typename T>
2123
void init_camera_parameters(const cv::Mat& cameraMatrix)
2224
{

modules/calib3d/src/posit.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ static CvStatus icvPOSIT( CvPOSITObject *pObject, CvPoint2D32f *imagePoints,
115115
float* rotation, float* translation )
116116
{
117117
int i, j, k;
118-
int count = 0, converged = 0;
118+
int count = 0;
119+
bool converged = false;
119120
float scale = 0, inv_Z = 0;
120121
float diff = (float)criteria.epsilon;
121122

@@ -233,8 +234,8 @@ static CvStatus icvPOSIT( CvPOSITObject *pObject, CvPoint2D32f *imagePoints,
233234
inv_Z = scale * inv_focalLength;
234235

235236
count++;
236-
converged = ((criteria.type & CV_TERMCRIT_EPS) && (diff < criteria.epsilon));
237-
converged |= ((criteria.type & CV_TERMCRIT_ITER) && (count == criteria.max_iter));
237+
converged = ((criteria.type & CV_TERMCRIT_EPS) && (diff < criteria.epsilon))
238+
|| ((criteria.type & CV_TERMCRIT_ITER) && (count == criteria.max_iter));
238239
}
239240
const float invScale = 1 / scale;
240241
translation[0] = imagePoints[0].x * invScale;

modules/calib3d/src/upnp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class upnp
6060

6161
double compute_pose(cv::Mat& R, cv::Mat& t);
6262
private:
63+
upnp(const upnp &); // copy disabled
64+
upnp& operator=(const upnp &); // assign disabled
6365
template <typename T>
6466
void init_camera_parameters(const cv::Mat& cameraMatrix)
6567
{

modules/core/src/array.cpp

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ cvGetMatND( const CvArr* arr, CvMatND* matnd, int* coi )
374374
// returns number of dimensions to iterate.
375375
/*
376376
Checks whether <count> arrays have equal type, sizes (mask is optional array
377-
that needs to have the same size, but 8uC1 or 8sC1 type).
377+
that needs to have the same size, but 8uC1 or 8sC1 type - feature has been disabled).
378378
Returns number of dimensions to iterate through:
379379
0 means that all arrays are continuous,
380380
1 means that all arrays are vectors of continuous arrays etc.
@@ -399,17 +399,16 @@ cvInitNArrayIterator( int count, CvArr** arrs,
399399
if( !iterator )
400400
CV_Error( CV_StsNullPtr, "Iterator pointer is NULL" );
401401

402-
for( i = 0; i <= count; i++ )
402+
if (mask)
403+
CV_Error( CV_StsBadArg, "Iterator with mask is not supported" );
404+
405+
for( i = 0; i < count; i++ )
403406
{
404-
const CvArr* arr = i < count ? arrs[i] : mask;
407+
const CvArr* arr = arrs[i];
405408
CvMatND* hdr;
406409

407410
if( !arr )
408-
{
409-
if( i < count )
410-
CV_Error( CV_StsNullPtr, "Some of required array pointers is NULL" );
411-
break;
412-
}
411+
CV_Error( CV_StsNullPtr, "Some of required array pointers is NULL" );
413412

414413
if( CV_IS_MATND( arr ))
415414
hdr = (CvMatND*)arr;
@@ -429,31 +428,23 @@ cvInitNArrayIterator( int count, CvArr** arrs,
429428
CV_Error( CV_StsUnmatchedSizes,
430429
"Number of dimensions is the same for all arrays" );
431430

432-
if( i < count )
431+
switch( flags & (CV_NO_DEPTH_CHECK|CV_NO_CN_CHECK))
433432
{
434-
switch( flags & (CV_NO_DEPTH_CHECK|CV_NO_CN_CHECK))
435-
{
436-
case 0:
437-
if( !CV_ARE_TYPES_EQ( hdr, hdr0 ))
438-
CV_Error( CV_StsUnmatchedFormats,
439-
"Data type is not the same for all arrays" );
440-
break;
441-
case CV_NO_DEPTH_CHECK:
442-
if( !CV_ARE_CNS_EQ( hdr, hdr0 ))
443-
CV_Error( CV_StsUnmatchedFormats,
444-
"Number of channels is not the same for all arrays" );
445-
break;
446-
case CV_NO_CN_CHECK:
447-
if( !CV_ARE_CNS_EQ( hdr, hdr0 ))
448-
CV_Error( CV_StsUnmatchedFormats,
449-
"Depth is not the same for all arrays" );
450-
break;
451-
}
452-
}
453-
else
454-
{
455-
if( !CV_IS_MASK_ARR( hdr ))
456-
CV_Error( CV_StsBadMask, "Mask should have 8uC1 or 8sC1 data type" );
433+
case 0:
434+
if( !CV_ARE_TYPES_EQ( hdr, hdr0 ))
435+
CV_Error( CV_StsUnmatchedFormats,
436+
"Data type is not the same for all arrays" );
437+
break;
438+
case CV_NO_DEPTH_CHECK:
439+
if( !CV_ARE_CNS_EQ( hdr, hdr0 ))
440+
CV_Error( CV_StsUnmatchedFormats,
441+
"Number of channels is not the same for all arrays" );
442+
break;
443+
case CV_NO_CN_CHECK:
444+
if( !CV_ARE_CNS_EQ( hdr, hdr0 ))
445+
CV_Error( CV_StsUnmatchedFormats,
446+
"Depth is not the same for all arrays" );
447+
break;
457448
}
458449

459450
if( !(flags & CV_NO_SIZE_CHECK) )

modules/core/src/matrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ bool _InputArray::isContinuous(int i) const
21652165
if( k == STD_ARRAY_MAT )
21662166
{
21672167
const Mat* vv = (const Mat*)obj;
2168-
CV_Assert(i < sz.height);
2168+
CV_Assert(i > 0 && i < sz.height);
21692169
return vv[i].isContinuous();
21702170
}
21712171

modules/core/src/rand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ void RNG::fill( InputOutputArray _mat, int disttype,
675675

676676
const Mat* arrays[] = {&mat, 0};
677677
uchar* ptr;
678-
NAryMatIterator it(arrays, &ptr);
678+
NAryMatIterator it(arrays, &ptr, 1);
679679
int total = (int)it.size, blockSize = std::min((BLOCK_SIZE + cn - 1)/cn, total);
680680
size_t esz = mat.elemSize();
681681
AutoBuffer<double> buf;

modules/core/src/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ struct IPPInitSingleton
19761976

19771977
// Disable AVX1 since we don't track regressions for it. SSE42 will be used instead
19781978
if(cpuFeatures&ippCPUID_AVX && !(cpuFeatures&ippCPUID_AVX2))
1979-
ippFeatures &= ~ippCPUID_AVX;
1979+
ippFeatures &= ~((Ipp64u)ippCPUID_AVX);
19801980

19811981
// IPP integrations in OpenCV support only SSE4.2, AVX2 and AVX-512 optimizations.
19821982
if(!(

0 commit comments

Comments
 (0)