diff --git a/3rdparty/libtiff/tif_getimage.c b/3rdparty/libtiff/tif_getimage.c index 11d59e06e6..c148b9ed4c 100644 --- a/3rdparty/libtiff/tif_getimage.c +++ b/3rdparty/libtiff/tif_getimage.c @@ -604,7 +604,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) nrow = (row + rowstoread > h ? h - row : rowstoread); for (col = 0; col < w; col += tw) { - if (TIFFReadTile(tif, buf, col+img->col_offset, + if ((int)TIFFReadTile(tif, buf, col+img->col_offset, row+img->row_offset, 0, 0) < 0 && img->stoponerr) { ret = 0; @@ -708,19 +708,19 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) nrow = (row + rowstoread > h ? h - row : rowstoread); for (col = 0; col < w; col += tw) { - if (TIFFReadTile(tif, p0, col+img->col_offset, + if ((int)TIFFReadTile(tif, p0, col+img->col_offset, row+img->row_offset,0,0) < 0 && img->stoponerr) { ret = 0; break; } - if (TIFFReadTile(tif, p1, col+img->col_offset, + if ((int)TIFFReadTile(tif, p1, col+img->col_offset, row+img->row_offset,0,1) < 0 && img->stoponerr) { ret = 0; break; } - if (TIFFReadTile(tif, p2, col+img->col_offset, + if ((int)TIFFReadTile(tif, p2, col+img->col_offset, row+img->row_offset,0,2) < 0 && img->stoponerr) { ret = 0; @@ -728,7 +728,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } if (alpha) { - if (TIFFReadTile(tif,pa,col+img->col_offset, + if ((int)TIFFReadTile(tif,pa,col+img->col_offset, row+img->row_offset,0,3) < 0 && img->stoponerr) { ret = 0; @@ -826,7 +826,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) nrowsub = nrow; if ((nrowsub%subsamplingver)!=0) nrowsub+=subsamplingver-nrowsub%subsamplingver; - if (TIFFReadEncodedStrip(tif, + if ((int)TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif,row+img->row_offset, 0), buf, ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline) < 0 @@ -913,21 +913,21 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); offset_row = row + img->row_offset; - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), + if ((int)TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { ret = 0; break; } - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), + if ((int)TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), p1, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { ret = 0; break; } - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), + if ((int)TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), p2, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { @@ -936,7 +936,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } if (alpha) { - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3), + if ((int)TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3), pa, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { diff --git a/modules/contrib/src/chamfermatching.cpp b/modules/contrib/src/chamfermatching.cpp index 12ae018ee7..c9e38d464c 100644 --- a/modules/contrib/src/chamfermatching.cpp +++ b/modules/contrib/src/chamfermatching.cpp @@ -72,6 +72,7 @@ private: class ImageIterator { public: + virtual ~ImageIterator() {} virtual bool hasNext() const = 0; virtual location_scale_t next() = 0; }; diff --git a/modules/contrib/src/retinafilter.hpp b/modules/contrib/src/retinafilter.hpp index 1f22c6e73e..5b3d2290d5 100644 --- a/modules/contrib/src/retinafilter.hpp +++ b/modules/contrib/src/retinafilter.hpp @@ -304,7 +304,11 @@ public: /** * @return the input image sampled by the photoreceptors spatial sampling */ - inline const std::valarray &getPhotoreceptorsSampledFrame() const {if (_photoreceptorsLogSampling)return _photoreceptorsLogSampling->getSampledFrame();}; + inline const std::valarray &getPhotoreceptorsSampledFrame() const + { + CV_Assert(_photoreceptorsLogSampling); + return _photoreceptorsLogSampling->getSampledFrame(); + }; /** * @return photoreceptors output, locally adapted luminance only, no high frequency spatio-temporal noise reduction at the next retina processing stages, use getPhotoreceptors method to get complete photoreceptors output diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 13ed04ac28..5912239383 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -1089,7 +1089,6 @@ template inline void process( const Mat_& m1, Mat_& m2, Op op ) { int y, x, rows = m1.rows, cols = m1.cols; - int c1 = m1.channels(), c2 = m2.channels(); CV_DbgAssert( m1.size() == m2.size() ); diff --git a/modules/core/include/opencv2/core/opengl_interop.hpp b/modules/core/include/opencv2/core/opengl_interop.hpp index 33b882fb2f..7b0f08824c 100644 --- a/modules/core/include/opencv2/core/opengl_interop.hpp +++ b/modules/core/include/opencv2/core/opengl_interop.hpp @@ -103,13 +103,13 @@ namespace cv inline Usage usage() const { return usage_; } + class Impl; private: int rows_; int cols_; int type_; Usage usage_; - class Impl; Ptr impl_; }; @@ -150,12 +150,12 @@ namespace cv inline int elemSize() const { return CV_ELEM_SIZE(type_); } inline int elemSize1() const { return CV_ELEM_SIZE1(type_); } + class Impl; private: int rows_; int cols_; int type_; - class Impl; Ptr impl_; }; diff --git a/modules/highgui/src/window_cocoa.mm b/modules/highgui/src/window_cocoa.mm index e54e1ba9f4..d72c721e59 100644 --- a/modules/highgui/src/window_cocoa.mm +++ b/modules/highgui/src/window_cocoa.mm @@ -544,7 +544,7 @@ CV_IMPL int cvWaitKey (int maxWait) - (void)cvSendMouseEvent:(NSEvent *)event type:(int)type flags:(int)flags { //cout << "cvSendMouseEvent" << endl; NSPoint mp = [NSEvent mouseLocation]; - NSRect visible = [[self contentView] frame]; + //NSRect visible = [[self contentView] frame]; mp = [self convertScreenToBase: mp]; double viewHeight = [self contentView].frame.size.height; double viewWidth = [self contentView].frame.size.width; diff --git a/modules/imgproc/src/_list.h b/modules/imgproc/src/_list.h index b2b63e9cb6..a19f7e2af9 100644 --- a/modules/imgproc/src/_list.h +++ b/modules/imgproc/src/_list.h @@ -345,7 +345,7 @@ void prefix##remove_at_##type(_CVLIST* l, CVPOS pos)\ void prefix##set_##type(CVPOS pos, type* data)\ {\ ELEMENT_##type* element = ((ELEMENT_##type*)(pos.m_pos));\ - memcpy(&(element->m_data), data, sizeof(data));\ + memcpy(&(element->m_data), data, sizeof(*data));\ }\ type* prefix##get_##type(CVPOS pos)\ {\ diff --git a/modules/legacy/src/blobtrackanalysishist.cpp b/modules/legacy/src/blobtrackanalysishist.cpp index 5f214c4a5b..c4b36613fe 100644 --- a/modules/legacy/src/blobtrackanalysishist.cpp +++ b/modules/legacy/src/blobtrackanalysishist.cpp @@ -1045,7 +1045,7 @@ public: return NULL; } - virtual void SetFileName(const char* DataBaseName) + virtual void SetFileName(char* DataBaseName) { if(m_HistMat.m_Volume!=m_HistVolumeSaved)SaveHist(); m_DataFileName[0] = 0; diff --git a/modules/legacy/src/epilines.cpp b/modules/legacy/src/epilines.cpp index 9a49fc451c..ad0b0855c8 100644 --- a/modules/legacy/src/epilines.cpp +++ b/modules/legacy/src/epilines.cpp @@ -2179,9 +2179,8 @@ icvCvt_64d_32f( double *src, float *dst, int size ) void FindLineForEpiline( CvSize imageSize, float a,float b,float c, CvPoint2D32f *start,CvPoint2D32f *end, - int* result) + int*) { - result = result; CvPoint2D32f frameBeg; CvPoint2D32f frameEnd; diff --git a/modules/legacy/src/lmeds.cpp b/modules/legacy/src/lmeds.cpp index 18ac33e660..95a0432104 100644 --- a/modules/legacy/src/lmeds.cpp +++ b/modules/legacy/src/lmeds.cpp @@ -1590,86 +1590,6 @@ icvGaussMxN( double *A, double *B, int M, int N, double **solutions ) } /* icvGaussMxN */ -/*=====================================================================================*/ -/* -static CvStatus -icvGetCoof( double *f1, double *f2, double *a2, double *a1, double *a0 ) -{ - double G[9], a3; - int i; - - if( !f1 || !f2 || !a0 || !a1 || !a2 ) - return CV_BADFACTOR_ERR; - - for( i = 0; i < 9; i++ ) - { - - G[i] = f1[i] - f2[i]; - } - - a3 = icvDet( G ); - - if( REAL_ZERO( a3 )) - return CV_BADFACTOR_ERR; - - *a2 = 0; - *a1 = 0; - *a0 = icvDet( f2 ); - - for( i = 0; i < 9; i++ ) - { - - *a2 += f2[i] * icvMinor( G, (int) (i % 3), (int) (i / 3) ); - *a1 += G[i] * icvMinor( f2, (int) (i % 3), (int) (i / 3) ); - } - - *a0 /= a3; - *a1 /= a3; - *a2 /= a3; - - return CV_NO_ERR; - -}*/ /* icvGetCoof */ - - - -/*======================================================================================*/ - -/*F/////////////////////////////////////////////////////////////////////////////////////// -// Name: icvLMedS7 -// Purpose: -// -// -// Context: -// Parameters: -// -// -// -// -// -// -// -// Returns: -// CV_NO_ERR if all Ok or error code -// Notes: -//F*/ - -CvStatus -icvLMedS7( int *points1, int *points2, CvMatrix3 * matrix ) -{ /* Incorrect realization */ - CvStatus error = CV_NO_ERR; - -/* int amount; */ - matrix = matrix; - points1 = points1; - points2 = points2; - -/* error = cs_Point7( points1, points2, matrix ); */ -/* error = icvPoint7 ( points1, points2, matrix,&amount ); */ - return error; - -} /* icvLMedS7 */ - /*======================================================================================*/ /*F/////////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/legacy/src/scanlines.cpp b/modules/legacy/src/scanlines.cpp index fe1e17d67f..09eb4d550f 100644 --- a/modules/legacy/src/scanlines.cpp +++ b/modules/legacy/src/scanlines.cpp @@ -154,23 +154,16 @@ icvMakeScanlines( CvMatrix3 * matrix, int *scanlines_1, int *scanlines_2, int *lens_1, int *lens_2, int *numlines ) { - CvStatus error; - - error = icvGetCoefficient( matrix, imgSize, scanlines_2, scanlines_1, numlines ); + CvStatus error = icvGetCoefficient( matrix, imgSize, scanlines_2, scanlines_1, numlines ); /* Make Length of scanlines */ - if( scanlines_1 == 0 && scanlines_2 == 0 ) return error; icvMakeScanlinesLengths( scanlines_1, *numlines, lens_1 ); - icvMakeScanlinesLengths( scanlines_2, *numlines, lens_2 ); - matrix = matrix; return CV_NO_ERR; - - } /* icvMakeScanlines */ @@ -332,7 +325,7 @@ icvGetCoefficient( CvMatrix3 * matrix, /*===========================================================================*/ CvStatus -icvGetCoefficientDefault( CvMatrix3 * matrix, +icvGetCoefficientDefault( CvMatrix3 *, CvSize imgSize, int *scanlines_1, int *scanlines_2, int *numlines ) { int curr; @@ -359,7 +352,6 @@ icvGetCoefficientDefault( CvMatrix3 * matrix, curr += 4; } - matrix = matrix; return CV_NO_ERR; } /* icvlGetCoefficientDefault */ diff --git a/modules/legacy/src/texture.cpp b/modules/legacy/src/texture.cpp index 131b11ccae..0aceea672f 100644 --- a/modules/legacy/src/texture.cpp +++ b/modules/legacy/src/texture.cpp @@ -135,7 +135,7 @@ cvCreateGLCM( const IplImage* srcImage, } CV_CALL( newGLCM = (CvGLCM*)cvAlloc(sizeof(newGLCM))); - memset( newGLCM, 0, sizeof(newGLCM) ); + memset( newGLCM, 0, sizeof(*newGLCM) ); newGLCM->matrices = 0; newGLCM->numMatrices = numStepDirections; @@ -515,8 +515,8 @@ icvCreateGLCMDescriptors_AllowDoubleNest( CvGLCM* destGLCM, int matrixIndex ) correlationStdDeviation += (actualSideLoop1-correlationMean) * (actualSideLoop1-correlationMean) * sideEntryValueSum; } - HXY1 =- HXY1; - HXY2 =- HXY2; + HXY1 = -HXY1; + HXY2 = -HXY2; descriptors[ CV_GLCMDESC_CORRELATIONINFO1 ] = ( HXY - HXY1 ) / ( correlationMean ); descriptors[ CV_GLCMDESC_CORRELATIONINFO2 ] = sqrt( 1.0 - exp( -2.0 * (HXY2 - HXY ) ) ); diff --git a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp index 3300c2016c..355bb46fa2 100644 --- a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp @@ -470,11 +470,12 @@ protected: Ptr oldCascade; public: - class MaskGenerator + class CV_EXPORTS MaskGenerator { - public: - virtual cv::Mat generateMask(const cv::Mat& src)=0; - virtual void initializeMask(const cv::Mat& /*src*/) {}; + public: + virtual ~MaskGenerator() {} + virtual cv::Mat generateMask(const cv::Mat& src)=0; + virtual void initializeMask(const cv::Mat& /*src*/) {}; }; void setMaskGenerator(Ptr maskGenerator); Ptr getMaskGenerator(); diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index dd9b8f7bf8..7cb9708a1d 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -170,7 +170,7 @@ class MeanshiftGrouping { public: MeanshiftGrouping(const Point3d& densKer, const vector& posV, - const vector& wV, double modeEps = 1e-4, int maxIter = 20) + const vector& wV, double, int maxIter = 20) { densityKernel = densKer; weightsV = wV; @@ -178,15 +178,12 @@ public: positionsCount = (int)posV.size(); meanshiftV.resize(positionsCount); distanceV.resize(positionsCount); - modeEps = modeEps; iterMax = maxIter; for (unsigned i = 0; i