diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4f1453a2ff..e72c70d8c3 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ diff --git a/3rdparty/carotene/src/resize.cpp b/3rdparty/carotene/src/resize.cpp index 3a80d472df..184deb1205 100644 --- a/3rdparty/carotene/src/resize.cpp +++ b/3rdparty/carotene/src/resize.cpp @@ -432,7 +432,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize, vSum = vaddq_u16(vSum, vaddl_u8(vLane4.val[0], vLane4.val[1])); vSum = vaddq_u16(vSum, vaddl_u8(vLane4.val[2], vLane4.val[3])); - vst1_u8(dst_row + dj, areaDownsamplingDivision(vSum)); + vst1_u8(dst_row + dj, (areaDownsamplingDivision(vSum))); } for ( ; dj < dsize.width; ++dj, sj += 4) @@ -706,7 +706,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize, uint16x8_t v_sum = vcombine_u16(vadd_u16(vget_low_u16(v_sum0), vget_high_u16(v_sum0)), vadd_u16(vget_low_u16(v_sum1), vget_high_u16(v_sum1))); - vst1_u8(dst_row + dj, areaDownsamplingDivision(v_sum)); + vst1_u8(dst_row + dj, (areaDownsamplingDivision(v_sum))); } for (size_t dwidth = dsize.width << 2; dj < dwidth; dj += 4, sj += 16) diff --git a/3rdparty/ffmpeg/ffmpeg.cmake b/3rdparty/ffmpeg/ffmpeg.cmake index 448ad2bb2c..193b5d8905 100644 --- a/3rdparty/ffmpeg/ffmpeg.cmake +++ b/3rdparty/ffmpeg/ffmpeg.cmake @@ -1,11 +1,11 @@ -# Binary branch name: ffmpeg/master_20150703 -# Binaries were created for OpenCV: e379ea6ed60b0caad4d4e3eea096e9d850cb8c86 -set(FFMPEG_BINARIES_COMMIT "8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb") -set(FFMPEG_FILE_HASH_BIN32 "89c783eee1c47bfc733f08334ec2e31c") -set(FFMPEG_FILE_HASH_BIN64 "35fe6ccdda6d7a04e9056b0d73b98e76") -set(FFMPEG_FILE_HASH_CMAKE "8606f947a780071f8fcce8cbf39ceef5") +# Binary branch name: ffmpeg/master_20160715 +# Binaries were created for OpenCV: 0e6aa189cb9a9642b0ae7983d301693516faad5d +set(FFMPEG_BINARIES_COMMIT "7eef9080d3271c7547d303fa839a62e1124ff1e6") +set(FFMPEG_FILE_HASH_BIN32 "3bb2a8388af90adf6c762210e696400d") +set(FFMPEG_FILE_HASH_BIN64 "ebcfc963f0a94f7e83d58d60eaf23849") +set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2") -set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/) +set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/) ocv_download(PACKAGE opencv_ffmpeg.dll HASH ${FFMPEG_FILE_HASH_BIN32} diff --git a/3rdparty/ippicv/downloader.cmake b/3rdparty/ippicv/downloader.cmake index a6016dbe10..e20804d7b4 100644 --- a/3rdparty/ippicv/downloader.cmake +++ b/3rdparty/ippicv/downloader.cmake @@ -64,7 +64,7 @@ function(_icv_downloader) if(DEFINED ENV{OPENCV_ICV_URL}) set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL}) else() - set(OPENCV_ICV_URL "https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${IPPICV_BINARIES_COMMIT}/ippicv") + set(OPENCV_ICV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_BINARIES_COMMIT}/ippicv") endif() endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ea42680b9..317edbb139 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,7 @@ OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_PNG "Include PNG support" ON) +OCV_OPTION(WITH_GDCM "Include DICOM support" OFF) OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) @@ -1008,6 +1009,7 @@ if(WITH_PNG) else() status(" PNG:" "NO") endif() + if(WITH_TIFF) if(TIFF_VERSION_STRING AND TIFF_FOUND) status(" TIFF:" "${TIFF_LIBRARY} (ver ${TIFF_VERSION} - ${TIFF_VERSION_STRING})") @@ -1034,6 +1036,12 @@ else() status(" GDAL:" "NO") endif() +if(WITH_GDCM) + status(" GDCM:" GDCM_FOUND THEN "YES (ver ${GDCM_VERSION})" ELSE "NO") +else() + status(" GDCM:" "NO") +endif() + # ========================== VIDEO IO ========================== status("") status(" Video I/O:") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e13c89969..318e9ac8fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ ## Contributing guidelines -All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/Itseez/opencv/wiki/How_to_contribute). +All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/opencv/opencv/wiki/How_to_contribute). diff --git a/README.md b/README.md index 7dbc823200..37543b6e5d 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ * Homepage: * Docs: * Q&A forum: -* Issue tracking: +* Issue tracking: #### Contributing -Please read before starting work on a pull request: +Please read before starting work on a pull request: Summary of guidelines: diff --git a/apps/annotation/opencv_annotation.cpp b/apps/annotation/opencv_annotation.cpp index d8ff61d209..1bd22a298c 100644 --- a/apps/annotation/opencv_annotation.cpp +++ b/apps/annotation/opencv_annotation.cpp @@ -224,28 +224,24 @@ vector get_annotations(Mat input_image) int main( int argc, const char** argv ) { - // If no arguments are given, then supply some information on how this tool works - if( argc == 1 ){ - cout << "Usage: " << argv[0] << endl; - cout << " -images [example - /data/testimages/]" << endl; - cout << " -annotations [example - /data/annotations.txt]" << endl; - cout << "TIP: Use absolute paths to avoid any problems with the software!" << endl; - return -1; - } - + // Use the cmdlineparser to process input arguments + CommandLineParser parser(argc, argv, + "{ help h usage ? | | show this message }" + "{ images i | | (required) path to image folder [example - /data/testimages/] }" + "{ annotations a | | (required) path to annotations txt file [example - /data/annotations.txt] }" + ); // Read in the input arguments - string image_folder; - string annotations_file; - for(int i = 1; i < argc; ++i ) - { - if( !strcmp( argv[i], "-images" ) ) - { - image_folder = argv[++i]; - } - else if( !strcmp( argv[i], "-annotations" ) ) - { - annotations_file = argv[++i]; - } + if (parser.has("help")){ + parser.printMessage(); + cerr << "TIP: Use absolute paths to avoid any problems with the software!" << endl; + return 0; + } + string image_folder(parser.get("images")); + string annotations_file(parser.get("annotations")); + if (image_folder.empty() || annotations_file.empty()){ + parser.printMessage(); + cerr << "TIP: Use absolute paths to avoid any problems with the software!" << endl; + return -1; } // Check if the folder actually exists diff --git a/apps/createsamples/createsamples.cpp b/apps/createsamples/createsamples.cpp index 9f05e416bd..1660adee44 100644 --- a/apps/createsamples/createsamples.cpp +++ b/apps/createsamples/createsamples.cpp @@ -76,6 +76,7 @@ int main( int argc, char* argv[] ) double scale = 4.0; int width = 24; int height = 24; + double maxscale = -1.0; srand((unsigned int)time(0)); @@ -92,9 +93,10 @@ int main( int argc, char* argv[] ) " [-maxyangle ]\n" " [-maxzangle ]\n" " [-show []]\n" - " [-w ]\n [-h ]\n", + " [-w ]\n [-h ]\n" + " [-maxscale ]\n", argv[0], num, bgcolor, bgthreshold, maxintensitydev, - maxxangle, maxyangle, maxzangle, scale, width, height ); + maxxangle, maxyangle, maxzangle, scale, width, height, maxscale ); return 0; } @@ -172,6 +174,10 @@ int main( int argc, char* argv[] ) { height = atoi( argv[++i] ); } + else if( !strcmp( argv[i], "-maxscale" ) ) + { + maxscale = atof( argv[++i] ); + } } printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) ); @@ -194,6 +200,7 @@ int main( int argc, char* argv[] ) } printf( "Width: %d\n", width ); printf( "Height: %d\n", height ); + printf( "Max Scale: %g\n", maxscale); /* determine action */ if( imagename && vecname ) @@ -213,7 +220,7 @@ int main( int argc, char* argv[] ) cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num, invert, maxintensitydev, - maxxangle, maxyangle, maxzangle, showsamples, width, height ); + maxxangle, maxyangle, maxzangle, showsamples, width, height, maxscale); printf( "Done\n" ); } diff --git a/apps/createsamples/utility.cpp b/apps/createsamples/utility.cpp index b5834f3e02..cf2bdebbf9 100644 --- a/apps/createsamples/utility.cpp +++ b/apps/createsamples/utility.cpp @@ -38,7 +38,6 @@ // the use of this software, even if advised of the possibility of such damage. // //M*/ - #include #include @@ -1308,7 +1307,7 @@ void cvCreateTestSamples( const char* infoname, int invert, int maxintensitydev, double maxxangle, double maxyangle, double maxzangle, int showsamples, - int winwidth, int winheight ) + int winwidth, int winheight, double maxscale ) { CvSampleDistortionData data; @@ -1337,7 +1336,6 @@ void cvCreateTestSamples( const char* infoname, int i; int x, y, width, height; float scale; - float maxscale; int inverse; if( showsamples ) @@ -1366,12 +1364,16 @@ void cvCreateTestSamples( const char* infoname, for( i = 0; i < count; i++ ) { icvGetNextFromBackgroundData( cvbgdata, cvbgreader ); - - maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth, + if( maxscale < 0.0 ) + { + maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth, 0.7F * cvbgreader->src.rows / winheight ); + } + if( maxscale < 1.0F ) continue; - scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F; + scale = ((float)maxscale - 1.0F) * rand() / RAND_MAX + 1.0F; + width = (int) (scale * winwidth); height = (int) (scale * winheight); x = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.cols - width)); diff --git a/apps/createsamples/utility.hpp b/apps/createsamples/utility.hpp index 9367778daf..d04947c9be 100644 --- a/apps/createsamples/utility.hpp +++ b/apps/createsamples/utility.hpp @@ -86,7 +86,7 @@ void cvCreateTestSamples( const char* infoname, int invert, int maxintensitydev, double maxxangle, double maxyangle, double maxzangle, int showsamples, - int winwidth, int winheight ); + int winwidth, int winheight, double maxscale ); /* * cvCreateTrainingSamplesFromInfo diff --git a/apps/traincascade/cascadeclassifier.cpp b/apps/traincascade/cascadeclassifier.cpp index b26daf1211..9c24feb49a 100644 --- a/apps/traincascade/cascadeclassifier.cpp +++ b/apps/traincascade/cascadeclassifier.cpp @@ -310,7 +310,8 @@ bool CvCascadeClassifier::updateTrainingSet( double minimumAcceptanceRatio, doub int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed ); if ( !negCount ) - return false; + if ( !(negConsumed > 0 && ((double)negCount+1)/(double)negConsumed <= minimumAcceptanceRatio) ) + return false; curNumSamples = posCount + negCount; acceptanceRatio = negConsumed == 0 ? 0 : ( (double)negCount/(double)(int64)negConsumed ); diff --git a/apps/visualisation/opencv_visualisation.cpp b/apps/visualisation/opencv_visualisation.cpp index 75703bd528..68ebd65902 100644 --- a/apps/visualisation/opencv_visualisation.cpp +++ b/apps/visualisation/opencv_visualisation.cpp @@ -49,13 +49,6 @@ understanding of the used features. USAGE: ./opencv_visualisation --model= --image= --data=