opencv/cmake
StefanBruens 8d78400052
Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port
Jpeg2000 OpenJPEG port

* OpenJPEG based JPEG2000 decoder implementation

Currently, the following input color spaces and depth conversions are
supported:

- 8 bit -> 8 bit
- 16 bit -> 16 bit (IMREAD_UNCHANGED, IMREAD_ANYDEPTH)

- RGB(a) -> BGR
- RGBA -> BGRA (IMREAD_UNCHANGED)
- Y(a) -> Y(a) (IMREAD_ANYCOLOR, IMREAD_GRAY, IMREAD_UNCHANGED))
- YCC -> Y (IMREAD_GRAY)

* Check for OpenJPEG availability

This enables OpenJPEG based JPEG2000 imread support by default, which
can be disabled by -DWITH_OPENJPEG=OFF. In case OpenJPEG is enabled
and found, any checks for Jasper are skipped.

* Implement precision downscaling for precision > 8 without IMREAD_UNCHANGED

With IMREAD_UNCHANGED, values are kept from the input image, without it
components are downscaled to CV_8U range.

* Enable Jpeg2K tests when OpenJPEG is available

* Add support for some more color conversions

Support IMREAD_GRAY when input color space is RGB or unspecified.
Support YUV input color space for BGR output.

* fix: problems with unmanaged memory

* fix: CMake warning - HAVE_OPENJPEG is undefined

Removed trailing whitespaces

* fix: CMake find_package OpenJPEG add minimal version

* Basic JPEG2K encoder

Images with depth CV_8U and CV_16U are supported, with 1 to 4 channels.

* feature: Improved code for OpenJPEG2000 encoder/decoder

 - Removed code duplication
 - Added error handlers
 - Extracted functions

* feature: Update conversion openjpeg array from/to Mat

* feature: Extend ChannelsIterator to fulfill RandomAccessIterator named requirements

 - Removed channels split in copyFromMatImpl. With ChannelsIterator no allocations are performed.
 - Split whole loop into 2 parts in copyToMat -> where std::copy and std::transforms are called.

* fix: Applied review comments.

 - Changed `nullptr` in CV_LOG* functions to `NULL`
 - Added `falls through` comment in decoder color space `switch`
 - Added warning about unsupported parameters for the encoder

* feature: Added decode from in-memory buffers.

Co-authored-by: Vadim Levin <vadim.levin@xperience.ai>
2020-03-27 07:18:58 +00:00
..
android Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
checks Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-01 17:26:00 +00:00
FindCUDA FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
platforms cmake: fix UWP scripts path 2019-10-16 21:42:31 +00:00
templates Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
cl2cpp.cmake cmake: don't add include <module>/src directory to avoid conflicts 2018-03-19 11:14:15 +03:00
copy_files.cmake cmake: fix android examples dependencies 2018-03-15 14:17:02 +03:00
FindCUDA.cmake Misc. typos 2018-07-31 18:44:23 +03:00
FindCUDNN.cmake Merge pull request #14660 from YashasSamaga:dnn-cuda-build 2019-06-02 14:47:15 +03:00
FindFlake8.cmake cmake: added check_flake8 target 2018-05-11 17:32:22 +03:00
FindOpenVX.cmake Updated OpenVX detector and wrappers to handle Reference attribute names change 2017-03-22 16:50:38 +03:00
FindPylint.cmake cmake: fix Pylint version detection 2017-08-28 19:03:44 +03:00
FindVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVCompilerDefenses.cmake Added support for Clang build hardening (including Apple) 2019-05-07 13:00:43 +03:00
OpenCVCompilerOptimizations.cmake cmake: prefer using CMAKE_SYSTEM_PROCESSOR / CMAKE_SIZEOF_VOID_P 2019-12-11 00:21:10 +00:00
OpenCVCompilerOptions.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-28 18:34:37 +00:00
OpenCVCRTLinkage.cmake cmake: update handling of MSVC /MP flag 2020-02-11 21:05:44 +00:00
OpenCVDetectApacheAnt.cmake FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
OpenCVDetectCUDA.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
OpenCVDetectCXXCompiler.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-17 13:23:33 +03:00
OpenCVDetectDirectX.cmake Merge pull request #14294 from alalek:issue_14286 2019-04-11 17:50:15 +03:00
OpenCVDetectHalide.cmake cmake: add Halide support (#8794) 2017-06-21 14:33:47 +03:00
OpenCVDetectInferenceEngine.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-14 19:54:59 +03:00
OpenCVDetectOpenCL.cmake Merge pull request #14294 from alalek:issue_14286 2019-04-11 17:50:15 +03:00
OpenCVDetectPython.cmake fix: minor typo in CMakeCVDetectPython 2020-03-21 11:15:07 +02:00
OpenCVDetectTBB.cmake Fix TBB debug 2019-05-27 10:26:06 +03:00
OpenCVDetectTrace.cmake trace: initial support for code trace 2017-06-26 17:07:13 +03:00
OpenCVDetectVTK.cmake Merge pull request #12887 from alalek:fix_cmake_conditions 2018-10-24 13:17:54 +00:00
OpenCVDetectVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVDownload.cmake cmake: add directory creation to download helper scripts 2019-09-04 17:09:13 +03:00
OpenCVExtraTargets.cmake Added group targets for samples (opencv_samples, opencv_samples_<group>), install samples/data inseparate component 'samples_data' 2018-02-12 18:42:36 +03:00
OpenCVFindAtlas.cmake moved BLAS/LAPACK detection scripts from opencv_contrib/dnn to the main repository (#7918) 2016-12-22 22:57:44 +03:00
OpenCVFindFrameworks.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-02 05:33:35 +00:00
OpenCVFindIPP.cmake Merge pull request #16639 from iigalanin:patch-1 2020-02-25 22:04:11 +03:00
OpenCVFindIPPIW.cmake cmake: add check for IPP IW license files 2019-10-01 18:24:03 +03:00
OpenCVFindLAPACK.cmake LAPACK: add support for complex numbers for MSVC 2019-05-22 18:43:45 +03:00
OpenCVFindLATEX.cmake Started top-level CMakeLists.txt file reorganization: cmake scripts are moved to separate folder; refactored BUILD_*, INSTALL_*, ENABLE_*, USE_*, WITH_* options. 2012-01-03 13:48:12 +00:00
OpenCVFindLibsGrfmt.cmake Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
OpenCVFindLibsGUI.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-23 19:50:20 +03:00
OpenCVFindLibsPerf.cmake cmake: hide IPPICV symbols using --exclude-libs 2020-02-04 18:11:07 +03:00
OpenCVFindLibsVideo.cmake cmake: prefer using CMAKE_SYSTEM_PROCESSOR / CMAKE_SIZEOF_VOID_P 2019-12-11 00:21:10 +00:00
OpenCVFindMKL.cmake OpenCVFindMKL: Fix a typo 2019-10-18 18:33:06 +02:00
OpenCVFindOpenBLAS.cmake cmake: update OpenBLAS support 2017-10-28 10:17:37 +03:00
OpenCVFindOpenEXR.cmake cmake: fix Linux system OpenEXR detection 2020-01-16 23:12:41 +02:00
OpenCVFindProtobuf.cmake Fix install with external protobuf 2018-10-04 13:48:59 +03:00
OpenCVFindTengine.cmake Merge pull request #16832 from liqi-c:3.4-tengine-android 2020-03-20 10:10:39 +00:00
OpenCVFindVA_INTEL.cmake Removed unnecessary build-time MediaSDK detection 2018-09-13 13:43:11 +03:00
OpenCVFindVA.cmake cmake: allow to specify own libva paths 2018-08-10 16:03:10 +03:00
OpenCVFindWebP.cmake update CMakeList.txt 2018-02-05 16:23:52 +03:00
OpenCVFindXimea.cmake Merge pull request #13422 from mshabunin:split-videoio-cmake 2018-12-26 15:50:20 +03:00
OpenCVGenABI.cmake cmake: support OPENCV_ABI_SKIP_MODULES_LIST 2020-01-27 14:40:48 +03:00
OpenCVGenAndroidMK.cmake next(android): java3 -> java4 2018-04-10 18:09:54 +03:00
OpenCVGenConfig.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-20 21:11:49 +00:00
OpenCVGenHeaders.cmake cmake: support multiple CPU targets 2017-02-13 19:52:59 +03:00
OpenCVGenInfoPlist.cmake Merge pull request #8009 from Legoless:master 2017-01-20 19:16:01 +03:00
OpenCVGenPkgconfig.cmake cmake: update install paths (Linux) 2018-09-19 15:43:52 +03:00
OpenCVGenSetupVars.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-18 19:07:43 +00:00
OpenCVInstallLayout.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-20 21:11:49 +00:00
OpenCVMinDepVersions.cmake Merge pull request #14827 from YashasSamaga:cuda4dnn-csl-low 2019-10-21 14:28:00 +03:00
OpenCVModule.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-17 13:23:33 +03:00
OpenCVPackaging.cmake exclude opencv_contrib modules 2020-02-26 15:12:45 +03:00
OpenCVPCHSupport.cmake Fix pch generation when linker flags used with GCC 2019-12-10 14:55:56 +00:00
OpenCVPylint.cmake cmake: fix Ninja generator warning about pylintrc 2018-04-10 12:23:10 +03:00
OpenCVUtils.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-04 19:49:24 +03:00
OpenCVVersion.cmake cmake: hide 'junk' dir from the root of build directory 2018-12-07 05:14:08 +00:00