From 4286f6038716fd4cee6b4cacd3ef6ac42d84a906 Mon Sep 17 00:00:00 2001 From: vbystricky Date: Fri, 4 Jul 2014 18:48:15 +0400 Subject: [PATCH] Extract imgcodecs module from highgui --- 3rdparty/readme.txt | 10 +- apps/traincascade/CMakeLists.txt | 2 +- apps/traincascade/imagestorage.cpp | 3 +- apps/traincascade/imagestorage.h | 3 - cmake/OpenCVModule.cmake | 10 +- doc/CMakeLists.txt | 2 +- doc/check_docs.py | 2 + doc/conf.py | 12 +- doc/opencv_cheatsheet.tex | 6 +- .../py_video_display/py_video_display.rst | 2 +- .../discrete_fourier_transform.rst | 2 +- .../how_to_scan_images/how_to_scan_images.rst | 12 +- .../interoperability_with_OpenCV_1.rst | 10 +- .../mat_the_basic_image_container.rst | 2 +- .../table_of_content_core.rst | 3 - .../display_image/display_image.rst | 16 +- .../how_to_write_a_tutorial.rst | 8 +- .../load_save_image/load_save_image.rst | 12 +- .../ml/non_linear_svms/non_linear_svms.rst | 2 +- include/opencv2/opencv.hpp | 1 + modules/calib3d/perf/perf_precomp.hpp | 2 +- modules/calib3d/test/test_precomp.hpp | 2 +- modules/features2d/perf/perf_precomp.hpp | 2 +- .../test/test_descriptors_regression.cpp | 1 - modules/features2d/test/test_precomp.hpp | 2 +- modules/highgui/CMakeLists.txt | 56 +----- modules/highgui/doc/highgui.rst | 3 +- ...ideo.rst => reading_and_writing_video.rst} | 187 +----------------- modules/highgui/include/opencv2/highgui.hpp | 47 ----- .../include/opencv2/highgui/highgui_c.h | 61 ------ modules/highgui/perf/perf_precomp.hpp | 1 + modules/highgui/src/precomp.hpp | 1 + modules/highgui/test/test_precomp.hpp | 1 + modules/imgcodecs/CMakeLists.txt | 131 ++++++++++++ modules/imgcodecs/doc/imgcodecs.rst | 10 + .../doc/reading_and_writing_images.rst | 187 ++++++++++++++++++ .../imgcodecs/include/opencv2/imgcodecs.hpp | 91 +++++++++ .../include/opencv2/imgcodecs/imgcodecs.hpp | 48 +++++ .../include/opencv2/imgcodecs/imgcodecs_c.h | 117 +++++++++++ .../imgcodecs/include/opencv2/imgcodecs/ios.h | 48 +++++ modules/imgcodecs/perf/perf_main.cpp | 3 + modules/imgcodecs/perf/perf_precomp.hpp | 19 ++ .../{highgui => imgcodecs}/src/bitstrm.cpp | 0 .../{highgui => imgcodecs}/src/bitstrm.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_base.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_base.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_bmp.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_bmp.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_exr.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_exr.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_hdr.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_hdr.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_jpeg.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_jpeg.hpp | 0 .../src/grfmt_jpeg2000.cpp | 0 .../src/grfmt_jpeg2000.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_png.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_png.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_pxm.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_pxm.hpp | 0 .../src/grfmt_sunras.cpp | 0 .../src/grfmt_sunras.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_tiff.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_tiff.hpp | 0 .../{highgui => imgcodecs}/src/grfmt_webp.cpp | 0 .../{highgui => imgcodecs}/src/grfmt_webp.hpp | 0 modules/{highgui => imgcodecs}/src/grfmts.hpp | 0 .../src/ios_conversions.mm | 0 .../{highgui => imgcodecs}/src/loadsave.cpp | 0 modules/imgcodecs/src/precomp.hpp | 87 ++++++++ modules/{highgui => imgcodecs}/src/rgbe.cpp | 0 modules/{highgui => imgcodecs}/src/rgbe.hpp | 0 modules/{highgui => imgcodecs}/src/utils.cpp | 0 modules/{highgui => imgcodecs}/src/utils.hpp | 0 .../test/test_drawing.cpp | 1 - .../test/test_grfmt.cpp | 1 - modules/imgcodecs/test/test_main.cpp | 3 + modules/imgcodecs/test/test_precomp.hpp | 20 ++ modules/imgproc/perf/perf_precomp.hpp | 2 +- modules/imgproc/test/test_precomp.hpp | 2 +- modules/java/CMakeLists.txt | 2 +- modules/java/generator/rst_parser.py | 2 +- .../generator/src/java/android+Utils.java | 4 +- modules/nonfree/perf/perf_precomp.hpp | 2 +- modules/objdetect/test/test_precomp.hpp | 2 +- modules/optim/test/test_denoise_tvl1.cpp | 1 - modules/optim/test/test_precomp.hpp | 1 + modules/photo/perf/perf_precomp.hpp | 2 +- modules/photo/test/test_precomp.hpp | 2 +- modules/python/CMakeLists.txt | 3 +- modules/python/src2/hdr_parser.py | 1 + modules/shape/test/test_precomp.hpp | 2 +- modules/stitching/perf/perf_stich.cpp | 2 +- modules/stitching/test/test_precomp.hpp | 2 +- modules/ts/CMakeLists.txt | 2 +- modules/ts/include/opencv2/ts/cuda_perf.hpp | 2 +- modules/ts/include/opencv2/ts/cuda_test.hpp | 1 + modules/ts/include/opencv2/ts/ocl_test.hpp | 1 + modules/video/perf/perf_precomp.hpp | 2 +- modules/video/test/test_precomp.hpp | 2 +- samples/android/CMakeLists.txt | 4 +- samples/android/hello-android/main.cpp | 1 + samples/cpp/3calibration.cpp | 1 + samples/cpp/CMakeLists.txt | 2 +- samples/cpp/bagofwords_classification.cpp | 1 + samples/cpp/calibration.cpp | 1 + samples/cpp/cloning_demo.cpp | 1 + samples/cpp/cloning_gui.cpp | 1 + samples/cpp/connected_components.cpp | 1 + samples/cpp/create_mask.cpp | 1 + samples/cpp/demhist.cpp | 1 + samples/cpp/descriptor_extractor_matcher.cpp | 1 + samples/cpp/dft.cpp | 1 + samples/cpp/distrans.cpp | 1 + samples/cpp/edge.cpp | 1 + samples/cpp/facedetect.cpp | 1 + samples/cpp/ffilldemo.cpp | 1 + samples/cpp/fitellipse.cpp | 1 + samples/cpp/grabcut.cpp | 1 + samples/cpp/houghcircles.cpp | 1 + samples/cpp/houghlines.cpp | 1 + samples/cpp/image.cpp | 1 + samples/cpp/image_alignment.cpp | 1 + samples/cpp/imagelist_creator.cpp | 1 + samples/cpp/inpaint.cpp | 1 + samples/cpp/lsd_lines.cpp | 1 + samples/cpp/morphology2.cpp | 1 + samples/cpp/npr_demo.cpp | 1 + samples/cpp/pca.cpp | 1 + samples/cpp/select3dobj.cpp | 1 + samples/cpp/shape_example.cpp | 1 + samples/cpp/shape_transformation.cpp | 1 + samples/cpp/simpleflow_demo.cpp | 1 + samples/cpp/squares.cpp | 1 + samples/cpp/starter_imagelist.cpp | 1 + samples/cpp/starter_video.cpp | 1 + samples/cpp/stereo_calib.cpp | 1 + samples/cpp/stereo_match.cpp | 1 + samples/cpp/stitching.cpp | 1 + samples/cpp/stitching_detailed.cpp | 1 + samples/cpp/textdetection.cpp | 1 + .../HighGUI/AddingImagesTrackbar.cpp | 1 + .../HighGUI/BasicLinearTransformsTrackbar.cpp | 1 + .../Histograms_Matching/EqualizeHist_Demo.cpp | 1 + .../MatchTemplate_Demo.cpp | 1 + .../calcBackProject_Demo1.cpp | 1 + .../calcBackProject_Demo2.cpp | 1 + .../Histograms_Matching/calcHist_Demo.cpp | 1 + .../Histograms_Matching/compareHist_Demo.cpp | 1 + .../tutorial_code/ImgProc/AddingImages.cpp | 1 + .../ImgProc/BasicLinearTransforms.cpp | 1 + .../tutorial_code/ImgProc/Morphology_1.cpp | 1 + .../tutorial_code/ImgProc/Morphology_2.cpp | 1 + .../cpp/tutorial_code/ImgProc/Pyramids.cpp | 1 + .../cpp/tutorial_code/ImgProc/Smoothing.cpp | 1 + .../cpp/tutorial_code/ImgProc/Threshold.cpp | 1 + .../ImgTrans/CannyDetector_Demo.cpp | 1 + .../ImgTrans/Geometric_Transforms_Demo.cpp | 1 + .../ImgTrans/HoughCircle_Demo.cpp | 1 + .../ImgTrans/HoughLines_Demo.cpp | 1 + .../tutorial_code/ImgTrans/Laplace_Demo.cpp | 1 + .../cpp/tutorial_code/ImgTrans/Remap_Demo.cpp | 1 + .../cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp | 1 + .../ImgTrans/copyMakeBorder_demo.cpp | 1 + .../tutorial_code/ImgTrans/filter2D_demo.cpp | 1 + .../ShapeDescriptors/findContours_demo.cpp | 1 + .../generalContours_demo1.cpp | 1 + .../generalContours_demo2.cpp | 1 + .../ShapeDescriptors/hull_demo.cpp | 1 + .../ShapeDescriptors/moments_demo.cpp | 1 + .../TrackingMotion/cornerDetector_Demo.cpp | 1 + .../TrackingMotion/cornerHarris_Demo.cpp | 1 + .../TrackingMotion/cornerSubPix_Demo.cpp | 1 + .../goodFeaturesToTrack_Demo.cpp | 1 + .../camera_calibration/camera_calibration.cpp | 1 + .../calib3d/stereoBM/SBM_Sample.cpp | 1 + .../discrete_fourier_transform.cpp | 1 + .../how_to_scan_images/how_to_scan_images.cpp | 1 + .../interoperability_with_OpenCV_1.cpp | 2 + .../mat_mask_operations.cpp | 1 + .../features2D/SURF_FlannMatcher.cpp | 1 + .../features2D/SURF_Homography.cpp | 1 + .../features2D/SURF_descriptor.cpp | 1 + .../features2D/SURF_detector.cpp | 1 + .../gpu-basics-similarity.cpp | 2 +- .../display_image/display_image.cpp | 1 + .../introduction_windows_vs.cpp | 1 + .../introduction_to_svm.cpp | 1 + .../ml/non_linear_svms/non_linear_svms.cpp | 1 + .../photo/hdr_imaging/hdr_imaging.cpp | 1 + samples/cpp/tutorial_code/video/bg_sub.cpp | 1 + samples/cpp/tvl1_optical_flow.cpp | 1 + samples/cpp/ufacedetect.cpp | 1 + samples/cpp/watershed.cpp | 1 + samples/directx/CMakeLists.txt | 2 +- samples/directx/d3d_base.inl.hpp | 1 + samples/gpu/CMakeLists.txt | 2 +- samples/tapi/CMakeLists.txt | 2 +- samples/tapi/clahe.cpp | 1 + samples/tapi/hog.cpp | 1 + samples/tapi/pyrlk_optical_flow.cpp | 1 + samples/tapi/squares.cpp | 1 + samples/tapi/surf_matcher.cpp | 1 + samples/tapi/tvl1_optical_flow.cpp | 1 + 204 files changed, 968 insertions(+), 439 deletions(-) rename modules/highgui/doc/{reading_and_writing_images_and_video.rst => reading_and_writing_video.rst} (63%) create mode 100644 modules/imgcodecs/CMakeLists.txt create mode 100644 modules/imgcodecs/doc/imgcodecs.rst create mode 100644 modules/imgcodecs/doc/reading_and_writing_images.rst create mode 100644 modules/imgcodecs/include/opencv2/imgcodecs.hpp create mode 100644 modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs.hpp create mode 100644 modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h create mode 100644 modules/imgcodecs/include/opencv2/imgcodecs/ios.h create mode 100644 modules/imgcodecs/perf/perf_main.cpp create mode 100644 modules/imgcodecs/perf/perf_precomp.hpp rename modules/{highgui => imgcodecs}/src/bitstrm.cpp (100%) rename modules/{highgui => imgcodecs}/src/bitstrm.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_base.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_base.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_bmp.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_bmp.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_exr.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_exr.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_hdr.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_hdr.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_jpeg.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_jpeg.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_jpeg2000.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_jpeg2000.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_png.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_png.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_pxm.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_pxm.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_sunras.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_sunras.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_tiff.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_tiff.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_webp.cpp (100%) rename modules/{highgui => imgcodecs}/src/grfmt_webp.hpp (100%) rename modules/{highgui => imgcodecs}/src/grfmts.hpp (100%) rename modules/{highgui => imgcodecs}/src/ios_conversions.mm (100%) rename modules/{highgui => imgcodecs}/src/loadsave.cpp (100%) create mode 100644 modules/imgcodecs/src/precomp.hpp rename modules/{highgui => imgcodecs}/src/rgbe.cpp (100%) rename modules/{highgui => imgcodecs}/src/rgbe.hpp (100%) rename modules/{highgui => imgcodecs}/src/utils.cpp (100%) rename modules/{highgui => imgcodecs}/src/utils.hpp (100%) rename modules/{highgui => imgcodecs}/test/test_drawing.cpp (99%) rename modules/{highgui => imgcodecs}/test/test_grfmt.cpp (99%) create mode 100644 modules/imgcodecs/test/test_main.cpp create mode 100644 modules/imgcodecs/test/test_precomp.hpp diff --git a/3rdparty/readme.txt b/3rdparty/readme.txt index ca46fbd576..64e2563a85 100644 --- a/3rdparty/readme.txt +++ b/3rdparty/readme.txt @@ -1,5 +1,5 @@ This folder contains libraries and headers of a few very popular still image codecs -used by highgui module. +used by imgcodecs module. The libraries and headers are preferably to build Win32 and Win64 versions of OpenCV. On UNIX systems all the libraries are automatically detected by configure script. In order to use these versions of libraries instead of system ones on UNIX systems you @@ -11,7 +11,7 @@ libjpeg 8d (8.4) - The Independent JPEG Group's JPEG software. See IGJ home page http://www.ijg.org for details and links to the source code - HAVE_JPEG preprocessor flag must be set to make highgui use libjpeg. + HAVE_JPEG preprocessor flag must be set to make imgcodecs use libjpeg. On UNIX systems configure script takes care of it. ------------------------------------------------------------------------------------ libpng 1.5.12 - Portable Network Graphics library. @@ -19,7 +19,7 @@ libpng 1.5.12 - Portable Network Graphics library. See libpng home page http://www.libpng.org for details and links to the source code - HAVE_PNG preprocessor flag must be set to make highgui use libpng. + HAVE_PNG preprocessor flag must be set to make imgcodecs use libpng. On UNIX systems configure script takes care of it. ------------------------------------------------------------------------------------ libtiff 4.0.2 - Tag Image File Format (TIFF) Software @@ -28,7 +28,7 @@ libtiff 4.0.2 - Tag Image File Format (TIFF) Software See libtiff home page http://www.remotesensing.org/libtiff/ for details and links to the source code - HAVE_TIFF preprocessor flag must be set to make highgui use libtiff. + HAVE_TIFF preprocessor flag must be set to make imgcodecs use libtiff. On UNIX systems configure script takes care of it. In this build support for ZIP (LZ77 compression) is turned on. ------------------------------------------------------------------------------------ @@ -37,7 +37,7 @@ zlib 1.2.7 - General purpose LZ77 compression library See zlib home page http://www.zlib.net for details and links to the source code - No preprocessor definition is needed to make highgui use this library - + No preprocessor definition is needed to make imgcodecs use this library - it is included automatically if either libpng or libtiff are used. ------------------------------------------------------------------------------------ jasper-1.900.1 - JasPer is a collection of software diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index e560ed815c..c815303d49 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -1,4 +1,4 @@ -set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_photo opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d) +set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_photo opencv_objdetect opencv_imgcodecs opencv_highgui opencv_calib3d opencv_video opencv_features2d) ocv_check_dependencies(${OPENCV_TRAINCASCADE_DEPS}) if(NOT OCV_DEPENDENCIES_FOUND) diff --git a/apps/traincascade/imagestorage.cpp b/apps/traincascade/imagestorage.cpp index e69a7df1ad..2f791240e4 100644 --- a/apps/traincascade/imagestorage.cpp +++ b/apps/traincascade/imagestorage.cpp @@ -1,6 +1,7 @@ #include "opencv2/core.hpp" +#include "opencv2/core/core_c.h" #include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "imagestorage.h" #include diff --git a/apps/traincascade/imagestorage.h b/apps/traincascade/imagestorage.h index fb68e25cb2..38ca52a8b5 100644 --- a/apps/traincascade/imagestorage.h +++ b/apps/traincascade/imagestorage.h @@ -1,9 +1,6 @@ #ifndef _OPENCV_IMAGESTORAGE_H_ #define _OPENCV_IMAGESTORAGE_H_ -#include "highgui.h" - - class CvCascadeImageReader { diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index e6fa199119..6618ca8834 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -704,8 +704,8 @@ function(ocv_add_perf_tests) if(BUILD_PERF_TESTS AND EXISTS "${perf_path}") __ocv_parse_test_sources(PERF ${ARGN}) - # opencv_highgui is required for imread/imwrite - set(perf_deps ${the_module} opencv_ts opencv_highgui ${OPENCV_PERF_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS}) + # opencv_imgcodecs is required for imread/imwrite + set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_PERF_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS}) ocv_check_dependencies(${perf_deps}) if(OCV_DEPENDENCIES_FOUND) @@ -757,8 +757,8 @@ function(ocv_add_accuracy_tests) if(BUILD_TESTS AND EXISTS "${test_path}") __ocv_parse_test_sources(TEST ${ARGN}) - # opencv_highgui is required for imread/imwrite - set(test_deps ${the_module} opencv_ts opencv_highgui ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS}) + # opencv_imgcodecs is required for imread/imwrite + set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_highgui ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS}) ocv_check_dependencies(${test_deps}) if(OCV_DEPENDENCIES_FOUND) @@ -811,7 +811,7 @@ function(ocv_add_samples) string(REGEX REPLACE "^opencv_" "" module_id ${the_module}) if(BUILD_EXAMPLES AND EXISTS "${samples_path}") - set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_highgui ${ARGN}) + set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_imgcodecs opencv_highgui ${ARGN}) ocv_check_dependencies(${samples_deps}) if(OCV_DEPENDENCIES_FOUND) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1c284539ee..33fd9957d3 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -33,7 +33,7 @@ if(BUILD_DOCS AND HAVE_SPHINX) endif() endforeach() - set(FIXED_ORDER_MODULES core imgproc highgui video calib3d features2d objdetect ml flann photo stitching nonfree contrib legacy) + set(FIXED_ORDER_MODULES core imgproc imgcodecs highgui video calib3d features2d objdetect ml flann photo stitching nonfree contrib legacy) list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES}) diff --git a/doc/check_docs.py b/doc/check_docs.py index 0290fc70f4..c0e519b29c 100755 --- a/doc/check_docs.py +++ b/doc/check_docs.py @@ -14,6 +14,7 @@ opencv_hdr_list = [ "../modules/video/include/opencv2/video/tracking.hpp", "../modules/video/include/opencv2/video/background_segm.hpp", "../modules/objdetect/include/opencv2/objdetect.hpp", +"../modules/imgcodecs/include/opencv2/imgcodecs.hpp", "../modules/highgui/include/opencv2/highgui.hpp", ] @@ -24,6 +25,7 @@ opencv_module_list = [ "features2d", "video", "objdetect", +"imgcodecs", "highgui", "ml" ] diff --git a/doc/conf.py b/doc/conf.py index a0c231c3b5..c17dfb618f 100755 --- a/doc/conf.py +++ b/doc/conf.py @@ -302,14 +302,16 @@ man_pages = [ extlinks = { 'basicstructures' : ('http://docs.opencv.org/modules/core/doc/basic_structures.html#%s', None), 'oldbasicstructures' : ('http://docs.opencv.org/modules/core/doc/old_basic_structures.html#%s', None), - 'readwriteimagevideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#%s', None), + 'readwriteimage' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html#%s', None), + 'readwritevideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html#%s', None), 'operationsonarrays' : ('http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#%s', None), 'utilitysystemfunctions' : ('http://docs.opencv.org/modules/core/doc/utility_and_system_functions_and_macros.html#%s', None), 'imgprocfilter' : ('http://docs.opencv.org/modules/imgproc/doc/filtering.html#%s', None), 'svms' : ('http://docs.opencv.org/modules/ml/doc/support_vector_machines.html#%s', None), 'drawingfunc' : ('http://docs.opencv.org/modules/core/doc/drawing_functions.html#%s', None), 'xmlymlpers' : ('http://docs.opencv.org/modules/core/doc/xml_yaml_persistence.html#%s', None), - 'hgvideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#%s', None), + 'rwimg' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html#%s', None), + 'hgvideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html#%s', None), 'gpuinit' : ('http://docs.opencv.org/modules/gpu/doc/initalization_and_information.html#%s', None), 'gpudatastructure' : ('http://docs.opencv.org/modules/gpu/doc/data_structures.html#%s', None), 'gpuopmatrices' : ('http://docs.opencv.org/modules/gpu/doc/operations_on_matrices.html#%s', None), @@ -329,8 +331,8 @@ extlinks = { 'how_to_contribute' : ('http://code.opencv.org/projects/opencv/wiki/How_to_contribute/%s', None), 'cvt_color' : ('http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=cvtcolor#cvtcolor%s', None), - 'imread' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread%s', None), - 'imwrite' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imwrite#imwrite%s', None), + 'imread' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html?highlight=imread#imread%s', None), + 'imwrite' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html?highlight=imwrite#imwrite%s', None), 'imshow' : ('http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=imshow#imshow%s', None), 'named_window' : ('http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=namedwindow#namedwindow%s', None), 'wait_key' : ('http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=waitkey#waitkey%s', None), @@ -418,7 +420,7 @@ extlinks = { 'background_subtractor' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractor#backgroundsubtractor%s', None), 'background_subtractor_mog' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractorMOG#backgroundsubtractormog%s', None), 'background_subtractor_mog_two' : ('http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html?highlight=backgroundsubtractorMOG2#backgroundsubtractormog2%s', None), - 'video_capture' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=videocapture#videocapture%s', None), + 'video_capture' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_video.html?highlight=videocapture#videocapture%s', None), 'ippa_convert': ('http://docs.opencv.org/modules/core/doc/ipp_async_converters.html#%s', None), 'ptr':('http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=Ptr#Ptr%s', None) } diff --git a/doc/opencv_cheatsheet.tex b/doc/opencv_cheatsheet.tex index d6c339916d..01d5c275d9 100644 --- a/doc/opencv_cheatsheet.tex +++ b/doc/opencv_cheatsheet.tex @@ -522,9 +522,9 @@ samples on what are the contours and how to use them. \begin{tabbing} \textbf{Wr}\=\textbf{iting and reading raster images}\\ -\texttt{\href{http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html\#imwrite}{imwrite}("myimage.jpg", image);}\\ -\texttt{Mat image\_color\_copy = \href{http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html\#imread}{imread}("myimage.jpg", 1);}\\ -\texttt{Mat image\_grayscale\_copy = \href{http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html\#imread}{imread}("myimage.jpg", 0);}\\ +\texttt{\href{http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html\#imwrite}{imwrite}("myimage.jpg", image);}\\ +\texttt{Mat image\_color\_copy = \href{http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html\#imread}{imread}("myimage.jpg", 1);}\\ +\texttt{Mat image\_grayscale\_copy = \href{http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html\#imread}{imread}("myimage.jpg", 0);}\\ \end{tabbing} \emph{The functions can read/write images in the following formats: \textbf{BMP (.bmp), JPEG (.jpg, .jpeg), TIFF (.tif, .tiff), PNG (.png), PBM/PGM/PPM (.p?m), Sun Raster (.sr), JPEG 2000 (.jp2)}. Every format supports 8-bit, 1- or 3-channel images. Some formats (PNG, JPEG 2000) support 16 bits per channel.} diff --git a/doc/py_tutorials/py_gui/py_video_display/py_video_display.rst b/doc/py_tutorials/py_gui/py_video_display/py_video_display.rst index 56946bc5db..5bdf4fcb87 100644 --- a/doc/py_tutorials/py_gui/py_video_display/py_video_display.rst +++ b/doc/py_tutorials/py_gui/py_video_display/py_video_display.rst @@ -46,7 +46,7 @@ To capture a video, you need to create a **VideoCapture** object. Its argument c Sometimes, ``cap`` may not have initialized the capture. In that case, this code shows error. You can check whether it is initialized or not by the method **cap.isOpened()**. If it is True, OK. Otherwise open it using **cap.open()**. -You can also access some of the features of this video using **cap.get(propId)** method where propId is a number from 0 to 18. Each number denotes a property of the video (if it is applicable to that video) and full details can be seen here: `Property Identifier `_. Some of these values can be modified using **cap.set(propId, value)**. Value is the new value you want. +You can also access some of the features of this video using **cap.get(propId)** method where propId is a number from 0 to 18. Each number denotes a property of the video (if it is applicable to that video) and full details can be seen here: `Property Identifier `_. Some of these values can be modified using **cap.set(propId, value)**. Value is the new value you want. For example, I can check the frame width and height by ``cap.get(3)`` and ``cap.get(4)``. It gives me 640x480 by default. But I want to modify it to 320x240. Just use ``ret = cap.set(3,320)`` and ``ret = cap.set(4,240)``. diff --git a/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.rst b/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.rst index b7cf446687..ca3d75dca3 100644 --- a/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.rst +++ b/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.rst @@ -25,7 +25,7 @@ Here's a sample usage of :operationsonarrays:`dft() ` : :language: cpp :linenos: :tab-width: 4 - :lines: 1-3, 5, 19-20, 23-78 + :lines: 1-4, 6, 20-21, 24-79 Explanation =========== diff --git a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.rst b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.rst index b6a18fee88..6162985ddb 100644 --- a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.rst +++ b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.rst @@ -45,7 +45,7 @@ The final argument is optional. If given the image will be loaded in gray scale .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 48-60 + :lines: 49-61 Here we first use the C++ *stringstream* class to convert the third command line argument from text to an integer format. Then we use a simple look and the upper formula to calculate the lookup table. No OpenCV specific stuff here. @@ -99,7 +99,7 @@ When it comes to performance you cannot beat the classic C style operator[] (poi .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 125-152 + :lines: 126-153 Here we basically just acquire a pointer to the start of each row and go through it until it ends. In the special case that the matrix is stored in a continues manner we only need to request the pointer a single time and go all the way to the end. We need to look out for color images: we have three channels so we need to pass through three times more items in each row. @@ -122,7 +122,7 @@ In case of the efficient way making sure that you pass through the right amount .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 154-182 + :lines: 155-183 In case of color images we have three uchar items per column. This may be considered a short vector of uchar items, that has been baptized in OpenCV with the *Vec3b* name. To access the n-th sub column we use simple operator[] access. It's important to remember that OpenCV iterators go through the columns and automatically skip to the next row. Therefore in case of color images if you use a simple *uchar* iterator you'll be able to access only the blue channel values. @@ -134,7 +134,7 @@ The final method isn't recommended for scanning. It was made to acquire or modif .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 184-216 + :lines: 185-217 The functions takes your input type and coordinates and calculates on the fly the address of the queried item. Then returns a reference to that. This may be a constant when you *get* the value and non-constant when you *set* the value. As a safety step in **debug mode only*** there is performed a check that your input coordinates are valid and does exist. If this isn't the case you'll get a nice output message of this on the standard error output stream. Compared to the efficient way in release mode the only difference in using this is that for every element of the image you'll get a new row pointer for what we use the C operator[] to acquire the column element. @@ -148,14 +148,14 @@ This is a bonus method of achieving lookup table modification in an image. Becau .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 107-110 + :lines: 108-111 Finally call the function (I is our input image and J the output one): .. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp :language: cpp :tab-width: 4 - :lines: 115 + :lines: 116 Performance Difference ====================== diff --git a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst index 9285509b07..9d4189363f 100644 --- a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst +++ b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst @@ -77,7 +77,7 @@ Now that you have the basics done :download:`here's <../../../../samples/cpp/tut :language: cpp :linenos: :tab-width: 4 - :lines: 1-9, 22-25, 27-44 + :lines: 1-10, 23-26, 29-46 Here you can observe that with the new structure we have no pointer problems, although it is possible to use the old functions and in the end just transform the result to a *Mat* object. @@ -85,7 +85,7 @@ Here you can observe that with the new structure we have no pointer problems, al :language: cpp :linenos: :tab-width: 4 - :lines: 46-51 + :lines: 48-53 Because, we want to mess around with the images luma component we first convert from the default RGB to the YUV color space and then split the result up into separate planes. Here the program splits: in the first example it processes each plane using one of the three major image scanning algorithms in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the image some Gaussian noise and then mix together the channels according to some formula. @@ -95,7 +95,7 @@ The scanning version looks like: :language: cpp :linenos: :tab-width: 4 - :lines: 55-75 + :lines: 57-77 Here you can observe that we may go through all the pixels of an image in three fashions: an iterator, a C pointer and an individual element access style. You can read a more in-depth description of these in the :ref:`howToScanImagesOpenCV` tutorial. Converting from the old function names is easy. Just remove the cv prefix and use the new *Mat* data structure. Here's an example of this by using the weighted addition function: @@ -103,7 +103,7 @@ Here you can observe that we may go through all the pixels of an image in three :language: cpp :linenos: :tab-width: 4 - :lines: 79-112 + :lines: 81-113 As you may observe the *planes* variable is of type *Mat*. However, converting from *Mat* to *IplImage* is easy and made automatically with a simple assignment operator. @@ -111,7 +111,7 @@ As you may observe the *planes* variable is of type *Mat*. However, converting f :language: cpp :linenos: :tab-width: 4 - :lines: 115-127 + :lines: 117-129 The new *imshow* highgui function accepts both the *Mat* and *IplImage* data structures. Compile and run the program and if the first image below is your input you may get either the first or second as output: diff --git a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.rst b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.rst index 736aceb02d..67517d32f1 100644 --- a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.rst +++ b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.rst @@ -86,7 +86,7 @@ Each of the building components has their own valid domains. This leads to the d Creating a *Mat* object explicitly ================================== -In the :ref:`Load_Save_Image` tutorial you have already learned how to write a matrix to an image file by using the :readwriteimagevideo:`imwrite() ` function. However, for debugging purposes it's much more convenient to see the actual values. You can do this using the << operator of *Mat*. Be aware that this only works for two dimensional matrices. +In the :ref:`Load_Save_Image` tutorial you have already learned how to write a matrix to an image file by using the :readwriteimage:`imwrite() ` function. However, for debugging purposes it's much more convenient to see the actual values. You can do this using the << operator of *Mat*. Be aware that this only works for two dimensional matrices. Although *Mat* works really well as an image container, it is also a general matrix class. Therefore, it is possible to create and manipulate multidimensional matrices. You can create a Mat object in multiple ways: diff --git a/doc/tutorials/core/table_of_content_core/table_of_content_core.rst b/doc/tutorials/core/table_of_content_core/table_of_content_core.rst index 1fcf4ee2b1..ea5756da23 100644 --- a/doc/tutorials/core/table_of_content_core/table_of_content_core.rst +++ b/doc/tutorials/core/table_of_content_core/table_of_content_core.rst @@ -200,7 +200,6 @@ Here you will learn the about the basic building blocks of the library. A must r :height: 90pt :width: 90pt - =============== ====================================================== + .. tabularcolumns:: m{100pt} m{300pt} .. cssclass:: toctableopencv @@ -221,8 +220,6 @@ Here you will learn the about the basic building blocks of the library. A must r :width: 90pt .. |Author_ElenaG| unicode:: Elena U+0020 Gvozdeva - =============== ====================================================== - .. raw:: latex \pagebreak diff --git a/doc/tutorials/introduction/display_image/display_image.rst b/doc/tutorials/introduction/display_image/display_image.rst index 6b30b7c295..fc6e6ca5cc 100644 --- a/doc/tutorials/introduction/display_image/display_image.rst +++ b/doc/tutorials/introduction/display_image/display_image.rst @@ -39,28 +39,28 @@ You'll almost always end up using the: .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp :tab-width: 4 - :lines: 1-3 + :lines: 1-4 We also include the *iostream* to facilitate console line output and input. To avoid data structure and function name conflicts with other libraries, OpenCV has its own namespace: *cv*. To avoid the need appending prior each of these the *cv::* keyword you can import the namespace in the whole file by using the lines: .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp :tab-width: 4 - :lines: 5-6 + :lines: 6-7 This is true for the STL library too (used for console I/O). Now, let's analyze the *main* function. We start up assuring that we acquire a valid image name argument from the command line. .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp :tab-width: 4 - :lines: 10-14 + :lines: 11-15 Then create a *Mat* object that will store the data of the loaded image. .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp :tab-width: 4 - :lines: 16 + :lines: 17 Now we call the :imread:`imread <>` function which loads the image name specified by the first argument (*argv[1]*). The second argument specifies the format in what we want the image. This may be: @@ -73,7 +73,7 @@ Now we call the :imread:`imread <>` function which loads the image name specifie .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp :tab-width: 4 - :lines: 17 + :lines: 18 .. note:: @@ -88,21 +88,21 @@ After checking that the image data was loaded correctly, we want to display our .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp - :lines: 25 + :lines: 26 :tab-width: 4 Finally, to update the content of the OpenCV window with a new image use the :imshow:`imshow <>` function. Specify the OpenCV window name to update and the image to use during this operation: .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp - :lines: 26 + :lines: 27 :tab-width: 4 Because we want our window to be displayed until the user presses a key (otherwise the program would end far too quickly), we use the :wait_key:`waitKey <>` function whose only parameter is just how long should it wait for a user input (measured in milliseconds). Zero means to wait forever. .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp :language: cpp - :lines: 28 + :lines: 29 :tab-width: 4 Result diff --git a/doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst b/doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst index 5ae5062492..d68116c818 100644 --- a/doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst +++ b/doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst @@ -361,16 +361,16 @@ Now here's our recommendation for the structure of the tutorial (although, remem # ---- External links for tutorials ----------------- extlinks = { - 'hgvideo' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#%s', None) + 'rwimg' : ('http://docs.opencv.org/modules/imgcodecs/doc/reading_and_writing_images.html#%s', None) } - In short here we defined a new **hgvideo** directive that refers to an external webpage link. Its usage is: + In short here we defined a new **rwimg** directive that refers to an external webpage link. Its usage is: .. code-block:: rst - A sample function of the highgui modules image write and read page is the :hgvideo:`imread() function `. + A sample function of the highgui modules image write and read page is the :rwimg:`imread() function `. - Which turns to: A sample function of the highgui modules image write and read page is the :hgvideo:`imread() function `. The argument you give between the <> will be put in place of the ``%s`` in the upper definition, and as the link will anchor to the correct function. To find out the anchor of a given function just open up a web page, search for the function and click on it. In the address bar it should appear like: ``http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#imread`` . Look here for the name of the directives for each page of the OpenCV reference manual. If none present for one of them feel free to add one for it. + Which turns to: A sample function of the highgui modules image write and read page is the :rwimg:`imread() function `. The argument you give between the <> will be put in place of the ``%s`` in the upper definition, and as the link will anchor to the correct function. To find out the anchor of a given function just open up a web page, search for the function and click on it. In the address bar it should appear like: ``http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images.html#imread`` . Look here for the name of the directives for each page of the OpenCV reference manual. If none present for one of them feel free to add one for it. For formulas you can add LATEX code that will translate in the web pages into images. You do this by using the *math* directive. A usage tip: diff --git a/doc/tutorials/introduction/load_save_image/load_save_image.rst b/doc/tutorials/introduction/load_save_image/load_save_image.rst index dec75c1958..cde81e12b5 100644 --- a/doc/tutorials/introduction/load_save_image/load_save_image.rst +++ b/doc/tutorials/introduction/load_save_image/load_save_image.rst @@ -5,7 +5,7 @@ Load, Modify, and Save an Image .. note:: - We assume that by now you know how to load an image using :readwriteimagevideo:`imread ` and to display it in a window (using :user_interface:`imshow `). Read the :ref:`Display_Image` tutorial otherwise. + We assume that by now you know how to load an image using :readwriteimage:`imread ` and to display it in a window (using :user_interface:`imshow `). Read the :ref:`Display_Image` tutorial otherwise. Goals ====== @@ -14,9 +14,9 @@ In this tutorial you will learn how to: .. container:: enumeratevisibleitemswithsquare - * Load an image using :readwriteimagevideo:`imread ` + * Load an image using :readwriteimage:`imread ` * Transform an image from BGR to Grayscale format by using :miscellaneous_transformations:`cvtColor ` - * Save your transformed image in a file on disk (using :readwriteimagevideo:`imwrite `) + * Save your transformed image in a file on disk (using :readwriteimage:`imwrite `) Code ====== @@ -62,7 +62,7 @@ Here it is: Explanation ============ -#. We begin by loading an image using :readwriteimagevideo:`imread `, located in the path given by *imageName*. For this example, assume you are loading a RGB image. +#. We begin by loading an image using :readwriteimage:`imread `, located in the path given by *imageName*. For this example, assume you are loading a RGB image. #. Now we are going to convert our image from BGR to Grayscale format. OpenCV has a really nice function to do this kind of transformations: @@ -76,9 +76,9 @@ Explanation * a source image (*image*) * a destination image (*gray_image*), in which we will save the converted image. - * an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_BGR2GRAY** (because of :readwriteimagevideo:`imread ` has BGR default channel order in case of color images). + * an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_BGR2GRAY** (because of :readwriteimage:`imread ` has BGR default channel order in case of color images). -#. So now we have our new *gray_image* and want to save it on disk (otherwise it will get lost after the program ends). To save it, we will use a function analagous to :readwriteimagevideo:`imread `: :readwriteimagevideo:`imwrite ` +#. So now we have our new *gray_image* and want to save it on disk (otherwise it will get lost after the program ends). To save it, we will use a function analagous to :readwriteimage:`imread `: :readwriteimage:`imwrite ` .. code-block:: cpp diff --git a/doc/tutorials/ml/non_linear_svms/non_linear_svms.rst b/doc/tutorials/ml/non_linear_svms/non_linear_svms.rst index 57e0b1b6ea..bd7fde8775 100644 --- a/doc/tutorials/ml/non_linear_svms/non_linear_svms.rst +++ b/doc/tutorials/ml/non_linear_svms/non_linear_svms.rst @@ -73,7 +73,7 @@ You may also find the source code and these video file in the :file:`samples/cpp :language: cpp :linenos: :tab-width: 4 - :lines: 1-11, 22-23, 26- + :lines: 1-12, 23-24, 27- Explanation =========== diff --git a/include/opencv2/opencv.hpp b/include/opencv2/opencv.hpp index b7c290a49c..fc24981eb6 100644 --- a/include/opencv2/opencv.hpp +++ b/include/opencv2/opencv.hpp @@ -50,6 +50,7 @@ #include "opencv2/features2d.hpp" #include "opencv2/objdetect.hpp" #include "opencv2/calib3d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/ml.hpp" diff --git a/modules/calib3d/perf/perf_precomp.hpp b/modules/calib3d/perf/perf_precomp.hpp index 86312de1b8..9c5ab997d1 100644 --- a/modules/calib3d/perf/perf_precomp.hpp +++ b/modules/calib3d/perf/perf_precomp.hpp @@ -11,7 +11,7 @@ #include "opencv2/ts.hpp" #include "opencv2/calib3d.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY diff --git a/modules/calib3d/test/test_precomp.hpp b/modules/calib3d/test/test_precomp.hpp index d670a4c220..ac3371cef3 100644 --- a/modules/calib3d/test/test_precomp.hpp +++ b/modules/calib3d/test/test_precomp.hpp @@ -13,7 +13,7 @@ #include "opencv2/ts.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/calib3d.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" namespace cvtest { diff --git a/modules/features2d/perf/perf_precomp.hpp b/modules/features2d/perf/perf_precomp.hpp index 30607daaf6..f5280a84e8 100644 --- a/modules/features2d/perf/perf_precomp.hpp +++ b/modules/features2d/perf/perf_precomp.hpp @@ -10,7 +10,7 @@ #define __OPENCV_PERF_PRECOMP_HPP__ #include "opencv2/ts.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/features2d.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY diff --git a/modules/features2d/test/test_descriptors_regression.cpp b/modules/features2d/test/test_descriptors_regression.cpp index 7119d590ef..281df244a1 100644 --- a/modules/features2d/test/test_descriptors_regression.cpp +++ b/modules/features2d/test/test_descriptors_regression.cpp @@ -40,7 +40,6 @@ //M*/ #include "test_precomp.hpp" -#include "opencv2/highgui.hpp" using namespace std; using namespace cv; diff --git a/modules/features2d/test/test_precomp.hpp b/modules/features2d/test/test_precomp.hpp index 49bc1dfd18..bce72f7296 100644 --- a/modules/features2d/test/test_precomp.hpp +++ b/modules/features2d/test/test_precomp.hpp @@ -12,7 +12,7 @@ #include "opencv2/ts.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/features2d.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include #endif diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index f4a19cffe6..efe31a1cac 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "High-level GUI and Media I/O") -ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_androidcamera) +ocv_add_module(highgui opencv_imgproc opencv_imgcodecs OPTIONAL opencv_androidcamera) # ---------------------------------------------------------------------------- # CMake file for highgui. See root CMakeLists.txt @@ -7,61 +7,17 @@ ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_androidcamera) # Jose Luis Blanco, 2008 # ---------------------------------------------------------------------------- -ocv_clear_vars(GRFMT_LIBS) - if(HAVE_WINRT_CX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") endif() -if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR) +if(APPLE) ocv_include_directories(${ZLIB_INCLUDE_DIRS}) - list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES}) -endif() - -if(HAVE_JPEG) - ocv_include_directories(${JPEG_INCLUDE_DIR}) - list(APPEND GRFMT_LIBS ${JPEG_LIBRARIES}) -endif() - -if(WITH_WEBP) - add_definitions(-DHAVE_WEBP) - ocv_include_directories(${WEBP_INCLUDE_DIR}) - list(APPEND GRFMT_LIBS ${WEBP_LIBRARIES}) -endif() - -if(HAVE_PNG) - add_definitions(${PNG_DEFINITIONS}) - ocv_include_directories(${PNG_INCLUDE_DIR}) - list(APPEND GRFMT_LIBS ${PNG_LIBRARIES}) + list(APPEND HIGHGUI_LIBRARIES ${ZLIB_LIBRARIES}) endif() -if(HAVE_TIFF) - ocv_include_directories(${TIFF_INCLUDE_DIR}) - list(APPEND GRFMT_LIBS ${TIFF_LIBRARIES}) -endif() - -if(HAVE_JASPER) - ocv_include_directories(${JASPER_INCLUDE_DIR}) - list(APPEND GRFMT_LIBS ${JASPER_LIBRARIES}) -endif() - -if(HAVE_OPENEXR) - include_directories(SYSTEM ${OPENEXR_INCLUDE_PATHS}) - list(APPEND GRFMT_LIBS ${OPENEXR_LIBRARIES}) -endif() - -file(GLOB grfmt_hdrs src/grfmt*.hpp) -file(GLOB grfmt_srcs src/grfmt*.cpp) -list(APPEND grfmt_hdrs src/bitstrm.hpp) -list(APPEND grfmt_srcs src/bitstrm.cpp) -list(APPEND grfmt_hdrs src/rgbe.hpp) -list(APPEND grfmt_srcs src/rgbe.cpp) - -source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs}) - set(highgui_hdrs src/precomp.hpp - src/utils.hpp src/cap_ffmpeg_impl.hpp ) @@ -69,8 +25,6 @@ set(highgui_srcs src/cap.cpp src/cap_images.cpp src/cap_ffmpeg.cpp - src/loadsave.cpp - src/utils.cpp src/window.cpp ) @@ -257,10 +211,10 @@ endif() source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs}) source_group("Include" FILES ${highgui_ext_hdrs}) -ocv_set_module_sources(HEADERS ${highgui_ext_hdrs} SOURCES ${highgui_srcs} ${highgui_hdrs} ${grfmt_srcs} ${grfmt_hdrs}) +ocv_set_module_sources(HEADERS ${highgui_ext_hdrs} SOURCES ${highgui_srcs} ${highgui_hdrs}) ocv_module_include_directories() -ocv_create_module(${GRFMT_LIBS} ${HIGHGUI_LIBRARIES}) +ocv_create_module(${HIGHGUI_LIBRARIES}) if(APPLE) ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS) diff --git a/modules/highgui/doc/highgui.rst b/modules/highgui/doc/highgui.rst index 02beddbafb..0450018785 100644 --- a/modules/highgui/doc/highgui.rst +++ b/modules/highgui/doc/highgui.rst @@ -9,12 +9,11 @@ It provides easy interface to: * Create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS). * Add trackbars to the windows, handle simple mouse events as well as keyboard commands. -* Read and write images to/from disk or memory. * Read video from camera or file and write video to a file. .. toctree:: :maxdepth: 2 user_interface - reading_and_writing_images_and_video + reading_and_writing_video qt_new_functions diff --git a/modules/highgui/doc/reading_and_writing_images_and_video.rst b/modules/highgui/doc/reading_and_writing_video.rst similarity index 63% rename from modules/highgui/doc/reading_and_writing_images_and_video.rst rename to modules/highgui/doc/reading_and_writing_video.rst index c094ef7e23..4c7355129a 100644 --- a/modules/highgui/doc/reading_and_writing_images_and_video.rst +++ b/modules/highgui/doc/reading_and_writing_video.rst @@ -1,191 +1,8 @@ -Reading and Writing Images and Video -==================================== +Reading and Writing Video +========================= .. highlight:: cpp -imdecode --------- -Reads an image from a buffer in memory. - -.. ocv:function:: Mat imdecode( InputArray buf, int flags ) - -.. ocv:function:: Mat imdecode( InputArray buf, int flags, Mat* dst ) - -.. ocv:cfunction:: IplImage* cvDecodeImage( const CvMat* buf, int iscolor=CV_LOAD_IMAGE_COLOR) - -.. ocv:cfunction:: CvMat* cvDecodeImageM( const CvMat* buf, int iscolor=CV_LOAD_IMAGE_COLOR) - -.. ocv:pyfunction:: cv2.imdecode(buf, flags) -> retval - - :param buf: Input array or vector of bytes. - - :param flags: The same flags as in :ocv:func:`imread` . - - :param dst: The optional output placeholder for the decoded matrix. It can save the image reallocations when the function is called repeatedly for images of the same size. - -The function reads an image from the specified buffer in the memory. -If the buffer is too short or contains invalid data, the empty matrix/image is returned. - -See -:ocv:func:`imread` for the list of supported formats and flags description. - -.. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order. - -imencode --------- -Encodes an image into a memory buffer. - -.. ocv:function:: bool imencode( const String& ext, InputArray img, vector& buf, const vector& params=vector()) - -.. ocv:cfunction:: CvMat* cvEncodeImage( const char* ext, const CvArr* image, const int* params=0 ) - -.. ocv:pyfunction:: cv2.imencode(ext, img[, params]) -> retval, buf - - :param ext: File extension that defines the output format. - - :param img: Image to be written. - - :param buf: Output buffer resized to fit the compressed image. - - :param params: Format-specific parameters. See :ocv:func:`imwrite` . - -The function compresses the image and stores it in the memory buffer that is resized to fit the result. -See -:ocv:func:`imwrite` for the list of supported formats and flags description. - -.. note:: ``cvEncodeImage`` returns single-row matrix of type ``CV_8UC1`` that contains encoded image as array of bytes. - -imread ------- -Loads an image from a file. - -.. ocv:function:: Mat imread( const String& filename, int flags=IMREAD_COLOR ) - -.. ocv:pyfunction:: cv2.imread(filename[, flags]) -> retval - -.. ocv:cfunction:: IplImage* cvLoadImage( const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR ) - -.. ocv:cfunction:: CvMat* cvLoadImageM( const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR ) - - :param filename: Name of file to be loaded. - - :param flags: Flags specifying the color type of a loaded image: - - * CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. - - * CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one - - * CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one - - * **>0** Return a 3-channel color image. - .. note:: In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel. - - * **=0** Return a grayscale image. - - * **<0** Return the loaded image as is (with alpha channel). - -The function ``imread`` loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix ( ``Mat::data==NULL`` ). Currently, the following file formats are supported: - - * Windows bitmaps - ``*.bmp, *.dib`` (always supported) - - * JPEG files - ``*.jpeg, *.jpg, *.jpe`` (see the *Notes* section) - - * JPEG 2000 files - ``*.jp2`` (see the *Notes* section) - - * Portable Network Graphics - ``*.png`` (see the *Notes* section) - - * WebP - ``*.webp`` (see the *Notes* section) - - * Portable image format - ``*.pbm, *.pgm, *.ppm`` (always supported) - - * Sun rasters - ``*.sr, *.ras`` (always supported) - - * TIFF files - ``*.tiff, *.tif`` (see the *Notes* section) - -.. note:: - - * The function determines the type of an image by the content, not by the file extension. - - * On Microsoft Windows* OS and MacOSX*, the codecs shipped with an OpenCV image (libjpeg, libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware that currently these native image loaders give images with different pixel values because of the color management embedded into MacOSX. - - * On Linux*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for codecs supplied with an OS image. Install the relevant packages (do not forget the development files, for example, "libjpeg-dev", in Debian* and Ubuntu*) to get the codec support or turn on the ``OPENCV_BUILD_3RDPARTY_LIBS`` flag in CMake. - -.. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order. - -imwrite ------------ -Saves an image to a specified file. - -.. ocv:function:: bool imwrite( const String& filename, InputArray img, const vector& params=vector() ) - -.. ocv:pyfunction:: cv2.imwrite(filename, img[, params]) -> retval - -.. ocv:cfunction:: int cvSaveImage( const char* filename, const CvArr* image, const int* params=0 ) - - :param filename: Name of the file. - - :param image: Image to be saved. - - :param params: Format-specific save parameters encoded as pairs ``paramId_1, paramValue_1, paramId_2, paramValue_2, ...`` . The following parameters are currently supported: - - * For JPEG, it can be a quality ( ``CV_IMWRITE_JPEG_QUALITY`` ) from 0 to 100 (the higher is the better). Default value is 95. - - * For WEBP, it can be a quality ( CV_IMWRITE_WEBP_QUALITY ) from 1 to 100 (the higher is the better). - By default (without any parameter) and for quality above 100 the lossless compression is used. - - * For PNG, it can be the compression level ( ``CV_IMWRITE_PNG_COMPRESSION`` ) from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3. - - * For PPM, PGM, or PBM, it can be a binary format flag ( ``CV_IMWRITE_PXM_BINARY`` ), 0 or 1. Default value is 1. - -The function ``imwrite`` saves the image to the specified file. The image format is chosen based on the ``filename`` extension (see -:ocv:func:`imread` for the list of extensions). Only 8-bit (or 16-bit unsigned (``CV_16U``) in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function. If the format, depth or channel order is different, use -:ocv:func:`Mat::convertTo` , and -:ocv:func:`cvtColor` to convert it before saving. Or, use the universal :ocv:class:`FileStorage` I/O functions to save the image to XML or YAML format. - -It is possible to store PNG images with an alpha channel using this function. To do this, create 8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535. The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom compression parameters :: - - #include - #include - #include - - using namespace cv; - using namespace std; - - void createAlphaMat(Mat &mat) - { - for (int i = 0; i < mat.rows; ++i) { - for (int j = 0; j < mat.cols; ++j) { - Vec4b& rgba = mat.at(i, j); - rgba[0] = UCHAR_MAX; - rgba[1] = saturate_cast((float (mat.cols - j)) / ((float)mat.cols) * UCHAR_MAX); - rgba[2] = saturate_cast((float (mat.rows - i)) / ((float)mat.rows) * UCHAR_MAX); - rgba[3] = saturate_cast(0.5 * (rgba[1] + rgba[2])); - } - } - } - - int main(int argv, char **argc) - { - // Create mat with alpha channel - Mat mat(480, 640, CV_8UC4); - createAlphaMat(mat); - - vector compression_params; - compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION); - compression_params.push_back(9); - - try { - imwrite("alpha.png", mat, compression_params); - } - catch (runtime_error& ex) { - fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what()); - return 1; - } - - fprintf(stdout, "Saved PNG file with alpha data.\n"); - return 0; - } - VideoCapture ------------ diff --git a/modules/highgui/include/opencv2/highgui.hpp b/modules/highgui/include/opencv2/highgui.hpp index f05825f784..e0f40b9292 100644 --- a/modules/highgui/include/opencv2/highgui.hpp +++ b/modules/highgui/include/opencv2/highgui.hpp @@ -202,53 +202,6 @@ CV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change, } // cv - - -//////////////////////////////// image codec //////////////////////////////// -namespace cv -{ - -enum { IMREAD_UNCHANGED = -1, // 8bit, color or not - IMREAD_GRAYSCALE = 0, // 8bit, gray - IMREAD_COLOR = 1, // ?, color - IMREAD_ANYDEPTH = 2, // any depth, ? - IMREAD_ANYCOLOR = 4 // ?, any color - }; - -enum { IMWRITE_JPEG_QUALITY = 1, - IMWRITE_JPEG_PROGRESSIVE = 2, - IMWRITE_JPEG_OPTIMIZE = 3, - IMWRITE_PNG_COMPRESSION = 16, - IMWRITE_PNG_STRATEGY = 17, - IMWRITE_PNG_BILEVEL = 18, - IMWRITE_PXM_BINARY = 32, - IMWRITE_WEBP_QUALITY = 64 - }; - -enum { IMWRITE_PNG_STRATEGY_DEFAULT = 0, - IMWRITE_PNG_STRATEGY_FILTERED = 1, - IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, - IMWRITE_PNG_STRATEGY_RLE = 3, - IMWRITE_PNG_STRATEGY_FIXED = 4 - }; - -CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR ); - -CV_EXPORTS_W bool imwrite( const String& filename, InputArray img, - const std::vector& params = std::vector()); - -CV_EXPORTS_W Mat imdecode( InputArray buf, int flags ); - -CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst); - -CV_EXPORTS_W bool imencode( const String& ext, InputArray img, - CV_OUT std::vector& buf, - const std::vector& params = std::vector()); - -} // cv - - - ////////////////////////////////// video io ///////////////////////////////// typedef struct CvCapture CvCapture; diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h index 130302150f..a94e69601b 100644 --- a/modules/highgui/include/opencv2/highgui/highgui_c.h +++ b/modules/highgui/include/opencv2/highgui/highgui_c.h @@ -194,67 +194,6 @@ typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, vo CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param CV_DEFAULT(NULL)); -enum -{ -/* 8bit, color or not */ - CV_LOAD_IMAGE_UNCHANGED =-1, -/* 8bit, gray */ - CV_LOAD_IMAGE_GRAYSCALE =0, -/* ?, color */ - CV_LOAD_IMAGE_COLOR =1, -/* any depth, ? */ - CV_LOAD_IMAGE_ANYDEPTH =2, -/* ?, any color */ - CV_LOAD_IMAGE_ANYCOLOR =4 -}; - -/* load image from file - iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED - overrides the other flags - using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED - unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit -*/ -CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); -CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); - -enum -{ - CV_IMWRITE_JPEG_QUALITY =1, - CV_IMWRITE_JPEG_PROGRESSIVE =2, - CV_IMWRITE_JPEG_OPTIMIZE =3, - CV_IMWRITE_PNG_COMPRESSION =16, - CV_IMWRITE_PNG_STRATEGY =17, - CV_IMWRITE_PNG_BILEVEL =18, - CV_IMWRITE_PNG_STRATEGY_DEFAULT =0, - CV_IMWRITE_PNG_STRATEGY_FILTERED =1, - CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2, - CV_IMWRITE_PNG_STRATEGY_RLE =3, - CV_IMWRITE_PNG_STRATEGY_FIXED =4, - CV_IMWRITE_PXM_BINARY =32, - CV_IMWRITE_WEBP_QUALITY =64 -}; - -/* save image to file */ -CVAPI(int) cvSaveImage( const char* filename, const CvArr* image, - const int* params CV_DEFAULT(0) ); - -/* decode image stored in the buffer */ -CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); -CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); - -/* encode image and store the result as a byte vector (single-row 8uC1 matrix) */ -CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image, - const int* params CV_DEFAULT(0) ); - -enum -{ - CV_CVTIMG_FLIP =1, - CV_CVTIMG_SWAP_RB =2 -}; - -/* utility function: convert one image to another with optional vertical flip */ -CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0)); - /* wait for key event infinitely (delay<=0) or for "delay" milliseconds */ CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0)); diff --git a/modules/highgui/perf/perf_precomp.hpp b/modules/highgui/perf/perf_precomp.hpp index faf34617e3..a5286691f6 100644 --- a/modules/highgui/perf/perf_precomp.hpp +++ b/modules/highgui/perf/perf_precomp.hpp @@ -10,6 +10,7 @@ #define __OPENCV_PERF_PRECOMP_HPP__ #include "opencv2/ts.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index bb4ed8ede5..7f78c7d05b 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -48,6 +48,7 @@ #include "opencv2/core/private.hpp" #include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/imgcodecs/imgcodecs_c.h" #include "opencv2/highgui/highgui_c.h" #include diff --git a/modules/highgui/test/test_precomp.hpp b/modules/highgui/test/test_precomp.hpp index 826d165749..9e14123d32 100644 --- a/modules/highgui/test/test_precomp.hpp +++ b/modules/highgui/test/test_precomp.hpp @@ -12,6 +12,7 @@ #include #include "opencv2/ts.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc/imgproc_c.h" diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt new file mode 100644 index 0000000000..8cf60e5469 --- /dev/null +++ b/modules/imgcodecs/CMakeLists.txt @@ -0,0 +1,131 @@ +set(the_description "Image codecs") +ocv_add_module(imgcodecs opencv_imgproc) + +# ---------------------------------------------------------------------------- +# CMake file for imgcodecs. See root CMakeLists.txt +# Some parts taken from version of Hartmut Seichter, HIT Lab NZ. +# Jose Luis Blanco, 2008 +# ---------------------------------------------------------------------------- + +ocv_clear_vars(GRFMT_LIBS) + +if(HAVE_WINRT_CX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") +endif() + +if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR) + ocv_include_directories(${ZLIB_INCLUDE_DIRS}) + list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES}) +endif() + +if(HAVE_JPEG) + ocv_include_directories(${JPEG_INCLUDE_DIR}) + list(APPEND GRFMT_LIBS ${JPEG_LIBRARIES}) +endif() + +if(WITH_WEBP) + add_definitions(-DHAVE_WEBP) + ocv_include_directories(${WEBP_INCLUDE_DIR}) + list(APPEND GRFMT_LIBS ${WEBP_LIBRARIES}) +endif() + +if(HAVE_PNG) + add_definitions(${PNG_DEFINITIONS}) + ocv_include_directories(${PNG_INCLUDE_DIR}) + list(APPEND GRFMT_LIBS ${PNG_LIBRARIES}) +endif() + +if(HAVE_TIFF) + ocv_include_directories(${TIFF_INCLUDE_DIR}) + list(APPEND GRFMT_LIBS ${TIFF_LIBRARIES}) +endif() + +if(HAVE_JASPER) + ocv_include_directories(${JASPER_INCLUDE_DIR}) + list(APPEND GRFMT_LIBS ${JASPER_LIBRARIES}) +endif() + +if(HAVE_OPENEXR) + include_directories(SYSTEM ${OPENEXR_INCLUDE_PATHS}) + list(APPEND GRFMT_LIBS ${OPENEXR_LIBRARIES}) +endif() + +file(GLOB grfmt_hdrs src/grfmt*.hpp) +file(GLOB grfmt_srcs src/grfmt*.cpp) +list(APPEND grfmt_hdrs src/bitstrm.hpp) +list(APPEND grfmt_srcs src/bitstrm.cpp) +list(APPEND grfmt_hdrs src/rgbe.hpp) +list(APPEND grfmt_srcs src/rgbe.cpp) + +source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs}) + +set(imgcodecs_hdrs + src/precomp.hpp + src/utils.hpp + ) + +set(imgcodecs_srcs + src/loadsave.cpp + src/utils.cpp + ) + +file(GLOB imgcodecs_ext_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h") + +if(IOS) + add_definitions(-DHAVE_IOS=1) + list(APPEND imgcodecs_srcs src/ios_conversions.mm) + list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework CoreImage" "-framework QuartzCore" "-framework AssetsLibrary") +endif() + +if(UNIX) + #these variables are set by CHECK_MODULE macro + foreach(P ${IMGCODECS_INCLUDE_DIRS}) + ocv_include_directories(${P}) + endforeach() + + foreach(P ${IMGCODECS_LIBRARY_DIRS}) + link_directories(${P}) + endforeach() +endif() + +source_group("Src" FILES ${imgcodecs_srcs} ${imgcodecs_hdrs}) +source_group("Include" FILES ${imgcodecs_ext_hdrs}) +ocv_set_module_sources(HEADERS ${imgcodecs_ext_hdrs} SOURCES ${imgcodecs_srcs} ${imgcodecs_hdrs} ${grfmt_srcs} ${grfmt_hdrs}) +ocv_module_include_directories() + +ocv_create_module(${GRFMT_LIBS} ${IMGCODECS_LIBRARIES}) + +if(APPLE) + ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS) + if(HAVE_OBJC_EXCEPTIONS) + foreach(source ${OPENCV_MODULE_${the_module}_SOURCES}) + if("${source}" MATCHES "\\.mm$") + get_source_file_property(flags "${source}" COMPILE_FLAGS) + if(flags) + set(flags "${_flags} -fobjc-exceptions") + else() + set(flags "-fobjc-exceptions") + endif() + + set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}") + endif() + endforeach() + endif() +endif() + +if(BUILD_SHARED_LIBS) + add_definitions(-DIMGCODECS_EXPORTS) +endif() + +if(MSVC) + set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG") +endif() + +#stop automatic dependencies propagation for this module +set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "") + +ocv_add_precompiled_headers(${the_module}) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations) + +ocv_add_accuracy_tests() +ocv_add_perf_tests() diff --git a/modules/imgcodecs/doc/imgcodecs.rst b/modules/imgcodecs/doc/imgcodecs.rst new file mode 100644 index 0000000000..bcb3131f56 --- /dev/null +++ b/modules/imgcodecs/doc/imgcodecs.rst @@ -0,0 +1,10 @@ +***************************************** +imgcodecs. Image file reading and writing +***************************************** + +This module of the OpenCV help you read and write images to/from disk or memory. + +.. toctree:: + :maxdepth: 2 + + reading_and_writing_images diff --git a/modules/imgcodecs/doc/reading_and_writing_images.rst b/modules/imgcodecs/doc/reading_and_writing_images.rst new file mode 100644 index 0000000000..9f8dcaafef --- /dev/null +++ b/modules/imgcodecs/doc/reading_and_writing_images.rst @@ -0,0 +1,187 @@ +Reading and Writing Images +========================== + +.. highlight:: cpp + +imdecode +-------- +Reads an image from a buffer in memory. + +.. ocv:function:: Mat imdecode( InputArray buf, int flags ) + +.. ocv:function:: Mat imdecode( InputArray buf, int flags, Mat* dst ) + +.. ocv:cfunction:: IplImage* cvDecodeImage( const CvMat* buf, int iscolor=CV_LOAD_IMAGE_COLOR) + +.. ocv:cfunction:: CvMat* cvDecodeImageM( const CvMat* buf, int iscolor=CV_LOAD_IMAGE_COLOR) + +.. ocv:pyfunction:: cv2.imdecode(buf, flags) -> retval + + :param buf: Input array or vector of bytes. + + :param flags: The same flags as in :ocv:func:`imread` . + + :param dst: The optional output placeholder for the decoded matrix. It can save the image reallocations when the function is called repeatedly for images of the same size. + +The function reads an image from the specified buffer in the memory. +If the buffer is too short or contains invalid data, the empty matrix/image is returned. + +See +:ocv:func:`imread` for the list of supported formats and flags description. + +.. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order. + +imencode +-------- +Encodes an image into a memory buffer. + +.. ocv:function:: bool imencode( const String& ext, InputArray img, vector& buf, const vector& params=vector()) + +.. ocv:cfunction:: CvMat* cvEncodeImage( const char* ext, const CvArr* image, const int* params=0 ) + +.. ocv:pyfunction:: cv2.imencode(ext, img[, params]) -> retval, buf + + :param ext: File extension that defines the output format. + + :param img: Image to be written. + + :param buf: Output buffer resized to fit the compressed image. + + :param params: Format-specific parameters. See :ocv:func:`imwrite` . + +The function compresses the image and stores it in the memory buffer that is resized to fit the result. +See +:ocv:func:`imwrite` for the list of supported formats and flags description. + +.. note:: ``cvEncodeImage`` returns single-row matrix of type ``CV_8UC1`` that contains encoded image as array of bytes. + +imread +------ +Loads an image from a file. + +.. ocv:function:: Mat imread( const String& filename, int flags=IMREAD_COLOR ) + +.. ocv:pyfunction:: cv2.imread(filename[, flags]) -> retval + +.. ocv:cfunction:: IplImage* cvLoadImage( const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR ) + +.. ocv:cfunction:: CvMat* cvLoadImageM( const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR ) + + :param filename: Name of file to be loaded. + + :param flags: Flags specifying the color type of a loaded image: + + * CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. + + * CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one + + * CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one + + * **>0** Return a 3-channel color image. + .. note:: In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel. + + * **=0** Return a grayscale image. + + * **<0** Return the loaded image as is (with alpha channel). + +The function ``imread`` loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix ( ``Mat::data==NULL`` ). Currently, the following file formats are supported: + + * Windows bitmaps - ``*.bmp, *.dib`` (always supported) + + * JPEG files - ``*.jpeg, *.jpg, *.jpe`` (see the *Notes* section) + + * JPEG 2000 files - ``*.jp2`` (see the *Notes* section) + + * Portable Network Graphics - ``*.png`` (see the *Notes* section) + + * WebP - ``*.webp`` (see the *Notes* section) + + * Portable image format - ``*.pbm, *.pgm, *.ppm`` (always supported) + + * Sun rasters - ``*.sr, *.ras`` (always supported) + + * TIFF files - ``*.tiff, *.tif`` (see the *Notes* section) + +.. note:: + + * The function determines the type of an image by the content, not by the file extension. + + * On Microsoft Windows* OS and MacOSX*, the codecs shipped with an OpenCV image (libjpeg, libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware that currently these native image loaders give images with different pixel values because of the color management embedded into MacOSX. + + * On Linux*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for codecs supplied with an OS image. Install the relevant packages (do not forget the development files, for example, "libjpeg-dev", in Debian* and Ubuntu*) to get the codec support or turn on the ``OPENCV_BUILD_3RDPARTY_LIBS`` flag in CMake. + +.. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order. + +imwrite +----------- +Saves an image to a specified file. + +.. ocv:function:: bool imwrite( const String& filename, InputArray img, const vector& params=vector() ) + +.. ocv:pyfunction:: cv2.imwrite(filename, img[, params]) -> retval + +.. ocv:cfunction:: int cvSaveImage( const char* filename, const CvArr* image, const int* params=0 ) + + :param filename: Name of the file. + + :param image: Image to be saved. + + :param params: Format-specific save parameters encoded as pairs ``paramId_1, paramValue_1, paramId_2, paramValue_2, ...`` . The following parameters are currently supported: + + * For JPEG, it can be a quality ( ``CV_IMWRITE_JPEG_QUALITY`` ) from 0 to 100 (the higher is the better). Default value is 95. + + * For WEBP, it can be a quality ( CV_IMWRITE_WEBP_QUALITY ) from 1 to 100 (the higher is the better). + By default (without any parameter) and for quality above 100 the lossless compression is used. + + * For PNG, it can be the compression level ( ``CV_IMWRITE_PNG_COMPRESSION`` ) from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3. + + * For PPM, PGM, or PBM, it can be a binary format flag ( ``CV_IMWRITE_PXM_BINARY`` ), 0 or 1. Default value is 1. + +The function ``imwrite`` saves the image to the specified file. The image format is chosen based on the ``filename`` extension (see +:ocv:func:`imread` for the list of extensions). Only 8-bit (or 16-bit unsigned (``CV_16U``) in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function. If the format, depth or channel order is different, use +:ocv:func:`Mat::convertTo` , and +:ocv:func:`cvtColor` to convert it before saving. Or, use the universal :ocv:class:`FileStorage` I/O functions to save the image to XML or YAML format. + +It is possible to store PNG images with an alpha channel using this function. To do this, create 8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535. The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom compression parameters :: + + #include + #include + #include + + using namespace cv; + using namespace std; + + void createAlphaMat(Mat &mat) + { + for (int i = 0; i < mat.rows; ++i) { + for (int j = 0; j < mat.cols; ++j) { + Vec4b& rgba = mat.at(i, j); + rgba[0] = UCHAR_MAX; + rgba[1] = saturate_cast((float (mat.cols - j)) / ((float)mat.cols) * UCHAR_MAX); + rgba[2] = saturate_cast((float (mat.rows - i)) / ((float)mat.rows) * UCHAR_MAX); + rgba[3] = saturate_cast(0.5 * (rgba[1] + rgba[2])); + } + } + } + + int main(int argv, char **argc) + { + // Create mat with alpha channel + Mat mat(480, 640, CV_8UC4); + createAlphaMat(mat); + + vector compression_params; + compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION); + compression_params.push_back(9); + + try { + imwrite("alpha.png", mat, compression_params); + } + catch (runtime_error& ex) { + fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what()); + return 1; + } + + fprintf(stdout, "Saved PNG file with alpha data.\n"); + return 0; + } diff --git a/modules/imgcodecs/include/opencv2/imgcodecs.hpp b/modules/imgcodecs/include/opencv2/imgcodecs.hpp new file mode 100644 index 0000000000..81f8a45f65 --- /dev/null +++ b/modules/imgcodecs/include/opencv2/imgcodecs.hpp @@ -0,0 +1,91 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +// Copyright (C) 2009, Willow Garage Inc., all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_IMGCODECS_HPP__ +#define __OPENCV_IMGCODECS_HPP__ + +#include "opencv2/core.hpp" + +//////////////////////////////// image codec //////////////////////////////// +namespace cv +{ + +enum { IMREAD_UNCHANGED = -1, // 8bit, color or not + IMREAD_GRAYSCALE = 0, // 8bit, gray + IMREAD_COLOR = 1, // ?, color + IMREAD_ANYDEPTH = 2, // any depth, ? + IMREAD_ANYCOLOR = 4 // ?, any color + }; + +enum { IMWRITE_JPEG_QUALITY = 1, + IMWRITE_JPEG_PROGRESSIVE = 2, + IMWRITE_JPEG_OPTIMIZE = 3, + IMWRITE_PNG_COMPRESSION = 16, + IMWRITE_PNG_STRATEGY = 17, + IMWRITE_PNG_BILEVEL = 18, + IMWRITE_PXM_BINARY = 32, + IMWRITE_WEBP_QUALITY = 64 + }; + +enum { IMWRITE_PNG_STRATEGY_DEFAULT = 0, + IMWRITE_PNG_STRATEGY_FILTERED = 1, + IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, + IMWRITE_PNG_STRATEGY_RLE = 3, + IMWRITE_PNG_STRATEGY_FIXED = 4 + }; + +CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR ); + +CV_EXPORTS_W bool imwrite( const String& filename, InputArray img, + const std::vector& params = std::vector()); + +CV_EXPORTS_W Mat imdecode( InputArray buf, int flags ); + +CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst); + +CV_EXPORTS_W bool imencode( const String& ext, InputArray img, + CV_OUT std::vector& buf, + const std::vector& params = std::vector()); + +} // cv + +#endif //__OPENCV_IMGCODECS_HPP__ diff --git a/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs.hpp b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs.hpp new file mode 100644 index 0000000000..a3cd232645 --- /dev/null +++ b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs.hpp @@ -0,0 +1,48 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +// Copyright (C) 2009, Willow Garage Inc., all rights reserved. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/imgcodecs.hpp" diff --git a/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h new file mode 100644 index 0000000000..81566eb659 --- /dev/null +++ b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h @@ -0,0 +1,117 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// Intel License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of Intel Corporation may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_IMGCODECS_H__ +#define __OPENCV_IMGCODECS_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +enum +{ +/* 8bit, color or not */ + CV_LOAD_IMAGE_UNCHANGED =-1, +/* 8bit, gray */ + CV_LOAD_IMAGE_GRAYSCALE =0, +/* ?, color */ + CV_LOAD_IMAGE_COLOR =1, +/* any depth, ? */ + CV_LOAD_IMAGE_ANYDEPTH =2, +/* ?, any color */ + CV_LOAD_IMAGE_ANYCOLOR =4 +}; + +/* load image from file + iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED + overrides the other flags + using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED + unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit +*/ +CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); +CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); + +enum +{ + CV_IMWRITE_JPEG_QUALITY =1, + CV_IMWRITE_JPEG_PROGRESSIVE =2, + CV_IMWRITE_JPEG_OPTIMIZE =3, + CV_IMWRITE_PNG_COMPRESSION =16, + CV_IMWRITE_PNG_STRATEGY =17, + CV_IMWRITE_PNG_BILEVEL =18, + CV_IMWRITE_PNG_STRATEGY_DEFAULT =0, + CV_IMWRITE_PNG_STRATEGY_FILTERED =1, + CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2, + CV_IMWRITE_PNG_STRATEGY_RLE =3, + CV_IMWRITE_PNG_STRATEGY_FIXED =4, + CV_IMWRITE_PXM_BINARY =32, + CV_IMWRITE_WEBP_QUALITY =64 +}; + +/* save image to file */ +CVAPI(int) cvSaveImage( const char* filename, const CvArr* image, + const int* params CV_DEFAULT(0) ); + +/* decode image stored in the buffer */ +CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); +CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); + +/* encode image and store the result as a byte vector (single-row 8uC1 matrix) */ +CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image, + const int* params CV_DEFAULT(0) ); + +enum +{ + CV_CVTIMG_FLIP =1, + CV_CVTIMG_SWAP_RB =2 +}; + +/* utility function: convert one image to another with optional vertical flip */ +CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0)); + + +#ifdef __cplusplus +} +#endif + +#endif // __OPENCV_IMGCODECS_H__ diff --git a/modules/imgcodecs/include/opencv2/imgcodecs/ios.h b/modules/imgcodecs/include/opencv2/imgcodecs/ios.h new file mode 100644 index 0000000000..d7ba6e67c2 --- /dev/null +++ b/modules/imgcodecs/include/opencv2/imgcodecs/ios.h @@ -0,0 +1,48 @@ + +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +// Copyright (C) 2009, Willow Garage Inc., all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "opencv2/core/core.hpp" + +UIImage* MatToUIImage(const cv::Mat& image); +void UIImageToMat(const UIImage* image, + cv::Mat& m, bool alphaExist = false); diff --git a/modules/imgcodecs/perf/perf_main.cpp b/modules/imgcodecs/perf/perf_main.cpp new file mode 100644 index 0000000000..ebe94ab7cc --- /dev/null +++ b/modules/imgcodecs/perf/perf_main.cpp @@ -0,0 +1,3 @@ +#include "perf_precomp.hpp" + +CV_PERF_TEST_MAIN(highgui) diff --git a/modules/imgcodecs/perf/perf_precomp.hpp b/modules/imgcodecs/perf/perf_precomp.hpp new file mode 100644 index 0000000000..e6e34b40c6 --- /dev/null +++ b/modules/imgcodecs/perf/perf_precomp.hpp @@ -0,0 +1,19 @@ +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-declarations" +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic ignored "-Wmissing-prototypes" +# pragma GCC diagnostic ignored "-Wextra" +# endif +#endif + +#ifndef __OPENCV_PERF_PRECOMP_HPP__ +#define __OPENCV_PERF_PRECOMP_HPP__ + +#include "opencv2/ts.hpp" +#include "opencv2/imgcodecs.hpp" + +#ifdef GTEST_CREATE_SHARED_LIBRARY +#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined +#endif + +#endif diff --git a/modules/highgui/src/bitstrm.cpp b/modules/imgcodecs/src/bitstrm.cpp similarity index 100% rename from modules/highgui/src/bitstrm.cpp rename to modules/imgcodecs/src/bitstrm.cpp diff --git a/modules/highgui/src/bitstrm.hpp b/modules/imgcodecs/src/bitstrm.hpp similarity index 100% rename from modules/highgui/src/bitstrm.hpp rename to modules/imgcodecs/src/bitstrm.hpp diff --git a/modules/highgui/src/grfmt_base.cpp b/modules/imgcodecs/src/grfmt_base.cpp similarity index 100% rename from modules/highgui/src/grfmt_base.cpp rename to modules/imgcodecs/src/grfmt_base.cpp diff --git a/modules/highgui/src/grfmt_base.hpp b/modules/imgcodecs/src/grfmt_base.hpp similarity index 100% rename from modules/highgui/src/grfmt_base.hpp rename to modules/imgcodecs/src/grfmt_base.hpp diff --git a/modules/highgui/src/grfmt_bmp.cpp b/modules/imgcodecs/src/grfmt_bmp.cpp similarity index 100% rename from modules/highgui/src/grfmt_bmp.cpp rename to modules/imgcodecs/src/grfmt_bmp.cpp diff --git a/modules/highgui/src/grfmt_bmp.hpp b/modules/imgcodecs/src/grfmt_bmp.hpp similarity index 100% rename from modules/highgui/src/grfmt_bmp.hpp rename to modules/imgcodecs/src/grfmt_bmp.hpp diff --git a/modules/highgui/src/grfmt_exr.cpp b/modules/imgcodecs/src/grfmt_exr.cpp similarity index 100% rename from modules/highgui/src/grfmt_exr.cpp rename to modules/imgcodecs/src/grfmt_exr.cpp diff --git a/modules/highgui/src/grfmt_exr.hpp b/modules/imgcodecs/src/grfmt_exr.hpp similarity index 100% rename from modules/highgui/src/grfmt_exr.hpp rename to modules/imgcodecs/src/grfmt_exr.hpp diff --git a/modules/highgui/src/grfmt_hdr.cpp b/modules/imgcodecs/src/grfmt_hdr.cpp similarity index 100% rename from modules/highgui/src/grfmt_hdr.cpp rename to modules/imgcodecs/src/grfmt_hdr.cpp diff --git a/modules/highgui/src/grfmt_hdr.hpp b/modules/imgcodecs/src/grfmt_hdr.hpp similarity index 100% rename from modules/highgui/src/grfmt_hdr.hpp rename to modules/imgcodecs/src/grfmt_hdr.hpp diff --git a/modules/highgui/src/grfmt_jpeg.cpp b/modules/imgcodecs/src/grfmt_jpeg.cpp similarity index 100% rename from modules/highgui/src/grfmt_jpeg.cpp rename to modules/imgcodecs/src/grfmt_jpeg.cpp diff --git a/modules/highgui/src/grfmt_jpeg.hpp b/modules/imgcodecs/src/grfmt_jpeg.hpp similarity index 100% rename from modules/highgui/src/grfmt_jpeg.hpp rename to modules/imgcodecs/src/grfmt_jpeg.hpp diff --git a/modules/highgui/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp similarity index 100% rename from modules/highgui/src/grfmt_jpeg2000.cpp rename to modules/imgcodecs/src/grfmt_jpeg2000.cpp diff --git a/modules/highgui/src/grfmt_jpeg2000.hpp b/modules/imgcodecs/src/grfmt_jpeg2000.hpp similarity index 100% rename from modules/highgui/src/grfmt_jpeg2000.hpp rename to modules/imgcodecs/src/grfmt_jpeg2000.hpp diff --git a/modules/highgui/src/grfmt_png.cpp b/modules/imgcodecs/src/grfmt_png.cpp similarity index 100% rename from modules/highgui/src/grfmt_png.cpp rename to modules/imgcodecs/src/grfmt_png.cpp diff --git a/modules/highgui/src/grfmt_png.hpp b/modules/imgcodecs/src/grfmt_png.hpp similarity index 100% rename from modules/highgui/src/grfmt_png.hpp rename to modules/imgcodecs/src/grfmt_png.hpp diff --git a/modules/highgui/src/grfmt_pxm.cpp b/modules/imgcodecs/src/grfmt_pxm.cpp similarity index 100% rename from modules/highgui/src/grfmt_pxm.cpp rename to modules/imgcodecs/src/grfmt_pxm.cpp diff --git a/modules/highgui/src/grfmt_pxm.hpp b/modules/imgcodecs/src/grfmt_pxm.hpp similarity index 100% rename from modules/highgui/src/grfmt_pxm.hpp rename to modules/imgcodecs/src/grfmt_pxm.hpp diff --git a/modules/highgui/src/grfmt_sunras.cpp b/modules/imgcodecs/src/grfmt_sunras.cpp similarity index 100% rename from modules/highgui/src/grfmt_sunras.cpp rename to modules/imgcodecs/src/grfmt_sunras.cpp diff --git a/modules/highgui/src/grfmt_sunras.hpp b/modules/imgcodecs/src/grfmt_sunras.hpp similarity index 100% rename from modules/highgui/src/grfmt_sunras.hpp rename to modules/imgcodecs/src/grfmt_sunras.hpp diff --git a/modules/highgui/src/grfmt_tiff.cpp b/modules/imgcodecs/src/grfmt_tiff.cpp similarity index 100% rename from modules/highgui/src/grfmt_tiff.cpp rename to modules/imgcodecs/src/grfmt_tiff.cpp diff --git a/modules/highgui/src/grfmt_tiff.hpp b/modules/imgcodecs/src/grfmt_tiff.hpp similarity index 100% rename from modules/highgui/src/grfmt_tiff.hpp rename to modules/imgcodecs/src/grfmt_tiff.hpp diff --git a/modules/highgui/src/grfmt_webp.cpp b/modules/imgcodecs/src/grfmt_webp.cpp similarity index 100% rename from modules/highgui/src/grfmt_webp.cpp rename to modules/imgcodecs/src/grfmt_webp.cpp diff --git a/modules/highgui/src/grfmt_webp.hpp b/modules/imgcodecs/src/grfmt_webp.hpp similarity index 100% rename from modules/highgui/src/grfmt_webp.hpp rename to modules/imgcodecs/src/grfmt_webp.hpp diff --git a/modules/highgui/src/grfmts.hpp b/modules/imgcodecs/src/grfmts.hpp similarity index 100% rename from modules/highgui/src/grfmts.hpp rename to modules/imgcodecs/src/grfmts.hpp diff --git a/modules/highgui/src/ios_conversions.mm b/modules/imgcodecs/src/ios_conversions.mm similarity index 100% rename from modules/highgui/src/ios_conversions.mm rename to modules/imgcodecs/src/ios_conversions.mm diff --git a/modules/highgui/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp similarity index 100% rename from modules/highgui/src/loadsave.cpp rename to modules/imgcodecs/src/loadsave.cpp diff --git a/modules/imgcodecs/src/precomp.hpp b/modules/imgcodecs/src/precomp.hpp new file mode 100644 index 0000000000..88959a036f --- /dev/null +++ b/modules/imgcodecs/src/precomp.hpp @@ -0,0 +1,87 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// Intel License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of Intel Corporation may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __IMGCODECS_H_ +#define __IMGCODECS_H_ + +#include "opencv2/imgcodecs.hpp" + +#include "opencv2/core/utility.hpp" +#include "opencv2/core/private.hpp" + +#include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/imgcodecs/imgcodecs_c.h" + +#include +#include +#include +#include +#include +#include + +#if defined WIN32 || defined WINCE + #if !defined _WIN32_WINNT + #ifdef HAVE_MSMF + #define _WIN32_WINNT 0x0600 // Windows Vista + #else + #define _WIN32_WINNT 0x0500 // Windows 2000 + #endif + #endif + + #include + #undef small + #undef min + #undef max + #undef abs +#endif + +#ifdef HAVE_TEGRA_OPTIMIZATION +#include "opencv2/imgcodecs/imgcodecs_tegra.hpp" +#endif + +#define __BEGIN__ __CV_BEGIN__ +#define __END__ __CV_END__ +#define EXIT __CV_EXIT__ + +CVAPI(int) cvHaveImageReader(const char* filename); +CVAPI(int) cvHaveImageWriter(const char* filename); + +#endif /* __HIGHGUI_H_ */ diff --git a/modules/highgui/src/rgbe.cpp b/modules/imgcodecs/src/rgbe.cpp similarity index 100% rename from modules/highgui/src/rgbe.cpp rename to modules/imgcodecs/src/rgbe.cpp diff --git a/modules/highgui/src/rgbe.hpp b/modules/imgcodecs/src/rgbe.hpp similarity index 100% rename from modules/highgui/src/rgbe.hpp rename to modules/imgcodecs/src/rgbe.hpp diff --git a/modules/highgui/src/utils.cpp b/modules/imgcodecs/src/utils.cpp similarity index 100% rename from modules/highgui/src/utils.cpp rename to modules/imgcodecs/src/utils.cpp diff --git a/modules/highgui/src/utils.hpp b/modules/imgcodecs/src/utils.hpp similarity index 100% rename from modules/highgui/src/utils.hpp rename to modules/imgcodecs/src/utils.hpp diff --git a/modules/highgui/test/test_drawing.cpp b/modules/imgcodecs/test/test_drawing.cpp similarity index 99% rename from modules/highgui/test/test_drawing.cpp rename to modules/imgcodecs/test/test_drawing.cpp index 9d9e17dde2..7621ccf983 100644 --- a/modules/highgui/test/test_drawing.cpp +++ b/modules/imgcodecs/test/test_drawing.cpp @@ -41,7 +41,6 @@ //M*/ #include "test_precomp.hpp" -#include "opencv2/highgui.hpp" using namespace std; using namespace cv; diff --git a/modules/highgui/test/test_grfmt.cpp b/modules/imgcodecs/test/test_grfmt.cpp similarity index 99% rename from modules/highgui/test/test_grfmt.cpp rename to modules/imgcodecs/test/test_grfmt.cpp index e4d3e70461..02851a0da6 100644 --- a/modules/highgui/test/test_grfmt.cpp +++ b/modules/imgcodecs/test/test_grfmt.cpp @@ -41,7 +41,6 @@ //M*/ #include "test_precomp.hpp" -#include "opencv2/highgui.hpp" using namespace cv; using namespace std; diff --git a/modules/imgcodecs/test/test_main.cpp b/modules/imgcodecs/test/test_main.cpp new file mode 100644 index 0000000000..461e7fac7f --- /dev/null +++ b/modules/imgcodecs/test/test_main.cpp @@ -0,0 +1,3 @@ +#include "test_precomp.hpp" + +CV_TEST_MAIN("imgcodecs") diff --git a/modules/imgcodecs/test/test_precomp.hpp b/modules/imgcodecs/test/test_precomp.hpp new file mode 100644 index 0000000000..2aed614337 --- /dev/null +++ b/modules/imgcodecs/test/test_precomp.hpp @@ -0,0 +1,20 @@ +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-declarations" +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic ignored "-Wmissing-prototypes" +# pragma GCC diagnostic ignored "-Wextra" +# endif +#endif + +#ifndef __OPENCV_TEST_PRECOMP_HPP__ +#define __OPENCV_TEST_PRECOMP_HPP__ + +#include +#include "opencv2/ts.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" +#include "opencv2/imgproc/imgproc_c.h" + +#include "opencv2/core/private.hpp" + +#endif diff --git a/modules/imgproc/perf/perf_precomp.hpp b/modules/imgproc/perf/perf_precomp.hpp index 19f62712c1..5bede78db8 100644 --- a/modules/imgproc/perf/perf_precomp.hpp +++ b/modules/imgproc/perf/perf_precomp.hpp @@ -11,7 +11,7 @@ #include "opencv2/ts.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined diff --git a/modules/imgproc/test/test_precomp.hpp b/modules/imgproc/test/test_precomp.hpp index 53f315ee4f..249ec8d629 100644 --- a/modules/imgproc/test/test_precomp.hpp +++ b/modules/imgproc/test/test_precomp.hpp @@ -13,7 +13,7 @@ #include "opencv2/ts.hpp" #include "opencv2/core/private.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc/imgproc_c.h" diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 1948e21141..25c9352f4e 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -6,7 +6,7 @@ if(IOS OR NOT PYTHON_EXECUTABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND OR (ANDR endif() set(the_description "The java bindings") -ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_highgui opencv_ml opencv_calib3d opencv_photo opencv_nonfree opencv_contrib) +ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_highgui opencv_ml opencv_calib3d opencv_photo opencv_nonfree opencv_contrib) ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp") if(NOT ANDROID) diff --git a/modules/java/generator/rst_parser.py b/modules/java/generator/rst_parser.py index 750d6f0be8..0fe3e5a3bd 100755 --- a/modules/java/generator/rst_parser.py +++ b/modules/java/generator/rst_parser.py @@ -2,7 +2,7 @@ from __future__ import print_function import os, sys, re, string, fnmatch -allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "softcascade", "superres"] +allmodules = ["core", "flann", "imgproc", "ml", "imgcodecs", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "softcascade", "superres"] verbose = False show_warnings = True show_errors = True diff --git a/modules/java/generator/src/java/android+Utils.java b/modules/java/generator/src/java/android+Utils.java index 9c461087c4..404c986da8 100644 --- a/modules/java/generator/src/java/android+Utils.java +++ b/modules/java/generator/src/java/android+Utils.java @@ -6,7 +6,7 @@ import android.graphics.Bitmap; import org.opencv.core.CvException; import org.opencv.core.CvType; import org.opencv.core.Mat; -import org.opencv.highgui.Highgui; +import org.opencv.imgcodecs.Imgcodecs; import java.io.ByteArrayOutputStream; import java.io.File; @@ -67,7 +67,7 @@ public class Utils { encoded.put(0, 0, os.toByteArray()); os.close(); - Mat decoded = Highgui.imdecode(encoded, flags); + Mat decoded = Imgcodecs.imdecode(encoded, flags); encoded.release(); return decoded; diff --git a/modules/nonfree/perf/perf_precomp.hpp b/modules/nonfree/perf/perf_precomp.hpp index 45478eb8a3..ed84be8e37 100644 --- a/modules/nonfree/perf/perf_precomp.hpp +++ b/modules/nonfree/perf/perf_precomp.hpp @@ -13,7 +13,7 @@ #include "opencv2/ts.hpp" #include "opencv2/nonfree.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/opencv_modules.hpp" diff --git a/modules/objdetect/test/test_precomp.hpp b/modules/objdetect/test/test_precomp.hpp index cd0fbe4987..a68dd79911 100644 --- a/modules/objdetect/test/test_precomp.hpp +++ b/modules/objdetect/test/test_precomp.hpp @@ -12,6 +12,6 @@ #include "opencv2/ts.hpp" #include "opencv2/objdetect.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #endif diff --git a/modules/optim/test/test_denoise_tvl1.cpp b/modules/optim/test/test_denoise_tvl1.cpp index 76ec2cda3e..f757a1438d 100644 --- a/modules/optim/test/test_denoise_tvl1.cpp +++ b/modules/optim/test/test_denoise_tvl1.cpp @@ -39,7 +39,6 @@ // //M*/ #include "test_precomp.hpp" -#include "opencv2/highgui.hpp" void make_noisy(const cv::Mat& img, cv::Mat& noisy, double sigma, double pepper_salt_ratio,cv::RNG& rng) { diff --git a/modules/optim/test/test_precomp.hpp b/modules/optim/test/test_precomp.hpp index 9a86cab4b5..4f633e517a 100644 --- a/modules/optim/test/test_precomp.hpp +++ b/modules/optim/test/test_precomp.hpp @@ -11,5 +11,6 @@ #include "opencv2/ts.hpp" #include "opencv2/optim.hpp" +#include "opencv2/imgcodecs.hpp" #endif diff --git a/modules/photo/perf/perf_precomp.hpp b/modules/photo/perf/perf_precomp.hpp index 1fd0c81093..8e0acf7a24 100644 --- a/modules/photo/perf/perf_precomp.hpp +++ b/modules/photo/perf/perf_precomp.hpp @@ -11,7 +11,7 @@ #include "opencv2/ts.hpp" #include "opencv2/photo.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #ifdef GTEST_CREATE_SHARED_LIBRARY #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined diff --git a/modules/photo/test/test_precomp.hpp b/modules/photo/test/test_precomp.hpp index 336e5f8424..0b18859525 100644 --- a/modules/photo/test/test_precomp.hpp +++ b/modules/photo/test/test_precomp.hpp @@ -12,7 +12,7 @@ #include #include "opencv2/ts.hpp" #include "opencv2/photo.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include #include #include diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index a50e372cc9..44f3fe5008 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -11,7 +11,7 @@ if(ANDROID OR IOS OR NOT PYTHONLIBS_FOUND OR NOT PYTHON_NUMPY_INCLUDE_DIRS) endif() set(the_description "The python bindings") -ocv_add_module(python BINDINGS opencv_core opencv_flann opencv_imgproc opencv_video opencv_ml opencv_features2d opencv_highgui opencv_calib3d opencv_photo opencv_objdetect OPTIONAL opencv_nonfree) +ocv_add_module(python BINDINGS opencv_core opencv_flann opencv_imgproc opencv_video opencv_ml opencv_features2d opencv_imgcodecs opencv_highgui opencv_calib3d opencv_photo opencv_objdetect OPTIONAL opencv_nonfree) ocv_module_include_directories( "${PYTHON_INCLUDE_PATH}" @@ -31,6 +31,7 @@ set(opencv_hdrs "${OPENCV_MODULE_opencv_video_LOCATION}/include/opencv2/video/background_segm.hpp" "${OPENCV_MODULE_opencv_video_LOCATION}/include/opencv2/video/tracking.hpp" "${OPENCV_MODULE_opencv_photo_LOCATION}/include/opencv2/photo.hpp" + "${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include/opencv2/imgcodecs.hpp" "${OPENCV_MODULE_opencv_highgui_LOCATION}/include/opencv2/highgui.hpp" "${OPENCV_MODULE_opencv_ml_LOCATION}/include/opencv2/ml.hpp" "${OPENCV_MODULE_opencv_features2d_LOCATION}/include/opencv2/features2d.hpp" diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index e2bab9e7d3..93b137b897 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -15,6 +15,7 @@ opencv_hdr_list = [ "../../video/include/opencv2/video/tracking.hpp", "../../video/include/opencv2/video/background_segm.hpp", "../../objdetect/include/opencv2/objdetect.hpp", +"../../imgcodecs/include/opencv2/imgcodecs.hpp", "../../highgui/include/opencv2/highgui.hpp" ] diff --git a/modules/shape/test/test_precomp.hpp b/modules/shape/test/test_precomp.hpp index e73248422b..819d711e85 100644 --- a/modules/shape/test/test_precomp.hpp +++ b/modules/shape/test/test_precomp.hpp @@ -13,7 +13,7 @@ #include "opencv2/ts.hpp" #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/shape.hpp" #include "opencv2/opencv_modules.hpp" diff --git a/modules/stitching/perf/perf_stich.cpp b/modules/stitching/perf/perf_stich.cpp index 1a37472e98..b64fa18984 100644 --- a/modules/stitching/perf/perf_stich.cpp +++ b/modules/stitching/perf/perf_stich.cpp @@ -1,5 +1,5 @@ #include "perf_precomp.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/flann.hpp" #include "opencv2/opencv_modules.hpp" diff --git a/modules/stitching/test/test_precomp.hpp b/modules/stitching/test/test_precomp.hpp index 60d6b3f057..0a3a709d18 100644 --- a/modules/stitching/test/test_precomp.hpp +++ b/modules/stitching/test/test_precomp.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt index 3e1b5a05ac..9bab70accc 100644 --- a/modules/ts/CMakeLists.txt +++ b/modules/ts/CMakeLists.txt @@ -9,7 +9,7 @@ set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) -ocv_add_module(ts opencv_core opencv_imgproc opencv_highgui) +ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui) ocv_glob_module_sources() ocv_module_include_directories() diff --git a/modules/ts/include/opencv2/ts/cuda_perf.hpp b/modules/ts/include/opencv2/ts/cuda_perf.hpp index 8a23857f99..e503618ca0 100644 --- a/modules/ts/include/opencv2/ts/cuda_perf.hpp +++ b/modules/ts/include/opencv2/ts/cuda_perf.hpp @@ -44,7 +44,7 @@ #define __OPENCV_CUDA_PERF_UTILITY_HPP__ #include "opencv2/core.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/ts/ts_perf.hpp" #include "cvconfig.h" diff --git a/modules/ts/include/opencv2/ts/cuda_test.hpp b/modules/ts/include/opencv2/ts/cuda_test.hpp index c433dfec7a..049021b544 100644 --- a/modules/ts/include/opencv2/ts/cuda_test.hpp +++ b/modules/ts/include/opencv2/ts/cuda_test.hpp @@ -47,6 +47,7 @@ #include "cvconfig.h" #include "opencv2/core.hpp" #include "opencv2/core/cuda.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/ts.hpp" diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp index 43c01b2dab..227fdfc049 100644 --- a/modules/ts/include/opencv2/ts/ocl_test.hpp +++ b/modules/ts/include/opencv2/ts/ocl_test.hpp @@ -46,6 +46,7 @@ #include "opencv2/ts.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/imgproc/types_c.h" diff --git a/modules/video/perf/perf_precomp.hpp b/modules/video/perf/perf_precomp.hpp index 0ea88f0da5..7d1e9d922e 100644 --- a/modules/video/perf/perf_precomp.hpp +++ b/modules/video/perf/perf_precomp.hpp @@ -12,7 +12,7 @@ #include "opencv2/ts.hpp" #include #include -#include +#include #ifdef GTEST_CREATE_SHARED_LIBRARY #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined diff --git a/modules/video/test/test_precomp.hpp b/modules/video/test/test_precomp.hpp index 0aae1031f8..96a96f88fb 100644 --- a/modules/video/test/test_precomp.hpp +++ b/modules/video/test/test_precomp.hpp @@ -13,6 +13,6 @@ #include "opencv2/ts.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/video.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #endif diff --git a/samples/android/CMakeLists.txt b/samples/android/CMakeLists.txt index 0dc4a3cd69..b82c297a67 100644 --- a/samples/android/CMakeLists.txt +++ b/samples/android/CMakeLists.txt @@ -19,9 +19,9 @@ add_subdirectory(native-activity) # hello-android sample if(HAVE_opencv_highgui) - ocv_include_modules_recurse(opencv_highgui opencv_core) + ocv_include_modules_recurse(opencv_imgcodecs opencv_highgui opencv_core) add_executable(hello-android hello-android/main.cpp) - target_link_libraries(hello-android ${OPENCV_LINKER_LIBS} opencv_highgui opencv_core) + target_link_libraries(hello-android ${OPENCV_LINKER_LIBS} opencv_imgcodecs opencv_highgui opencv_core) set_target_properties(hello-android PROPERTIES OUTPUT_NAME hello-android RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}") add_dependencies(opencv_android_examples hello-android) endif() diff --git a/samples/android/hello-android/main.cpp b/samples/android/hello-android/main.cpp index cd02e1742a..3e9f762455 100644 --- a/samples/android/hello-android/main.cpp +++ b/samples/android/hello-android/main.cpp @@ -1,4 +1,5 @@ #include +#include #include using namespace cv; diff --git a/samples/cpp/3calibration.cpp b/samples/cpp/3calibration.cpp index 55644e9db4..53254050c0 100644 --- a/samples/cpp/3calibration.cpp +++ b/samples/cpp/3calibration.cpp @@ -4,6 +4,7 @@ #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index e597c0c387..732df786b5 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ # ---------------------------------------------------------------------------- SET(OPENCV_CPP_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_flann - opencv_highgui opencv_ml opencv_video opencv_objdetect opencv_photo opencv_nonfree + opencv_imgcodecs opencv_highgui opencv_ml opencv_video opencv_objdetect opencv_photo opencv_nonfree opencv_features2d opencv_calib3d opencv_stitching opencv_videostab opencv_shape) ocv_check_dependencies(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS}) diff --git a/samples/cpp/bagofwords_classification.cpp b/samples/cpp/bagofwords_classification.cpp index 5601aa53ac..ef4f3c73c6 100644 --- a/samples/cpp/bagofwords_classification.cpp +++ b/samples/cpp/bagofwords_classification.cpp @@ -1,4 +1,5 @@ #include "opencv2/opencv_modules.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/features2d/features2d.hpp" diff --git a/samples/cpp/calibration.cpp b/samples/cpp/calibration.cpp index bb7c396b43..ffd665fa8c 100644 --- a/samples/cpp/calibration.cpp +++ b/samples/cpp/calibration.cpp @@ -2,6 +2,7 @@ #include #include "opencv2/imgproc.hpp" #include "opencv2/calib3d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/cloning_demo.cpp b/samples/cpp/cloning_demo.cpp index 24d9b7facf..be5da04bea 100644 --- a/samples/cpp/cloning_demo.cpp +++ b/samples/cpp/cloning_demo.cpp @@ -23,6 +23,7 @@ #include "opencv2/photo.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/core.hpp" #include diff --git a/samples/cpp/cloning_gui.cpp b/samples/cpp/cloning_gui.cpp index 2457b12154..db6cfcfde9 100644 --- a/samples/cpp/cloning_gui.cpp +++ b/samples/cpp/cloning_gui.cpp @@ -33,6 +33,7 @@ #include #include "opencv2/photo.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/core.hpp" #include diff --git a/samples/cpp/connected_components.cpp b/samples/cpp/connected_components.cpp index 50c677d372..32bd0dc053 100644 --- a/samples/cpp/connected_components.cpp +++ b/samples/cpp/connected_components.cpp @@ -1,5 +1,6 @@ #include #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/create_mask.cpp b/samples/cpp/create_mask.cpp index 6da64d738f..42225ebc6c 100644 --- a/samples/cpp/create_mask.cpp +++ b/samples/cpp/create_mask.cpp @@ -10,6 +10,7 @@ */ #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/core.hpp" #include diff --git a/samples/cpp/demhist.cpp b/samples/cpp/demhist.cpp index ba60115df0..033b63d82c 100644 --- a/samples/cpp/demhist.cpp +++ b/samples/cpp/demhist.cpp @@ -1,5 +1,6 @@ #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/descriptor_extractor_matcher.cpp b/samples/cpp/descriptor_extractor_matcher.cpp index fe3d4d212e..6f25ac48d7 100644 --- a/samples/cpp/descriptor_extractor_matcher.cpp +++ b/samples/cpp/descriptor_extractor_matcher.cpp @@ -1,3 +1,4 @@ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" diff --git a/samples/cpp/dft.cpp b/samples/cpp/dft.cpp index 4708defabb..c4034e896c 100644 --- a/samples/cpp/dft.cpp +++ b/samples/cpp/dft.cpp @@ -1,6 +1,7 @@ #include "opencv2/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/distrans.cpp b/samples/cpp/distrans.cpp index 706f506637..8f0ae57b55 100644 --- a/samples/cpp/distrans.cpp +++ b/samples/cpp/distrans.cpp @@ -1,5 +1,6 @@ #include #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/edge.cpp b/samples/cpp/edge.cpp index 262833c672..a4c0f5d0bb 100644 --- a/samples/cpp/edge.cpp +++ b/samples/cpp/edge.cpp @@ -1,5 +1,6 @@ #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/facedetect.cpp b/samples/cpp/facedetect.cpp index 4c5250664d..80b57b2c87 100644 --- a/samples/cpp/facedetect.cpp +++ b/samples/cpp/facedetect.cpp @@ -1,4 +1,5 @@ #include "opencv2/objdetect.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/core/utility.hpp" diff --git a/samples/cpp/ffilldemo.cpp b/samples/cpp/ffilldemo.cpp index 1cdce9bb5c..251f2a06a1 100644 --- a/samples/cpp/ffilldemo.cpp +++ b/samples/cpp/ffilldemo.cpp @@ -1,4 +1,5 @@ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/fitellipse.cpp b/samples/cpp/fitellipse.cpp index c42f8f3c3e..1e9a85857a 100644 --- a/samples/cpp/fitellipse.cpp +++ b/samples/cpp/fitellipse.cpp @@ -15,6 +15,7 @@ * ********************************************************************************/ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include using namespace cv; diff --git a/samples/cpp/grabcut.cpp b/samples/cpp/grabcut.cpp index d6cf201f4b..110e0ff770 100644 --- a/samples/cpp/grabcut.cpp +++ b/samples/cpp/grabcut.cpp @@ -1,3 +1,4 @@ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" diff --git a/samples/cpp/houghcircles.cpp b/samples/cpp/houghcircles.cpp index 12f1c57677..2a20b62a76 100644 --- a/samples/cpp/houghcircles.cpp +++ b/samples/cpp/houghcircles.cpp @@ -1,3 +1,4 @@ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" diff --git a/samples/cpp/houghlines.cpp b/samples/cpp/houghlines.cpp index 2fdabe8397..ad472a47cc 100644 --- a/samples/cpp/houghlines.cpp +++ b/samples/cpp/houghlines.cpp @@ -1,3 +1,4 @@ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" diff --git a/samples/cpp/image.cpp b/samples/cpp/image.cpp index 4d7a5715a3..f63d3b77ec 100644 --- a/samples/cpp/image.cpp +++ b/samples/cpp/image.cpp @@ -22,6 +22,7 @@ static void help() #ifdef DEMO_MIXED_API_USE # include +# include #endif int main( int argc, char** argv ) diff --git a/samples/cpp/image_alignment.cpp b/samples/cpp/image_alignment.cpp index 56e8209dd9..85fcc919de 100644 --- a/samples/cpp/image_alignment.cpp +++ b/samples/cpp/image_alignment.cpp @@ -13,6 +13,7 @@ * Authors: G. Evangelidis, INRIA, Grenoble, France * M. Asbach, Fraunhofer IAIS, St. Augustin, Germany */ +#include #include #include #include diff --git a/samples/cpp/imagelist_creator.cpp b/samples/cpp/imagelist_creator.cpp index 96114a9c4c..f2abb11c9a 100644 --- a/samples/cpp/imagelist_creator.cpp +++ b/samples/cpp/imagelist_creator.cpp @@ -2,6 +2,7 @@ */ #include "opencv2/core/core.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/inpaint.cpp b/samples/cpp/inpaint.cpp index 7690595cc2..7d17d0bf9f 100644 --- a/samples/cpp/inpaint.cpp +++ b/samples/cpp/inpaint.cpp @@ -1,3 +1,4 @@ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/photo/photo.hpp" diff --git a/samples/cpp/lsd_lines.cpp b/samples/cpp/lsd_lines.cpp index 92452a99c8..82842b2548 100644 --- a/samples/cpp/lsd_lines.cpp +++ b/samples/cpp/lsd_lines.cpp @@ -4,6 +4,7 @@ #include "opencv2/core/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace std; diff --git a/samples/cpp/morphology2.cpp b/samples/cpp/morphology2.cpp index e4ec8162c2..1bb4ec55e3 100644 --- a/samples/cpp/morphology2.cpp +++ b/samples/cpp/morphology2.cpp @@ -1,4 +1,5 @@ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/npr_demo.cpp b/samples/cpp/npr_demo.cpp index 5579ca269f..ff6a3fce60 100644 --- a/samples/cpp/npr_demo.cpp +++ b/samples/cpp/npr_demo.cpp @@ -17,6 +17,7 @@ #include #include "opencv2/photo.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/core.hpp" #include diff --git a/samples/cpp/pca.cpp b/samples/cpp/pca.cpp index d4272736c2..db5fb3802f 100644 --- a/samples/cpp/pca.cpp +++ b/samples/cpp/pca.cpp @@ -43,6 +43,7 @@ #include #include +#include "opencv2/imgcodecs.hpp" #include using namespace cv; diff --git a/samples/cpp/select3dobj.cpp b/samples/cpp/select3dobj.cpp index 32d30552f5..c0c526e178 100644 --- a/samples/cpp/select3dobj.cpp +++ b/samples/cpp/select3dobj.cpp @@ -12,6 +12,7 @@ #include #include "opencv2/imgproc.hpp" #include "opencv2/calib3d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/shape_example.cpp b/samples/cpp/shape_example.cpp index 42630033eb..42bcffdb96 100644 --- a/samples/cpp/shape_example.cpp +++ b/samples/cpp/shape_example.cpp @@ -3,6 +3,7 @@ */ #include "opencv2/shape.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include diff --git a/samples/cpp/shape_transformation.cpp b/samples/cpp/shape_transformation.cpp index 5dac0a5116..62e5554101 100644 --- a/samples/cpp/shape_transformation.cpp +++ b/samples/cpp/shape_transformation.cpp @@ -3,6 +3,7 @@ */ #include "opencv2/shape.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/features2d/features2d.hpp" diff --git a/samples/cpp/simpleflow_demo.cpp b/samples/cpp/simpleflow_demo.cpp index c9cde783da..cc84249ec6 100644 --- a/samples/cpp/simpleflow_demo.cpp +++ b/samples/cpp/simpleflow_demo.cpp @@ -1,6 +1,7 @@ #include #include "opencv2/video/tracking.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/cpp/squares.cpp b/samples/cpp/squares.cpp index 392075d79f..23d2ad0f13 100644 --- a/samples/cpp/squares.cpp +++ b/samples/cpp/squares.cpp @@ -4,6 +4,7 @@ #include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/starter_imagelist.cpp b/samples/cpp/starter_imagelist.cpp index fe89579301..a576030b95 100644 --- a/samples/cpp/starter_imagelist.cpp +++ b/samples/cpp/starter_imagelist.cpp @@ -8,6 +8,7 @@ * that was generated with imagelist_creator.cpp * easy as CV_PI right? */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/starter_video.cpp b/samples/cpp/starter_video.cpp index 1a3d5b0c9a..3cc4467a81 100644 --- a/samples/cpp/starter_video.cpp +++ b/samples/cpp/starter_video.cpp @@ -11,6 +11,7 @@ * easy as CV_PI right? */ +#include #include #include diff --git a/samples/cpp/stereo_calib.cpp b/samples/cpp/stereo_calib.cpp index a989e2a011..f042d638e5 100644 --- a/samples/cpp/stereo_calib.cpp +++ b/samples/cpp/stereo_calib.cpp @@ -23,6 +23,7 @@ ************************************************** */ #include "opencv2/calib3d/calib3d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" diff --git a/samples/cpp/stereo_match.cpp b/samples/cpp/stereo_match.cpp index 92ebc485ad..aaeea6d810 100644 --- a/samples/cpp/stereo_match.cpp +++ b/samples/cpp/stereo_match.cpp @@ -9,6 +9,7 @@ #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/core/utility.hpp" diff --git a/samples/cpp/stitching.cpp b/samples/cpp/stitching.cpp index 602edfe86e..5b4437ac9e 100644 --- a/samples/cpp/stitching.cpp +++ b/samples/cpp/stitching.cpp @@ -42,6 +42,7 @@ #include #include +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/stitching.hpp" diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp index df0a9abc84..f33f8e19bd 100644 --- a/samples/cpp/stitching_detailed.cpp +++ b/samples/cpp/stitching_detailed.cpp @@ -46,6 +46,7 @@ #include #include "opencv2/opencv_modules.hpp" #include +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/stitching/detail/autocalib.hpp" #include "opencv2/stitching/detail/blenders.hpp" diff --git a/samples/cpp/textdetection.cpp b/samples/cpp/textdetection.cpp index f1b4ce2650..8f853250fe 100644 --- a/samples/cpp/textdetection.cpp +++ b/samples/cpp/textdetection.cpp @@ -10,6 +10,7 @@ #include "opencv2/opencv.hpp" #include "opencv2/objdetect.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" diff --git a/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp b/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp index eb858a4728..475675b417 100644 --- a/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp +++ b/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp b/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp index 88c1dd4968..213850f995 100644 --- a/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp +++ b/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp @@ -5,6 +5,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; diff --git a/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp b/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp index 38a5839bb2..3edfa8c3df 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp b/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp index c9e29a4aeb..e106cb461e 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp b/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp index 86d2f2e154..ce0e911237 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp b/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp index 28181c2d31..ff7b369e2c 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp b/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp index 577c8a8b9c..766ca3bf42 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/highgui/highgui.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc/imgproc.hpp" #include #include diff --git a/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp b/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp index 424a38e93a..122e19bebc 100644 --- a/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp +++ b/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp b/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp index 4e974275c6..c32a6a6fd6 100644 --- a/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp +++ b/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp b/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp index fee56bf0c2..9ffe1563de 100644 --- a/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp +++ b/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp b/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp index 13a96a1f51..6d4e6eba55 100644 --- a/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp index a963bf83e6..96eb26ee0a 100644 --- a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp b/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp index fc98d1c21a..4751a5b53f 100644 --- a/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp b/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp index 8513bcf76a..238f921e92 100644 --- a/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp @@ -7,6 +7,7 @@ #include #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/features2d/features2d.hpp" diff --git a/samples/cpp/tutorial_code/ImgProc/Threshold.cpp b/samples/cpp/tutorial_code/ImgProc/Threshold.cpp index 96d5686a8d..0944f6cd3b 100644 --- a/samples/cpp/tutorial_code/ImgProc/Threshold.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Threshold.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp index 7851c9f58b..f5611b01f6 100644 --- a/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp index 0a2a2f5fa4..00184a3f87 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp index 29648ceca5..5fc36a2f7f 100644 --- a/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp index 6400c43794..2d9b7b6454 100644 --- a/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp index f6dff102d8..b6ccdf5a4c 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp index 86b6a2cb60..49727e9cf0 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp @@ -4,6 +4,7 @@ * @author Ana Huaman */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp index f8c97c4117..2647a4d049 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp b/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp index 0a441ccdfc..17cffc0c05 100644 --- a/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp b/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp index 86db4d8ed4..cf1577f917 100644 --- a/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp @@ -5,6 +5,7 @@ */ #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp index 5eb2d92a7e..cd29b1c2e7 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp index d481d03898..a9c22e60fc 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp index e1f44712b7..c6fd379328 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp index 499eb452e2..0b354291a9 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp index 9ca230f875..c3a5cbf60a 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp b/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp index 31c7004787..c5dceab48b 100644 --- a/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp +++ b/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp @@ -3,6 +3,7 @@ * @brief Demo code for detecting corners using OpenCV built-in functions * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp b/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp index e048f057b2..4314a97e26 100644 --- a/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp +++ b/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp b/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp index 5957a95d6d..775e566ce7 100644 --- a/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp +++ b/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp b/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp index b45d60a083..cff59f5390 100644 --- a/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp +++ b/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp @@ -4,6 +4,7 @@ * @author OpenCV team */ +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include diff --git a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp index 13fde6f857..4cd9a85d84 100644 --- a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp +++ b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp @@ -7,6 +7,7 @@ #include #include #include +#include "opencv2/imgcodecs.hpp" #include #ifndef _CRT_SECURE_NO_WARNINGS diff --git a/samples/cpp/tutorial_code/calib3d/stereoBM/SBM_Sample.cpp b/samples/cpp/tutorial_code/calib3d/stereoBM/SBM_Sample.cpp index 64c650bb82..f4493bb56c 100644 --- a/samples/cpp/tutorial_code/calib3d/stereoBM/SBM_Sample.cpp +++ b/samples/cpp/tutorial_code/calib3d/stereoBM/SBM_Sample.cpp @@ -8,6 +8,7 @@ #include #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/core/core.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; diff --git a/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp b/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp index de7a32ca6b..581a968246 100644 --- a/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp +++ b/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp @@ -1,5 +1,6 @@ #include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include diff --git a/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp b/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp index f257d6ed6e..ca40fc76d9 100644 --- a/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp +++ b/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp @@ -1,5 +1,6 @@ #include #include +#include "opencv2/imgcodecs.hpp" #include #include #include diff --git a/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp b/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp index e13f2b6960..1b1c1bc6b3 100644 --- a/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp +++ b/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp @@ -3,6 +3,7 @@ #include #include +#include "opencv2/imgcodecs.hpp" #include #include @@ -24,6 +25,7 @@ static void help( char* progName) #ifdef DEMO_MIXED_API_USE # include +# include #endif int main( int argc, char** argv ) diff --git a/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp b/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp index dea929960c..93e22ceb65 100644 --- a/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp +++ b/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp b/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp index 7ccebcdd5f..e861a5f108 100644 --- a/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp +++ b/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp @@ -8,6 +8,7 @@ #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/features2d.hpp" diff --git a/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp b/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp index 47bc3ecfe3..f3d4df88fb 100644 --- a/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp +++ b/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp @@ -8,6 +8,7 @@ #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/nonfree/features2d.hpp" diff --git a/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp b/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp index 89b60d4baa..140136d3a6 100644 --- a/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp +++ b/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp @@ -8,6 +8,7 @@ #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/features2d.hpp" diff --git a/samples/cpp/tutorial_code/features2D/SURF_detector.cpp b/samples/cpp/tutorial_code/features2D/SURF_detector.cpp index a1288a8c85..2a14bdc079 100644 --- a/samples/cpp/tutorial_code/features2D/SURF_detector.cpp +++ b/samples/cpp/tutorial_code/features2D/SURF_detector.cpp @@ -8,6 +8,7 @@ #include #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/features2d.hpp" diff --git a/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp b/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp index 501f87c484..515f7a38b1 100644 --- a/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp +++ b/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp @@ -4,7 +4,7 @@ #include // Basic OpenCV structures #include #include // Image processing methods for the CPU -#include // Read images +#include // Read images // CUDA structures and methods #include diff --git a/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp b/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp index 847cd8f6dc..67403708a1 100644 --- a/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp +++ b/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp b/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp index 8db86d8de8..c3343fb86b 100644 --- a/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp +++ b/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp b/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp index 1c8dbd24a6..2b4a97d54d 100644 --- a/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp +++ b/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp @@ -1,4 +1,5 @@ #include +#include "opencv2/imgcodecs.hpp" #include #include diff --git a/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp b/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp index 4f6daecaa9..bfab746cdf 100644 --- a/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp +++ b/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp @@ -1,5 +1,6 @@ #include #include +#include "opencv2/imgcodecs.hpp" #include #include diff --git a/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp b/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp index aa84b15d4e..6ff6687678 100644 --- a/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp +++ b/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp @@ -1,4 +1,5 @@ #include +#include "opencv2/imgcodecs.hpp" #include #include #include diff --git a/samples/cpp/tutorial_code/video/bg_sub.cpp b/samples/cpp/tutorial_code/video/bg_sub.cpp index 24805a1edc..6faa020b80 100644 --- a/samples/cpp/tutorial_code/video/bg_sub.cpp +++ b/samples/cpp/tutorial_code/video/bg_sub.cpp @@ -5,6 +5,7 @@ */ //opencv +#include "opencv2/imgcodecs.hpp" #include #include //C diff --git a/samples/cpp/tvl1_optical_flow.cpp b/samples/cpp/tvl1_optical_flow.cpp index f5e71863c2..dee9cf6e33 100644 --- a/samples/cpp/tvl1_optical_flow.cpp +++ b/samples/cpp/tvl1_optical_flow.cpp @@ -3,6 +3,7 @@ #include #include "opencv2/video.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" using namespace cv; diff --git a/samples/cpp/ufacedetect.cpp b/samples/cpp/ufacedetect.cpp index 5e13a8211e..e7e85d5633 100644 --- a/samples/cpp/ufacedetect.cpp +++ b/samples/cpp/ufacedetect.cpp @@ -1,4 +1,5 @@ #include "opencv2/objdetect.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/core/utility.hpp" diff --git a/samples/cpp/watershed.cpp b/samples/cpp/watershed.cpp index cd47505045..e57c5aa1cf 100644 --- a/samples/cpp/watershed.cpp +++ b/samples/cpp/watershed.cpp @@ -1,5 +1,6 @@ #include #include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include diff --git a/samples/directx/CMakeLists.txt b/samples/directx/CMakeLists.txt index 0bd7de941e..97d7fc305c 100644 --- a/samples/directx/CMakeLists.txt +++ b/samples/directx/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(OPENCV_DIRECTX_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_highgui) +SET(OPENCV_DIRECTX_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui) ocv_check_dependencies(${OPENCV_DIRECTX_SAMPLES_REQUIRED_DEPS}) diff --git a/samples/directx/d3d_base.inl.hpp b/samples/directx/d3d_base.inl.hpp index 0ef5c00a00..0ba44eca15 100644 --- a/samples/directx/d3d_base.inl.hpp +++ b/samples/directx/d3d_base.inl.hpp @@ -8,6 +8,7 @@ #include "opencv2/imgproc/types_c.h" // cvtColor #include "opencv2/highgui.hpp" // imread #include "opencv2/core/directx.hpp" +#include "opencv2/imgcodecs.hpp" #include #include diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt index ca5243aa0b..87beb1bea1 100644 --- a/samples/gpu/CMakeLists.txt +++ b/samples/gpu/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(OPENCV_CUDA_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc opencv_highgui +SET(OPENCV_CUDA_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc opencv_imgcodecs opencv_highgui opencv_ml opencv_video opencv_objdetect opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_cuda opencv_nonfree opencv_softcascade opencv_superres diff --git a/samples/tapi/CMakeLists.txt b/samples/tapi/CMakeLists.txt index e1fc8552c6..25436bb710 100644 --- a/samples/tapi/CMakeLists.txt +++ b/samples/tapi/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(OPENCV_TAPI_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_video opencv_highgui opencv_objdetect opencv_features2d opencv_calib3d opencv_nonfree opencv_flann) +SET(OPENCV_TAPI_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_video opencv_imgcodecs opencv_highgui opencv_objdetect opencv_features2d opencv_calib3d opencv_nonfree opencv_flann) ocv_check_dependencies(${OPENCV_TAPI_SAMPLES_REQUIRED_DEPS}) diff --git a/samples/tapi/clahe.cpp b/samples/tapi/clahe.cpp index a28f2ab05d..9f9404d35d 100644 --- a/samples/tapi/clahe.cpp +++ b/samples/tapi/clahe.cpp @@ -3,6 +3,7 @@ #include "opencv2/core/ocl.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; diff --git a/samples/tapi/hog.cpp b/samples/tapi/hog.cpp index ee537b310e..ac227fc0c9 100644 --- a/samples/tapi/hog.cpp +++ b/samples/tapi/hog.cpp @@ -6,6 +6,7 @@ #include #include #include +#include "opencv2/imgcodecs.hpp" #include #include #include diff --git a/samples/tapi/pyrlk_optical_flow.cpp b/samples/tapi/pyrlk_optical_flow.cpp index d4b77294be..cc48374a6e 100644 --- a/samples/tapi/pyrlk_optical_flow.cpp +++ b/samples/tapi/pyrlk_optical_flow.cpp @@ -3,6 +3,7 @@ #include #include "opencv2/core/utility.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/core/ocl.hpp" #include "opencv2/video/video.hpp" diff --git a/samples/tapi/squares.cpp b/samples/tapi/squares.cpp index 402702e497..87a3894b93 100644 --- a/samples/tapi/squares.cpp +++ b/samples/tapi/squares.cpp @@ -6,6 +6,7 @@ #include "opencv2/core/ocl.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/tapi/surf_matcher.cpp b/samples/tapi/surf_matcher.cpp index 9066bfd3fb..2aca96f1bc 100644 --- a/samples/tapi/surf_matcher.cpp +++ b/samples/tapi/surf_matcher.cpp @@ -3,6 +3,7 @@ #include "opencv2/core/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/core/ocl.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/features2d.hpp" #include "opencv2/calib3d.hpp" diff --git a/samples/tapi/tvl1_optical_flow.cpp b/samples/tapi/tvl1_optical_flow.cpp index 436ba715c8..b37c5bb764 100644 --- a/samples/tapi/tvl1_optical_flow.cpp +++ b/samples/tapi/tvl1_optical_flow.cpp @@ -4,6 +4,7 @@ #include "opencv2/core/ocl.hpp" #include "opencv2/core/utility.hpp" +#include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/video/video.hpp"