mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Compare commits
371 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 705e7b207c | |||
| ea91f7e57d | |||
| decdb68636 | |||
| d4cc7f4299 | |||
| 4699d2ba0c | |||
| e8536c4a0e | |||
| 2687a2b6dc | |||
| aab6362705 | |||
| 94e8a08d1d | |||
| ce8027c6fb | |||
| 301c078d19 | |||
| 9485113923 | |||
| 9acbfc6e05 | |||
| 4f3130f562 | |||
| a783bf4a93 | |||
| f7e8dc770a | |||
| 34909d97b4 | |||
| 474a67231c | |||
| a316b11aaa | |||
| b645fc10a3 | |||
| 8e1e08ee38 | |||
| d266fee8bb | |||
| 8357e865bc | |||
| 2c6a2f0381 | |||
| fe9a8ebea2 | |||
| b866d0dc38 | |||
| 2b558a3787 | |||
| 72d06080c6 | |||
| 3cdf926454 | |||
| 23baf1a75e | |||
| 025a9647af | |||
| 32e7ef8a3d | |||
| 2b82f8f12c | |||
| b5c162175b | |||
| 60c76cc289 | |||
| efd556b1a9 | |||
| 3a184ae677 | |||
| b4b2a276c8 | |||
| 464d53bb16 | |||
| 4c9e3723e8 | |||
| 06477743ab | |||
| e4a9ad1730 | |||
| d0b6637c1d | |||
| 58268b6eef | |||
| 14aa8affe5 | |||
| 56074c2eb3 | |||
| 3da1e8b2f8 | |||
| 786cecfe66 | |||
| dde3cb3b99 | |||
| 24f2b7dd3f | |||
| 936530f795 | |||
| cfbdbffcad | |||
| 71db9d3b57 | |||
| b455e1cf52 | |||
| 564d1a0f79 | |||
| 90bea15e35 | |||
| 892cac9e1b | |||
| f58f36dc88 | |||
| 9e84b860f2 | |||
| 2e7ef6f4e8 | |||
| cea137f313 | |||
| 79a82013ad | |||
| 05c011e842 | |||
| 3826158547 | |||
| a7c150ec66 | |||
| 61144f935e | |||
| d23435baac | |||
| 389495f76a | |||
| a3f3fbe05d | |||
| 4d00ed8df7 | |||
| 41e906d1a4 | |||
| 41c2669476 | |||
| 0e4b5b88dc | |||
| 011d8e80d8 | |||
| 1f8f0abe92 | |||
| d9c5b85671 | |||
| 76cf31bee7 | |||
| ed3591ed1f | |||
| d986cc4861 | |||
| 724001aa0f | |||
| 5564d73071 | |||
| 3fc1c73064 | |||
| 1b0dca9c2c | |||
| 5dae278652 | |||
| ef32d7fd16 | |||
| 30d91e8ed6 | |||
| 5f1ca33c6f | |||
| c69417149d | |||
| 08271e5591 | |||
| a104e7c593 | |||
| c3e7a23da5 | |||
| 083edb201c | |||
| df7bf9a048 | |||
| bed5debca6 | |||
| caa1658a4c | |||
| bb5b628cce | |||
| e12adcdf08 | |||
| 127a44f2b9 | |||
| 527cedd848 | |||
| ec5065eb53 | |||
| 90524a8528 | |||
| ad71a1633c | |||
| eb24575e2c | |||
| d9877efe1d | |||
| 7459613623 | |||
| fb69620a27 | |||
| a6e15b2f57 | |||
| 39ecd96b09 | |||
| 21a8d9569d | |||
| 07736c912f | |||
| 24d60da553 | |||
| 039795b405 | |||
| a110ede0a2 | |||
| 2a3cdba724 | |||
| 099ad1a259 | |||
| 6df92b3bca | |||
| 48ccbe39b4 | |||
| 716450ceb5 | |||
| 691c3d1e3c | |||
| ca8bb8d053 | |||
| 56d2b7137c | |||
| d9a62c42e5 | |||
| 97eaddd93b | |||
| e3ce0fbee3 | |||
| 364702b1c9 | |||
| 978f387961 | |||
| 209f6cdcc7 | |||
| 0f7b2eb79f | |||
| 4a0760719e | |||
| d011383a3d | |||
| 1fe276d041 | |||
| f345ed564a | |||
| 3d4563913d | |||
| 93c3775927 | |||
| afbf383ba3 | |||
| 36598677cf | |||
| 0ec94630d4 | |||
| c71f2714c6 | |||
| 71462d9f99 | |||
| 72dfd4846e | |||
| 61a8cf8ba7 | |||
| bd40952097 | |||
| 8869d3212f | |||
| ea1e3fb90d | |||
| 3a99fb9d34 | |||
| e1b56e376e | |||
| aac7c5465b | |||
| 22ee5c0c4d | |||
| e8058b9fdb | |||
| d31b6c3480 | |||
| 95ff928228 | |||
| 510dc17c2e | |||
| 2669d8ce73 | |||
| 7f3d8de26f | |||
| 331b73c8e4 | |||
| 1729297ef3 | |||
| 9138c98b25 | |||
| 456af21d8b | |||
| b87f7a625e | |||
| c3e8790dfd | |||
| bf49149c97 | |||
| 49d5960a32 | |||
| dcfa23d5d2 | |||
| 5ac0712cf1 | |||
| c82417697a | |||
| adac1da64e | |||
| 9c8626bf3c | |||
| ef21fd3cf8 | |||
| bd19f991a5 | |||
| e87ba1d317 | |||
| f9d1f5196a | |||
| b5717f82a0 | |||
| aa51382dbc | |||
| bc6a70c689 | |||
| 1fb6c6e6e5 | |||
| d2dbc9d7a0 | |||
| 8bf451a3e0 | |||
| 0d3e05f9b3 | |||
| 8c4d415412 | |||
| 06a09d5991 | |||
| 57c894f44d | |||
| 7de189114b | |||
| 4c048a487e | |||
| 09a62012b2 | |||
| b494de6a01 | |||
| dbeec7715d | |||
| 25163eb008 | |||
| 1048feac3b | |||
| 96e8b83d41 | |||
| 78476a0fe2 | |||
| d5fd2f0155 | |||
| c8ebe0eb86 | |||
| de93782fab | |||
| 16561ed71e | |||
| 4bfdf7cf2a | |||
| e58da86efc | |||
| 7ed82aea38 | |||
| dc15187f1b | |||
| ae1a249a0a | |||
| 2dd2d60955 | |||
| 171fbf879f | |||
| 1b443219ed | |||
| 8a1caa0d16 | |||
| cdcf7e62f3 | |||
| 083727b0a6 | |||
| 718dd9f170 | |||
| 76be3529f4 | |||
| 6c218c7b0f | |||
| e87a0baa4b | |||
| 8ee5f2ad89 | |||
| ee76cef1ff | |||
| 6a51e3b39a | |||
| 6da05f7086 | |||
| ae265a48c7 | |||
| af2f8c69f0 | |||
| e24b1629a0 | |||
| 46ccde82cf | |||
| 537494f4dd | |||
| d9ea9bedb2 | |||
| 1546b9bf99 | |||
| 39d5e14c1f | |||
| 62b5d37b6b | |||
| d78d9bf151 | |||
| a5f0fb6008 | |||
| f2bb3d0d80 | |||
| d5dce63254 | |||
| 01981ed290 | |||
| 037a72debd | |||
| 1ef4b7ae5a | |||
| b314cc4c23 | |||
| 6f5d56d994 | |||
| 644de8f22a | |||
| 36f61f3879 | |||
| aa11f7d8a3 | |||
| 793b2b9ad9 | |||
| 050c960dfc | |||
| f30aafc3cc | |||
| 2f065b8b4c | |||
| aece3e732e | |||
| aabeb8a18e | |||
| ebe9327a92 | |||
| d7d51e4cc7 | |||
| 102d8f67cd | |||
| a00fe15abd | |||
| 3acf8cfd63 | |||
| 5224d016e9 | |||
| d34717d8c9 | |||
| 199687a1c5 | |||
| b5a6c8e2b2 | |||
| a5b8f163d7 | |||
| 6add3b9161 | |||
| 955909bdb5 | |||
| 1ddd61f98a | |||
| 3503a36e5e | |||
| 2ea7269450 | |||
| a968eadbf1 | |||
| c6b63e0e28 | |||
| 7bd8ddc8fa | |||
| e3da18121f | |||
| 0c4a8e2ca8 | |||
| a3e7c2d8e3 | |||
| 40b8b58bc6 | |||
| fc1a156262 | |||
| 8cbd20b380 | |||
| 43d306fc2d | |||
| 14e264f646 | |||
| 01e23a2222 | |||
| f88d89ad82 | |||
| 969b55036f | |||
| b29f73d5e0 | |||
| e998d89e88 | |||
| 295afd5882 | |||
| cbf978d1f7 | |||
| 94e0ac7d9f | |||
| 08b36e4f48 | |||
| d62d880316 | |||
| 361b5e0ebf | |||
| 8da1b9aafa | |||
| c16e2e6234 | |||
| 19f4cc57c1 | |||
| c08f29c803 | |||
| ecb6d03ccd | |||
| e59793cc75 | |||
| 236ad4aeda | |||
| 97bb91d5fa | |||
| 80d4d4d92c | |||
| 6a7df4e973 | |||
| 098f07664d | |||
| 233030e417 | |||
| 6256e425f3 | |||
| 4dbb8ac4b2 | |||
| 48368dc9a1 | |||
| 691c655630 | |||
| e7f2af5fdb | |||
| 4419f4093e | |||
| b88ad7f2d9 | |||
| b300b6b3bd | |||
| c945ea125a | |||
| c32e349332 | |||
| 118218754b | |||
| 234117800f | |||
| 00c61cf197 | |||
| f6901ab877 | |||
| ac58b2f857 | |||
| 862fc06b6f | |||
| 89ed813585 | |||
| 0dc28d3446 | |||
| 50657e2324 | |||
| 7c22cd49a7 | |||
| 220b37144b | |||
| c012490399 | |||
| e937d9b559 | |||
| 688aea6bec | |||
| 7186c46377 | |||
| 74c8ccb45b | |||
| 3fc1487cc9 | |||
| 48ddb53332 | |||
| 9cfe981e1f | |||
| f584c6d723 | |||
| 3ea9022c5f | |||
| 45ee8e2532 | |||
| 2f9072efdc | |||
| f7b8f522ff | |||
| f6aa9ac304 | |||
| 6c575e8826 | |||
| f52a2cf5e1 | |||
| 5e90802b1a | |||
| 45fee13f3d | |||
| 5bfb779d82 | |||
| 261ad78122 | |||
| 4fa82809df | |||
| 95fd61c9b4 | |||
| d1cdef596c | |||
| 7163781639 | |||
| a63cee2139 | |||
| 3e3787ecb6 | |||
| a723aaedd8 | |||
| 830d8d6b75 | |||
| ebb528976f | |||
| f77c2d700f | |||
| 8c44b8306b | |||
| a07f064e50 | |||
| e668cff573 | |||
| ea4b491a73 | |||
| fa953e4205 | |||
| 986bc65e1f | |||
| 540982cc9d | |||
| 5218443784 | |||
| a61546680b | |||
| 8cb7eae5c9 | |||
| 18440c1faf | |||
| 9f69ca503a | |||
| 49ba744130 | |||
| 3b00ee2afb | |||
| 4b24ddd70d | |||
| 1612db5f91 | |||
| 7dfe68cac6 | |||
| 7d832337ae | |||
| a258404a58 | |||
| 83807811cd | |||
| a3048239b3 | |||
| 23e71d1aa2 | |||
| f787c73841 | |||
| b542a1804c | |||
| 2dff2f36bf | |||
| 6b674709b8 | |||
| f56445d7ca | |||
| 03bee14372 | |||
| 50ff40d684 | |||
| da555a2c9b | |||
| dfb9832a25 |
Vendored
+2
-2
@@ -27,7 +27,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(carotene_objs OBJECT
|
||||
add_library(carotene_objs OBJECT EXCLUDE_FROM_ALL
|
||||
${carotene_headers}
|
||||
${carotene_sources}
|
||||
)
|
||||
@@ -41,4 +41,4 @@ if(WITH_NEON)
|
||||
endif()
|
||||
|
||||
# we add dummy file to fix XCode build
|
||||
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
|
||||
add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
|
||||
|
||||
Vendored
+2
-2
@@ -14,7 +14,7 @@ if(NOT DEFINED CPUFEATURES_SOURCES)
|
||||
endif()
|
||||
|
||||
include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
||||
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
|
||||
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${CPUFEATURES_SOURCES})
|
||||
|
||||
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
|
||||
PROPERTIES OUTPUT_NAME cpufeatures
|
||||
@@ -29,7 +29,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
/*****************************************************************************\
|
||||
|
||||
Copyright (c) 2013-2019 Intel Corporation All Rights Reserved.
|
||||
|
||||
THESE MATERIALS ARE 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 INTEL OR ITS
|
||||
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 THESE
|
||||
MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: cl_va_api_media_sharing_intel.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Notes:
|
||||
|
||||
\*****************************************************************************/
|
||||
|
||||
|
||||
#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
|
||||
#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
|
||||
|
||||
#include <CL/cl.h>
|
||||
#include <CL/cl_platform.h>
|
||||
#include <va/va.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************
|
||||
* cl_intel_va_api_media_sharing extension *
|
||||
*******************************************/
|
||||
|
||||
#define cl_intel_va_api_media_sharing 1
|
||||
|
||||
/* error codes */
|
||||
#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
|
||||
#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
|
||||
#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
|
||||
#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
|
||||
|
||||
/* cl_va_api_device_source_intel */
|
||||
#define CL_VA_API_DISPLAY_INTEL 0x4094
|
||||
|
||||
/* cl_va_api_device_set_intel */
|
||||
#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
|
||||
#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
|
||||
#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
|
||||
|
||||
typedef cl_uint cl_va_api_device_source_intel;
|
||||
typedef cl_uint cl_va_api_device_set_intel;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
|
||||
cl_platform_id platform,
|
||||
cl_va_api_device_source_intel media_adapter_type,
|
||||
void* media_adapter,
|
||||
cl_va_api_device_set_intel media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
|
||||
cl_platform_id platform,
|
||||
cl_va_api_device_source_intel media_adapter_type,
|
||||
void* media_adapter,
|
||||
cl_va_api_device_set_intel media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromVA_APIMediaSurfaceINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
VASurfaceID* surface,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
VASurfaceID* surface,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireVA_APIMediaSurfacesINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseVA_APIMediaSurfacesINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
|
||||
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IP
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
add_library(${IPP_IW_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if(UNIX)
|
||||
if(CV_GCC OR CV_CLANG OR CV_ICC)
|
||||
@@ -41,5 +41,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
Vendored
+2
-2
@@ -37,7 +37,7 @@ set(ITT_SRCS
|
||||
src/ittnotify/jitprofiling.c
|
||||
)
|
||||
|
||||
add_library(${ITT_LIBRARY} STATIC ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
|
||||
if(NOT WIN32)
|
||||
if(HAVE_DL_LIBRARY)
|
||||
@@ -60,7 +60,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ file(GLOB lib_ext_hdrs jasper/*.h)
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
add_library(${JASPER_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
|
||||
add_library(${JASPER_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
|
||||
|
||||
if(WIN32 AND NOT MINGW)
|
||||
add_definitions(-DJAS_WIN_MSVC_BUILD)
|
||||
@@ -46,7 +46,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(jasper LICENSE README copyright)
|
||||
|
||||
+4
-4
@@ -4,9 +4,9 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-6
|
||||
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 0)
|
||||
set(VERSION_REVISION 5)
|
||||
set(VERSION_REVISION 6)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000005)
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000006)
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -106,7 +106,7 @@ set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
|
||||
|
||||
ocv_list_add_prefix(JPEG_SOURCES src/)
|
||||
|
||||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
@@ -121,7 +121,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg)
|
||||
|
||||
Vendored
+1
-1
@@ -91,7 +91,7 @@ best of our understanding.
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
|
||||
Copyright (C)2009-2020 D. R. Commander. All Rights Reserved.
|
||||
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
Vendored
+8
-14
@@ -223,12 +223,12 @@ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
|
||||
A PDF file of the older JFIF 1.02 specification is available at
|
||||
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
|
||||
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
|
||||
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
|
||||
(Compression tag 7). Copies of this Note can be obtained from
|
||||
The TIFF 6.0 file format specification can be obtained from
|
||||
http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
|
||||
scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
|
||||
problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
|
||||
tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
|
||||
#2 (Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
@@ -243,14 +243,8 @@ The most recent released version can always be found there in
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
|
||||
and other news.answers archive sites, including the official news.answers
|
||||
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
|
||||
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
|
||||
with body
|
||||
send usenet/news.answers/jpeg-faq/part1
|
||||
send usenet/news.answers/jpeg-faq/part2
|
||||
general information about JPEG. It is available at
|
||||
http://www.faqs.org/faqs/jpeg-faq.
|
||||
|
||||
|
||||
FILE FORMAT COMPATIBILITY
|
||||
|
||||
Vendored
+11
-10
@@ -2,7 +2,7 @@ Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
|
||||
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and
|
||||
baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and
|
||||
MIPS systems, as well as progressive JPEG compression on x86 and x86-64
|
||||
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
|
||||
all else being equal. On other types of systems, libjpeg-turbo can still
|
||||
@@ -179,8 +179,8 @@ supported and which aren't.
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
|
||||
means of quality improvement. Readers are invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
@@ -287,12 +287,13 @@ following reasons:
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
point IDCT in line with the accuracy of the accurate integer IDCT. The
|
||||
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
|
||||
not produce significantly more accuracy than the accurate integer algorithms
|
||||
(to put numbers on this, the typical difference in PNSR between the two
|
||||
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
|
||||
the upper range of the quality scale is typically more like a 1.0 dB
|
||||
difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
@@ -340,7 +341,7 @@ The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
It is therefore strongly advised that you use the accurate integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -34,10 +34,10 @@
|
||||
* memory footprint by 64k, which is important for some mobile applications
|
||||
* that create many isolated instances of libjpeg-turbo (web browsers, for
|
||||
* instance.) This may improve performance on some mobile platforms as well.
|
||||
* This feature is enabled by default only on ARM processors, because some x86
|
||||
* This feature is enabled by default only on Arm processors, because some x86
|
||||
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
|
||||
* shown to have a significant performance impact even on the x86 chips that
|
||||
* have a fast implementation of it. When building for ARMv6, you can
|
||||
* have a fast implementation of it. When building for Armv6, you can
|
||||
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
Vendored
+4
-1
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcinit.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -19,6 +21,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+2
-2
@@ -43,10 +43,10 @@
|
||||
* memory footprint by 64k, which is important for some mobile applications
|
||||
* that create many isolated instances of libjpeg-turbo (web browsers, for
|
||||
* instance.) This may improve performance on some mobile platforms as well.
|
||||
* This feature is enabled by default only on ARM processors, because some x86
|
||||
* This feature is enabled by default only on Arm processors, because some x86
|
||||
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
|
||||
* shown to have a significant performance impact even on the x86 chips that
|
||||
* have a fast implementation of it. When building for ARMv6, you can
|
||||
* have a fast implementation of it. When building for Armv6, you can
|
||||
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
Vendored
+3
-2
@@ -4,8 +4,8 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||
* Modified 2000-2009 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -17,6 +17,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
+36
-9
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2015-2018, D. R. Commander.
|
||||
* Copyright (C) 2010, 2015-2018, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "jinclude.h"
|
||||
#include "jdmainct.h"
|
||||
#include "jdcoefct.h"
|
||||
#include "jdmaster.h"
|
||||
#include "jdmerge.h"
|
||||
#include "jdsample.h"
|
||||
#include "jmemsys.h"
|
||||
|
||||
@@ -316,6 +318,8 @@ LOCAL(void)
|
||||
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION n;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
JSAMPARRAY scanlines = NULL;
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows) = NULL;
|
||||
@@ -332,8 +336,13 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
scanlines = &upsample->spare_row;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_lines; n++)
|
||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
jpeg_read_scanlines(cinfo, scanlines, 1);
|
||||
|
||||
if (color_convert)
|
||||
cinfo->cconvert->color_convert = color_convert;
|
||||
@@ -353,6 +362,12 @@ increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
|
||||
{
|
||||
JDIMENSION rows_left;
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
|
||||
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
read_and_discard_scanlines(cinfo, rows);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Increment the counter to the next row group after the skipped rows. */
|
||||
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
|
||||
@@ -382,21 +397,27 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
JDIMENSION i, x;
|
||||
int y;
|
||||
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
|
||||
JDIMENSION lines_to_skip, lines_to_read;
|
||||
|
||||
/* Two-pass color quantization is not supported. */
|
||||
if (cinfo->quantize_colors && cinfo->two_pass_quantize)
|
||||
ERREXIT(cinfo, JERR_NOTIMPL);
|
||||
|
||||
if (cinfo->global_state != DSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Do not skip past the bottom of the image. */
|
||||
if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
|
||||
num_lines = cinfo->output_height - cinfo->output_scanline;
|
||||
cinfo->output_scanline = cinfo->output_height;
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
cinfo->inputctl->eoi_reached = TRUE;
|
||||
return cinfo->output_height - cinfo->output_scanline;
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
if (num_lines == 0)
|
||||
@@ -445,8 +466,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skipping is much simpler when context rows are not required. */
|
||||
@@ -458,8 +481,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +519,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
@@ -535,7 +561,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
|
||||
* output_scanline.
|
||||
*/
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
|
||||
/* Always skip the requested number of lines. */
|
||||
return num_lines;
|
||||
|
||||
+5
-3
@@ -6,7 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2015, 2020, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -495,11 +495,13 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
if (first_row && block_row == 0)
|
||||
prev_block_row = buffer_ptr;
|
||||
else
|
||||
prev_block_row = buffer[block_row - 1];
|
||||
prev_block_row = buffer[block_row - 1] +
|
||||
cinfo->master->first_MCU_col[ci];
|
||||
if (last_row && block_row == block_rows - 1)
|
||||
next_block_row = buffer_ptr;
|
||||
else
|
||||
next_block_row = buffer[block_row + 1];
|
||||
next_block_row = buffer[block_row + 1] +
|
||||
cinfo->master->first_MCU_col[ci];
|
||||
/* We fetch the surrounding DC values using a sliding-register approach.
|
||||
* Initialize all nine here so as to do the right thing on narrow pics.
|
||||
*/
|
||||
|
||||
Vendored
+4
-5
@@ -571,11 +571,10 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
#define PACK_SHORT_565_LE(r, g, b) \
|
||||
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) \
|
||||
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
Vendored
+13
-42
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -40,41 +40,13 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdmerge.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_upsampler pub; /* public fields */
|
||||
|
||||
/* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
|
||||
/* Private state for YCC->RGB conversion */
|
||||
int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
|
||||
/* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
* We need a "spare" row buffer to hold the second output row if the
|
||||
* application provides just a one-row buffer; we also use the spare
|
||||
* to discard the dummy last row if the image height is odd.
|
||||
*/
|
||||
JSAMPROW spare_row;
|
||||
boolean spare_full; /* T if spare buffer is occupied */
|
||||
|
||||
JDIMENSION out_row_width; /* samples per output row */
|
||||
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
} my_upsampler;
|
||||
|
||||
typedef my_upsampler *my_upsample_ptr;
|
||||
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
|
||||
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
|
||||
@@ -189,7 +161,7 @@ typedef my_upsampler *my_upsample_ptr;
|
||||
LOCAL(void)
|
||||
build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
int i;
|
||||
JLONG x;
|
||||
SHIFT_TEMPS
|
||||
@@ -232,7 +204,7 @@ build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
METHODDEF(void)
|
||||
start_pass_merged_upsample(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Mark the spare buffer empty */
|
||||
upsample->spare_full = FALSE;
|
||||
@@ -254,7 +226,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 2:1 vertical sampling case: may need a spare row. */
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
JSAMPROW work_ptrs[2];
|
||||
JDIMENSION num_rows; /* number of rows returned to caller */
|
||||
|
||||
@@ -305,7 +277,7 @@ merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 1:1 vertical sampling case: much easier, never need a spare row. */
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Just do the upsampling. */
|
||||
(*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
|
||||
@@ -420,11 +392,10 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
#define PACK_SHORT_565_LE(r, g, b) \
|
||||
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) \
|
||||
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
@@ -566,11 +537,11 @@ h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
GLOBAL(void)
|
||||
jinit_merged_upsampler(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample;
|
||||
my_merged_upsample_ptr upsample;
|
||||
|
||||
upsample = (my_upsample_ptr)
|
||||
upsample = (my_merged_upsample_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_upsampler));
|
||||
sizeof(my_merged_upsampler));
|
||||
cinfo->upsample = (struct jpeg_upsampler *)upsample;
|
||||
upsample->pub.start_pass = start_pass_merged_upsample;
|
||||
upsample->pub.need_context_rows = FALSE;
|
||||
|
||||
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* jdmerge.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_upsampler pub; /* public fields */
|
||||
|
||||
/* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
|
||||
/* Private state for YCC->RGB conversion */
|
||||
int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
|
||||
/* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
* We need a "spare" row buffer to hold the second output row if the
|
||||
* application provides just a one-row buffer; we also use the spare
|
||||
* to discard the dummy last row if the image height is odd.
|
||||
*/
|
||||
JSAMPROW spare_row;
|
||||
boolean spare_full; /* T if spare buffer is occupied */
|
||||
|
||||
JDIMENSION out_row_width; /* samples per output row */
|
||||
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
} my_merged_upsampler;
|
||||
|
||||
typedef my_merged_upsampler *my_merged_upsample_ptr;
|
||||
|
||||
#endif /* UPSAMPLE_MERGING_SUPPORTED */
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2014-2015, 2018, D. R. Commander.
|
||||
* Copyright (C) 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -19,7 +19,7 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -90,7 +90,7 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -163,7 +163,7 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
@@ -259,7 +259,7 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2011, 2015, D. R. Commander.
|
||||
* Copyright (C) 2011, 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -97,7 +97,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
|
||||
Vendored
+3
-2
@@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -16,6 +16,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
+2
-2
@@ -4,11 +4,11 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a slow-but-accurate integer implementation of the
|
||||
* This file contains a slower but more accurate integer implementation of the
|
||||
* forward DCT (Discrete Cosine Transform).
|
||||
*
|
||||
* A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
|
||||
|
||||
+2
-2
@@ -5,11 +5,11 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modification developed 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a slow-but-accurate integer implementation of the
|
||||
* This file contains a slower but more accurate integer implementation of the
|
||||
* inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
|
||||
* must also perform dequantization of the input coefficients.
|
||||
*
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -273,9 +273,9 @@ typedef int boolean;
|
||||
|
||||
/* Capability options common to encoder and decoder: */
|
||||
|
||||
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
|
||||
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
|
||||
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
|
||||
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
|
||||
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
|
||||
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
|
||||
|
||||
/* Encoder capability options: */
|
||||
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jpegcomp.h
|
||||
*
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* Copyright (C) 2010, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -19,6 +19,7 @@
|
||||
#define _min_DCT_v_scaled_size min_DCT_v_scaled_size
|
||||
#define _jpeg_width jpeg_width
|
||||
#define _jpeg_height jpeg_height
|
||||
#define JERR_ARITH_NOTIMPL JERR_NOT_COMPILED
|
||||
#else
|
||||
#define _DCT_scaled_size DCT_scaled_size
|
||||
#define _DCT_h_scaled_size DCT_scaled_size
|
||||
|
||||
Vendored
+4
-4
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -244,9 +244,9 @@ typedef enum {
|
||||
/* DCT/IDCT algorithm options. */
|
||||
|
||||
typedef enum {
|
||||
JDCT_ISLOW, /* slow but accurate integer algorithm */
|
||||
JDCT_IFAST, /* faster, less accurate integer method */
|
||||
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
|
||||
JDCT_ISLOW, /* accurate integer method */
|
||||
JDCT_IFAST, /* less accurate integer method [legacy feature] */
|
||||
JDCT_FLOAT /* floating-point method [legacy feature] */
|
||||
} J_DCT_METHOD;
|
||||
|
||||
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
|
||||
|
||||
Vendored
+3
-3
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2014-2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -1145,7 +1145,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan)
|
||||
int i;
|
||||
|
||||
/* Only F-S dithering or no dithering is supported. */
|
||||
/* If user asks for ordered dither, give him F-S. */
|
||||
/* If user asks for ordered dither, give them F-S. */
|
||||
if (cinfo->dither_mode != JDITHER_NONE)
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
|
||||
@@ -1263,7 +1263,7 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo)
|
||||
cquantize->sv_colormap = NULL;
|
||||
|
||||
/* Only F-S dithering or no dithering is supported. */
|
||||
/* If user asks for ordered dither, give him F-S. */
|
||||
/* If user asks for ordered dither, give them F-S. */
|
||||
if (cinfo->dither_mode != JDITHER_NONE)
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
|
||||
|
||||
+8
-6
@@ -30,23 +30,25 @@
|
||||
* NOTE: It is our convention to place the authors in the following order:
|
||||
* - libjpeg-turbo authors (2009-) in descending order of the date of their
|
||||
* most recent contribution to the project, then in ascending order of the
|
||||
* date of their first contribution to the project
|
||||
* date of their first contribution to the project, then in alphabetical
|
||||
* order
|
||||
* - Upstream authors in descending order of the date of the first inclusion of
|
||||
* their code
|
||||
*/
|
||||
|
||||
#define JCOPYRIGHT \
|
||||
"Copyright (C) 2009-2020 D. R. Commander\n" \
|
||||
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||
"Copyright (C) 2015, 2020 Google, Inc.\n" \
|
||||
"Copyright (C) 2019 Arm Limited\n" \
|
||||
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||
"Copyright (C) 2015 Intel Corporation\n" \
|
||||
"Copyright (C) 2015 Google, Inc.\n" \
|
||||
"Copyright (C) 2013-2014 Linaro Limited\n" \
|
||||
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
||||
"Copyright (C) 2013 Linaro Limited\n" \
|
||||
"Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
|
||||
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
||||
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
|
||||
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
||||
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
|
||||
"Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding"
|
||||
|
||||
#define JCOPYRIGHT_SHORT \
|
||||
"Copyright (C) 1991-2020 The libjpeg-turbo Project and many others"
|
||||
|
||||
Vendored
+2
-2
@@ -19,7 +19,7 @@ endif()
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
|
||||
@@ -42,7 +42,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libjpeg README)
|
||||
|
||||
Vendored
+2
-2
@@ -74,7 +74,7 @@ if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
endif(MSVC)
|
||||
|
||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
add_library(${PNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
|
||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare)
|
||||
@@ -92,7 +92,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libpng LICENSE README)
|
||||
|
||||
Vendored
+8
-17
@@ -20,9 +20,8 @@
|
||||
# Author: qtang@openailab.com or https://github.com/BUG1989
|
||||
# qli@openailab.com
|
||||
# sqfu@openailab.com
|
||||
#
|
||||
|
||||
SET(TENGINE_COMMIT_VERSION "8a4c58e0e05cd850f4bb0936a330edc86dc0e28c")
|
||||
SET(TENGINE_COMMIT_VERSION "e89cf8870de2ff0a80cfe626c0b52b2a16fb302e")
|
||||
SET(OCV_TENGINE_DIR "${OpenCV_BINARY_DIR}/3rdparty/libtengine")
|
||||
SET(OCV_TENGINE_SOURCE_PATH "${OCV_TENGINE_DIR}/Tengine-${TENGINE_COMMIT_VERSION}")
|
||||
|
||||
@@ -32,11 +31,10 @@ IF(EXISTS "${OCV_TENGINE_SOURCE_PATH}")
|
||||
SET(Tengine_FOUND ON)
|
||||
SET(BUILD_TENGINE ON)
|
||||
ELSE()
|
||||
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name2
|
||||
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url2
|
||||
SET(tengine_md5sum f51ca8f3963faeeff3f019a6f6edc206) #md5sum2
|
||||
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name
|
||||
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url
|
||||
SET(tengine_md5sum 23f61ebb1dd419f1207d8876496289c5) #md5sum
|
||||
|
||||
#MESSAGE(STATUS "**** TENGINE DOWNLOAD BEGIN ****")
|
||||
ocv_download(FILENAME ${OCV_TENGINE_FILENAME}
|
||||
HASH ${tengine_md5sum}
|
||||
URL
|
||||
@@ -62,24 +60,17 @@ ENDIF()
|
||||
if(BUILD_TENGINE)
|
||||
SET(HAVE_TENGINE 1)
|
||||
|
||||
# android system
|
||||
if(ANDROID)
|
||||
if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
|
||||
SET(CONFIG_ARCH_ARM32 ON)
|
||||
elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
|
||||
SET(CONFIG_ARCH_ARM64 ON)
|
||||
endif()
|
||||
else()
|
||||
if(NOT ANDROID)
|
||||
# linux system
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
|
||||
SET(CONFIG_ARCH_ARM32 ON)
|
||||
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv7-a")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) ## AARCH64
|
||||
SET(CONFIG_ARCH_ARM64 ON)
|
||||
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv8-a")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
SET(BUILT_IN_OPENCV ON) ## set for tengine compile discern .
|
||||
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/core/include" CACHE INTERNAL "")
|
||||
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/include" CACHE INTERNAL "")
|
||||
if(EXISTS "${OCV_TENGINE_SOURCE_PATH}/CMakeLists.txt")
|
||||
add_subdirectory("${OCV_TENGINE_SOURCE_PATH}" "${OCV_TENGINE_DIR}/build")
|
||||
else()
|
||||
|
||||
Vendored
+2
-2
@@ -462,7 +462,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
|
||||
|
||||
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
|
||||
add_library(${TIFF_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs})
|
||||
target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})
|
||||
|
||||
set_target_properties(${TIFF_LIBRARY}
|
||||
@@ -479,7 +479,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libtiff COPYRIGHT)
|
||||
|
||||
Vendored
+2
-2
@@ -34,7 +34,7 @@ endif()
|
||||
|
||||
add_definitions(-DWEBP_USE_THREAD)
|
||||
|
||||
add_library(${WEBP_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
add_library(${WEBP_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
|
||||
if(ANDROID)
|
||||
target_link_libraries(${WEBP_LIBRARY} ${CPUFEATURES_LIBRARIES})
|
||||
endif()
|
||||
@@ -59,6 +59,6 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -125,7 +125,7 @@ if(MSVC AND CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qrestrict")
|
||||
endif()
|
||||
|
||||
add_library(IlmImf STATIC ${lib_hdrs} ${lib_srcs})
|
||||
add_library(IlmImf STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_hdrs} ${lib_srcs})
|
||||
target_link_libraries(IlmImf ${ZLIB_LIBRARIES})
|
||||
|
||||
set_target_properties(IlmImf
|
||||
@@ -142,7 +142,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(openexr LICENSE AUTHORS.ilmbase AUTHORS.openexr)
|
||||
|
||||
Vendored
+3
-2
@@ -140,7 +140,8 @@ append_if_exist(Protobuf_SRCS
|
||||
${PROTOBUF_ROOT}/src/google/protobuf/wrappers.pb.cc
|
||||
)
|
||||
|
||||
add_library(libprotobuf STATIC ${Protobuf_SRCS})
|
||||
include_directories(BEFORE "${PROTOBUF_ROOT}/src") # ensure using if own headers: https://github.com/opencv/opencv/issues/13328
|
||||
add_library(libprotobuf STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${Protobuf_SRCS})
|
||||
target_include_directories(libprotobuf SYSTEM PUBLIC $<BUILD_INTERFACE:${PROTOBUF_ROOT}/src>)
|
||||
set_target_properties(libprotobuf
|
||||
PROPERTIES
|
||||
@@ -156,7 +157,7 @@ get_protobuf_version(Protobuf_VERSION "${PROTOBUF_ROOT}/src")
|
||||
set(Protobuf_VERSION ${Protobuf_VERSION} CACHE INTERNAL "" FORCE)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(libprotobuf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(libprotobuf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(protobuf LICENSE README.md)
|
||||
|
||||
Vendored
+2
-2
@@ -8,7 +8,7 @@ ocv_include_directories(${CURR_INCLUDE_DIR})
|
||||
file(GLOB_RECURSE quirc_headers RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "include/*.h")
|
||||
file(GLOB_RECURSE quirc_sources RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "src/*.c")
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${quirc_headers} ${quirc_sources})
|
||||
add_library(${PROJECT_NAME} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${quirc_headers} ${quirc_sources})
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
@@ -24,7 +24,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${PROJECT_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${PROJECT_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(${PROJECT_NAME} LICENSE)
|
||||
|
||||
Vendored
+2
-1
@@ -108,7 +108,7 @@ set(tbb_version_file "version_string.ver")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}.cmakein" "${CMAKE_CURRENT_BINARY_DIR}/${tbb_version_file}" @ONLY)
|
||||
list(APPEND TBB_SOURCE_FILES "${CMAKE_CURRENT_BINARY_DIR}/${tbb_version_file}")
|
||||
|
||||
add_library(tbb ${TBB_SOURCE_FILES})
|
||||
add_library(tbb ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${TBB_SOURCE_FILES})
|
||||
target_compile_definitions(tbb PUBLIC
|
||||
TBB_USE_GCC_BUILTINS=1
|
||||
__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1
|
||||
@@ -165,6 +165,7 @@ ocv_install_target(tbb EXPORT OpenCVModules
|
||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs
|
||||
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev
|
||||
OPTIONAL
|
||||
)
|
||||
|
||||
ocv_install_3rdparty_licenses(tbb "${tbb_src_dir}/LICENSE" "${tbb_src_dir}/README")
|
||||
|
||||
Vendored
+1
-1
@@ -76,7 +76,7 @@ set(ZLIB_SRCS
|
||||
zutil.c
|
||||
)
|
||||
|
||||
add_library(${ZLIB_LIBRARY} STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
add_library(${ZLIB_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
set_target_properties(${ZLIB_LIBRARY} PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshift-negative-value
|
||||
|
||||
+26
-4
@@ -367,6 +367,9 @@ OCV_OPTION(WITH_MSMF_DXVA "Enable hardware acceleration in Media Foundation back
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT WINRT
|
||||
VERIFY HAVE_XIMEA)
|
||||
OCV_OPTION(WITH_UEYE "Include UEYE camera support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT APPLE AND NOT WINRT
|
||||
VERIFY HAVE_UEYE)
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF
|
||||
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
|
||||
VERIFY HAVE_XINE)
|
||||
@@ -439,6 +442,9 @@ OCV_OPTION(WITH_ANDROID_MEDIANDK "Use Android Media NDK for Video I/O (Android)"
|
||||
OCV_OPTION(WITH_TENGINE "Include Arm Inference Tengine support" OFF
|
||||
VISIBLE_IF (ARM OR AARCH64) AND (UNIX OR ANDROID) AND NOT IOS
|
||||
VERIFY HAVE_TENGINE)
|
||||
OCV_OPTION(WITH_ONNX "Include Microsoft ONNX Runtime support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_ONNX)
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
@@ -464,6 +470,7 @@ OCV_OPTION(BUILD_OBJC "Enable Objective-C support"
|
||||
# OpenCV installation options
|
||||
# ===================================================
|
||||
OCV_OPTION(INSTALL_CREATE_DISTRIB "Change install rules to build the distribution package" OFF )
|
||||
OCV_OPTION(INSTALL_BIN_EXAMPLES "Install prebuilt examples" WIN32 IF BUILD_EXAMPLES)
|
||||
OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
|
||||
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
|
||||
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
|
||||
@@ -774,6 +781,11 @@ if(WITH_QUIRC)
|
||||
add_subdirectory(3rdparty/quirc)
|
||||
set(HAVE_QUIRC TRUE)
|
||||
endif()
|
||||
|
||||
if(WITH_ONNX)
|
||||
include(cmake/FindONNX.cmake)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# OpenCV HAL
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -1371,6 +1383,10 @@ if(WITH_XIMEA OR HAVE_XIMEA)
|
||||
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_UEYE OR HAVE_UEYE)
|
||||
status(" uEye:" HAVE_UEYE THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_XINE OR HAVE_XINE)
|
||||
status(" Xine:" HAVE_XINE THEN "YES (ver ${XINE_VERSION})" ELSE NO)
|
||||
endif()
|
||||
@@ -1433,10 +1449,6 @@ if(WITH_VA OR HAVE_VA)
|
||||
status(" VA:" HAVE_VA THEN "YES" ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_VA_INTEL OR HAVE_VA_INTEL)
|
||||
status(" Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_TENGINE OR HAVE_TENGINE)
|
||||
status(" Tengine:" HAVE_TENGINE THEN "YES (${TENGINE_LIBRARIES})" ELSE NO)
|
||||
endif()
|
||||
@@ -1549,6 +1561,7 @@ if(WITH_OPENCL OR HAVE_OPENCL)
|
||||
IF HAVE_CLAMDFFT THEN "AMDFFT"
|
||||
IF HAVE_CLAMDBLAS THEN "AMDBLAS"
|
||||
IF HAVE_OPENCL_D3D11_NV THEN "NVD3D11"
|
||||
IF HAVE_VA_INTEL THEN "INTELVA"
|
||||
ELSE "no extra features")
|
||||
status("")
|
||||
status(" OpenCL:" HAVE_OPENCL THEN "YES (${opencl_features})" ELSE "NO")
|
||||
@@ -1558,6 +1571,15 @@ if(WITH_OPENCL OR HAVE_OPENCL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_ONNX OR HAVE_ONNX)
|
||||
status("")
|
||||
status(" ONNX:" HAVE_ONNX THEN "YES" ELSE "NO")
|
||||
if(HAVE_ONNX)
|
||||
status(" Include path:" ONNX_INCLUDE_DIR THEN "${ONNX_INCLUDE_DIR}" ELSE "NO")
|
||||
status(" Link libraries:" ONNX_LIBRARIES THEN "${ONNX_LIBRARIES}" ELSE "NO")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ========================== python ==========================
|
||||
if(BUILD_opencv_python2)
|
||||
status("")
|
||||
|
||||
@@ -32,7 +32,7 @@ bool calib::parametersController::loadFromFile(const std::string &inputFileName)
|
||||
|
||||
if(!reader.isOpened()) {
|
||||
std::cerr << "Warning: Unable to open " << inputFileName <<
|
||||
" Applicatioin stated with default advanced parameters" << std::endl;
|
||||
" Application started with default advanced parameters" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
ocv_clear_vars(HAVE_ONNX)
|
||||
|
||||
set(ONNXRT_ROOT_DIR "" CACHE PATH "ONNX Runtime install directory")
|
||||
|
||||
# For now, check the old name ORT_INSTALL_DIR
|
||||
if(ORT_INSTALL_DIR AND NOT ONNXRT_ROOT_DIR)
|
||||
set(ONNXRT_ROOT_DIR ORT_INSTALL_DIR)
|
||||
endif()
|
||||
|
||||
if(ONNXRT_ROOT_DIR)
|
||||
find_library(ORT_LIB onnxruntime
|
||||
${ONNXRT_ROOT_DIR}/lib
|
||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
||||
find_path(ORT_INCLUDE onnxruntime_cxx_api.h
|
||||
${ONNXRT_ROOT_DIR}/include/onnxruntime/core/session
|
||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
||||
endif()
|
||||
|
||||
if(ORT_LIB AND ORT_INCLUDE)
|
||||
set(HAVE_ONNX TRUE)
|
||||
# For CMake output only
|
||||
set(ONNX_LIBRARIES "${ORT_LIB}" CACHE STRING "ONNX Runtime libraries")
|
||||
set(ONNX_INCLUDE_DIR "${ORT_INCLUDE}" CACHE STRING "ONNX Runtime include path")
|
||||
|
||||
# Link target with associated interface headers
|
||||
set(ONNX_LIBRARY "onnxruntime" CACHE STRING "ONNX Link Target")
|
||||
ocv_add_library(${ONNX_LIBRARY} SHARED IMPORTED)
|
||||
set_target_properties(${ONNX_LIBRARY} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${ORT_INCLUDE}
|
||||
IMPORTED_LOCATION ${ORT_LIB}
|
||||
IMPORTED_IMPLIB ${ORT_LIB})
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_ONNX)
|
||||
ocv_clear_vars(HAVE_ONNX ORT_LIB ORT_INCLUDE_DIR)
|
||||
endif()
|
||||
@@ -100,7 +100,7 @@ if(CUDA_FOUND)
|
||||
set(_arch_pascal "6.0;6.1")
|
||||
set(_arch_volta "7.0")
|
||||
set(_arch_turing "7.5")
|
||||
set(_arch_ampere "8.0")
|
||||
set(_arch_ampere "8.0;8.6")
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
list(APPEND _generations "Auto")
|
||||
endif()
|
||||
@@ -208,7 +208,7 @@ if(CUDA_FOUND)
|
||||
|
||||
if(${status} EQUAL 0)
|
||||
# cache detected values
|
||||
set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${result_list}} CACHE INTERNAL "")
|
||||
set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${output}} CACHE INTERNAL "")
|
||||
set(OPENCV_CACHE_CUDA_ACTIVE_CC_check "${__cache_key_check}" CACHE INTERNAL "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -129,9 +129,9 @@ endif()
|
||||
|
||||
if(INF_ENGINE_TARGET)
|
||||
if(NOT INF_ENGINE_RELEASE)
|
||||
message(WARNING "InferenceEngine version has not been set, 2020.4 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
message(WARNING "InferenceEngine version has not been set, 2021.2 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
endif()
|
||||
set(INF_ENGINE_RELEASE "2020040000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2020.1.0.2 -> 2020010002)")
|
||||
set(INF_ENGINE_RELEASE "2021020000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2020.1.0.2 -> 2020010002)")
|
||||
set_target_properties(${INF_ENGINE_TARGET} PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "HAVE_INF_ENGINE=1;INF_ENGINE_RELEASE=${INF_ENGINE_RELEASE}"
|
||||
)
|
||||
|
||||
@@ -81,4 +81,13 @@ if(OPENCL_FOUND)
|
||||
|
||||
# check WITH_OPENCL_D3D11_NV is located in OpenCVDetectDirectX.cmake file
|
||||
|
||||
if(WITH_VA_INTEL AND HAVE_VA)
|
||||
if(HAVE_OPENCL AND EXISTS "${OPENCL_INCLUDE_DIR}/CL/cl_va_api_media_sharing_intel.h")
|
||||
set(HAVE_VA_INTEL ON)
|
||||
elseif(HAVE_OPENCL AND EXISTS "${OPENCL_INCLUDE_DIR}/CL/va_ext.h")
|
||||
set(HAVE_VA_INTEL ON)
|
||||
set(HAVE_VA_INTEL_OLD_HEADER ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -252,6 +252,7 @@ if(NOT DEFINED IPPROOT)
|
||||
else()
|
||||
ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/EULA.txt")
|
||||
endif()
|
||||
ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/third-party-programs.txt")
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT)
|
||||
|
||||
@@ -51,7 +51,12 @@ endif(WITH_CUDA)
|
||||
|
||||
# --- Eigen ---
|
||||
if(WITH_EIGEN AND NOT HAVE_EIGEN)
|
||||
find_package(Eigen3 QUIET)
|
||||
if(NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG)
|
||||
find_package(Eigen3 CONFIG QUIET) # Ceres 2.0.0 CMake scripts doesn't work with CMake's FindEigen3.cmake module (due to missing EIGEN3_VERSION_STRING)
|
||||
endif()
|
||||
if(NOT Eigen3_FOUND)
|
||||
find_package(Eigen3 QUIET)
|
||||
endif()
|
||||
|
||||
if(Eigen3_FOUND)
|
||||
if(TARGET Eigen3::Eigen)
|
||||
|
||||
@@ -3,15 +3,6 @@ if(WIN32)
|
||||
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32)
|
||||
endif(WIN32)
|
||||
|
||||
# --- VA & VA_INTEL ---
|
||||
if(WITH_VA_INTEL)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindVA_INTEL.cmake")
|
||||
if(VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
ocv_include_directories(${VA_INTEL_IOCL_INCLUDE_DIR})
|
||||
endif()
|
||||
set(WITH_VA YES)
|
||||
endif(WITH_VA_INTEL)
|
||||
|
||||
if(WITH_VA)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindVA.cmake")
|
||||
if(VA_INCLUDE_DIR)
|
||||
|
||||
@@ -57,7 +57,7 @@ SET(Open_BLAS_INCLUDE_SEARCH_PATHS
|
||||
)
|
||||
|
||||
SET(Open_BLAS_LIB_SEARCH_PATHS
|
||||
$ENV{OpenBLAS}cd
|
||||
$ENV{OpenBLAS}
|
||||
$ENV{OpenBLAS}/lib
|
||||
$ENV{OpenBLAS_HOME}
|
||||
$ENV{OpenBLAS_HOME}/lib
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Main variables:
|
||||
# HAVE_VA for conditional compilation OpenCV with/without libva
|
||||
# Output:
|
||||
# HAVE_VA - libva is available
|
||||
# HAVE_VA_INTEL - OpenCL/libva Intel interoperability extension is available
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
find_path(
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# Main variables:
|
||||
# VA_INTEL_IOCL_INCLUDE_DIR to use VA_INTEL
|
||||
# HAVE_VA_INTEL for conditional compilation OpenCV with/without VA_INTEL
|
||||
|
||||
# VA_INTEL_IOCL_ROOT - root of Intel OCL installation
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
ocv_check_environment_variables(VA_INTEL_IOCL_ROOT)
|
||||
if(NOT DEFINED VA_INTEL_IOCL_ROOT)
|
||||
set(VA_INTEL_IOCL_ROOT "/opt/intel/opencl")
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
VA_INTEL_IOCL_INCLUDE_DIR
|
||||
NAMES CL/va_ext.h
|
||||
PATHS ${VA_INTEL_IOCL_ROOT}
|
||||
PATH_SUFFIXES include
|
||||
DOC "Path to Intel OpenCL headers")
|
||||
endif()
|
||||
|
||||
if(VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
set(HAVE_VA_INTEL TRUE)
|
||||
if(NOT DEFINED VA_INTEL_LIBRARIES)
|
||||
set(VA_INTEL_LIBRARIES "va" "va-drm")
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_VA_INTEL FALSE)
|
||||
message(WARNING "Intel OpenCL installation is not found.")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FORCE VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
@@ -1364,8 +1364,8 @@ function(ocv_add_samples)
|
||||
add_dependencies(${the_target} opencv_videoio_plugins)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id}" COMPONENT samples)
|
||||
if(INSTALL_BIN_EXAMPLES)
|
||||
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${module_id}" COMPONENT samples)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -1881,3 +1881,9 @@ function(ocv_update_file filepath content)
|
||||
file(WRITE "${filepath}" "${content}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS AND (CMAKE_VERSION VERSION_LESS "3.14.0"))
|
||||
ocv_update(OPENCV_3RDPARTY_EXCLUDE_FROM_ALL "") # avoid CMake warnings: https://gitlab.kitware.com/cmake/cmake/-/issues/18938
|
||||
else()
|
||||
ocv_update(OPENCV_3RDPARTY_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
||||
endif()
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
opencv2/flann/hdf5.h
|
||||
opencv2/imgcodecs/imgcodecs_c.h
|
||||
opencv2/imgcodecs/ios.h
|
||||
opencv2/imgcodecs/macosx.h
|
||||
opencv2/videoio/videoio_c.h
|
||||
opencv2/videoio/cap_ios.h
|
||||
opencv2/xobjdetect/private.hpp
|
||||
|
||||
+15
-1
@@ -145,9 +145,23 @@ if(DOXYGEN_FOUND)
|
||||
set(tutorial_js_path "${CMAKE_CURRENT_SOURCE_DIR}/js_tutorials")
|
||||
set(example_path "${CMAKE_SOURCE_DIR}/samples")
|
||||
|
||||
set(doxygen_image_path
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/images
|
||||
${paths_doc}
|
||||
${tutorial_path}
|
||||
${tutorial_py_path}
|
||||
${tutorial_js_path}
|
||||
${paths_tutorial}
|
||||
#${OpenCV_SOURCE_DIR}/samples/data # TODO: need to resolve ambiguous conflicts first
|
||||
${OpenCV_SOURCE_DIR}
|
||||
${OpenCV_SOURCE_DIR}/modules # <opencv>/modules
|
||||
${OPENCV_EXTRA_MODULES_PATH} # <opencv_contrib>/modules
|
||||
${OPENCV_DOCS_EXTRA_IMAGE_PATH} # custom variable for user modules
|
||||
)
|
||||
|
||||
# set export variables
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_hal_interface} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial} ; ${tutorial_contrib_root}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/images ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${doxygen_image_path}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXCLUDE_LIST "${CMAKE_DOXYGEN_EXCLUDE_LIST}")
|
||||
string(REPLACE ";" " " CMAKE_DOXYGEN_ENABLED_SECTIONS "${CMAKE_DOXYGEN_ENABLED_SECTIONS}")
|
||||
# TODO: remove paths_doc from EXAMPLE_PATH after face module tutorials/samples moved to separate folders
|
||||
|
||||
@@ -59,7 +59,7 @@ Demo
|
||||
We use the function: **cv.grabCut (image, mask, rect, bgdModel, fgdModel, iterCount, mode = cv.GC_EVAL)**
|
||||
|
||||
@param image input 8-bit 3-channel image.
|
||||
@param mask input/output 8-bit single-channel mask. The mask is initialized by the function when mode is set to GC_INIT_WITH_RECT. Its elements may have one of the cv.rabCutClasses.
|
||||
@param mask input/output 8-bit single-channel mask. The mask is initialized by the function when mode is set to GC_INIT_WITH_RECT. Its elements may have one of the cv.grabCutClasses.
|
||||
@param rect ROI containing a segmented object. The pixels outside of the ROI are marked as "obvious background". The parameter is only used when mode==GC_INIT_WITH_RECT.
|
||||
@param bgdModel temporary array for the background model. Do not modify it while you are processing the same image.
|
||||
@param fgdModel temporary arrays for the foreground model. Do not modify it while you are processing the same image.
|
||||
@@ -73,4 +73,4 @@ Try it
|
||||
<iframe src="../../js_grabcut_grabCut.html" width="100%"
|
||||
onload="this.style.height=this.contentDocument.body.scrollHeight +'px';">
|
||||
</iframe>
|
||||
\endhtmlonly
|
||||
\endhtmlonly
|
||||
|
||||
@@ -32,6 +32,15 @@ source ./emsdk_env.sh
|
||||
echo ${EMSCRIPTEN}
|
||||
@endcode
|
||||
|
||||
The version 1.39.16 of emscripten is verified for latest WebAssembly. Please check the version of emscripten to use the newest features of WebAssembly.
|
||||
|
||||
For example:
|
||||
@code{.bash}
|
||||
./emsdk update
|
||||
./emsdk install 1.39.16
|
||||
./emsdk activate 1.39.16
|
||||
@endcode
|
||||
|
||||
Obtaining OpenCV Source Code
|
||||
--------------------------
|
||||
|
||||
@@ -76,6 +85,31 @@ Building OpenCV.js from Source
|
||||
python ./platforms/js/build_js.py build_wasm --build_wasm
|
||||
@endcode
|
||||
|
||||
-# [Optional] To build the OpenCV.js loader, append `--build_loader`.
|
||||
|
||||
For example:
|
||||
@code{.bash}
|
||||
python ./platforms/js/build_js.py build_js --build_loader
|
||||
@endcode
|
||||
|
||||
@note
|
||||
The loader is implemented as a js file in the path `<opencv_js_dir>/bin/loader.js`. The loader utilizes the [WebAssembly Feature Detection](https://github.com/GoogleChromeLabs/wasm-feature-detect) to detect the features of the broswer and load corresponding OpenCV.js automatically. To use it, you need to use the UMD version of [WebAssembly Feature Detection](https://github.com/GoogleChromeLabs/wasm-feature-detect) and introduce the `loader.js` in your Web application.
|
||||
|
||||
Example Code:
|
||||
@code{.javascipt}
|
||||
// Set paths configuration
|
||||
let pathsConfig = {
|
||||
wasm: "../../build_wasm/opencv.js",
|
||||
threads: "../../build_mt/opencv.js",
|
||||
simd: "../../build_simd/opencv.js",
|
||||
threadsSimd: "../../build_mtSIMD/opencv.js",
|
||||
}
|
||||
|
||||
// Load OpenCV.js and use the pathsConfiguration and main function as the params.
|
||||
loadOpenCV(pathsConfig, main);
|
||||
@endcode
|
||||
|
||||
|
||||
-# [optional] To build documents, append `--build_doc` option.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -92,11 +92,11 @@ def main():
|
||||
dest="square_size", type=float)
|
||||
parser.add_argument("-R", "--radius_rate", help="circles_radius = square_size/radius_rate", default="5.0",
|
||||
action="store", dest="radius_rate", type=float)
|
||||
parser.add_argument("-w", "--page_width", help="page width in units", default="216", action="store",
|
||||
parser.add_argument("-w", "--page_width", help="page width in units", default=argparse.SUPPRESS, action="store",
|
||||
dest="page_width", type=float)
|
||||
parser.add_argument("-h", "--page_height", help="page height in units", default="279", action="store",
|
||||
dest="page_width", type=float)
|
||||
parser.add_argument("-a", "--page_size", help="page size, supersedes -h -w arguments", default="A4", action="store",
|
||||
parser.add_argument("-h", "--page_height", help="page height in units", default=argparse.SUPPRESS, action="store",
|
||||
dest="page_height", type=float)
|
||||
parser.add_argument("-a", "--page_size", help="page size, superseded if -h and -w are set", default="A4", action="store",
|
||||
dest="page_size", choices=["A0", "A1", "A2", "A3", "A4", "A5"])
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -111,12 +111,16 @@ def main():
|
||||
units = args.units
|
||||
square_size = args.square_size
|
||||
radius_rate = args.radius_rate
|
||||
page_size = args.page_size
|
||||
# page size dict (ISO standard, mm) for easy lookup. format - size: [width, height]
|
||||
page_sizes = {"A0": [840, 1188], "A1": [594, 840], "A2": [420, 594], "A3": [297, 420], "A4": [210, 297],
|
||||
"A5": [148, 210]}
|
||||
page_width = page_sizes[page_size.upper()][0]
|
||||
page_height = page_sizes[page_size.upper()][1]
|
||||
if 'page_width' and 'page_height' in args:
|
||||
page_width = args.page_width
|
||||
page_height = args.page_height
|
||||
else:
|
||||
page_size = args.page_size
|
||||
# page size dict (ISO standard, mm) for easy lookup. format - size: [width, height]
|
||||
page_sizes = {"A0": [840, 1188], "A1": [594, 840], "A2": [420, 594], "A3": [297, 420], "A4": [210, 297],
|
||||
"A5": [148, 210]}
|
||||
page_width = page_sizes[page_size][0]
|
||||
page_height = page_sizes[page_size][1]
|
||||
pm = PatternMaker(columns, rows, output, units, square_size, radius_rate, page_width, page_height)
|
||||
# dict for easy lookup of pattern type
|
||||
mp = {"circles": pm.make_circles_pattern, "acircles": pm.make_acircles_pattern,
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ pixelpoints = np.transpose(np.nonzero(mask))
|
||||
Here, two methods, one using Numpy functions, next one using OpenCV function (last commented line)
|
||||
are given to do the same. Results are also same, but with a slight difference. Numpy gives
|
||||
coordinates in **(row, column)** format, while OpenCV gives coordinates in **(x,y)** format. So
|
||||
basically the answers will be interchanged. Note that, **row = x** and **column = y**.
|
||||
basically the answers will be interchanged. Note that, **row = y** and **column = x**.
|
||||
|
||||
7. Maximum Value, Minimum Value and their locations
|
||||
---------------------------------------------------
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 18 KiB |
@@ -48,7 +48,7 @@ titles = ['Original Image','BINARY','BINARY_INV','TRUNC','TOZERO','TOZERO_INV']
|
||||
images = [img, thresh1, thresh2, thresh3, thresh4, thresh5]
|
||||
|
||||
for i in xrange(6):
|
||||
plt.subplot(2,3,i+1),plt.imshow(images[i],'gray')
|
||||
plt.subplot(2,3,i+1),plt.imshow(images[i],'gray',vmin=0,vmax=255)
|
||||
plt.title(titles[i])
|
||||
plt.xticks([]),plt.yticks([])
|
||||
|
||||
|
||||
+20
-3
@@ -6,12 +6,11 @@ body, table, div, p, dl {
|
||||
}
|
||||
|
||||
code {
|
||||
font: 12px Consolas, "Liberation Mono", Courier, monospace;
|
||||
font-size: 85%;
|
||||
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
|
||||
white-space: pre-wrap;
|
||||
padding: 1px 5px;
|
||||
padding: 0;
|
||||
background-color: #ddd;
|
||||
background-color: rgb(223, 229, 241);
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
@@ -20,6 +19,16 @@ body {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div.fragment {
|
||||
padding: 3px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
div.line {
|
||||
padding-bottom: 3px;
|
||||
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
|
||||
}
|
||||
|
||||
div.contents {
|
||||
width: 980px;
|
||||
margin: 0 auto;
|
||||
@@ -35,3 +44,11 @@ span.arrow {
|
||||
div.image img{
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
#projectlogo
|
||||
{
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-collapse: separate;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ Explanation
|
||||
form an ill-posed problem, so the calibration will fail. For square images the positions of the
|
||||
corners are only approximate. We may improve this by calling the @ref cv::cornerSubPix function.
|
||||
(`winSize` is used to control the side length of the search window. Its default value is 11.
|
||||
`winSzie` may be changed by command line parameter `--winSize=<number>`.)
|
||||
`winSize` may be changed by command line parameter `--winSize=<number>`.)
|
||||
It will produce better calibration result. After this we add a valid inputs result to the
|
||||
*imagePoints* vector to collect all of the equations into a single container. Finally, for
|
||||
visualization feedback purposes we will draw the found points on the input image using @ref
|
||||
|
||||
@@ -4,6 +4,13 @@ OpenCV4Android SDK {#tutorial_O4A_SDK}
|
||||
@prev_tutorial{tutorial_android_dev_intro}
|
||||
@next_tutorial{tutorial_dev_with_OCV_on_Android}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Vsevolod Glumov |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial is deprecated.
|
||||
|
||||
This tutorial was designed to help you with installation and configuration of OpenCV4Android SDK.
|
||||
|
||||
|
||||
@@ -4,6 +4,14 @@ Introduction into Android Development {#tutorial_android_dev_intro}
|
||||
@prev_tutorial{tutorial_clojure_dev_intro}
|
||||
@next_tutorial{tutorial_O4A_SDK}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Vsevolod Glumov |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial is deprecated.
|
||||
|
||||
|
||||
This guide was designed to help you in learning Android development basics and setting up your
|
||||
working environment quickly. It was written with Windows 7 in mind, though it would work with Linux
|
||||
|
||||
@@ -4,6 +4,13 @@ Use OpenCL in Android camera preview based CV application {#tutorial_android_ocl
|
||||
@prev_tutorial{tutorial_dev_with_OCV_on_Android}
|
||||
@next_tutorial{tutorial_macos_install}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Andrey Pavlenko |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial is deprecated.
|
||||
|
||||
This guide was designed to help you in use of [OpenCL ™](https://www.khronos.org/opencl/) in Android camera preview based CV application.
|
||||
It was written for [Eclipse-based ADT tools](http://developer.android.com/tools/help/adt.html)
|
||||
|
||||
@@ -4,6 +4,13 @@ Android Development with OpenCV {#tutorial_dev_with_OCV_on_Android}
|
||||
@prev_tutorial{tutorial_O4A_SDK}
|
||||
@next_tutorial{tutorial_android_ocl_intro}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Vsevolod Glumov |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial is deprecated.
|
||||
|
||||
This tutorial has been created to help you use OpenCV library within your Android project.
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ Building OpenCV for Tegra with CUDA {#tutorial_building_tegra_cuda}
|
||||
@prev_tutorial{tutorial_arm_crosscompile_with_cmake}
|
||||
@next_tutorial{tutorial_display_image}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Randy J. Ray |
|
||||
| Compatibility | OpenCV >= 3.1.0 |
|
||||
|
||||
@warning
|
||||
This tutorial is deprecated.
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ Introduction to OpenCV Development with Clojure {#tutorial_clojure_dev_intro}
|
||||
@prev_tutorial{tutorial_java_eclipse}
|
||||
@next_tutorial{tutorial_android_dev_intro}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Mimmo Cosenza |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
As of OpenCV 2.4.4, OpenCV supports desktop Java development using nearly the same interface as for
|
||||
Android development.
|
||||
|
||||
@@ -0,0 +1,589 @@
|
||||
OpenCV configuration options reference {#tutorial_config_reference}
|
||||
======================================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
# Introduction {#tutorial_config_reference_intro}
|
||||
|
||||
@note
|
||||
We assume you have read @ref tutorial_general_install tutorial or have experience with CMake.
|
||||
|
||||
Configuration options can be set in several different ways:
|
||||
* Command line: `cmake -Doption=value ...`
|
||||
* Initial cache files: `cmake -C my_options.txt ...`
|
||||
* Interactive via GUI
|
||||
|
||||
In this reference we will use regular command line.
|
||||
|
||||
Most of the options can be found in the root cmake script of OpenCV: `opencv/CMakeLists.txt`. Some options can be defined in specific modules.
|
||||
|
||||
It is possible to use CMake tool to print all available options:
|
||||
```.sh
|
||||
# initial configuration
|
||||
cmake ../opencv
|
||||
|
||||
# print all options
|
||||
cmake -L
|
||||
|
||||
# print all options with help message
|
||||
cmake -LH
|
||||
|
||||
# print all options including advanced
|
||||
cmake -LA
|
||||
```
|
||||
|
||||
Most popular and useful are options starting with `WITH_`, `ENABLE_`, `BUILD_`, `OPENCV_`.
|
||||
|
||||
Default values vary depending on platform and other options values.
|
||||
|
||||
|
||||
# General options {#tutorial_config_reference_general}
|
||||
|
||||
## Build with extra modules {#tutorial_config_reference_general_contrib}
|
||||
|
||||
`OPENCV_EXTRA_MODULES_PATH` option contains a semicolon-separated list of directories containing extra modules which will be added to the build. Module directory must have compatible layout and CMakeLists.txt, brief description can be found in the [Coding Style Guide](https://github.com/opencv/opencv/wiki/Coding_Style_Guide).
|
||||
|
||||
Examples:
|
||||
```.sh
|
||||
# build with all modules in opencv_contrib
|
||||
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
|
||||
|
||||
# build with one of opencv_contrib modules
|
||||
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/bgsegm ../opencv
|
||||
|
||||
# build with two custom modules (semicolon must be escaped in bash)
|
||||
cmake -DOPENCV_EXTRA_MODULES_PATH=../my_mod1\;../my_mod2 ../opencv
|
||||
```
|
||||
|
||||
@note
|
||||
Only 0- and 1-level deep module locations are supported, following command will raise an error:
|
||||
```.sh
|
||||
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib ../opencv
|
||||
```
|
||||
|
||||
|
||||
## Debug build {#tutorial_config_reference_general_debug}
|
||||
|
||||
`CMAKE_BUILD_TYPE` option can be used to enable debug build; resulting binaries will contain debug symbols and most of compiler optimizations will be turned off. To enable debug symbols in Release build turn the `BUILD_WITH_DEBUG_INFO` option on.
|
||||
|
||||
On some platforms (e.g. Linux) build type must be set at configuration stage:
|
||||
```.sh
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ../opencv
|
||||
cmake --build .
|
||||
```
|
||||
On other platforms different types of build can be produced in the same build directory (e.g. Visual Studio, XCode):
|
||||
```.sh
|
||||
cmake <options> ../opencv
|
||||
cmake --build . --config Debug
|
||||
```
|
||||
|
||||
If you use GNU libstdc++ (default for GCC) you can turn on the `ENABLE_GNU_STL_DEBUG` option, then C++ library will be used in Debug mode, e.g. indexes will be bound-checked during vector element access.
|
||||
|
||||
Many kinds of optimizations can be disabled with `CV_DISABLE_OPTIMIZATION` option:
|
||||
* Some third-party libraries (e.g. IPP, Lapack, Eigen)
|
||||
* Explicit vectorized implementation (universal intrinsics, raw intrinsics, etc.)
|
||||
* Dispatched optimizations
|
||||
* Explicit loop unrolling
|
||||
|
||||
@see https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
@see https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
|
||||
@see https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
||||
|
||||
|
||||
## Static build {#tutorial_config_reference_general_static}
|
||||
|
||||
`BUILD_SHARED_LIBS` option control whether to produce dynamic (.dll, .so, .dylib) or static (.a, .lib) libraries. Default value depends on target platform, in most cases it is `ON`.
|
||||
|
||||
Example:
|
||||
```.sh
|
||||
cmake -DBUILD_SHARED_LIBS=OFF ../opencv
|
||||
```
|
||||
|
||||
@see https://en.wikipedia.org/wiki/Static_library
|
||||
|
||||
`ENABLE_PIC` sets the [CMAKE_POSITION_INDEPENDENT_CODE](https://cmake.org/cmake/help/latest/variable/CMAKE_POSITION_INDEPENDENT_CODE.html) option. It enables or disable generation of "position-independent code". This option must be enabled when building dynamic libraries or static libraries intended to be linked into dynamic libraries. Default value is `ON`.
|
||||
|
||||
@see https://en.wikipedia.org/wiki/Position-independent_code
|
||||
|
||||
|
||||
## Generate pkg-config info
|
||||
|
||||
`OPENCV_GENERATE_PKGCONFIG` option enables `.pc` file generation along with standard CMake package. This file can be useful for projects which do not use CMake for build.
|
||||
|
||||
Example:
|
||||
```.sh
|
||||
cmake -DOPENCV_GENERATE_PKGCONFIG=ON ../opencv
|
||||
```
|
||||
|
||||
@note
|
||||
Due to complexity of configuration process resulting `.pc` file can contain incomplete list of third-party dependencies and may not work in some configurations, especially for static builds. This feature is not officially supported since 4.x version and is disabled by default.
|
||||
|
||||
|
||||
## Build tests, samples and applications {#tutorial_config_reference_general_tests}
|
||||
|
||||
There are two kinds of tests: accuracy (`opencv_test_*`) and performance (`opencv_perf_*`). Tests and applications are enabled by default. Examples are not being built by default and should be enabled explicitly.
|
||||
|
||||
Corresponding _cmake_ options:
|
||||
```.sh
|
||||
cmake \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DBUILD_PERF_TESTS=ON \
|
||||
-DBUILD_EXAMPLES=ON \
|
||||
-DBUILD_opencv_apps=ON \
|
||||
../opencv
|
||||
```
|
||||
|
||||
|
||||
## Build limited set of modules {#tutorial_config_reference_general_modules}
|
||||
|
||||
Each module is a subdirectory of the `modules` directory. It is possible to disable one module:
|
||||
```.sh
|
||||
cmake -DBUILD_opencv_calib3d=OFF ../opencv
|
||||
```
|
||||
|
||||
The opposite option is to build only specified modules and all modules they depend on:
|
||||
```.sh
|
||||
cmake -DBUILD_LIST=calib3d,videoio,ts ../opencv
|
||||
```
|
||||
In this example we requested 3 modules and configuration script has determined all dependencies automatically:
|
||||
```
|
||||
-- OpenCV modules:
|
||||
-- To be built: calib3d core features2d flann highgui imgcodecs imgproc ts videoio
|
||||
```
|
||||
|
||||
|
||||
## Downloaded dependencies {#tutorial_config_reference_general_download}
|
||||
|
||||
Configuration script can try to download additional libraries and files from the internet, if it fails to do it corresponding features will be turned off. In some cases configuration error can occur. By default all files are first downloaded to the `<source>/.cache` directory and then unpacked or copied to the build directory. It is possible to change download cache location by setting environment variable or configuration option:
|
||||
```.sh
|
||||
export OPENCV_DOWNLOAD_PATH=/tmp/opencv-cache
|
||||
cmake ../opencv
|
||||
# or
|
||||
cmake -DOPENCV_DOWNLOAD_PATH=/tmp/opencv-cache ../opencv
|
||||
```
|
||||
|
||||
In case of access via proxy, corresponding environment variables should be set before running cmake:
|
||||
```.sh
|
||||
export http_proxy=<proxy-host>:<port>
|
||||
export https_proxy=<proxy-host>:<port>
|
||||
```
|
||||
|
||||
Full log of download process can be found in build directory - `CMakeDownloadLog.txt`. In addition, for each failed download a command will be added to helper scripts in the build directory, e.g. `download_with_wget.sh`. Users can run these scripts as is or modify according to their needs.
|
||||
|
||||
|
||||
## CPU optimization level {#tutorial_config_reference_general_cpu}
|
||||
|
||||
On x86_64 machines the library will be compiled for SSE3 instruction set level by default. This level can be changed by configuration option:
|
||||
```.sh
|
||||
cmake -DCPU_BASELINE=AVX2 ../opencv
|
||||
```
|
||||
|
||||
@note
|
||||
Other platforms have their own instruction set levels: `VFPV3` and `NEON` on ARM, `VSX` on PowerPC.
|
||||
|
||||
Some functions support dispatch mechanism allowing to compile them for several instruction sets and to choose one during runtime. List of enabled instruction sets can be changed during configuration:
|
||||
```.sh
|
||||
cmake -DCPU_DISPATCH=AVX,AVX2 ../opencv
|
||||
```
|
||||
To disable dispatch mechanism this option should be set to an empty value:
|
||||
```.sh
|
||||
cmake -DCPU_DISPATCH= ../opencv
|
||||
```
|
||||
|
||||
It is possible to disable optimized parts of code for troubleshooting and debugging:
|
||||
```.sh
|
||||
# disable universal intrinsics
|
||||
cmake -DCV_ENABLE_INTRINSICS=OFF ../opencv
|
||||
# disable all possible built-in optimizations
|
||||
cmake -DCV_DISABLE_OPTIMIZATION=ON ../opencv
|
||||
```
|
||||
|
||||
@note
|
||||
More details on CPU optimization options can be found in wiki: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
||||
|
||||
|
||||
## Profiling, coverage, sanitize, hardening, size optimization
|
||||
|
||||
Following options can be used to produce special builds with instrumentation or improved security. All options are disabled by default.
|
||||
|
||||
| Option | Compiler | Description |
|
||||
| `ENABLE_PROFILING` | GCC or Clang | Enable profiling compiler and linker options. |
|
||||
| `ENABLE_COVERAGE` | GCC or Clang | Enable code coverage support. |
|
||||
| `OPENCV_ENABLE_MEMORY_SANITIZER` | N/A | Enable several quirks in code to assist memory sanitizer. |
|
||||
| `ENABLE_BUILD_HARDENING` | GCC, Clang, MSVC | Enable compiler options which reduce possibility of code exploitation. |
|
||||
| `ENABLE_LTO` | GCC, Clang, MSVC | Enable Link Time Optimization (LTO). |
|
||||
| `ENABLE_THIN_LTO` | Clang | Enable thin LTO which incorporates intermediate bitcode to binaries allowing consumers optimize their applications later. |
|
||||
|
||||
@see [GCC instrumentation](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html)
|
||||
@see [Build hardening](https://en.wikipedia.org/wiki/Hardening_(computing))
|
||||
@see [Interprocedural optimization](https://en.wikipedia.org/wiki/Interprocedural_optimization)
|
||||
@see [Link time optimization](https://gcc.gnu.org/wiki/LinkTimeOptimization)
|
||||
@see [ThinLTO](https://clang.llvm.org/docs/ThinLTO.html)
|
||||
|
||||
|
||||
# Functional features and dependencies {#tutorial_config_reference_func}
|
||||
|
||||
There are many optional dependencies and features that can be turned on or off. _cmake_ has special option allowing to print all available configuration parameters:
|
||||
```.sh
|
||||
cmake -LH ../opencv
|
||||
```
|
||||
|
||||
|
||||
## Options naming conventions
|
||||
|
||||
There are three kinds of options used to control dependencies of the library, they have different prefixes:
|
||||
- Options starting with `WITH_` enable or disable a dependency
|
||||
- Options starting with `BUILD_` enable or disable building and using 3rdparty library bundled with OpenCV
|
||||
- Options starting with `HAVE_` indicate that dependency have been enabled, can be used to manually enable a dependency if automatic detection can not be used.
|
||||
|
||||
When `WITH_` option is enabled:
|
||||
- If `BUILD_` option is enabled, 3rdparty library will be built and enabled => `HAVE_` set to `ON`
|
||||
- If `BUILD_` option is disabled, 3rdparty library will be detected and enabled if found => `HAVE_` set to `ON` if dependency is found
|
||||
|
||||
|
||||
## Heterogeneous computation {#tutorial_config_reference_func_hetero}
|
||||
|
||||
### CUDA support
|
||||
|
||||
`WITH_CUDA` (default: _OFF_)
|
||||
|
||||
Many algorithms have been implemented using CUDA acceleration, these functions are located in separate modules. CUDA toolkit must be installed from the official NVIDIA site as a prerequisite. For cmake versions older than 3.9 OpenCV uses own `cmake/FindCUDA.cmake` script, for newer versions - the one packaged with CMake. Additional options can be used to control build process, e.g. `CUDA_GENERATION` or `CUDA_ARCH_BIN`. These parameters are not documented yet, please consult with the `cmake/OpenCVDetectCUDA.cmake` script for details.
|
||||
|
||||
@note Since OpenCV version 4.0 all CUDA-accelerated algorithm implementations have been moved to the _opencv_contrib_ repository. To build _opencv_ and _opencv_contrib_ together check @ref tutorial_config_reference_general_contrib.
|
||||
|
||||
@cond CUDA_MODULES
|
||||
@note Some tutorials can be found in the corresponding section: @ref tutorial_table_of_content_gpu
|
||||
@see @ref cuda
|
||||
@endcond
|
||||
|
||||
@see https://en.wikipedia.org/wiki/CUDA
|
||||
|
||||
TODO: other options: `WITH_CUFFT`, `WITH_CUBLAS`, `WITH_NVCUVID`?
|
||||
|
||||
### OpenCL support
|
||||
|
||||
`WITH_OPENCL` (default: _ON_)
|
||||
|
||||
Multiple OpenCL-accelerated algorithms are available via so-called "Transparent API (T-API)". This integration uses same functions at the user level as regular CPU implementations. Switch to the OpenCL execution branch happens if input and output image arguments are passed as opaque cv::UMat objects. More information can be found in [the brief introduction](https://opencv.org/opencl/) and @ref core_opencl
|
||||
|
||||
At the build time this feature does not have any prerequisites. During runtime a working OpenCL runtime is required, to check it run `clinfo` and/or `opencv_version --opencl` command. Some parameters of OpenCL integration can be modified using environment variables, e.g. `OPENCV_OPENCL_DEVICE`. However there is no thorough documentation for this feature yet, so please check the source code in `modules/core/src/ocl.cpp` file for details.
|
||||
|
||||
@see https://en.wikipedia.org/wiki/OpenCL
|
||||
|
||||
TODO: other options: `WITH_OPENCL_SVM`, `WITH_OPENCLAMDFFT`, `WITH_OPENCLAMDBLAS`, `WITH_OPENCL_D3D11_NV`, `WITH_VA_INTEL`
|
||||
|
||||
## Image reading and writing (imgcodecs module) {#tutorial_config_reference_func_imgcodecs}
|
||||
|
||||
### Built-in formats
|
||||
|
||||
Following formats can be read by OpenCV without help of any third-party library:
|
||||
|
||||
- [BMP](https://en.wikipedia.org/wiki/BMP_file_format)
|
||||
- [HDR](https://en.wikipedia.org/wiki/RGBE_image_format) (`WITH_IMGCODEC_HDR`)
|
||||
- [Sun Raster](https://en.wikipedia.org/wiki/Sun_Raster) (`WITH_IMGCODEC_SUNRASTER`)
|
||||
- [PPM, PGM, PBM, PFM](https://en.wikipedia.org/wiki/Netpbm#File_formats) (`WITH_IMGCODEC_PXM`, `WITH_IMGCODEC_PFM`)
|
||||
|
||||
|
||||
### PNG, JPEG, TIFF, WEBP support
|
||||
|
||||
| Formats | Option | Default | Force build own |
|
||||
| --------| ------ | ------- | --------------- |
|
||||
| [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) | `WITH_PNG` | _ON_ | `BUILD_PNG` |
|
||||
| [JPEG](https://en.wikipedia.org/wiki/JPEG) | `WITH_JPEG` | _ON_ | `BUILD_JPEG` |
|
||||
| [TIFF](https://en.wikipedia.org/wiki/TIFF) | `WITH_TIFF` | _ON_ | `BUILD_TIFF` |
|
||||
| [WEBP](https://en.wikipedia.org/wiki/WebP) | `WITH_WEBP` | _ON_ | `BUILD_WEBP` |
|
||||
| [JPEG2000 with OpenJPEG](https://en.wikipedia.org/wiki/OpenJPEG) | `WITH_OPENJPEG` | _ON_ | `BUILD_OPENJPEG` |
|
||||
| [JPEG2000 with JasPer](https://en.wikipedia.org/wiki/JasPer) | `WITH_JASPER` | _ON_ (see note) | `BUILD_JASPER` |
|
||||
| [EXR](https://en.wikipedia.org/wiki/OpenEXR) | `WITH_OPENEXR` | _ON_ | `BUILD_OPENEXR` |
|
||||
|
||||
All libraries required to read images in these formats are included into OpenCV and will be built automatically if not found at the configuration stage. Corresponding `BUILD_*` options will force building and using own libraries, they are enabled by default on some platforms, e.g. Windows.
|
||||
|
||||
@note OpenJPEG have higher priority than JasPer which is deprecated. In order to use JasPer, OpenJPEG must be disabled.
|
||||
|
||||
|
||||
### GDAL integration
|
||||
|
||||
`WITH_GDAL` (default: _OFF_)
|
||||
|
||||
[GDAL](https://en.wikipedia.org/wiki/GDAL) is a higher level library which supports reading multiple file formats including PNG, JPEG and TIFF. It will have higher priority when opening files and can override other backends. This library will be searched using cmake package mechanism, make sure it is installed correctly or manually set `GDAL_DIR` environment or cmake variable.
|
||||
|
||||
|
||||
### GDCM integration
|
||||
|
||||
`WITH_GDCM` (default: _OFF_)
|
||||
|
||||
Enables [DICOM](https://en.wikipedia.org/wiki/DICOM) medical image format support through [GDCM library](https://en.wikipedia.org/wiki/GDCM). This library will be searched using cmake package mechanism, make sure it is installed correctly or manually set `GDCM_DIR` environment or cmake variable.
|
||||
|
||||
|
||||
## Video reading and writing (videoio module) {#tutorial_config_reference_func_videoio}
|
||||
|
||||
TODO: how videoio works, registry, priorities
|
||||
|
||||
### Video4Linux
|
||||
|
||||
`WITH_V4L` (Linux; default: _ON_ )
|
||||
|
||||
Capture images from camera using [Video4Linux](https://en.wikipedia.org/wiki/Video4Linux) API. Linux kernel headers must be installed.
|
||||
|
||||
### FFmpeg
|
||||
|
||||
`WITH_FFMPEG` (default: _ON_)
|
||||
|
||||
Integration with [FFmpeg](https://en.wikipedia.org/wiki/FFmpeg) library for decoding and encoding video files and network streams. This library can read and write many popular video formats. It consists of several components which must be installed as prerequisites for the build:
|
||||
- _avcodec_
|
||||
- _avformat_
|
||||
- _avutil_
|
||||
- _swscale_
|
||||
- _avresample_ (optional)
|
||||
|
||||
Exception is Windows platform where a prebuilt [plugin library containing FFmpeg](https://github.com/opencv/opencv_3rdparty/tree/ffmpeg/master) will be downloaded during a configuration stage and copied to the `bin` folder with all produced libraries.
|
||||
|
||||
@note [Libav](https://en.wikipedia.org/wiki/Libav) library can be used instead of FFmpeg, but this combination is not actively supported.
|
||||
|
||||
### GStreamer
|
||||
|
||||
`WITH_GSTREAMER` (default: _ON_)
|
||||
|
||||
Enable integration with [GStreamer](https://en.wikipedia.org/wiki/GStreamer) library for decoding and encoding video files, capturing frames from cameras and network streams. Numerous plugins can be installed to extend supported formats list. OpenCV allows running arbitrary GStreamer pipelines passed as strings to @ref cv::VideoCapture and @ref cv::VideoWriter objects.
|
||||
|
||||
Various GStreamer plugins offer HW-accelerated video processing on different platforms.
|
||||
|
||||
|
||||
### Microsoft Media Foundation
|
||||
|
||||
`WITH_MSMF` (Windows; default: _ON_)
|
||||
|
||||
Enables MSMF backend which uses Windows' built-in [Media Foundation framework](https://en.wikipedia.org/wiki/Media_Foundation). Can be used to capture frames from camera, decode and encode video files. This backend have HW-accelerated processing support (`WITH_MSMF_DXVA` option, default is _ON_).
|
||||
|
||||
@note Older versions of Windows (prior to 10) can have incompatible versions of Media Foundation and are known to have problems when used from OpenCV.
|
||||
|
||||
|
||||
### DirectShow
|
||||
|
||||
`WITH_DSHOW` (Windows; default: _ON_)
|
||||
|
||||
This backend uses older [DirectShow](https://en.wikipedia.org/wiki/DirectShow) framework. It can be used only to capture frames from camera. It is now deprecated in favor of MSMF backend, although both can be enabled in the same build.
|
||||
|
||||
|
||||
### AVFoundation
|
||||
|
||||
`WITH_AVFOUNDATION` (Apple; default: _ON_)
|
||||
|
||||
[AVFoundation](https://en.wikipedia.org/wiki/AVFoundation) framework is part of Apple platforms and can be used to capture frames from camera, encode and decode video files.
|
||||
|
||||
|
||||
### Other backends
|
||||
|
||||
There are multiple less popular frameworks which can be used to read and write videos. Each requires corresponding library or SDK installed.
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `WITH_1394` | _ON_ | [IIDC IEEE1394](https://en.wikipedia.org/wiki/IEEE_1394#IIDC) support using DC1394 library |
|
||||
| `WITH_OPENNI` | _OFF_ | [OpenNI](https://en.wikipedia.org/wiki/OpenNI) can be used to capture data from depth-sensing cameras. Deprecated. |
|
||||
| `WITH_OPENNI2` | _OFF_ | [OpenNI2](https://structure.io/openni) can be used to capture data from depth-sensing cameras. |
|
||||
| `WITH_PVAPI` | _OFF_ | [PVAPI](https://www.alliedvision.com/en/support/software-downloads.html) is legacy SDK for Prosilica GigE cameras. Deprecated. |
|
||||
| `WITH_ARAVIS` | _OFF_ | [Aravis](https://github.com/AravisProject/aravis) library is used for video acquisition using Genicam cameras. |
|
||||
| `WITH_XIMEA` | _OFF_ | [XIMEA](https://www.ximea.com/) cameras support. |
|
||||
| `WITH_XINE` | _OFF_ | [XINE](https://en.wikipedia.org/wiki/Xine) library support. |
|
||||
| `WITH_LIBREALSENSE` | _OFF_ | [RealSense](https://en.wikipedia.org/wiki/Intel_RealSense) cameras support. |
|
||||
| `WITH_MFX` | _OFF_ | [MediaSDK](http://mediasdk.intel.com/) library can be used for HW-accelerated decoding and encoding of raw video streams. |
|
||||
| `WITH_GPHOTO2` | _OFF_ | [GPhoto](https://en.wikipedia.org/wiki/GPhoto) library can be used to capure frames from cameras. |
|
||||
| `WITH_ANDROID_MEDIANDK` | _ON_ | [MediaNDK](https://developer.android.com/ndk/guides/stable_apis#libmediandk) library is available on Android since API level 21. |
|
||||
|
||||
|
||||
### videoio plugins
|
||||
|
||||
Some _videoio_ backends can be built as plugins thus breaking strict dependency on third-party libraries and making them optional at runtime. Following options can be used to control this mechanism:
|
||||
|
||||
| Option | Default | Description |
|
||||
| --------| ------ | ------- |
|
||||
| `VIDEOIO_ENABLE_PLUGINS` | _ON_ | Enable or disable plugins completely. |
|
||||
| `VIDEOIO_PLUGIN_LIST` | _empty_ | Comma- or semicolon-separated list of backend names to be compiled as plugins. Supported names are _ffmpeg_, _gstreamer_, _msmf_, _mfx_ and _all_. |
|
||||
| `VIDEOIO_ENABLE_STRICT_PLUGIN_CHECK` | _ON_ | Enable strict runtime version check to only allow plugins built with the same version of OpenCV. |
|
||||
|
||||
|
||||
## Parallel processing {#tutorial_config_reference_func_core}
|
||||
|
||||
Some of OpenCV algorithms can use multithreading to accelerate processing. OpenCV can be built with one of threading backends.
|
||||
|
||||
| Backend | Option | Default | Platform | Description |
|
||||
|-------- | ------ | ------- | -------- | ----------- |
|
||||
| pthreads | `WITH_PTHREADS_PF` | _ON_ | Unix-like | Default backend based on [pthreads](https://en.wikipedia.org/wiki/POSIX_Threads) library is available on Linux, Android and other Unix-like platforms. Thread pool is implemented in OpenCV and can be controlled with environment variables `OPENCV_THREAD_POOL_*`. Please check sources in _modules/core/src/parallel_impl.cpp_ file for details. |
|
||||
| Concurrency | N/A | _ON_ | Windows | [Concurrency runtime](https://docs.microsoft.com/en-us/cpp/parallel/concrt/concurrency-runtime) is available on Windows and will be turned _ON_ on supported platforms unless other backend is enabled. |
|
||||
| GCD | N/A | _ON_ | Apple | [Grand Central Dispatch](https://en.wikipedia.org/wiki/Grand_Central_Dispatch) is available on Apple platforms and will be turned _ON_ automatically unless other backend is enabled. Uses global system thread pool. |
|
||||
| TBB | `WITH_TBB` | Multiple | _OFF_ | [Threading Building Blocks](https://en.wikipedia.org/wiki/Threading_Building_Blocks) is a cross-platform library for parallel programming. |
|
||||
| OpenMP | `WITH_OPENMP` | Multiple | _OFF_ | [OpenMP](https://en.wikipedia.org/wiki/OpenMP) API relies on compiler support. |
|
||||
| HPX | `WITH_HPX` | Multiple | _OFF_ | [High Performance ParallelX](https://en.wikipedia.org/wiki/HPX) is an experimental backend which is more suitable for multiprocessor environments. |
|
||||
|
||||
@note OpenCV can download and build TBB library from GitHub, this functionality can be enabled with the `BUILD_TBB` option.
|
||||
|
||||
|
||||
## GUI backends (highgui module) {#tutorial_config_reference_highgui}
|
||||
|
||||
OpenCV relies on various GUI libraries for window drawing.
|
||||
|
||||
| Option | Default | Platform | Description |
|
||||
| ------ | ------- | -------- | ----------- |
|
||||
| `WITH_GTK` | _ON_ | Linux | [GTK](https://en.wikipedia.org/wiki/GTK) is a common toolkit in Linux and Unix-like OS-es. By default version 3 will be used if found, version 2 can be forced with the `WITH_GTK_2_X` option. |
|
||||
| `WITH_WIN32UI` | _ON_ | Windows | [WinAPI](https://en.wikipedia.org/wiki/Windows_API) is a standard GUI API in Windows. |
|
||||
| N/A | _ON_ | macOS | [Cocoa](https://en.wikipedia.org/wiki/Cocoa_(API)) is a framework used in macOS. |
|
||||
| `WITH_QT` | _OFF_ | Cross-platform | [Qt](https://en.wikipedia.org/wiki/Qt_(software)) is a cross-platform GUI framework. |
|
||||
|
||||
@note OpenCV compiled with Qt support enables advanced _highgui_ interface, see @ref highgui_qt for details.
|
||||
|
||||
|
||||
### OpenGL
|
||||
|
||||
`WITH_OPENGL` (default: _OFF_)
|
||||
|
||||
OpenGL integration can be used to draw HW-accelerated windows with following backends: GTK, WIN32 and Qt. And enables basic interoperability with OpenGL, see @ref core_opengl and @ref highgui_opengl for details.
|
||||
|
||||
|
||||
## Deep learning neural networks inference backends and options (dnn module) {#tutorial_config_reference_dnn}
|
||||
|
||||
OpenCV have own DNN inference module which have own build-in engine, but can also use other libraries for optimized processing. Multiple backends can be enabled in single build. Selection happens at runtime automatically or manually.
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `WITH_PROTOBUF` | _ON_ | Enables [protobuf](https://en.wikipedia.org/wiki/Protocol_Buffers) library search. OpenCV can either build own copy of the library or use external one. This dependency is required by the _dnn_ module, if it can't be found module will be disabled. |
|
||||
| `BUILD_PROTOBUF` | _ON_ | Build own copy of _protobuf_. Must be disabled if you want to use external library. |
|
||||
| `PROTOBUF_UPDATE_FILES` | _OFF_ | Re-generate all .proto files. _protoc_ compiler compatible with used version of _protobuf_ must be installed. |
|
||||
| `OPENCV_DNN_OPENCL` | _ON_ | Enable built-in OpenCL inference backend. |
|
||||
| `WITH_INF_ENGINE` | _OFF_ | Enables [Intel Inference Engine (IE)](https://github.com/openvinotoolkit/openvino) backend. Allows to execute networks in IE format (.xml + .bin). Inference Engine must be installed either as part of [OpenVINO toolkit](https://en.wikipedia.org/wiki/OpenVINO), either as a standalone library built from sources. |
|
||||
| `INF_ENGINE_RELEASE` | _2020040000_ | Defines version of Inference Engine library which is tied to OpenVINO toolkit version. Must be a 10-digit string, e.g. _2020040000_ for OpenVINO 2020.4. |
|
||||
| `WITH_NGRAPH` | _OFF_ | Enables Intel NGraph library support. This library is part of Inference Engine backend which allows executing arbitrary networks read from files in multiple formats supported by OpenCV: Caffe, TensorFlow, PyTorch, Darknet, etc.. NGraph library must be installed, it is included into Inference Engine. |
|
||||
| `OPENCV_DNN_CUDA` | _OFF_ | Enable CUDA backend. [CUDA](https://en.wikipedia.org/wiki/CUDA), CUBLAS and [CUDNN](https://developer.nvidia.com/cudnn) must be installed. |
|
||||
| `WITH_HALIDE` | _OFF_ | Use experimental [Halide](https://en.wikipedia.org/wiki/Halide_(programming_language)) backend which can generate optimized code for dnn-layers at runtime. Halide must be installed. |
|
||||
| `WITH_VULKAN` | _OFF_ | Enable experimental [Vulkan](https://en.wikipedia.org/wiki/Vulkan_(API)) backend. Does not require additional dependencies, but can use external Vulkan headers (`VULKAN_INCLUDE_DIRS`). |
|
||||
| `WITH_TENGINE` | _OFF_ | Enable experimental [Tengine](https://github.com/OAID/Tengine) backend for ARM CPUs. Tengine library must be installed. |
|
||||
|
||||
|
||||
# Installation layout {#tutorial_config_reference_install}
|
||||
|
||||
## Installation root {#tutorial_config_reference_install_root}
|
||||
|
||||
To install produced binaries root location should be configured. Default value depends on distribution, in Ubuntu it is usually set to `/usr/local`. It can be changed during configuration:
|
||||
```.sh
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/opt/opencv ../opencv
|
||||
```
|
||||
This path can be relative to current working directory, in the following example it will be set to `<absolute-path-to-build>/install`:
|
||||
```.sh
|
||||
cmake -DCMAKE_INSTALL_PREFIX=install ../opencv
|
||||
```
|
||||
|
||||
After building the library, all files can be copied to the configured install location using the following command:
|
||||
```.sh
|
||||
cmake --build . --target install
|
||||
```
|
||||
|
||||
To install binaries to the system location (e.g. `/usr/local`) as a regular user it is necessary to run the previous command with elevated privileges:
|
||||
```.sh
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
@note
|
||||
On some platforms (Linux) it is possible to remove symbol information during install. Binaries will become 10-15% smaller but debugging will be limited:
|
||||
```.sh
|
||||
cmake --build . --target install/strip
|
||||
```
|
||||
|
||||
|
||||
## Components and locations {#tutorial_config_reference_install_comp}
|
||||
|
||||
Options cane be used to control whether or not a part of the library will be installed:
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `INSTALL_C_EXAMPLES` | _OFF_ | Install C++ sample sources from the _samples/cpp_ directory. |
|
||||
| `INSTALL_PYTHON_EXAMPLES` | _OFF_ | Install Python sample sources from the _samples/python_ directory. |
|
||||
| `INSTALL_ANDROID_EXAMPLES` | _OFF_ | Install Android sample sources from the _samples/android_ directory. |
|
||||
| `INSTALL_BIN_EXAMPLES` | _OFF_ | Install prebuilt sample applications (`BUILD_EXAMPLES` must be enabled). |
|
||||
| `INSTALL_TESTS` | _OFF_ | Install tests (`BUILD_TESTS` must be enabled). |
|
||||
| `OPENCV_INSTALL_APPS_LIST` | _all_ | Comma- or semicolon-separated list of prebuilt applications to install (from _apps_ directory) |
|
||||
|
||||
Following options allow to modify components' installation locations relatively to install prefix. Default values of these options depend on platform and other options, please check the _cmake/OpenCVInstallLayout.cmake_ file for details.
|
||||
|
||||
| Option | Components |
|
||||
| ------ | ----------- |
|
||||
| `OPENCV_BIN_INSTALL_PATH` | applications, dynamic libraries (_win_) |
|
||||
| `OPENCV_TEST_INSTALL_PATH` | test applications |
|
||||
| `OPENCV_SAMPLES_BIN_INSTALL_PATH` | sample applications |
|
||||
| `OPENCV_LIB_INSTALL_PATH` | dynamic libraries, import libraries (_win_) |
|
||||
| `OPENCV_LIB_ARCHIVE_INSTALL_PATH` | static libraries |
|
||||
| `OPENCV_3P_LIB_INSTALL_PATH` | 3rdparty libraries |
|
||||
| `OPENCV_CONFIG_INSTALL_PATH` | cmake config package |
|
||||
| `OPENCV_INCLUDE_INSTALL_PATH` | header files |
|
||||
| `OPENCV_OTHER_INSTALL_PATH` | extra data files |
|
||||
| `OPENCV_SAMPLES_SRC_INSTALL_PATH` | sample sources |
|
||||
| `OPENCV_LICENSES_INSTALL_PATH` | licenses for included 3rdparty components |
|
||||
| `OPENCV_TEST_DATA_INSTALL_PATH` | test data |
|
||||
| `OPENCV_DOC_INSTALL_PATH` | documentation |
|
||||
| `OPENCV_JAR_INSTALL_PATH` | JAR file with Java bindings |
|
||||
| `OPENCV_JNI_INSTALL_PATH` | JNI part of Java bindings |
|
||||
| `OPENCV_JNI_BIN_INSTALL_PATH` | Dynamic libraries from the JNI part of Java bindings |
|
||||
|
||||
Following options can be used to change installation layout for common scenarios:
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `INSTALL_CREATE_DISTRIB` | _OFF_ | Tune multiple things to produce Windows and Android distributions. |
|
||||
| `INSTALL_TO_MANGLED_PATHS` | _OFF_ | Adds one level to several installation locations to allow side-by-side installations. For example, headers will be installed to _/usr/include/opencv-4.4.0_ instead of _/usr/include/opencv4_ with this option enabled. |
|
||||
|
||||
|
||||
# Miscellaneous features {#tutorial_config_reference_misc}
|
||||
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `OPENCV_ENABLE_NONFREE` | _OFF_ | Some algorithms included in the library are known to be protected by patents and are disabled by default. |
|
||||
| `OPENCV_FORCE_3RDPARTY_BUILD`| _OFF_ | Enable all `BUILD_` options at once. |
|
||||
| `ENABLE_CCACHE` | _ON_ (on Unix-like platforms) | Enable [ccache](https://en.wikipedia.org/wiki/Ccache) auto-detection. This tool wraps compiler calls and caches results, can significantly improve re-compilation time. |
|
||||
| `ENABLE_PRECOMPILED_HEADERS` | _ON_ (for MSVC) | Enable precompiled headers support. Improves build time. |
|
||||
| `BUILD_DOCS` | _OFF_ | Enable documentation build (_doxygen_, _doxygen_cpp_, _doxygen_python_, _doxygen_javadoc_ targets). [Doxygen](http://www.doxygen.org/index.html) must be installed for C++ documentation build. Python and [BeautifulSoup4](https://en.wikipedia.org/wiki/Beautiful_Soup_(HTML_parser)) must be installed for Python documentation build. Javadoc and Ant must be installed for Java documentation build (part of Java SDK). |
|
||||
| `ENABLE_PYLINT` | _ON_ (when docs or examples are enabled) | Enable python scripts check with [Pylint](https://en.wikipedia.org/wiki/Pylint) (_check_pylint_ target). Pylint must be installed. |
|
||||
| `ENABLE_FLAKE8` | _ON_ (when docs or examples are enabled) | Enable python scripts check with [Flake8](https://flake8.pycqa.org/) (_check_flake8_ target). Flake8 must be installed. |
|
||||
| `BUILD_JAVA` | _ON_ | Enable Java wrappers build. Java SDK and Ant must be installed. |
|
||||
| `BUILD_FAT_JAVA_LIB` | _ON_ (for static Android builds) | Build single _opencv_java_ dynamic library containing all library functionality bundled with Java bindings. |
|
||||
| `BUILD_opencv_python2` | _ON_ | Build python2 bindings (deprecated). Python with development files and numpy must be installed. |
|
||||
| `BUILD_opencv_python3` | _ON_ | Build python3 bindings. Python with development files and numpy must be installed. |
|
||||
|
||||
TODO: need separate tutorials covering bindings builds
|
||||
|
||||
|
||||
## Automated builds
|
||||
|
||||
Some features have been added specifically for automated build environments, like continuous integration and packaging systems.
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| `ENABLE_NOISY_WARNINGS` | _OFF_ | Enables several compiler warnings considered _noisy_, i.e. having less importance than others. These warnings are usually ignored but in some cases can be worth being checked for. |
|
||||
| `OPENCV_WARNINGS_ARE_ERRORS` | _OFF_ | Treat compiler warnings as errors. Build will be halted. |
|
||||
| `ENABLE_CONFIG_VERIFICATION` | _OFF_ | For each enabled dependency (`WITH_` option) verify that it has been found and enabled (`HAVE_` variable). By default feature will be silently turned off if dependency was not found, but with this option enabled cmake configuration will fail. Convenient for packaging systems which require stable library configuration not depending on environment fluctuations. |
|
||||
| `OPENCV_CMAKE_HOOKS_DIR` | _empty_ | OpenCV allows to customize configuration process by adding custom hook scripts at each stage and substage. cmake scripts with predefined names located in the directory set by this variable will be included before and after various configuration stages. Examples of file names: _CMAKE_INIT.cmake_, _PRE_CMAKE_BOOTSTRAP.cmake_, _POST_CMAKE_BOOTSTRAP.cmake_, etc.. Other names are not documented and can be found in the project cmake files by searching for the _ocv_cmake_hook_ macro calls. |
|
||||
| `OPENCV_DUMP_HOOKS_FLOW` | _OFF_ | Enables a debug message print on each cmake hook script call. |
|
||||
|
||||
|
||||
# Other non-documented options
|
||||
|
||||
`BUILD_ANDROID_PROJECTS`
|
||||
`BUILD_ANDROID_EXAMPLES`
|
||||
`ANDROID_HOME`
|
||||
`ANDROID_SDK`
|
||||
`ANDROID_NDK`
|
||||
`ANDROID_SDK_ROOT`
|
||||
|
||||
`CMAKE_TOOLCHAIN_FILE`
|
||||
|
||||
`WITH_CAROTENE`
|
||||
`WITH_CPUFEATURES`
|
||||
`WITH_EIGEN`
|
||||
`WITH_OPENVX`
|
||||
`WITH_CLP`
|
||||
`WITH_DIRECTX`
|
||||
`WITH_VA`
|
||||
`WITH_LAPACK`
|
||||
`WITH_QUIRC`
|
||||
`BUILD_ZLIB`
|
||||
`BUILD_ITT`
|
||||
`WITH_IPP`
|
||||
`BUILD_IPP_IW`
|
||||
@@ -3,6 +3,13 @@ Cross referencing OpenCV from other Doxygen projects {#tutorial_cross_referencin
|
||||
|
||||
@prev_tutorial{tutorial_transition_guide}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Sebastian Höffner |
|
||||
| Compatibility | OpenCV >= 3.3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Cross referencing OpenCV
|
||||
------------------------
|
||||
@@ -39,14 +46,14 @@ Open your Doxyfile using your favorite text editor and search for the key
|
||||
`TAGFILES`. Change it as follows:
|
||||
|
||||
@code
|
||||
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.5.0
|
||||
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.5.1
|
||||
@endcode
|
||||
|
||||
If you had other definitions already, you can append the line using a `\`:
|
||||
|
||||
@code
|
||||
TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \
|
||||
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.5.0
|
||||
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.5.1
|
||||
@endcode
|
||||
|
||||
Doxygen can now use the information from the tag file to link to the OpenCV
|
||||
|
||||
@@ -4,6 +4,13 @@ Cross compilation for ARM based Linux systems {#tutorial_arm_crosscompile_with_c
|
||||
@prev_tutorial{tutorial_ios_install}
|
||||
@next_tutorial{tutorial_building_tegra_cuda}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Alexander Smorkalov |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
This steps are tested on Ubuntu Linux 12.04, but should work for other Linux distributions. I case
|
||||
of other distributions package names and names of cross compilation tools may differ. There are
|
||||
|
||||
@@ -4,6 +4,13 @@ Introduction to Java Development {#tutorial_java_dev_intro}
|
||||
@prev_tutorial{tutorial_windows_visual_studio_image_watch}
|
||||
@next_tutorial{tutorial_java_eclipse}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Eric Christiansen and Andrey Pavlenko |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
As of OpenCV 2.4.4, OpenCV supports desktop Java development using nearly the same interface as for
|
||||
Android development. This guide will help you to create your first Java (or Scala) application using
|
||||
|
||||
@@ -4,6 +4,14 @@ Getting Started with Images {#tutorial_display_image}
|
||||
@prev_tutorial{tutorial_building_tegra_cuda}
|
||||
@next_tutorial{tutorial_documentation}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Ana Huamán |
|
||||
| Compatibility | OpenCV >= 3.4.4 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ Writing documentation for OpenCV {#tutorial_documentation}
|
||||
@prev_tutorial{tutorial_display_image}
|
||||
@next_tutorial{tutorial_transition_guide}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Maksim Shabunin |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
OpenCV installation overview {#tutorial_general_install}
|
||||
============================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
There are two ways of installing OpenCV on your machine: download prebuilt version for your platform or compile from sources.
|
||||
|
||||
# Prebuilt version {#tutorial_general_install_prebuilt}
|
||||
|
||||
In many cases you can find prebuilt version of OpenCV that will meet your needs.
|
||||
|
||||
## Packages by OpenCV core team {#tutorial_general_install_prebuilt_core}
|
||||
|
||||
Packages for Android, iOS and Windows built with default parameters and recent compilers are published for each release, they do not contain _opencv_contrib_ modules.
|
||||
|
||||
- GitHub releases: https://github.com/opencv/opencv/releases
|
||||
- SourceForge.net: https://sourceforge.net/projects/opencvlibrary/files/
|
||||
|
||||
|
||||
## Third-party packages {#tutorial_general_install_prebuilt_thirdparty}
|
||||
|
||||
Other organizations and people maintain their own binary distributions of OpenCV. For example:
|
||||
|
||||
- System packages in popular Linux distributions (https://pkgs.org/search/?q=opencv)
|
||||
- PyPI (https://pypi.org/search/?q=opencv)
|
||||
- Conda (https://anaconda.org/search?q=opencv)
|
||||
- Conan (https://github.com/conan-community/conan-opencv)
|
||||
- vcpkg (https://github.com/microsoft/vcpkg/tree/master/ports/opencv)
|
||||
- NuGet (https://www.nuget.org/packages?q=opencv)
|
||||
- Brew (https://formulae.brew.sh/formula/opencv)
|
||||
- Maven (https://search.maven.org/search?q=opencv)
|
||||
|
||||
|
||||
# Build from sources {#tutorial_general_install_sources}
|
||||
|
||||
It can happen that existing binary packages are not applicable for your use case, then you'll have to build custom version of OpenCV by yourself. This section gives a high-level overview of the build process, check tutorial for specific platform for actual build instructions.
|
||||
|
||||
OpenCV uses [CMake](https://cmake.org/) build management system for configuration and build, so this section mostly describes generalized process of building software with CMake.
|
||||
|
||||
|
||||
## Step 0: Prerequisites {#tutorial_general_install_sources_0}
|
||||
|
||||
Install C++ compiler and build tools. On \*NIX platforms it is usually GCC/G++ or Clang compiler and Make or Ninja build tool. On Windows it can be Visual Studio IDE or MinGW-w64 compiler. Native toolchains for Android are provided in the Android NDK. XCode IDE is used to build software for OSX and iOS platforms.
|
||||
|
||||
Install CMake from the official site or some other source.
|
||||
|
||||
Get other third-party dependencies: libraries with extra functionality like decoding videos or showing GUI elements; libraries providing optimized implementations of selected algorithms; tools used for documentation generation and other extras. Check @ref tutorial_config_reference for available options and corresponding dependencies.
|
||||
|
||||
|
||||
## Step 1: Get software sources {#tutorial_general_install_sources_1}
|
||||
|
||||
Typical software project consists of one or several code repositories. OpenCV have two repositories with code: _opencv_ - main repository with stable and actively supported algorithms and _opencv_contrib_ which contains experimental and non-free (patented) algorithms; and one repository with test data: _opencv_extra_.
|
||||
|
||||
You can download a snapshot of repository in form of an archive or clone repository with full history.
|
||||
|
||||
To download snapshot archives:
|
||||
|
||||
- Go to https://github.com/opencv/opencv/releases and download "Source code" archive from any release.
|
||||
- (optionally) Go to https://github.com/opencv/opencv_contrib/releases and download "Source code" archive for the same release as _opencv_
|
||||
- (optionally) Go to https://github.com/opencv/opencv_extra/releases and download "Source code" archive for the same release as _opencv_
|
||||
- Unpack all archives to some location
|
||||
|
||||
To clone repositories run the following commands in console (_git_ [must be installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)):
|
||||
|
||||
```.sh
|
||||
git clone https://github.com/opencv/opencv
|
||||
git -C opencv checkout <some-tag>
|
||||
|
||||
# optionally
|
||||
git clone https://github.com/opencv/opencv_contrib
|
||||
git -C opencv_contrib checkout <same-tag-as-opencv>
|
||||
|
||||
# optionally
|
||||
git clone https://github.com/opencv/opencv_extra
|
||||
git -C opencv_extra checkout <same-tag-as-opencv>
|
||||
```
|
||||
|
||||
@note
|
||||
If you want to build software using more than one repository, make sure all components are compatible with each other. For OpenCV it means that _opencv_ and _opencv_contrib_ repositories must be checked out at the same tag or that all snapshot archives are downloaded from the same release.
|
||||
|
||||
@note
|
||||
When choosing which version to download take in account your target platform and development tools versions, latest versions of OpenCV can have build problems with very old compilers and vice versa. We recommend using latest release and fresh OS/compiler combination.
|
||||
|
||||
## Step 2: Configure {#tutorial_general_install_sources_2}
|
||||
|
||||
At this step CMake will verify that all necessary tools and dependencies are available and compatible with the library and will generate intermediate files for the chosen build system. It could be Makefiles, IDE projects and solutions, etc. Usually this step is performed in newly created build directory:
|
||||
```
|
||||
cmake -G<generator> <configuration-options> <source-directory>
|
||||
```
|
||||
|
||||
@note
|
||||
`cmake-gui` application allows to see and modify available options using graphical user interface. See https://cmake.org/runningcmake/ for details.
|
||||
|
||||
|
||||
## Step 3: Build {#tutorial_general_install_sources_3}
|
||||
|
||||
During build process source files are compiled into object files which are linked together or otherwise combined into libraries and applications. This step can be run using universal command:
|
||||
```
|
||||
cmake --build <build-directory> <build-options>
|
||||
```
|
||||
... or underlying build system can be called directly:
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
## Step 3: Install {#tutorial_general_install_sources_4}
|
||||
|
||||
During installation procedure build results and other files from build directory will be copied to the install location. Default installation location is `/usr/local` on UNIX and `C:/Program Files` on Windows. This location can be changed at the configuration step by setting `CMAKE_INSTALL_PREFIX` option. To perform installation run the following command:
|
||||
```
|
||||
cmake --build <build-directory> --target install <other-options>
|
||||
```
|
||||
|
||||
@note
|
||||
This step is optional, OpenCV can be used directly from the build directory.
|
||||
|
||||
@note
|
||||
If the installation root location is a protected system directory, so the installation process must be run with superuser or administrator privileges (e.g. `sudo cmake ...`).
|
||||
@@ -4,6 +4,14 @@ Installation in iOS {#tutorial_ios_install}
|
||||
@prev_tutorial{tutorial_macos_install}
|
||||
@next_tutorial{tutorial_arm_crosscompile_with_cmake}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Artem Myagkov, Eduard Feicho, Steve Nicholson |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Required Packages
|
||||
-----------------
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ Using OpenCV Java with Eclipse {#tutorial_java_eclipse}
|
||||
@prev_tutorial{tutorial_java_dev_intro}
|
||||
@next_tutorial{tutorial_clojure_dev_intro}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Barış Evrim Demiröz |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Since version 2.4.4 [OpenCV supports Java](http://opencv.org/opencv-java-api.html). In this tutorial
|
||||
I will explain how to setup development environment for using OpenCV Java with Eclipse in
|
||||
|
||||
@@ -4,6 +4,14 @@ Using OpenCV with Eclipse (plugin CDT) {#tutorial_linux_eclipse}
|
||||
@prev_tutorial{tutorial_linux_gcc_cmake}
|
||||
@next_tutorial{tutorial_windows_install}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Ana Huamán |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
Two ways, one by forming a project directly, and another by CMake Prerequisites
|
||||
|
||||
@@ -4,6 +4,13 @@ Using OpenCV with gcc and CMake {#tutorial_linux_gcc_cmake}
|
||||
@prev_tutorial{tutorial_linux_install}
|
||||
@next_tutorial{tutorial_linux_eclipse}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Ana Huamán |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
@note We assume that you have successfully installed OpenCV in your workstation.
|
||||
|
||||
|
||||
@@ -3,146 +3,123 @@ Installation in Linux {#tutorial_linux_install}
|
||||
|
||||
@next_tutorial{tutorial_linux_gcc_cmake}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Ana Huamán |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
The following steps have been tested for Ubuntu 10.04 but should work with other distros as well.
|
||||
@tableofcontents
|
||||
|
||||
Required Packages
|
||||
-----------------
|
||||
# Quick start {#tutorial_linux_install_quick_start}
|
||||
|
||||
- GCC 4.4.x or later
|
||||
- CMake 2.8.7 or higher
|
||||
- Git
|
||||
- GTK+2.x or higher, including headers (libgtk2.0-dev)
|
||||
- pkg-config
|
||||
- Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
|
||||
- ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
|
||||
- [optional] libtbb2 libtbb-dev
|
||||
- [optional] libdc1394 2.x
|
||||
- [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
|
||||
- [optional] CUDA Toolkit 6.5 or higher
|
||||
|
||||
The packages can be installed using a terminal and the following commands or by using Synaptic
|
||||
Manager:
|
||||
@code{.bash}
|
||||
[compiler] sudo apt-get install build-essential
|
||||
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
|
||||
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
|
||||
@endcode
|
||||
Getting OpenCV Source Code
|
||||
--------------------------
|
||||
## Build core modules {#tutorial_linux_install_quick_build_core}
|
||||
|
||||
You can use the latest stable OpenCV version or you can grab the latest snapshot from our [Git
|
||||
repository](https://github.com/opencv/opencv.git).
|
||||
@snippet linux_quick_install.sh body
|
||||
|
||||
### Getting the Latest Stable OpenCV Version
|
||||
|
||||
- Go to our [downloads page](http://opencv.org/releases.html).
|
||||
- Download the source archive and unpack it.
|
||||
## Build with opencv_contrib {#tutorial_linux_install_quick_build_contrib}
|
||||
|
||||
### Getting the Cutting-edge OpenCV from the Git Repository
|
||||
@snippet linux_quick_install_contrib.sh body
|
||||
|
||||
Launch Git client and clone [OpenCV repository](http://github.com/opencv/opencv). If you need
|
||||
modules from [OpenCV contrib repository](http://github.com/opencv/opencv_contrib) then clone it as well.
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
cd ~/<my_working_directory>
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
git clone https://github.com/opencv/opencv_contrib.git
|
||||
@endcode
|
||||
Building OpenCV from Source Using CMake
|
||||
---------------------------------------
|
||||
# Detailed process {#tutorial_linux_install_detailed}
|
||||
|
||||
-# Create a temporary directory, which we denote as \<cmake_build_dir\>, where you want to put
|
||||
the generated Makefiles, project files as well the object files and output binaries and enter
|
||||
there.
|
||||
This section provides more details of the build process and describes alternative methods and tools. Please refer to the @ref tutorial_general_install tutorial for general installation details and to the @ref tutorial_config_reference for configuration options documentation.
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
cd ~/opencv
|
||||
mkdir build
|
||||
cd build
|
||||
@endcode
|
||||
-# Configuring. Run cmake [\<some optional parameters\>] \<path to the OpenCV source directory\>
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
|
||||
@endcode
|
||||
or cmake-gui
|
||||
## Install compiler and build tools {#tutorial_linux_install_detailed_basic_compiler}
|
||||
|
||||
- set full path to OpenCV source code, e.g. /home/user/opencv
|
||||
- set full path to \<cmake_build_dir\>, e.g. /home/user/opencv/build
|
||||
- set optional parameters
|
||||
- run: “Configure”
|
||||
- run: “Generate”
|
||||
- To compile OpenCV you will need a C++ compiler. Usually it is G++/GCC or Clang/LLVM:
|
||||
- Install GCC...
|
||||
@snippet linux_install_a.sh gcc
|
||||
- ... or Clang:
|
||||
@snippet linux_install_b.sh clang
|
||||
|
||||
@note
|
||||
Use `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..` , without spaces after -D if the above example doesn't work.
|
||||
- OpenCV uses CMake build configuration tool:
|
||||
@snippet linux_install_a.sh cmake
|
||||
|
||||
-# Description of some parameters
|
||||
- build type: `CMAKE_BUILD_TYPE=Release\Debug`
|
||||
- to build with modules from opencv_contrib set OPENCV_EXTRA_MODULES_PATH to \<path to
|
||||
opencv_contrib/modules/\>
|
||||
- set BUILD_DOCS for building documents
|
||||
- set BUILD_EXAMPLES to build all examples
|
||||
- CMake can generate scripts for different build systems, e.g. _make_, _ninja_:
|
||||
|
||||
-# [optional] Building python. Set the following python parameters:
|
||||
- PYTHON2(3)_EXECUTABLE = \<path to python\>
|
||||
- PYTHON_INCLUDE_DIR = /usr/include/python\<version\>
|
||||
- PYTHON_INCLUDE_DIR2 = /usr/include/x86_64-linux-gnu/python\<version\>
|
||||
- PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython\<version\>.so
|
||||
- PYTHON2(3)_NUMPY_INCLUDE_DIRS =
|
||||
/usr/lib/python\<version\>/dist-packages/numpy/core/include/
|
||||
- Install Make...
|
||||
@snippet linux_install_a.sh make
|
||||
- ... or Ninja:
|
||||
@snippet linux_install_b.sh ninja
|
||||
|
||||
-# [optional] Building java.
|
||||
- Unset parameter: BUILD_SHARED_LIBS
|
||||
- It is useful also to unset BUILD_EXAMPLES, BUILD_TESTS, BUILD_PERF_TESTS - as they all
|
||||
will be statically linked with OpenCV and can take a lot of memory.
|
||||
- Install tool for getting and unpacking sources:
|
||||
|
||||
-# [optional] Generate pkg-config info
|
||||
- Add this flag when running CMake: `-DOPENCV_GENERATE_PKGCONFIG=ON`
|
||||
- Will generate the .pc file for pkg-config and install it.
|
||||
- Useful if not using CMake in projects that use OpenCV
|
||||
- Installed as `opencv4`, usage: `pkg-config --cflags --libs opencv4`
|
||||
- _wget_ and _unzip_...
|
||||
@snippet linux_install_a.sh wget
|
||||
- ... or _git_:
|
||||
@snippet linux_install_b.sh git
|
||||
|
||||
-# Build. From build directory execute *make*, it is recommended to do this in several threads
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
make -j7 # runs 7 jobs in parallel
|
||||
@endcode
|
||||
-# [optional] Building documents. Enter \<cmake_build_dir/doc/\> and run make with target
|
||||
"doxygen"
|
||||
## Download sources {#tutorial_linux_install_detailed_basic_download}
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
cd ~/opencv/build/doc/
|
||||
make -j7 doxygen
|
||||
@endcode
|
||||
-# To install libraries, execute the following command from build directory
|
||||
@code{.bash}
|
||||
sudo make install
|
||||
@endcode
|
||||
-# [optional] Running tests
|
||||
There are two methods of getting OpenCV sources:
|
||||
|
||||
- Get the required test data from [OpenCV extra
|
||||
repository](https://github.com/opencv/opencv_extra).
|
||||
- Download snapshot of repository using web browser or any download tool (~80-90Mb) and unpack it...
|
||||
@snippet linux_install_a.sh download
|
||||
- ... or clone repository to local machine using _git_ to get full change history (>470Mb):
|
||||
@snippet linux_install_b.sh download
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
git clone https://github.com/opencv/opencv_extra.git
|
||||
@endcode
|
||||
- set OPENCV_TEST_DATA_PATH environment variable to \<path to opencv_extra/testdata\>.
|
||||
- execute tests from build directory.
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
<cmake_build_dir>/bin/opencv_test_core
|
||||
@endcode
|
||||
|
||||
@note
|
||||
If the size of the created library is a critical issue (like in case of an Android build) you
|
||||
can use the install/strip command to get the smallest size possible. The *stripped* version
|
||||
appears to be twice as small. However, we do not recommend using this unless those extra
|
||||
megabytes do really matter.
|
||||
Snapshots of other branches, releases or commits can be found on the [GitHub](https://github.com/opencv/opencv) and the [official download page](https://opencv.org/releases.html).
|
||||
|
||||
|
||||
## Configure and build {#tutorial_linux_install_detailed_basic_build}
|
||||
|
||||
- Create build directory:
|
||||
@snippet linux_install_a.sh prepare
|
||||
|
||||
- Configure - generate build scripts for the preferred build system:
|
||||
- For _make_...
|
||||
@snippet linux_install_a.sh configure
|
||||
- ... or for _ninja_:
|
||||
@snippet linux_install_b.sh configure
|
||||
|
||||
- Build - run actual compilation process:
|
||||
- Using _make_...
|
||||
@snippet linux_install_a.sh build
|
||||
- ... or _ninja_:
|
||||
@snippet linux_install_b.sh build
|
||||
|
||||
|
||||
@note
|
||||
_Configure_ process can download some files from the internet to satisfy library dependencies, connection failures can cause some of modules or functionalities to be turned off or behave differently. Refer to the @ref tutorial_general_install and @ref tutorial_config_reference tutorials for details and full configuration options reference.
|
||||
|
||||
@note
|
||||
If you experience problems with the build process, try to clean or recreate the build directory. Changes in the configuration like disabling a dependency, modifying build scripts or switching sources to another branch are not handled very well and can result in broken workspace.
|
||||
|
||||
@note
|
||||
_Make_ can run multiple compilation processes in parallel, `-j<NUM>` option means "run <NUM> jobs simultaneously". _Ninja_ will automatically detect number of available processor cores and does not need `-j` option.
|
||||
|
||||
|
||||
## Check build results {#tutorial_linux_install_detailed_basic_verify}
|
||||
|
||||
After successful build you will find libraries in the `build/lib` directory and executables (test, samples, apps) in the `build/bin` directory:
|
||||
@snippet linux_install_a.sh check
|
||||
|
||||
CMake package files will be located in the build root:
|
||||
@snippet linux_install_a.sh check cmake
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
@warning
|
||||
Installation process only copies files to predefined locations and do minor patching. Library installed using this method is not integrated into the system package registry and can not be uninstalled automatically. We do not recommend system-wide installation to regular users due to possible conflicts with system packages.
|
||||
|
||||
By default OpenCV will be installed to the `/usr/local` directory, all files will be copied to following locations:
|
||||
* `/usr/local/bin` - executable files
|
||||
* `/usr/local/lib` - libraries (.so)
|
||||
* `/usr/local/cmake/opencv4` - cmake package
|
||||
* `/usr/local/include/opencv4` - headers
|
||||
* `/usr/local/share/opencv4` - other files (e.g. trained cascades in XML format)
|
||||
|
||||
Since `/usr/local` is owned by the root user, the installation should be performed with elevated privileges (`sudo`):
|
||||
@snippet linux_install_a.sh install
|
||||
or
|
||||
@snippet linux_install_b.sh install
|
||||
|
||||
Installation root directory can be changed with `CMAKE_INSTALL_PREFIX` configuration parameter, e.g. `-DCMAKE_INSTALL_PREFIX=$HOME/.local` to install to current user's local directory. Installation layout can be changed with `OPENCV_*_INSTALL_PATH` parameters. See @ref tutorial_config_reference for details.
|
||||
|
||||
@@ -4,6 +4,10 @@ Installation in MacOS {#tutorial_macos_install}
|
||||
@prev_tutorial{tutorial_android_ocl_intro}
|
||||
@next_tutorial{tutorial_ios_install}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | `@sajarindider` |
|
||||
| Compatibility | OpenCV >= 3.4 |
|
||||
|
||||
The following steps have been tested for MacOSX (Mavericks) but should work with other versions as well.
|
||||
|
||||
|
||||
@@ -1,175 +1,38 @@
|
||||
Introduction to OpenCV {#tutorial_table_of_content_introduction}
|
||||
======================
|
||||
|
||||
Here you can read tutorials about how to set up your computer to work with the OpenCV library.
|
||||
Additionally you can find very basic sample source code to introduce you to the world of the OpenCV.
|
||||
- @subpage tutorial_general_install
|
||||
- @subpage tutorial_config_reference
|
||||
|
||||
##### Linux
|
||||
- @subpage tutorial_linux_install
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.0
|
||||
|
||||
_Author:_ Ana Huamán
|
||||
|
||||
We will learn how to setup OpenCV in your computer!
|
||||
|
||||
- @subpage tutorial_linux_gcc_cmake
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.0
|
||||
|
||||
_Author:_ Ana Huamán
|
||||
|
||||
We will learn how to compile your first project using gcc and CMake
|
||||
|
||||
- @subpage tutorial_linux_eclipse
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.0
|
||||
|
||||
_Author:_ Ana Huamán
|
||||
|
||||
We will learn how to compile your first project using the Eclipse environment
|
||||
|
||||
##### Windows
|
||||
- @subpage tutorial_windows_install
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.0
|
||||
|
||||
_Author:_ Bernát Gábor
|
||||
|
||||
You will learn how to setup OpenCV in your Windows Operating System!
|
||||
|
||||
- @subpage tutorial_windows_visual_studio_opencv
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.0
|
||||
|
||||
_Author:_ Bernát Gábor
|
||||
|
||||
You will learn what steps you need to perform in order to use the OpenCV library inside a new
|
||||
Microsoft Visual Studio project.
|
||||
|
||||
- @subpage tutorial_windows_visual_studio_image_watch
|
||||
|
||||
_Compatibility:_ \>= OpenCV 2.4
|
||||
|
||||
_Author:_ Wolf Kienzle
|
||||
|
||||
You will learn how to visualize OpenCV matrices and images within Visual Studio 2012.
|
||||
|
||||
##### Java & Android
|
||||
- @subpage tutorial_java_dev_intro
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.4
|
||||
|
||||
_Authors:_ Eric Christiansen and Andrey Pavlenko
|
||||
|
||||
Explains how to build and run a simple desktop Java application using Eclipse, Ant or the
|
||||
Simple Build Tool (SBT).
|
||||
|
||||
- @subpage tutorial_java_eclipse
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.4
|
||||
|
||||
_Author:_ Barış Evrim Demiröz
|
||||
|
||||
A tutorial on how to use OpenCV Java with Eclipse.
|
||||
|
||||
- @subpage tutorial_clojure_dev_intro
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.4
|
||||
|
||||
_Author:_ Mimmo Cosenza
|
||||
|
||||
A tutorial on how to interactively use OpenCV from the Clojure REPL.
|
||||
|
||||
- @subpage tutorial_android_dev_intro
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.2
|
||||
|
||||
_Author:_ Vsevolod Glumov
|
||||
|
||||
Not a tutorial, but a guide introducing Android development basics and environment setup
|
||||
|
||||
- @subpage tutorial_O4A_SDK
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.2
|
||||
|
||||
_Author:_ Vsevolod Glumov
|
||||
|
||||
OpenCV4Android SDK: general info, installation, running samples
|
||||
|
||||
- @subpage tutorial_dev_with_OCV_on_Android
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.3
|
||||
|
||||
_Author:_ Vsevolod Glumov
|
||||
|
||||
Development with OpenCV4Android SDK
|
||||
|
||||
- @subpage tutorial_android_ocl_intro
|
||||
|
||||
_Compatibility:_ \>= OpenCV 3.0
|
||||
|
||||
_Author:_ Andrey Pavlenko
|
||||
|
||||
Modify Android camera preview with OpenCL
|
||||
|
||||
##### Other platforms
|
||||
- @subpage tutorial_macos_install
|
||||
|
||||
_Compatibility:_ \> OpenCV 3.4.x
|
||||
|
||||
_Author:_ [\@sajarindider](https://github.com/sajarindider)
|
||||
|
||||
We will learn how to setup OpenCV in MacOS.
|
||||
|
||||
- @subpage tutorial_ios_install
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.2
|
||||
|
||||
_Author:_ Artem Myagkov, Eduard Feicho, Steve Nicholson
|
||||
|
||||
We will learn how to setup OpenCV for using it in iOS!
|
||||
|
||||
- @subpage tutorial_arm_crosscompile_with_cmake
|
||||
|
||||
_Compatibility:_ \> OpenCV 2.4.4
|
||||
|
||||
_Author:_ Alexander Smorkalov
|
||||
|
||||
We will learn how to setup OpenCV cross compilation environment for ARM Linux.
|
||||
|
||||
- @subpage tutorial_building_tegra_cuda
|
||||
|
||||
_Compatibility:_ \>= OpenCV 3.1.0
|
||||
##### Usage basics
|
||||
- @subpage tutorial_display_image - We will learn how to load an image from file and display it using OpenCV
|
||||
|
||||
_Author:_ Randy J. Ray
|
||||
|
||||
This tutorial will help you build OpenCV 3.1.0 for NVIDIA<sup>®</sup> Tegra<sup>®</sup> systems with CUDA 8.0.
|
||||
|
||||
- @subpage tutorial_display_image
|
||||
|
||||
_Languages:_ C++, Python
|
||||
|
||||
_Compatibility:_ \> OpenCV 3.4.4
|
||||
|
||||
_Author:_ Ana Huamán
|
||||
|
||||
We will learn how to read an image, display it in a window and write it to a file using OpenCV
|
||||
|
||||
- @subpage tutorial_documentation
|
||||
|
||||
_Compatibility:_ \> OpenCV 3.0
|
||||
|
||||
_Author:_ Maksim Shabunin
|
||||
|
||||
This tutorial describes new documenting process and some useful Doxygen features.
|
||||
|
||||
- @subpage tutorial_transition_guide
|
||||
|
||||
_Author:_ Maksim Shabunin
|
||||
|
||||
This document describes some aspects of 2.4 -> 3.0 transition process.
|
||||
|
||||
- @subpage tutorial_cross_referencing
|
||||
|
||||
_Compatibility:_ \> OpenCV 3.3.0
|
||||
|
||||
_Author:_ Sebastian Höffner
|
||||
|
||||
This document outlines how to create cross references to the OpenCV documentation from other Doxygen projects.
|
||||
##### Miscellaneous
|
||||
- @subpage tutorial_documentation - This tutorial describes new documenting process and some useful Doxygen features.
|
||||
- @subpage tutorial_transition_guide - This document describes some aspects of 2.4 -> 3.0 transition process.
|
||||
- @subpage tutorial_cross_referencing - This document outlines how to create cross references to the OpenCV documentation from other Doxygen projects.
|
||||
|
||||
@@ -4,6 +4,10 @@ Transition guide {#tutorial_transition_guide}
|
||||
@prev_tutorial{tutorial_documentation}
|
||||
@next_tutorial{tutorial_cross_referencing}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Maksim Shabunin |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ Installation in Windows {#tutorial_windows_install}
|
||||
@prev_tutorial{tutorial_linux_eclipse}
|
||||
@next_tutorial{tutorial_windows_visual_studio_opencv}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Bernát Gábor |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
The description here was tested on Windows 7 SP1. Nevertheless, it should also work on any other
|
||||
relatively modern version of Windows OS. If you encounter errors after following the steps described
|
||||
|
||||
+7
@@ -4,6 +4,13 @@ Image Watch: viewing in-memory images in the Visual Studio debugger {#tutorial_w
|
||||
@prev_tutorial{tutorial_windows_visual_studio_opencv}
|
||||
@next_tutorial{tutorial_java_dev_intro}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Wolf Kienzle |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Image Watch is a plug-in for Microsoft Visual Studio that lets you to visualize in-memory images
|
||||
(*cv::Mat* or *IplImage_* objects, for example) while debugging an application. This can be helpful
|
||||
|
||||
+7
-1
@@ -1,9 +1,15 @@
|
||||
How to build applications with OpenCV inside the "Microsoft Visual Studio" {#tutorial_windows_visual_studio_opencv}
|
||||
==========================================================================
|
||||
|
||||
@prev_tutorial{tutorial_windows_install}
|
||||
@next_tutorial{tutorial_windows_visual_studio_image_watch}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Bernát Gábor |
|
||||
| Compatibility | OpenCV >= 3.0 |
|
||||
|
||||
@warning
|
||||
This tutorial can contain obsolete information.
|
||||
|
||||
Everything I describe here will apply to the `C\C++` interface of OpenCV. I start out from the
|
||||
assumption that you have read and completed with success the @ref tutorial_windows_install tutorial.
|
||||
|
||||
@@ -1,93 +1,22 @@
|
||||
OpenCV Tutorials {#tutorial_root}
|
||||
================
|
||||
|
||||
The following links describe a set of basic OpenCV tutorials. All the source code mentioned here is
|
||||
provided as part of the OpenCV regular releases, so check before you start copying & pasting the code.
|
||||
The list of tutorials below is automatically generated from reST files located in our GIT
|
||||
repository.
|
||||
|
||||
As always, we would be happy to hear your comments and receive your contributions on any tutorial.
|
||||
|
||||
- @subpage tutorial_table_of_content_introduction
|
||||
|
||||
You will learn how to setup OpenCV on your computer
|
||||
|
||||
- @subpage tutorial_table_of_content_core
|
||||
|
||||
Here you will learn
|
||||
about the basic building blocks of this library. A must read for understanding how
|
||||
to manipulate the images on a pixel level.
|
||||
|
||||
- @subpage tutorial_table_of_content_imgproc
|
||||
|
||||
In this section
|
||||
you will learn about the image processing (manipulation) functions inside OpenCV.
|
||||
|
||||
- @subpage tutorial_table_of_content_highgui
|
||||
|
||||
This section contains valuable tutorials on how to use the
|
||||
built-in graphical user interface of the library.
|
||||
|
||||
- @subpage tutorial_table_of_content_imgcodecs
|
||||
|
||||
These tutorials show how to read and write images using imgcodecs module.
|
||||
|
||||
- @subpage tutorial_table_of_content_videoio
|
||||
|
||||
These tutorials show how to read and write videos using videio module.
|
||||
|
||||
- @subpage tutorial_table_of_content_calib3d
|
||||
|
||||
Although
|
||||
most of our images are in a 2D format they do come from a 3D world. Here you will learn how to find
|
||||
out 3D world information from 2D images.
|
||||
|
||||
- @subpage tutorial_table_of_content_features2d
|
||||
|
||||
Learn about how
|
||||
to use the feature points detectors, descriptors and matching framework found inside OpenCV.
|
||||
|
||||
- @subpage tutorial_table_of_content_video
|
||||
|
||||
Here you will find
|
||||
algorithms usable on your video streams like motion extraction, feature tracking and
|
||||
foreground extractions.
|
||||
|
||||
- @subpage tutorial_table_of_content_objdetect
|
||||
|
||||
Ever wondered
|
||||
how your digital camera detects people's faces? Look here to find out!
|
||||
|
||||
- @subpage tutorial_table_of_content_dnn
|
||||
|
||||
These tutorials show how to use dnn module effectively.
|
||||
|
||||
- @subpage tutorial_table_of_content_ml
|
||||
|
||||
Use the powerful
|
||||
machine learning classes for statistical classification, regression and clustering of data.
|
||||
|
||||
- @subpage tutorial_table_of_content_gapi
|
||||
|
||||
Learn how to use Graph API (G-API) and port algorithms from "traditional" OpenCV to a graph model.
|
||||
|
||||
- @subpage tutorial_table_of_content_photo
|
||||
|
||||
Use OpenCV for
|
||||
advanced photo processing.
|
||||
|
||||
- @subpage tutorial_table_of_content_stitching
|
||||
|
||||
Learn how to create beautiful photo panoramas and more with OpenCV stitching pipeline.
|
||||
|
||||
- @subpage tutorial_table_of_content_introduction - build and install OpenCV on your computer
|
||||
- @subpage tutorial_table_of_content_core - basic building blocks of the library
|
||||
- @subpage tutorial_table_of_content_imgproc - image processing functions
|
||||
- @subpage tutorial_table_of_content_highgui - built-in graphical user interface
|
||||
- @subpage tutorial_table_of_content_imgcodecs - read and write images from/to files using _imgcodecs_ module
|
||||
- @subpage tutorial_table_of_content_videoio - read and write videos using _videio_ module
|
||||
- @subpage tutorial_table_of_content_calib3d - extract 3D world information from 2D images
|
||||
- @subpage tutorial_table_of_content_features2d - feature detectors, descriptors and matching framework
|
||||
- @subpage tutorial_table_of_content_video - algorithms for video streams: motion detection, object and feature tracking, etc.
|
||||
- @subpage tutorial_table_of_content_objdetect - detect objects using conventional CV methods
|
||||
- @subpage tutorial_table_of_content_dnn - infer neural networks using built-in _dnn_ module
|
||||
- @subpage tutorial_table_of_content_ml - machine learning algorithms for statistical classification, regression and data clustering
|
||||
- @subpage tutorial_table_of_content_gapi - graph-based approach to computer vision algorithms building
|
||||
- @subpage tutorial_table_of_content_photo - advanced photo processing
|
||||
- @subpage tutorial_table_of_content_stitching - create panoramas and more using _stitching_ module
|
||||
- @subpage tutorial_table_of_content_ios - running OpenCV on an iDevice
|
||||
@cond CUDA_MODULES
|
||||
- @subpage tutorial_table_of_content_gpu
|
||||
|
||||
Squeeze out every
|
||||
little computational power from your system by utilizing the power of your video card to run the
|
||||
OpenCV algorithms.
|
||||
- @subpage tutorial_table_of_content_gpu - utilizing power of video card to run CV algorithms
|
||||
@endcond
|
||||
|
||||
- @subpage tutorial_table_of_content_ios
|
||||
|
||||
Run OpenCV and your vision apps on an iDevice
|
||||
|
||||
@@ -32,8 +32,7 @@ In this tutorial you will learn how to:
|
||||
-# Create and update the background model by using @ref cv::BackgroundSubtractor class;
|
||||
-# Get and show the foreground mask by using @ref cv::imshow ;
|
||||
|
||||
Code
|
||||
----
|
||||
### Code
|
||||
|
||||
In the following you can find the source code. We will let the user choose to process either a video
|
||||
file or a sequence of images.
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
Using Creative Senz3D and other Intel Perceptual Computing SDK compatible depth sensors {#tutorial_intelperc}
|
||||
Using Creative Senz3D and other Intel RealSense SDK compatible depth sensors {#tutorial_intelperc}
|
||||
=======================================================================================
|
||||
|
||||
@prev_tutorial{tutorial_kinect_openni}
|
||||
|
||||
**Note**: this tutorial is partially obsolete since PerC SDK has been replaced with RealSense SDK
|
||||
**Note**: This tutorial is partially obsolete since PerC SDK has been replaced with RealSense SDK
|
||||
|
||||
Depth sensors compatible with Intel Perceptual Computing SDK are supported through VideoCapture
|
||||
Depth sensors compatible with Intel® RealSense SDK are supported through VideoCapture
|
||||
class. Depth map, RGB image and some other formats of output can be retrieved by using familiar
|
||||
interface of VideoCapture.
|
||||
|
||||
In order to use depth sensor with OpenCV you should do the following preliminary steps:
|
||||
|
||||
-# Install Intel Perceptual Computing SDK (from here <http://www.intel.com/software/perceptual>).
|
||||
-# Install Intel RealSense SDK 2.0 (from here <https://github.com/IntelRealSense/librealsense>).
|
||||
|
||||
-# Configure OpenCV with Intel Perceptual Computing SDK support by setting WITH_INTELPERC flag in
|
||||
CMake. If Intel Perceptual Computing SDK is found in install folders OpenCV will be built with
|
||||
Intel Perceptual Computing SDK library (see a status INTELPERC in CMake log). If CMake process
|
||||
doesn't find Intel Perceptual Computing SDK installation folder automatically, the user should
|
||||
change corresponding CMake variables INTELPERC_LIB_DIR and INTELPERC_INCLUDE_DIR to the
|
||||
proper value.
|
||||
-# Configure OpenCV with Intel RealSense SDK support by setting WITH_LIBREALSENSE flag in
|
||||
CMake. If Intel RealSense SDK is found in install folders OpenCV will be built with
|
||||
Intel Realsense SDK library (see a status LIBREALSENSE in CMake log).
|
||||
|
||||
-# Build OpenCV.
|
||||
|
||||
@@ -38,7 +35,7 @@ VideoCapture can retrieve the following data:
|
||||
|
||||
In order to get depth map from depth sensor use VideoCapture::operator \>\>, e. g. :
|
||||
@code{.cpp}
|
||||
VideoCapture capture( CAP_INTELPERC );
|
||||
VideoCapture capture( CAP_REALSENSE );
|
||||
for(;;)
|
||||
{
|
||||
Mat depthMap;
|
||||
@@ -50,7 +47,7 @@ In order to get depth map from depth sensor use VideoCapture::operator \>\>, e.
|
||||
@endcode
|
||||
For getting several data maps use VideoCapture::grab and VideoCapture::retrieve, e.g. :
|
||||
@code{.cpp}
|
||||
VideoCapture capture(CAP_INTELPERC);
|
||||
VideoCapture capture(CAP_REALSENSE);
|
||||
for(;;)
|
||||
{
|
||||
Mat depthMap;
|
||||
@@ -70,7 +67,7 @@ For getting several data maps use VideoCapture::grab and VideoCapture::retrieve,
|
||||
For setting and getting some property of sensor\` data generators use VideoCapture::set and
|
||||
VideoCapture::get methods respectively, e.g. :
|
||||
@code{.cpp}
|
||||
VideoCapture capture( CAP_INTELPERC );
|
||||
VideoCapture capture(CAP_REALSENSE);
|
||||
capture.set( CAP_INTELPERC_DEPTH_GENERATOR | CAP_PROP_INTELPERC_PROFILE_IDX, 0 );
|
||||
cout << "FPS " << capture.get( CAP_INTELPERC_DEPTH_GENERATOR+CAP_PROP_FPS ) << endl;
|
||||
@endcode
|
||||
|
||||
@@ -126,13 +126,12 @@ captRefrnc.set(CAP_PROP_POS_FRAMES, 10); // go to the 10th frame of the video
|
||||
For properties you can read and change look into the documentation of the @ref cv::VideoCapture::get and
|
||||
@ref cv::VideoCapture::set functions.
|
||||
|
||||
Image similarity - PSNR and SSIM
|
||||
--------------------------------
|
||||
### Image similarity - PSNR and SSIM
|
||||
|
||||
We want to check just how imperceptible our video converting operation went, therefore we need a
|
||||
system to check frame by frame the similarity or differences. The most common algorithm used for
|
||||
this is the PSNR (aka **Peak signal-to-noise ratio**). The simplest definition of this starts out
|
||||
from the *mean squad error*. Let there be two images: I1 and I2; with a two dimensional size i and
|
||||
from the *mean squared error*. Let there be two images: I1 and I2; with a two dimensional size i and
|
||||
j, composed of c number of channels.
|
||||
|
||||
\f[MSE = \frac{1}{c*i*j} \sum{(I_1-I_2)^2}\f]
|
||||
@@ -145,15 +144,15 @@ Here the \f$MAX_I\f$ is the maximum valid value for a pixel. In case of the simp
|
||||
per pixel per channel this is 255. When two images are the same the MSE will give zero, resulting in
|
||||
an invalid divide by zero operation in the PSNR formula. In this case the PSNR is undefined and as
|
||||
we'll need to handle this case separately. The transition to a logarithmic scale is made because the
|
||||
pixel values have a very wide dynamic range. All this translated to OpenCV and a C++ function looks
|
||||
pixel values have a very wide dynamic range. All this translated to OpenCV and a function looks
|
||||
like:
|
||||
|
||||
@add_toggle_cpp
|
||||
@include cpp/tutorial_code/videoio/video-input-psnr-ssim/video-input-psnr-ssim.cpp get-psnr
|
||||
@snippet cpp/tutorial_code/videoio/video-input-psnr-ssim/video-input-psnr-ssim.cpp get-psnr
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_python
|
||||
@include samples/python/tutorial_code/videoio/video-input-psnr-ssim.py get-psnr
|
||||
@snippet samples/python/tutorial_code/videoio/video-input-psnr-ssim.py get-psnr
|
||||
@end_toggle
|
||||
|
||||
Typically result values are anywhere between 30 and 50 for video compression, where higher is
|
||||
@@ -172,11 +171,11 @@ implementation below.
|
||||
Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004." article.
|
||||
|
||||
@add_toggle_cpp
|
||||
@include cpp/tutorial_code/videoio/video-input-psnr-ssim/video-input-psnr-ssim.cpp get-mssim
|
||||
@snippet samples/cpp/tutorial_code/videoio/video-input-psnr-ssim/video-input-psnr-ssim.cpp get-mssim
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_python
|
||||
@include samples/python/tutorial_code/videoio/video-input-psnr-ssim.py get-mssim
|
||||
@snippet samples/python/tutorial_code/videoio/video-input-psnr-ssim.py get-mssim
|
||||
@end_toggle
|
||||
|
||||
This will return a similarity index for each channel of the image. This value is between zero and
|
||||
|
||||
@@ -63,7 +63,7 @@ specialized video writing libraries such as *FFMpeg* or codecs as *HuffYUV*, *Co
|
||||
an alternative, create the video track with OpenCV and expand it with sound tracks or convert it to
|
||||
other formats by using video manipulation programs such as *VirtualDub* or *AviSynth*.
|
||||
|
||||
The *VideoWriter* class
|
||||
The VideoWriter class
|
||||
-----------------------
|
||||
|
||||
The content written here builds on the assumption you
|
||||
|
||||
@@ -450,7 +450,7 @@ enum { LMEDS = 4, //!< least-median of squares algorithm
|
||||
USAC_FAST = 35, //!< USAC, fast settings
|
||||
USAC_ACCURATE = 36, //!< USAC, accurate settings
|
||||
USAC_PROSAC = 37, //!< USAC, sorted points, runs PROSAC
|
||||
USAC_MAGSAC = 38 //!< USAC, sorted points, runs PROSAC
|
||||
USAC_MAGSAC = 38 //!< USAC, runs MAGSAC++
|
||||
};
|
||||
|
||||
enum SolvePnPMethod {
|
||||
@@ -550,17 +550,18 @@ enum NeighborSearchMethod { NEIGH_FLANN_KNN, NEIGH_GRID, NEIGH_FLANN_RADIUS };
|
||||
|
||||
struct CV_EXPORTS_W_SIMPLE UsacParams
|
||||
{ // in alphabetical order
|
||||
double confidence = 0.99;
|
||||
bool isParallel = false;
|
||||
int loIterations = 5;
|
||||
LocalOptimMethod loMethod = LocalOptimMethod::LOCAL_OPTIM_INNER_LO;
|
||||
int loSampleSize = 14;
|
||||
int maxIterations = 5000;
|
||||
NeighborSearchMethod neighborsSearch = NeighborSearchMethod::NEIGH_GRID;
|
||||
int randomGeneratorState = 0;
|
||||
SamplingMethod sampler = SamplingMethod::SAMPLING_UNIFORM;
|
||||
ScoreMethod score = ScoreMethod::SCORE_METHOD_MSAC;
|
||||
double threshold = 1.5;
|
||||
CV_WRAP UsacParams();
|
||||
CV_PROP_RW double confidence;
|
||||
CV_PROP_RW bool isParallel;
|
||||
CV_PROP_RW int loIterations;
|
||||
CV_PROP_RW LocalOptimMethod loMethod;
|
||||
CV_PROP_RW int loSampleSize;
|
||||
CV_PROP_RW int maxIterations;
|
||||
CV_PROP_RW NeighborSearchMethod neighborsSearch;
|
||||
CV_PROP_RW int randomGeneratorState;
|
||||
CV_PROP_RW SamplingMethod sampler;
|
||||
CV_PROP_RW ScoreMethod score;
|
||||
CV_PROP_RW double threshold;
|
||||
};
|
||||
|
||||
/** @brief Converts a rotation matrix to a rotation vector or vice versa.
|
||||
@@ -2607,7 +2608,7 @@ final fundamental matrix. It can be set to something like 1-3, depending on the
|
||||
point localization, image resolution, and the image noise.
|
||||
@param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level
|
||||
of confidence (probability) that the estimated matrix is correct.
|
||||
@param mask
|
||||
@param[out] mask optional output mask
|
||||
@param maxIters The maximum number of robust method iterations.
|
||||
|
||||
The epipolar geometry is described by the following equation:
|
||||
|
||||
@@ -355,7 +355,7 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
|
||||
{
|
||||
CV_INSTRUMENT_REGION();
|
||||
|
||||
if (method >= 32 && method <= 38)
|
||||
if (method >= USAC_DEFAULT && method <= USAC_MAGSAC)
|
||||
return usac::findHomography(_points1, _points2, method, ransacReprojThreshold,
|
||||
_mask, maxIters, confidence);
|
||||
|
||||
@@ -380,6 +380,9 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
|
||||
return Mat();
|
||||
convertPointsFromHomogeneous(p, p);
|
||||
}
|
||||
// Need at least 4 point correspondences to calculate Homography
|
||||
if( npoints < 4 )
|
||||
CV_Error(Error::StsVecLengthErr , "The input arrays should have at least 4 corresponding point sets to calculate Homography");
|
||||
p.reshape(2, npoints).convertTo(m, CV_32F);
|
||||
}
|
||||
|
||||
@@ -831,7 +834,7 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2,
|
||||
{
|
||||
CV_INSTRUMENT_REGION();
|
||||
|
||||
if (method >= 32 && method <= 38)
|
||||
if (method >= USAC_DEFAULT && method <= USAC_MAGSAC)
|
||||
return usac::findFundamentalMat(_points1, _points2, method,
|
||||
ransacReprojThreshold, confidence, maxIters, _mask);
|
||||
|
||||
|
||||
@@ -77,18 +77,18 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
|
||||
OutputArray _Ma, OutputArray _Mb)
|
||||
{
|
||||
//argument checking:
|
||||
size_t n = static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()); //number of points
|
||||
size_t n = static_cast<size_t>(_normalizedInputPoints.rows()) * static_cast<size_t>(_normalizedInputPoints.cols()); //number of points
|
||||
int objType = _objectPoints.type();
|
||||
int type_input = _normalizedInputPoints.type();
|
||||
|
||||
CV_CheckType(objType, objType == CV_32FC3 || objType == CV_64FC3,
|
||||
"Type of _objectPoints must be CV_32FC3 or CV_64FC3" );
|
||||
CV_CheckType(type_input, type_input == CV_32FC2 || type_input == CV_64FC2,
|
||||
"Type of _normalizedInputPoints must be CV_32FC3 or CV_64FC3" );
|
||||
"Type of _normalizedInputPoints must be CV_32FC2 or CV_64FC2" );
|
||||
CV_Assert(_objectPoints.rows() == 1 || _objectPoints.cols() == 1);
|
||||
CV_Assert(_objectPoints.rows() >= 4 || _objectPoints.cols() >= 4);
|
||||
CV_Assert(_normalizedInputPoints.rows() == 1 || _normalizedInputPoints.cols() == 1);
|
||||
CV_Assert(static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()) == n);
|
||||
CV_Assert(static_cast<size_t>(_objectPoints.rows()) * static_cast<size_t>(_objectPoints.cols()) == n);
|
||||
|
||||
Mat normalizedInputPoints;
|
||||
if (type_input == CV_32FC2)
|
||||
@@ -101,7 +101,7 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
|
||||
}
|
||||
|
||||
Mat objectInputPoints;
|
||||
if (type_input == CV_32FC3)
|
||||
if (objType == CV_32FC3)
|
||||
{
|
||||
_objectPoints.getMat().convertTo(objectInputPoints, CV_64F);
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ Mat estimateAffine2D(InputArray _from, InputArray _to, OutputArray _inliers,
|
||||
const size_t refineIters)
|
||||
{
|
||||
|
||||
if (method >= 32 && method <= 38)
|
||||
if (method >= USAC_DEFAULT && method <= USAC_MAGSAC)
|
||||
return cv::usac::estimateAffine2D(_from, _to, _inliers, method,
|
||||
ransacReprojThreshold, (int)maxIters, confidence, (int)refineIters);
|
||||
|
||||
|
||||
@@ -197,6 +197,21 @@ public:
|
||||
Mat tvec;
|
||||
};
|
||||
|
||||
UsacParams::UsacParams()
|
||||
{
|
||||
confidence = 0.99;
|
||||
isParallel = false;
|
||||
loIterations = 5;
|
||||
loMethod = LocalOptimMethod::LOCAL_OPTIM_INNER_LO;
|
||||
loSampleSize = 14;
|
||||
maxIterations = 5000;
|
||||
neighborsSearch = NeighborSearchMethod::NEIGH_GRID;
|
||||
randomGeneratorState = 0;
|
||||
sampler = SamplingMethod::SAMPLING_UNIFORM;
|
||||
score = ScoreMethod::SCORE_METHOD_MSAC;
|
||||
threshold = 1.5;
|
||||
}
|
||||
|
||||
bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
InputArray _cameraMatrix, InputArray _distCoeffs,
|
||||
OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess,
|
||||
@@ -205,7 +220,7 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
{
|
||||
CV_INSTRUMENT_REGION();
|
||||
|
||||
if (flags >= 32 && flags <= 38)
|
||||
if (flags >= USAC_DEFAULT && flags <= USAC_MAGSAC)
|
||||
return usac::solvePnPRansac(_opoints, _ipoints, _cameraMatrix, _distCoeffs,
|
||||
_rvec, _tvec, useExtrinsicGuess, iterationsCount, reprojectionError,
|
||||
confidence, _inliers, flags);
|
||||
|
||||
@@ -193,6 +193,26 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class GammaValues
|
||||
{
|
||||
const double max_range_complete /*= 4.62*/, max_range_gamma /*= 1.52*/;
|
||||
const int max_size_table /* = 3000 */;
|
||||
|
||||
std::vector<double> gamma_complete, gamma_incomplete, gamma;
|
||||
|
||||
GammaValues(); // use getSingleton()
|
||||
|
||||
public:
|
||||
static const GammaValues& getSingleton();
|
||||
|
||||
const std::vector<double>& getCompleteGammaValues() const;
|
||||
const std::vector<double>& getIncompleteGammaValues() const;
|
||||
const std::vector<double>& getGammaValues() const;
|
||||
double getScaleOfGammaCompleteValues () const;
|
||||
double getScaleOfGammaValues () const;
|
||||
int getTableSize () const;
|
||||
};
|
||||
|
||||
////////////////////////////////////////// QUALITY ///////////////////////////////////////////
|
||||
class Quality : public Algorithm {
|
||||
public:
|
||||
@@ -269,10 +289,6 @@ public:
|
||||
virtual bool isModelValid (const Mat &/*model*/, const std::vector<int> &/*sample*/) const {
|
||||
return true;
|
||||
}
|
||||
virtual bool isModelValid (const Mat &/*model*/, const std::vector<int> &/*sample*/,
|
||||
int /*sample_size*/) const {
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* Fix degenerate model.
|
||||
* Return true if model is degenerate, false - otherwise
|
||||
@@ -286,7 +302,7 @@ public:
|
||||
|
||||
class EpipolarGeometryDegeneracy : public Degeneracy {
|
||||
public:
|
||||
static void recoverRank (Mat &model);
|
||||
static void recoverRank (Mat &model, bool is_fundamental_mat);
|
||||
static Ptr<EpipolarGeometryDegeneracy> create (const Mat &points_, int sample_size_);
|
||||
};
|
||||
|
||||
@@ -405,9 +421,7 @@ struct SPRT_history {
|
||||
double epsilon, delta, A;
|
||||
// number of samples processed by test
|
||||
int tested_samples; // k
|
||||
SPRT_history ()
|
||||
: epsilon(0), delta(0), A(0)
|
||||
{
|
||||
SPRT_history () : epsilon(0), delta(0), A(0) {
|
||||
tested_samples = 0;
|
||||
}
|
||||
};
|
||||
@@ -465,7 +479,7 @@ class GridNeighborhoodGraph : public NeighborhoodGraph {
|
||||
public:
|
||||
static Ptr<GridNeighborhoodGraph> create(const Mat &points, int points_size,
|
||||
int cell_size_x_img1_, int cell_size_y_img1_,
|
||||
int cell_size_x_img2_, int cell_size_y_img2_);
|
||||
int cell_size_x_img2_, int cell_size_y_img2_, int max_neighbors);
|
||||
};
|
||||
|
||||
////////////////////////////////////// UNIFORM SAMPLER ////////////////////////////////////////////
|
||||
@@ -568,7 +582,7 @@ namespace Math {
|
||||
// return skew symmetric matrix
|
||||
Matx33d getSkewSymmetric(const Vec3d &v_);
|
||||
// eliminate matrix with m rows and n columns to be upper triangular.
|
||||
void eliminateUpperTriangular (std::vector<double> &a, int m, int n);
|
||||
bool eliminateUpperTriangular (std::vector<double> &a, int m, int n);
|
||||
Matx33d rotVec2RotMat (const Vec3d &v);
|
||||
Vec3d rotMat2RotVec (const Matx33d &R);
|
||||
}
|
||||
@@ -746,6 +760,7 @@ public:
|
||||
virtual int getLOInnerMaxIters() const = 0;
|
||||
virtual const std::vector<int> &getGridCellNumber () const = 0;
|
||||
virtual int getRandomGeneratorState () const = 0;
|
||||
virtual int getMaxItersBeforeLO () const = 0;
|
||||
|
||||
// setters
|
||||
virtual void setLocalOptimization (LocalOptimMethod lo_) = 0;
|
||||
@@ -759,6 +774,7 @@ public:
|
||||
virtual void setLOIterations (int iters) = 0;
|
||||
virtual void setLOIterativeIters (int iters) = 0;
|
||||
virtual void setLOSampleSize (int lo_sample_size) = 0;
|
||||
virtual void setThresholdMultiplierLO (double thr_mult) = 0;
|
||||
virtual void setRandomGeneratorState (int state) = 0;
|
||||
|
||||
virtual void maskRequired (bool required) = 0;
|
||||
|
||||
@@ -18,17 +18,11 @@ public:
|
||||
* Do oriented constraint to verify if epipolar geometry is in front or behind the camera.
|
||||
* Return: true if all points are in front of the camers w.r.t. tested epipolar geometry - satisfies constraint.
|
||||
* false - otherwise.
|
||||
*/
|
||||
inline bool isModelValid(const Mat &F, const std::vector<int> &sample) const override {
|
||||
return isModelValid(F, sample, min_sample_size);
|
||||
}
|
||||
|
||||
/* Oriented constraint:
|
||||
* x'^T F x = 0
|
||||
* e' × x' ~+ Fx <=> λe' × x' = Fx, λ > 0
|
||||
* e × x ~+ x'^T F
|
||||
*/
|
||||
inline bool isModelValid(const Mat &F_, const std::vector<int> &sample, int sample_size_) const override {
|
||||
inline bool isModelValid(const Mat &F_, const std::vector<int> &sample) const override {
|
||||
// F is of rank 2, taking cross product of two rows we obtain null vector of F
|
||||
Vec3d ec_mat = F_.row(0).cross(F_.row(2));
|
||||
auto * ec = ec_mat.val; // of size 3x1
|
||||
@@ -40,7 +34,6 @@ public:
|
||||
ec_mat = F_.row(1).cross(F_.row(2));
|
||||
ec = ec_mat.val;
|
||||
}
|
||||
// F is 9x1 row-major ordered F matrix. ec is 3x1
|
||||
const auto * const F = (double *) F_.data;
|
||||
|
||||
// without loss of generality, let the first point in sample be in front of the camera.
|
||||
@@ -50,17 +43,12 @@ public:
|
||||
// sign1 = s1 * s2
|
||||
const double sign1 = (F[0]*points[pt+2]+F[3]*points[pt+3]+F[6])*(ec[1]-ec[2]*points[pt+1]);
|
||||
|
||||
int num_pts_behind = 0;
|
||||
for (int i = 1; i < sample_size_; i++) {
|
||||
for (int i = 1; i < min_sample_size; i++) {
|
||||
pt = 4 * sample[i];
|
||||
// if signum of the first point and tested point differs
|
||||
// then two points are on different sides of the camera.
|
||||
if (sign1*(F[0]*points[pt+2]+F[3]*points[pt+3]+F[6])*(ec[1]-ec[2]*points[pt+1])<0)
|
||||
// if 3 points are behind the camera for non-minimal sample then model is
|
||||
// not valid. Testing by one point as in case for minimal sample is not very
|
||||
// precise. The number 3 was chosen experimentally.
|
||||
if (min_sample_size == sample_size_ || ++num_pts_behind >= 3)
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -69,15 +57,20 @@ public:
|
||||
return makePtr<EpipolarGeometryDegeneracyImpl>(*points_mat, min_sample_size);
|
||||
}
|
||||
};
|
||||
void EpipolarGeometryDegeneracy::recoverRank (Mat &model) {
|
||||
void EpipolarGeometryDegeneracy::recoverRank (Mat &model, bool is_fundamental_mat) {
|
||||
/*
|
||||
* Do singular value decomposition.
|
||||
* Make last eigen value zero of diagonal matrix of singular values.
|
||||
*/
|
||||
Matx33d U, Vt;
|
||||
Vec3d w;
|
||||
SVD::compute(model, w, U, Vt, SVD::FULL_UV + SVD::MODIFY_A);
|
||||
model = Mat(U * Matx33d(w(0), 0, 0, 0, w(1), 0, 0, 0, 0) * Vt);
|
||||
SVD::compute(model, w, U, Vt, SVD::MODIFY_A);
|
||||
if (is_fundamental_mat)
|
||||
model = Mat(U * Matx33d(w(0), 0, 0, 0, w(1), 0, 0, 0, 0) * Vt);
|
||||
else {
|
||||
const double mean_singular_val = (w[0] + w[1]) * 0.5;
|
||||
model = Mat(U * Matx33d(mean_singular_val, 0, 0, 0, mean_singular_val, 0, 0, 0, 0) * Vt);
|
||||
}
|
||||
}
|
||||
Ptr<EpipolarGeometryDegeneracy> EpipolarGeometryDegeneracy::create (const Mat &points_,
|
||||
int sample_size_) {
|
||||
@@ -157,11 +150,15 @@ private:
|
||||
const float * const points;
|
||||
const Mat * points_mat;
|
||||
const Ptr<ReprojectionErrorForward> h_reproj_error;
|
||||
Ptr<HomographyNonMinimalSolver> h_non_min_solver;
|
||||
const EpipolarGeometryDegeneracyImpl ep_deg;
|
||||
// threshold to find inliers for homography model
|
||||
const double homography_threshold, log_conf = log(0.05);
|
||||
// points (1-7) to verify in sample
|
||||
std::vector<std::vector<int>> h_sample {{0,1,2},{3,4,5},{0,1,6},{3,4,6},{2,5,6}};
|
||||
std::vector<int> h_inliers;
|
||||
std::vector<double> weights;
|
||||
std::vector<Mat> h_models;
|
||||
const int points_size, sample_size;
|
||||
public:
|
||||
|
||||
@@ -179,14 +176,12 @@ public:
|
||||
h_sample.emplace_back(std::vector<int>{3, 6, 7});
|
||||
h_sample.emplace_back(std::vector<int>{2, 4, 7});
|
||||
}
|
||||
h_inliers = std::vector<int>(points_size);
|
||||
h_non_min_solver = HomographyNonMinimalSolver::create(points_);
|
||||
}
|
||||
inline bool isModelValid(const Mat &F, const std::vector<int> &sample) const override {
|
||||
return ep_deg.isModelValid(F, sample);
|
||||
}
|
||||
inline bool isModelValid(const Mat &F, const std::vector<int> &sample, int sample_size_) const override {
|
||||
return ep_deg.isModelValid(F, sample, sample_size_);
|
||||
}
|
||||
|
||||
bool recoverIfDegenerate (const std::vector<int> &sample, const Mat &F_best,
|
||||
Mat &non_degenerate_model, Score &non_degenerate_model_score) override {
|
||||
non_degenerate_model_score = Score(); // set worst case
|
||||
@@ -239,23 +234,32 @@ public:
|
||||
}
|
||||
|
||||
// compute H
|
||||
const Matx33d H = A - e_prime * (M.inv() * b).t();
|
||||
Matx33d H = A - e_prime * (M.inv() * b).t();
|
||||
|
||||
int inliers_on_plane = 0;
|
||||
int inliers_out_plane = 0;
|
||||
h_reproj_error->setModelParameters(Mat(H));
|
||||
|
||||
// find inliers from sample, points related to H, x' ~ Hx
|
||||
for (int s = 0; s < sample_size; s++)
|
||||
if (h_reproj_error->getError(sample[s]) < homography_threshold)
|
||||
if (++inliers_on_plane >= 5)
|
||||
if (h_reproj_error->getError(sample[s]) > homography_threshold)
|
||||
if (++inliers_out_plane > 2)
|
||||
break;
|
||||
|
||||
// if there are at least 5 points lying on plane then F is degenerate
|
||||
if (inliers_on_plane >= 5) {
|
||||
if (inliers_out_plane <= 2) {
|
||||
is_model_degenerate = true;
|
||||
|
||||
// update homography by polishing on all inliers
|
||||
int h_inls_cnt = 0;
|
||||
const auto &h_errors = h_reproj_error->getErrors(Mat(H));
|
||||
for (int pt = 0; pt < points_size; pt++)
|
||||
if (h_errors[pt] < homography_threshold)
|
||||
h_inliers[h_inls_cnt++] = pt;
|
||||
if (h_non_min_solver->estimate(h_inliers, h_inls_cnt, h_models, weights) != 0)
|
||||
H = Matx33d(h_models[0]);
|
||||
|
||||
Mat newF;
|
||||
const Score newF_score = planeAndParallaxRANSAC(H, newF);
|
||||
const Score newF_score = planeAndParallaxRANSAC(H, newF, h_errors);
|
||||
if (newF_score.isBetter(non_degenerate_model_score)) {
|
||||
// store non degenerate model
|
||||
non_degenerate_model_score = newF_score;
|
||||
@@ -271,7 +275,7 @@ public:
|
||||
}
|
||||
private:
|
||||
// RANSAC with plane-and-parallax to find new Fundamental matrix
|
||||
Score planeAndParallaxRANSAC (const Matx33d &H, Mat &best_F) {
|
||||
Score planeAndParallaxRANSAC (const Matx33d &H, Mat &best_F, const std::vector<float> &h_errors) {
|
||||
int max_iters = 100; // with 95% confidence assume at least 17% of inliers
|
||||
Score best_score;
|
||||
for (int iters = 0; iters < max_iters; iters++) {
|
||||
@@ -282,18 +286,17 @@ private:
|
||||
h_outlier2 = rng.uniform(0, points_size);
|
||||
|
||||
// find outliers of homography H
|
||||
if (h_reproj_error->getError(h_outlier1) > homography_threshold &&
|
||||
h_reproj_error->getError(h_outlier2) > homography_threshold) {
|
||||
if (h_errors[h_outlier1] > homography_threshold &&
|
||||
h_errors[h_outlier2] > homography_threshold) {
|
||||
|
||||
// do plane and parallax with outliers of H
|
||||
const Vec3d pt1 (points[4*h_outlier1], points[4*h_outlier1+1], 1);
|
||||
const Vec3d pt2 (points[4*h_outlier2], points[4*h_outlier2+1], 1);
|
||||
const Vec3d pt1_prime (points[4*h_outlier1+2],points[4*h_outlier1+3],1);
|
||||
const Vec3d pt2_prime (points[4*h_outlier2+2],points[4*h_outlier2+3],1);
|
||||
|
||||
// F = [(p1' x Hp1) x (p2' x Hp2)]_x H
|
||||
const Matx33d F = Math::getSkewSymmetric((pt1_prime.cross(H * pt1)).cross
|
||||
(pt2_prime.cross(H * pt2))) * H;
|
||||
const Matx33d F = Math::getSkewSymmetric(
|
||||
(Vec3d(points[4*h_outlier1+2], points[4*h_outlier1+3], 1).cross // p1'
|
||||
(H * Vec3d(points[4*h_outlier1 ], points[4*h_outlier1+1], 1))).cross // Hp1
|
||||
(Vec3d(points[4*h_outlier2+2], points[4*h_outlier2+3], 1).cross // p2'
|
||||
(H * Vec3d(points[4*h_outlier2 ], points[4*h_outlier2+1], 1))) // Hp2
|
||||
) * H;
|
||||
|
||||
const Score score = quality->getScore(Mat(F));
|
||||
if (score.isBetter(best_score)) {
|
||||
|
||||
@@ -214,7 +214,6 @@ public:
|
||||
|
||||
if (all_points_in_front_of_camera) {
|
||||
Mat model;
|
||||
// hconcat(rot_mat, soln_translation, model);
|
||||
hconcat(Math::rotVec2RotMat(Math::rotMat2RotVec(rot_mat)), soln_translation, model);
|
||||
models_.emplace_back(K * model);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user