Commit Graph

4965 Commits

Author SHA1 Message Date
Daniel Playfair Cal
4d63a89fa6
Merge pull request #20536 from hedgepigdaniel:fix/ocl-context-create-ownership
docs(core/ocl): clarify ownership of arguments passed into OpenCL related functions

* docs(core/ocl): clarify ownership in OpenCLExecutionContext::create

Although it is technically true that OpenCLExecutionContext::create
calls `clRetainContext` on its context argument, it is misleading
because it does not increase the reference count overall. Clarify that
the ownership of one reference of the passed context and device is
taken.

* docs(core/ocl): document ownership transfer in ocl::Device::fromHandle
2021-08-11 20:58:08 +03:00
Alexander Alekhin
424eaba4c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-08-07 17:25:06 +00:00
Alexander Smorkalov
6a2e559222 Fixed memory access issue in v_rshr_pack_store intrinsic on RISC-V RVV. 2021-08-04 20:04:03 +03:00
Vadim Levin
531ea5b3a2 fix: convert arguments names that are keywords reserved by Python 2021-08-01 12:02:36 +03:00
Zhuo Zhang
bdd3930855
Fix typo in comment, OpenMP => TBB 2021-07-29 09:34:09 +08:00
ZhangYin
acc576658a
Merge pull request #20412 from joy2myself:rvv-0.10
bug fixes for universal intrinsics of RISC-V back-end

* Align universal intrinsic comparator behaviour with other platforms

Set all bits to one for return value of int and fp comparators.

* fix v_pack_triplets, v_pack_store and v_pack_u_store

* Remove redundant CV_DECL_ALIGNED statements

Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
2021-07-23 17:08:43 +03:00
Francesco Petrogalli
d29c7e7871
Merge pull request #20392 from fpetrogalli:aarch64-semihosting
AArch64 semihosting

* [ts] Disable filesystem support in the TS module.

Because of this change, all the tests loading data will file, but tat
least the core module can be tested with the following line:

    opencv_test_core --gtest_filter=-"*Core_InputOutput*:*Core_globbing.accuracy*"

* [aarch64] Build OpenCV for AArch64 semihosting.

This patch provide a toolchain file that allows to build the library
for semihosting applications [1]. Minimal changes have been applied to
the code to be able to compile with a baremetal toolchain.

[1] https://developer.arm.com/documentation/100863/latest

The option `CV_SEMIHOSTING` is used to guard the bits in the code that
are specific to the target.

To build the code:

    cmake ../opencv/ \
        -DCMAKE_TOOLCHAIN_FILE=../opencv/platforms/semihosting/aarch64-semihosting.toolchain.cmake \
        -DSEMIHOSTING_TOOLCHAIN_PATH=/path/to/baremetal-toolchain/bin/ \
        -DBUILD_EXAMPLES=ON -GNinja

A barematel toolchain for targeting aarch64 semihosting can be found
at [2], under `aarch64-none-elf`.

[2] https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads

The folder `samples/semihosting` provides two example semihosting
applications.

The two binaries can be executed on the host platform with:

    qemu-aarch64 ./bin/example_semihosting_histogram
    qemu-aarch64 ./bin/example_semihosting_norm

Similarly, the test and perf executables of the modules can be run
with:

    qemu-aarch64 ./bin/opecv_[test|perf]_<module>

Notice that filesystem support is disabled by the toolchain file,
hence some of the test that depend on filesystem support will fail.

* [semihosting] Remove blank like at the end of file. [NFC]

The spurious blankline was reported by
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31158.

* [semihosting] Make the raw pixel file generation OS independent.

Use the facilities provided by Cmake to generate the header file
instead of a shell script, so that the build doesn't fail on systems
that do not have a unix shell.

* [semihosting] Rename variable for semihosting compilation.

* [semihosting] Move the cmake configuration to a variable file.

* [semihosting] Make the guard macro private for the core module.

* [semihosting] Remove space. [NFC]

* [semihosting] Improve comment with information about semihosting. [NFC]

* [semihosting] Update license statement on top of sourvce file. [NFC]

* [semihosting] Replace BM_SUFFIX with SEMIHOSTING_SUFFIX. [NFC]

* [semihosting] Remove double space. [NFC]

* [semihosting] Add some text output to the sample applications.

* [semihosting] Remove duplicate entry in cmake configuration. [NFCI]

* [semihosting] Replace `long` with `int` in sample apps. [NFCI]

* [semihosting] Use `configure_file` to create the random pixels. [NFCI]

* [semihosting][bugfix] Fix name of cmakedefine variable.

* [semihosting][samples] Use CV_8UC1 for grayscale images. [NFCI]

* [semihosting] Add readme file.

* [semihosting] Remove blank like at the end of README. [NFC]

This fixes the failure at
https://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31272.
2021-07-21 18:46:05 +03:00
Alexander Alekhin
4ab0377c6e Merge pull request #20143 from rogday:base64_encoding 2021-07-19 20:43:19 +00:00
Alexander Alekhin
39b91c97f0 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-07-16 10:35:42 +00:00
Pablo Romero
6f417b57c1
Merge pull request #20399 from pablorcum:3.4
Improves support for Unix non-Linux systems, including QNX

* Fixes #20395. Improves support for Unix non-Linux systems. Focus on QNX Neutrino.

Signed-off-by: promero <promero@mathworks.com>

* Update system.cpp
2021-07-13 19:40:15 +00:00
Alexander Alekhin
9103837228 Merge pull request #20278 from joy2myself:rvv-0.10 2021-07-09 22:42:29 +00:00
Francesco Petrogalli
b928ebdd53
Merge pull request #19985 from fpetrogalli:disable_threads
* [build][option] Introduce `OPENCV_DISABLE_THREAD_SUPPORT` option.

The option forces the library to build without thread support.

* update handling of OPENCV_DISABLE_THREAD_SUPPORT

- reduce amount of #if conditions

* [to squash] cmake: apply mode vars in toolchains too

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-07-08 20:21:21 +00:00
Smirnov Egor
b42623ff9d port base64 encoding from 3.4 2021-07-08 10:42:44 +03:00
Alexander Alekhin
aaad1791d9 Merge tag '4.5.3' 2021-07-05 21:48:40 +00:00
Alexander Alekhin
ad6e82942b release: OpenCV 4.5.3 2021-07-05 12:03:22 +00: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
Alexander Alekhin
8fad85edda Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-07-01 10:52:31 +00:00
Alexander Alekhin
94c67faaea Merge pull request #20336 from JoeHowse:refactor-cl_image-float16-conversions 2021-07-01 09:52:19 +00:00
Alexander Alekhin
947e06a860 Merge pull request #20328 from alalek:backport_20321 2021-06-30 20:51:49 +00:00
Joe Howse
6a3d925a47 OpenCL: core support for FP16, more channel orders
* Support cl_image conversion for CL_HALF_FLOAT (float16)

* Support cl_image conversion for additional channel orders:
  CL_A, CL_INTENSITY, CL_LUMINANCE, CL_RG, CL_RA

* Comment on why cl_image conversion is unsupported for CL_RGB

* Predict optimal vector width for float16

* ocl::kernelToStr: support float16

* ocl::Device::halfFPConfig: drop artificial requirement for OpenCL
  version >= 1.2. Even OpenCL 1.0 supports the underlying config
  property, CL_DEVICE_HALF_FP_CONFIG.

* dumpOpenCLInformation: provide info on OpenCL half-float support
  and preferred half-float vector width

* randu: support default range [-1.0, 1.0] for float16

* TestBase::warmup: support float16
2021-06-30 14:14:37 -03:00
Alexander Alekhin
db4b1e613c core(persistence): fix types format handling
partial backport of 4eac198270
2021-06-29 21:54:52 +00:00
Alexander Alekhin
ee39081b11 Merge pull request #20321 from alalek:issue_20279 2021-06-29 21:13:19 +00:00
Alexander Alekhin
4eac198270 core(persistence): fix types format handling, fix 16F support 2021-06-29 11:26:57 +00:00
Alexander Alekhin
42810621df Merge pull request #20318 from komakai:better-unsigned-type-support 2021-06-28 20:52:32 +00:00
Giles Payne
61a5378aeb Improvements/fixes for unsigned type handling in Swift/Kotlin 2021-06-27 21:08:25 +09:00
xzvno
42d644ef91
Merge pull request #20293 from endjkv:fix-mem-leak-when-throw
* fix memory leak when exception is thrown
2021-06-27 00:01:31 +03:00
Alexander Alekhin
e9a860d9cb Merge pull request #20295 from diablodale:umat_factory_usageflags 2021-06-23 18:15:14 +00:00
Dale Phurrough
8be86cbdfd
add usageFlags to UMat static factories
- add abi compatible overloads
- add test case
2021-06-23 18:50:33 +02:00
kikaxa
bb60cb0bf9 Reenable filesystem for ios builds 2021-06-20 16:33:25 +00:00
Alexander Alekhin
735a79ae83 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-19 18:44:16 +00:00
Zhang Yin
3a15a3821a Update RISC-V back-end to RVV 0.10 2021-06-18 15:44:38 +08:00
Vincent Rabaud
c8268e65fd Fix potential NaN in cv::norm.
There can be an int overflow.
cv::norm( InputArray _src, int normType, InputArray _mask ) is fine,
not cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask ).
2021-06-15 14:58:11 +02:00
Joe Howse
b4084491e5 DirectX: Support more types, including float16
Support the following type conversions:

* CV_16FC4 --> DXGI_FORMAT_R16G16B16A16_FLOAT

* CV_16FC2 --> DXGI_FORMAT_R16G16_FLOAT

* CV_16FC1 --> DXGI_FORMAT_R16_FLOAT

* CV_32FC2 --> DXGI_FORMAT_R32G32_FLOAT

* CV_32FC1 --> DXGI_FORMAT_D32_FLOAT

* CV_32SC2 --> DXGI_FORMAT_R32G32_UINT

* CV_32SC2 --> DXGI_FORMAT_R32G32_SINT

* CV_8UC4 -->  DXGI_FORMAT_R8G8_B8G8_UNORM

* CV_8UC4 -->  DXGI_FORMAT_G8R8_G8B8_UNORM
2021-06-11 00:55:06 -03:00
Alexander Alekhin
bc1af6227a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-09 10:58:37 +00:00
Alexander Alekhin
5f80f43ff5 core: fix nSize initialization in cvIplImage() 2021-06-09 07:31:38 +00:00
Alexander Alekhin
cafa04f842 Merge pull request #20221 from komakai:java-at-function 2021-06-08 18:45:38 +00:00
Alexander Alekhin
fef84f69ec Merge pull request #20220 from komakai:swift-at-function 2021-06-08 18:45:20 +00:00
Alexander Alekhin
b57faa41c2 pre: OpenCV 4.5.3 (version++) 2021-06-08 08:52:20 +00:00
JoeHowse
34183237ce
Merge pull request #20203 from JoeHowse:clMath-patches
Fix dynamic loading of clBLAS and clFFT (formerly, clAmdBlas and clAmdFft)

* Fix dynamic loading of clBLAS and clFFT

* Update filenames and function names for clBLAS (formerly, clAmdBlas)

* Update filenames and function names for clFFT (formerly, clAmdFft)

* Uncomment teardown of clFFT; tear down clFFT in same way as clBLAS

* Fix generators for clBLAS and clFFT headers

* Update generators to parse recent clBLAS and clFFT library headers

* Update generators to be compatible with Python 3

* Re-generate OpenCV's clBLAS and clFFT headers

* Update function calls to match names in newly generated headers

* Disable (and comment on) teardown code for clBLAS and clFFT

* Renaming *clamd* files

* Renaming *clamdblas* files to *clblas*

* Renaming *clamdfft* files to *clfft*

* Update generator for CL headers

* Update generator to be compatible with Python 3
2021-06-07 20:24:27 +00:00
Alexander Alekhin
286ec92967 Merge pull request #20027 from diablodale:fix19807-UMat-usageFlags 2021-06-07 20:20:13 +00:00
Alexander Alekhin
43940f7ffc pre: OpenCV 3.4.15 (version++) 2021-06-07 20:10:34 +00:00
Giles Payne
f1f9121bc7 Add test for Java Mat.at 2021-06-06 20:09:13 +09:00
Giles Payne
3b42e19505 At-like function for Java/Kotlin 2021-06-06 20:09:13 +09:00
Giles Payne
709156ee65 Add tests for Mat.at function 2021-06-06 19:34:48 +09:00
Giles Payne
472030907b At-like function for Swift 2021-06-06 19:34:48 +09:00
Alexander Alekhin
3e513ee6ab Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-03 16:23:36 +00:00
Dale Phurrough
c2ce3d927a
UMat usageFlags fixes opencv/opencv#19807
- corrects code to support non- USAGE_DEFAULT settings
- accuracy, regression, perf test cases
- not tested on the 3.x branch
2021-06-03 16:33:03 +02: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
HAN Liutong
8bd5405228 Fix RVV toolchain conflicts. 2021-05-30 16:00:18 +08:00