Commit Graph

1907 Commits

Author SHA1 Message Date
Alexander Alekhin
5578ad5e14 dnn(ocl): fix automatic globalsize adjusting
- if kernel code doesn't support that
2021-09-06 03:11:29 +00:00
Alexander Alekhin
6625810d2a Merge pull request #20618 from VadimLevin:dev/vlevin/fix-vector-conversion 2021-09-01 10:52:37 +00:00
Vadim Levin
16b9514543 feat: update conversion logic for std::vector<T> in Python bindings
`PyObject*` to `std::vector<T>` conversion logic:
- If user passed Numpy Array
  - If array is planar and T is a primitive type (doesn't require
    constructor call) that matches with the element type of array, then
    copy element one by one with the respect of the step between array
    elements. If compiler is lucky (or brave enough) copy loop can be
    vectorized.
    For classes that require constructor calls this path is not
    possible, because we can't begin an object lifetime without hacks.
  - Otherwise fall-back to general case
- Otherwise - execute the general case:
  If PyObject* corresponds to Sequence protocol - iterate over the
  sequence elements and invoke the appropriate `pyopencv_to` function.

`std::vector<T>` to `PyObject*` conversion logic:
- If `std::vector<T>` is empty - return empty tuple.
- If `T` has a corresponding `Mat` `DataType` than return
  Numpy array instance of the matching `dtype` e.g.
  `std::vector<cv::Rect>` is returned as `np.ndarray` of shape `Nx4` and
  `dtype=int`.
  This branch helps to optimize further evaluations in user code.
- Otherwise - execute the general case:
  Construct a tuple of length N = `std::vector::size` and insert
  elements one by one.

Unnecessary functions were removed and code was rearranged to allow
compiler select the appropriate conversion function specialization.
2021-09-01 13:00:21 +03:00
Dale Phurrough
3995deaf76
fix opencv/opencv#20544 nodiscard for msvc/gcc
- includes workaround for preprocessor non-compliance
- enable attribute syntax checking in msvc
2021-08-28 20:22:47 +02:00
Vadim Levin
531ea5b3a2 fix: convert arguments names that are keywords reserved by Python 2021-08-01 12:02:36 +03:00
Alexander Alekhin
9a9954a036 Merge tag '3.4.15' 2021-07-04 21:32:19 +00:00
Alexander Alekhin
591708903b release: OpenCV 3.4.15 2021-07-04 21:10:13 +00:00
kikaxa
bb60cb0bf9 Reenable filesystem for ios builds 2021-06-20 16:33:25 +00:00
Alexander Alekhin
5f80f43ff5 core: fix nSize initialization in cvIplImage() 2021-06-09 07:31:38 +00:00
Alexander Alekhin
43940f7ffc pre: OpenCV 3.4.15 (version++) 2021-06-07 20:10:34 +00:00
Developer-Ecosystem-Engineering
814550d2a6
Merge pull request #20011 from Developer-Ecosystem-Engineering:3.4
Improve performance on Arm64

* Improve performance on Apple silicon

This patch will
- Enable dot product intrinsics for macOS arm64 builds
- Enable for macOS arm64 builds
- Improve HAL primitives
  - reduction (sum, min, max, sad)
  - signmask
  - mul_expand
  - check_any / check_all

Results on a M1 Macbook Pro

* Updates to #20011 based on feedback

  - Removes Apple Silicon specific workarounds
  - Makes #ifdef sections smaller for v_mul_expand cases
  - Moves dot product optimization to compiler optimization check
  - Adds 4x4 matrix transpose optimization

* Remove dotprod and fix v_transpose

Based on the latest, we've removed dotprod entirely and will revisit in a future PR.

Added explicit cats with v_transpose4x4()

This should resolve all opens with this PR

* Remove commented out lines

Remove two extraneous comments
2021-06-01 09:39:55 +03:00
berak
302c2354a3 core: add missing implementation for Mat::ptr(Vec) 2021-05-09 14:15:12 +02:00
Zhuo Zhang
bf26050f7e
Fix missing return type for unsafe CV_XADD function 2021-04-26 20:08:45 +08:00
Suleyman TURKMEN
ec8b7c933a Update Documentation 2021-04-08 22:29:45 +03:00
Alexander Alekhin
2cf1a13755 Merge tag '3.4.14' 2021-04-02 09:31:32 +00:00
Alexander Alekhin
d0e3e638c3 release: OpenCV 3.4.14 2021-04-01 21:37:19 +00:00
Alexander Alekhin
b26f5b9468 core: backward compatibility for vx_store/vx_store_aligned calls 2021-04-01 02:17:47 +00:00
Vitaly Tuzov
aab62aa6dd
Merge pull request #18952 from terfendail:wui_doc
* Updated UI documentation to address WUI

* Added documentation for vx_ calls

* Removed vx_store operation overload

* Doxyfile updated to enable wide UI

* Enable doxygen documentation for vx_ WUI functions

* Wide intrinsics definition rework

* core: fix SIMD C++ emulator build (supports 128-bit only)
2021-03-30 16:18:03 +00:00
Jonathan Deakin
29a289dfa1 Add v_expand for AArch64, fuse vmovl+vget_high into vmovl_high 2021-03-23 15:06:41 +00:00
Alexander Alekhin
a97f6f8058 js: support setLogLevel() / getLogLevel() calls 2021-03-20 18:14:10 +00:00
Dale Phurrough
cbe236652b noexcept def construct Mat, UMat, Mat_, MatSize, MatStep
original commit: 1b0f781b7c
2021-03-12 20:26:32 +00:00
Sayed Adel
84fcc4ab9b core:ppc64 fix the build with the newer versions of Eigen on IBM/Power
It also fixes the build when universal intrinsics is disabled
   via `-DDCV_ENABLE_INTRINSICS=OFF`.
2021-03-09 19:20:18 +02:00
Vitaly Tuzov
04a9ff88d8
Merge pull request #19622 from terfendail:ref_doc
* Updated cpp reference implementations for a few intrinsics to address wide universal intrinsics as well

* Updated cpp reference implementations for a few more universal intrinsics
2021-03-06 17:22:21 +00:00
Mradul Agrawal
640f188ca2
Merge pull request #19583 from theroyalpekka:patch-1
* Update polynom_solver.cpp

This pull request is in the response to Issue  #19526. I have fixed the problem with the cube root calculation of 2*R. The Issue was in the usage of pow function with negative values of R, but if it is calculated for only positive values of R then changing x0 according to the parity of R, the Issue is resolved. Kindly consider it, Thanks!

* add cv::cubeRoot(double)

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-05 13:55:52 +00:00
Alexander Alekhin
a123c48d4d pre: OpenCV 3.4.14 (version++) 2021-03-02 20:47:29 +00:00
Alexander Alekhin
7ffc4b57aa Merge pull request #19535 from alalek:issue_18897 2021-02-23 22:42:51 +00:00
Alexander Alekhin
309e1e2b1d core(InputArray): replace STD_ARRAY to MATX
- remove duplication kind
2021-02-21 19:12:21 +00:00
Dale Phurrough
4badf640bf add noexcept to default constructors of cv::ocl
- follows iso c++ guideline C.44
- enables default compiler-created constructors to
  also be noexcept

original commit: 77e26a7db3

- handled KernelArg, Image2D
2021-02-20 16:20:25 +00:00
Alexander Alekhin
6d3502833f core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
Francesco Petrogalli
6ee23c9b85
Merge pull request #19486 from fpetrogalli:dotprod_fast-3.4
* [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

On Armv8 in AArch64 execution mode, we can skip the sequence

   v<op>_<ty>(vget_high_<ty>(x), vget_high_<ty>(y))

in favour of

   v<op>_high_<ty>(x, y)

This has better changes for recent compilers to use less data movement
operations and better register allocation. See for example:

   https://godbolt.org/z/bPq7vd

* [hal][neon] Fix build failure on armv7.

* [hal][neon] Address review comments in PR.

PR: https://github.com/opencv/opencv/pull/19486

* [hal][neon] Define macro to check for the AArch64 execution state of Armv8.

* [hal][neon] Fix macro definition for AArch64.

The fix is needed to prevent warnings when building for Armv7.
2021-02-11 13:24:09 +00:00
Pavel Rojtberg
6c1a433c4c python: also catch general c++ exceptions
they might be thrown from third-party code (notably Ogre in the ovis
module).
While Linux is kind enough to print them, they cause instant termination
on Windows.
Arguably, they do not origin from OpenCV itself, but still this helps
understanding what went wrong when calling an OpenCV function.
2021-02-02 21:16:01 +01:00
Alexander Alekhin
5ab4623c2a Merge pull request #19430 from alalek:fixup_19216 2021-01-31 17:41:24 +00:00
Alexander Alekhin
cdf73f2e05 Merge pull request #19427 from alalek:issue_19426 2021-01-31 14:24:37 +00:00
Alexander Alekhin
30bef20e22 js: fix SIMD build 2021-01-31 00:12:51 +00:00
Alexander Alekhin
c5bf15e009 build: fix cv2.cpp compilation 2021-01-30 11:32:27 +00:00
Vadim Levin
1d3207d7c7 feat: common fixed size sequence conversion for Python bindings 2021-01-25 08:08:38 +03:00
Alexander Alekhin
6ce9bb6f7a Merge pull request #19312 from VadimLevin:dev/vlevin/clear-msg-for-failed-overload-resolution 2021-01-18 20:14:10 +00:00
Vadim Levin
a0bdb78a99 feat: add overload resolution exception for Python bindings 2021-01-18 16:29:17 +03:00
Vitaly Tuzov
8f653ba8de Inlined WASM fallback intrinsics to avoid using of V_TypeTraits 2021-01-11 18:12:21 +03:00
Alexander Alekhin
68fb8dd873 Merge tag '3.4.13' 2020-12-21 14:55:54 +00:00
Alexander Alekhin
8869dc7762 release: OpenCV 3.4.13 2020-12-20 22:15:49 +00:00
Alexander Alekhin
dd276dbb59 Merge pull request #19176 from alalek:issue_19131 2020-12-20 16:40:28 +00:00
Alexander Alekhin
3359bdc464 docs(core): fix process_video_frame() code snippet 2020-12-20 02:27:46 +00:00
Vincent Rabaud
4c75b1c102 Fix comment typos. 2020-12-19 08:22:37 +01:00
Alexander Alekhin
b2ea15da35 Merge pull request #19137 from VadimLevin:dev/vlevin/safe-string-conversion 2020-12-18 11:20:50 +00:00
Vadim Levin
7b0d7d0c9a fix: conversion to string in python bindings
If provided `PyObject` can't be converted to string `TypeError` is
 reported instead of `SytemError` without any message.
2020-12-16 15:11:58 +03:00
Alexander Alekhin
392991fa0b core(opencl): add version check before clCreateFromGLTexture() call 2020-12-13 20:57:26 +00:00
Alexander Alekhin
d2bc0e5fe0 js(wasm): use fallback on missing intrinsics in Emscripten 2.0.0+ 2020-12-09 04:19:53 +00:00
Alexander Alekhin
26e8048a0a core: update handling of allocator stats type
- don't use OPENCV_ALLOCATOR_STATS_COUNTER_TYPE definition in non C++11 builds
- don't use with MinGW
2020-12-05 20:54:47 +00:00
Alexander Alekhin
6f8120cb3a core(UMat): drop unavailable methods 2020-12-02 15:02:43 +00:00