Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c19a0c
Reinitialize divider matrix in DivRCPerfTest and DivPerfTest Cases.
CNClareChen Aug 14, 2024
5638c38
Resolve compilation bug
CNClareChen Jul 4, 2024
a17fafc
Disable strict mode when reading avif files
vrabaud Aug 28, 2024
bacefd3
Merge pull request #26077 from vrabaud:avif_check
asmorkalov Aug 28, 2024
61f6b6d
videoio: fix V4L backend with NV12 input format
mshabunin Aug 21, 2024
f156236
Merge pull request #26081 from mshabunin:fix-v4l-nv12
asmorkalov Aug 28, 2024
2829a6d
Merge pull request #26030 from CNClareChen:4.x
asmorkalov Aug 30, 2024
a905526
Got rid of CAROTENE_NEON_ARCH and use standard __ARM_ARCH check.
asmorkalov Aug 30, 2024
5b4d1ce
Merge pull request #26080 from asmorkalov:as/HAL_minMaxIdx_ND_offset
asmorkalov Aug 30, 2024
4d66541
Merge pull request #26067 from CNClareChen:4.10
asmorkalov Aug 30, 2024
165bf25
Fix typo with cameramatrix command for documentation.
catree Aug 31, 2024
b72d7e3
Merge pull request #26091 from asmorkalov:as/arm_version_check
asmorkalov Sep 2, 2024
960aaa3
Merge pull request #26094 from catree:fix_cameramatrix_doc_typo
asmorkalov Sep 2, 2024
e2ba36b
Merge pull request #26093 from sturkmen72:related_issue_22090
sturkmen72 Sep 2, 2024
3995ad8
Make T a math symbol
FantasqueX Sep 3, 2024
e9c3e1a
Merge pull request #26102 from FantasqueX:make-t-a-math-symbol
asmorkalov Sep 3, 2024
88f99ed
Merge pull request #26071 from tingboliao:4.x
tingboliao Sep 3, 2024
8561f45
Merge pull request #26084 from vrabaud:avif_check
vrabaud Sep 3, 2024
32d3d6f
build: minor changes for cmake 3.30 and some cleanup
mshabunin Sep 3, 2024
76f495d
Merge pull request #26105 from mshabunin:fix-cmake-3.30
asmorkalov Sep 4, 2024
9ef574a
added bit-exact tests for RGB2Gray
Sep 5, 2024
c0a0852
added more data types for warpAffine() perf tests
Sep 5, 2024
06db881
Merge pull request #26114 from savuor:rv/rgb2gray_bit_exact
asmorkalov Sep 5, 2024
b743edd
Update remap tutorial
FantasqueX Sep 5, 2024
dbd53fe
RISC-V: remove statically initialized global RVV variables
mshabunin Sep 5, 2024
2a8d4c6
Merge pull request #26120 from mshabunin:fix-rvv-init-4.x
asmorkalov Sep 6, 2024
7590813
Merge pull request #26115 from savuor:rv/flip_ocl_dtypes
savuor Sep 6, 2024
6cc1669
Merge pull request #26117 from FantasqueX:update-remap-tutorial-1
asmorkalov Sep 6, 2024
307dc2a
Excluded nullptr leak to arithmetic HAL got from empty Mat.
asmorkalov Sep 6, 2024
a7d942b
Merge pull request #26125 from asmorkalov:as/HAL_fix_nullprt_leak
asmorkalov Sep 7, 2024
e5790c0
Merge pull request #26116 from savuor:rv/warp_affine_perf_types
asmorkalov Sep 9, 2024
79faf85
Merge pull request #26042 from pasbi:add-PtrStepSz_size
pasbi Sep 9, 2024
b574db2
Merge branch 4.x
asmorkalov Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions 3rdparty/carotene/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@ endif()

if(WITH_NEON)
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
if(NOT DEFINED CAROTENE_NEON_ARCH )
elseif(CAROTENE_NEON_ARCH EQUAL 8)
target_compile_definitions(carotene_objs PRIVATE "-DCAROTENE_NEON_ARCH=8")
elseif(CAROTENE_NEON_ARCH EQUAL 7)
target_compile_definitions(carotene_objs PRIVATE "-DCAROTENE_NEON_ARCH=7")
else()
target_compile_definitions(carotene_objs PRIVATE "-DCAROTENE_NEON_ARCH=0")
endif()
endif()

if(MINGW)
if(MINGW)
target_compile_definitions(carotene_objs PRIVATE "-D_USE_MATH_DEFINES=1")
endif()

Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/carotene/hal/tegra_hal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ TegraCvtColor_Invoker(bgrx2hsvf, bgrx2hsv, src_data + static_cast<size_t>(range.
#endif

// The optimized branch was developed for old armv7 processors and leads to perf degradation on armv8
#if defined(DCAROTENE_NEON_ARCH) && (DCAROTENE_NEON_ARCH == 7)
#if defined(__ARM_ARCH) && (__ARM_ARCH == 7)
inline CAROTENE_NS::BORDER_MODE borderCV2Carotene(int borderType)
{
switch(borderType)
Expand Down Expand Up @@ -1928,7 +1928,7 @@ inline int TEGRA_GaussianBlurBinomial(const uchar* src_data, size_t src_step, uc
#undef cv_hal_gaussianBlurBinomial
#define cv_hal_gaussianBlurBinomial TEGRA_GaussianBlurBinomial

#endif // DCAROTENE_NEON_ARCH=7
#endif // __ARM_ARCH=7

#endif // OPENCV_IMGPROC_HAL_INTERFACE_H

Expand Down
11 changes: 0 additions & 11 deletions 3rdparty/carotene/src/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@

namespace CAROTENE_NS { namespace internal {

#ifndef CAROTENE_NEON_ARCH
# if defined(__aarch64__) || defined(__aarch32__)
# define CAROTENE_NEON_ARCH 8
# else
# define CAROTENE_NEON_ARCH 7
# endif
#endif
#if ( !defined(__aarch64__) && !defined(__aarch32__) ) && (CAROTENE_NEON_ARCH == 8 )
# error("ARMv7 doen't support A32/A64 Neon instructions")
#endif

inline void prefetch(const void *ptr, size_t offset = 32*10)
{
#if defined __GNUC__
Expand Down
8 changes: 4 additions & 4 deletions 3rdparty/carotene/src/vround_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace CAROTENE_NS { namespace internal {

inline uint32x4_t vroundq_u32_f32(const float32x4_t val)
{
#if CAROTENE_NEON_ARCH >= 8 /* get ready for ARMv9 */
#if defined(__ARM_ARCH) && (__ARM_ARCH >= 8)
return vcvtnq_u32_f32(val);
#else
const float32x4_t delta = vdupq_n_f32(CAROTENE_ROUND_DELTA);
Expand All @@ -67,7 +67,7 @@ inline uint32x4_t vroundq_u32_f32(const float32x4_t val)

inline uint32x2_t vround_u32_f32(const float32x2_t val)
{
#if CAROTENE_NEON_ARCH >= 8 /* get ready for ARMv9 */
#if defined(__ARM_ARCH) && (__ARM_ARCH >= 8)
return vcvtn_u32_f32(val);
#else
const float32x2_t delta = vdup_n_f32(CAROTENE_ROUND_DELTA);
Expand All @@ -77,7 +77,7 @@ inline uint32x2_t vround_u32_f32(const float32x2_t val)

inline int32x4_t vroundq_s32_f32(const float32x4_t val)
{
#if CAROTENE_NEON_ARCH >= 8 /* get ready for ARMv9 */
#if defined(__ARM_ARCH) && (__ARM_ARCH >= 8)
return vcvtnq_s32_f32(val);
#else
const float32x4_t delta = vdupq_n_f32(CAROTENE_ROUND_DELTA);
Expand All @@ -87,7 +87,7 @@ inline int32x4_t vroundq_s32_f32(const float32x4_t val)

inline int32x2_t vround_s32_f32(const float32x2_t val)
{
#if CAROTENE_NEON_ARCH >= 8 /* get ready for ARMv9 */
#if defined(__ARM_ARCH) && (__ARM_ARCH >= 8)
return vcvtn_s32_f32(val);
#else
const float32x2_t delta = vdup_n_f32(CAROTENE_ROUND_DELTA);
Expand Down
97 changes: 19 additions & 78 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,20 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_PIC})
ocv_cmake_hook(PRE_CMAKE_BOOTSTRAP)

# Bootstrap CMake system: setup CMAKE_SYSTEM_NAME and other vars

# workaround: https://gitlab.kitware.com/cmake/cmake/-/issues/20989
if(OPENCV_WORKAROUND_CMAKE_20989)
set(CMAKE_SYSTEM_PROCESSOR_BACKUP ${CMAKE_SYSTEM_PROCESSOR})
endif()
enable_language(CXX C)

project(OpenCV CXX C)

if(OPENCV_WORKAROUND_CMAKE_20989)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR_BACKUP})
endif()

enable_testing()

ocv_cmake_hook(POST_CMAKE_BOOTSTRAP)

if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE)
Expand All @@ -151,10 +157,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # https://cmake.org/cmake/help/
endif()
endif()

enable_testing()

project(OpenCV CXX C)

if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()
Expand All @@ -163,70 +165,30 @@ ocv_cmake_eval(DEBUG_PRE ONCE)

ocv_clear_vars(OpenCVModules_TARGETS)

include(cmake/OpenCVDownload.cmake)

set(BUILD_LIST "" CACHE STRING "Build only listed modules (comma-separated, e.g. 'videoio,dnn,ts')")

# ----------------------------------------------------------------------------
# Break in case of popular CMake configuration mistakes
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
message(FATAL_ERROR "CMake fails to determine the bitness of the target platform.
Please check your CMake and compiler installation. If you are cross-compiling then ensure that your CMake toolchain file correctly sets the compiler details.")
find_host_package(Git QUIET)

if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
ocv_git_describe(OPENCV_VCSVERSION "${OpenCV_SOURCE_DIR}")
elseif(NOT DEFINED OPENCV_VCSVERSION)
# We don't have git:
set(OPENCV_VCSVERSION "unknown")
endif()

include(cmake/OpenCVDownload.cmake)

# ----------------------------------------------------------------------------
# Detect compiler and target platform architecture
# ----------------------------------------------------------------------------
include(cmake/OpenCVDetectCXXCompiler.cmake)
ocv_cmake_hook(POST_DETECT_COMPILER)

# Add these standard paths to the search paths for FIND_LIBRARY
# to find libraries from these locations first
if(UNIX AND NOT ANDROID)
if(X86_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
if(EXISTS /lib64)
list(APPEND CMAKE_LIBRARY_PATH /lib64)
else()
list(APPEND CMAKE_LIBRARY_PATH /lib)
endif()
if(EXISTS /usr/lib64)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib64)
else()
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
endif()
elseif(X86 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
if(EXISTS /lib32)
list(APPEND CMAKE_LIBRARY_PATH /lib32)
else()
list(APPEND CMAKE_LIBRARY_PATH /lib)
endif()
if(EXISTS /usr/lib32)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib32)
else()
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
endif()
endif()
endif()

# Add these standard paths to the search paths for FIND_PATH
# to find include files from these locations first
if(MINGW)
if(EXISTS /mingw)
list(APPEND CMAKE_INCLUDE_PATH /mingw)
endif()
if(EXISTS /mingw32)
list(APPEND CMAKE_INCLUDE_PATH /mingw32)
endif()
if(EXISTS /mingw64)
list(APPEND CMAKE_INCLUDE_PATH /mingw64)
endif()
endif()

# ----------------------------------------------------------------------------
# OpenCV cmake options
# ----------------------------------------------------------------------------

set(BUILD_LIST "" CACHE STRING "Build only listed modules (comma-separated, e.g. 'videoio,dnn,ts')")
OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF)

# 3rd party libs
Expand Down Expand Up @@ -658,19 +620,6 @@ ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
# ----------------------------------------------------------------------------
set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV modules (can be ;-separated list of paths)")

# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
find_host_package(Git QUIET)

if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
ocv_git_describe(OPENCV_VCSVERSION "${OpenCV_SOURCE_DIR}")
elseif(NOT DEFINED OPENCV_VCSVERSION)
# We don't have git:
set(OPENCV_VCSVERSION "unknown")
endif()


# ----------------------------------------------------------------------------
# OpenCV compiler and linker options
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -1004,15 +953,7 @@ foreach(hal ${OpenCV_HAL})
if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
add_subdirectory(3rdparty/carotene/hal)
ocv_hal_register(CAROTENE_HAL_LIBRARIES CAROTENE_HAL_HEADERS CAROTENE_HAL_INCLUDE_DIRS)

if( NOT DEFINED CAROTENE_NEON_ARCH)
set(CAROTENE_NEON_MSG "Auto detected")
elseif( CAROTENE_NEON_ARCH GREATER 7)
set(CAROTENE_NEON_MSG "Force ARMv8+")
else()
set(CAROTENE_NEON_MSG "Force ARMv7")
endif()
list(APPEND OpenCV_USED_HAL "carotene (ver ${CAROTENE_HAL_VERSION}, ${CAROTENE_NEON_MSG})")
list(APPEND OpenCV_USED_HAL "carotene (ver ${CAROTENE_HAL_VERSION})")
else()
message(STATUS "Carotene: NEON is not available, disabling carotene...")
endif()
Expand Down
8 changes: 7 additions & 1 deletion cmake/OpenCVDetectCXXCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ if(NOT DEFINED CMAKE_SIZEOF_VOID_P
AND NOT OPENCV_SUPPRESS_MESSAGE_MISSING_CMAKE_SIZEOF_VOID_P)
message(WARNING "OpenCV: CMAKE_SIZEOF_VOID_P is not defined. Perhaps CMake toolchain is broken")
endif()
if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
message(FATAL_ERROR "CMake fails to determine the bitness of the target platform.
Please check your CMake and compiler installation. If you are cross-compiling then ensure that your CMake toolchain file correctly sets the compiler details.")
endif()

message(STATUS "Detected processor: ${CMAKE_SYSTEM_PROCESSOR}")
if(OPENCV_SKIP_SYSTEM_PROCESSOR_DETECTION)
Expand Down Expand Up @@ -156,8 +160,10 @@ elseif(MSVC)
set(OpenCV_ARCH "ARM")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(OpenCV_ARCH "x64")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(OpenCV_ARCH "x86")
else()
set(OpenCV_ARCH x86)
message(FATAL_ERROR "Failed to determine system architecture")
endif()

if(MSVC_VERSION EQUAL 1400)
Expand Down
5 changes: 4 additions & 1 deletion cmake/OpenCVDownload.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ file(REMOVE "${OPENCV_DOWNLOAD_WITH_WGET}")
ocv_check_environment_variables(OPENCV_DOWNLOAD_MIRROR_ID)

function(ocv_init_download_mirror)
if(NOT GIT_FOUND)
return()
endif()
if(NOT DEFINED OPENCV_DOWNLOAD_MIRROR_ID)
# Run `git remote get-url origin` to get remote source
execute_process(
COMMAND
git remote get-url origin
${GIT_EXECUTABLE} remote get-url origin
WORKING_DIRECTORY
${CMAKE_SOURCE_DIR}
RESULT_VARIABLE
Expand Down
2 changes: 1 addition & 1 deletion doc/opencv.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ @inproceedings{Zuliani2014RANSACFD
title={RANSAC for Dummies With examples using the RANSAC toolbox for Matlab \& Octave and more...},
author={Marco Zuliani},
year={2014},
url = {https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.475.1243&rep=rep1&type=pdf}
url = {http://www.marcozuliani.com/docs/RANSAC4Dummies.pdf}
}
@inproceedings{forstner1987fast,
title={A fast operator for detection and precise location of distincs points, corners and center of circular features},
Expand Down
8 changes: 4 additions & 4 deletions doc/tutorials/imgproc/imgtrans/remap/remap.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Theory

![](images/Remap_Tutorial_Theory_0.jpg)

observe how the red circle changes positions with respect to x (considering \f$x\f$ the horizontal
observe how the red circle changes positions with respect to \f$x\f$ (considering \f$x\f$ the horizontal
direction):

![](images/Remap_Tutorial_Theory_1.jpg)
Expand All @@ -62,19 +62,19 @@ Code
- Wait for the user to exit the program

@add_toggle_cpp
- The tutorial code's is shown lines below. You can also download it from
- The tutorial code is shown lines below. You can also download it from
[here](https://github.com/opencv/opencv/tree/5.x/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp)
@include samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp
@end_toggle

@add_toggle_java
- The tutorial code's is shown lines below. You can also download it from
- The tutorial code is shown lines below. You can also download it from
[here](https://github.com/opencv/opencv/tree/5.x/samples/java/tutorial_code/ImgTrans/remap/RemapDemo.java)
@include samples/java/tutorial_code/ImgTrans/remap/RemapDemo.java
@end_toggle

@add_toggle_python
- The tutorial code's is shown lines below. You can also download it from
- The tutorial code is shown lines below. You can also download it from
[here](https://github.com/opencv/opencv/tree/5.x/samples/python/tutorial_code/ImgTrans/remap/Remap_Demo.py)
@include samples/python/tutorial_code/ImgTrans/remap/Remap_Demo.py
@end_toggle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Theory

-# We mentioned that an Affine Transformation is basically a **relation**
between two images. The information about this relation can come, roughly, in two ways:
-# We know both \f$X\f$ and T and we also know that they are related. Then our task is to find \f$M\f$
-# We know both \f$X\f$ and \f$T\f$ and we also know that they are related. Then our task is to find \f$M\f$
-# We know \f$M\f$ and \f$X\f$. To obtain \f$T\f$ we only need to apply \f$T = M \cdot X\f$. Our information
for \f$M\f$ may be explicit (i.e. have the 2-by-3 matrix) or it can come as a geometric relation
between points.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ Following options can be used to change installation layout for common scenarios
| `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_python3` | _ON_ | Build python3 bindings. Python with development files and numpy must be installed. |
| `CAROTENE_NEON_ARCH` | '(auto)' | Switch NEON Arch for Carotene. If it sets nothing, it will be auto-detected. If it sets 8, ARMv8(and later) is used. Otherwise, ARMv7 is used. |

TODO: need separate tutorials covering bindings builds

Expand Down
8 changes: 8 additions & 0 deletions modules/core/include/opencv2/core/cuda_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
#define __CV_CUDA_HOST_DEVICE__
#endif

#include "opencv2/core/cvdef.h"
#include "opencv2/core.hpp"

namespace cv
{
namespace cuda
Expand Down Expand Up @@ -124,6 +127,11 @@ namespace cv

int cols;
int rows;

CV_NODISCARD_STD __CV_CUDA_HOST_DEVICE__ Size size() const { return {cols, rows}; }
CV_NODISCARD_STD __CV_CUDA_HOST_DEVICE__ T& operator ()(const Point &pos) { return (*this)(pos.y, pos.x); }
CV_NODISCARD_STD __CV_CUDA_HOST_DEVICE__ const T& operator ()(const Point &pos) const { return (*this)(pos.y, pos.x); }
using PtrStep<T>::operator();
};

typedef PtrStepSz<unsigned char> PtrStepSzb;
Expand Down
6 changes: 5 additions & 1 deletion modules/core/include/opencv2/core/cvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,11 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
# define __has_cpp_attribute(__x) 0
# endif
# if __has_cpp_attribute(nodiscard)
# define CV_NODISCARD_STD [[nodiscard]]
# if defined(__NVCC__) && __CUDACC_VER_MAJOR__ < 12
# define CV_NODISCARD_STD
# else
# define CV_NODISCARD_STD [[nodiscard]]
# endif
# elif __cplusplus >= 201703L
// available when compiler is C++17 compliant
# define CV_NODISCARD_STD [[nodiscard]]
Expand Down
Loading