Commit Graph

34044 Commits

Author SHA1 Message Date
Alexander Smorkalov
b0d905864d
Merge pull request #25371 from alexlyulkov:al/adaptive-threshold-tests
Added tests for adaptiveThreshold and sepFilter2D
2024-04-09 11:51:00 +03:00
Maksim Shabunin
a25132986a
Merge pull request #25146 from mshabunin:cpp-contours
Reworked findContours to reduce C-API usage #25146

What is done:
* rewritten `findContours` and `icvApproximateChainTC89` using C++ data structures
* extracted LINK_RUNS mode to separate new public functions - `findContoursLinkRuns` (it uses completely different algorithm)
* ~added new public `cv::approximateChainTC89`~ - ** decided to hide it**
* enabled chain code output (method = 0, no public enum value for this in C++ yet)
* kept old function as `findContours_old` (exported, but not exposed to user)
* added more tests for findContours (`test_contours_new.cpp`), some tests compare results of old function with new one. Following tests have been added:
  * contours of random rectangle
  * contours of many small (1-2px) blobs
  * contours of random noise
  * backport of old accuracy test
  * separate test for LINK RUNS variant

What is left to be done (can be done now or later):
* improve tests: 
  * some tests have limited verification (e.g. only verify contour sizes)
  * perhaps reference data can be collected and stored
  * maybe more test variants can be added (?)
* add enum value for chain code output and a method of returning starting points (e.g. first 8 elements of returned `vector<uchar>` can represent 2 int point coordinates)
* add documentation for new functions - **✔️ DONE**
* check and improve performance (my experiment showed 0.7x-1.1x some time ago)
* remove old functions completely (?)
* change contour return order (BFS) or allow to select it (?)
* return result tree as-is (?) (new data structures should be exposed, bindings should adapt)
2024-04-09 09:37:49 +03:00
Alexander Smorkalov
e5d530abae
Merge pull request #25342 from asmorkalov:as/HAL_transpose
HAL interface for transpose2d.
2024-04-09 09:03:13 +03:00
Alexander Smorkalov
e55cf444cc
Merge pull request #25372 from CNOCycle:tflite/ShapeChecker
Add a shape checker for tflite models
2024-04-08 18:58:41 +03:00
Kumataro
8ed52cb564
Merge pull request #25356 from Kumataro:fix25345
core: doc: add note for countNonZero, hasNonZero and findNonZero #25356

Close #25345 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-04-08 18:47:58 +03:00
ecchen
e63690a2d9 Add a shape checker for tflite models 2024-04-08 13:28:05 +00:00
Alexander Lyulkov
30889f4a90 Added tests for adaptiveThreshold and sepFilter2D 2024-04-08 13:04:50 +03:00
Alexander Smorkalov
e80500828c
Merge pull request #25368 from UnaNancyOwen:fix_double
Remove unnecessary floating point literal
2024-04-08 12:52:20 +03:00
Tsukasa Sugiura
5528e70f3c remove floating point literal 2024-04-08 14:52:53 +09:00
Alexander Alekhin
5121a1bf0d Merge pull request #25353 from LaurentBerger:typotutoenvref 2024-04-06 18:55:48 +00:00
unknown
e17b8ae8a1 typo in env_reference.markdown 2024-04-06 20:07:10 +02:00
Alexander Smorkalov
e1ed422bdb HALL interface for transpose2d. 2024-04-05 14:12:36 +03:00
Alexander Smorkalov
e0b7f04fd2
Merge pull request #25333 from asmorkalov:as/dump_v4l2_test_frame
Added option to dump v4l2 test frame from virtual camera
2024-04-05 13:19:28 +03:00
Alexander Smorkalov
89b91fcb50 Added option to dump v4l2 test frame from virtual camera. 2024-04-04 15:50:27 +03:00
Alexander Smorkalov
2b1c8aa4db
Merge pull request #25287 from catree:feat_V4L2_PIX_FMT_SGRBG8_use_cvtColor
Use cvtColor() for Bayer image color demosaicing with V4L2_PIX_FMT_SGRBG8
2024-04-04 11:57:19 +03:00
Alexander Smorkalov
e665d2d636
Merge pull request #25325 from asmorkalov:as/tiff_flags
Export TIFF compression options as API and git rid of tiff.h.
2024-04-04 11:05:16 +03:00
Alexander Smorkalov
bf7208e1ed
Merge pull request #25322 from sepperliu:patch-1
Update highgui+HighGui.java
2024-04-04 10:23:24 +03:00
Alexander Smorkalov
bd819f97f1
Merge pull request #25327 from dkurt:uninit_jump_qrcode
Resolve valgrind issue at QRCode detector
2024-04-04 10:22:24 +03:00
Dmitry Kurtaev
df627e1281 Resolve valgrind issue at QRCode detector 2024-04-03 16:58:46 +03:00
Yuantao Feng
55d7e3f8cc
Merge pull request #1165 from fengyuentau:gold_yolo
[BugFix] dnn (ONNX): Foce dropping constant inputs in parseClip if they are shared #25319

Resolves https://github.com/opencv/opencv/issues/25278
Merge with https://github.com/opencv/opencv_extra/pull/1165

In Gold-YOLO ,`Div` has a constant input `B=6` which is then parsed into a `Const` layer in the ONNX importer, but `Clip` also has the shared constant input `max=6` which is already a `Const` layer and then connected to `Elementwise` layer. This should not happen because in the `forward()` of `Elementwise` layer, the legacy code goes through and apply activation to each input. More details on https://github.com/opencv/opencv/issues/25278#issuecomment-2032199630.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-04-03 15:56:59 +03:00
catree
d81cd13bb3 Use cvtColor() for Bayer image color demosaicing and for V4L2_PIX_FMT_SRGGB8, V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SGBRG8, V4L2_PIX_FMT_SGRBG8 options. Update modules/videoio/test/test_v4l2.cpp test file. 2024-04-03 13:48:24 +02:00
Alexander Smorkalov
2d864c3af9 Export TIFF compression options as API and git rid of tiff.h. 2024-04-03 14:30:11 +03:00
sepperliu
45587f23db Update highgui+HighGui.java
toBufferedImage
Modifying the original array copying method here can double the speed.
2024-04-03 13:29:10 +03:00
Dmitry Kurtaev
13c95efa74
Merge pull request #25312 from dkurt:dnn_hotfix_tflite
Ownership check in TFLite importer #25312

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/25310

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-04-03 09:41:40 +03:00
Alexander Smorkalov
99cacaaad6
Merge pull request #25195 from MaximSmolskiy:use-initial-quads-corners-in-ChessBoardDetector-findQuadNeighbors
Use initial quads corners in ChessBoardDetector::findQuadNeighbors
2024-04-02 13:13:01 +03:00
Alexander Smorkalov
2eedec7479
Merge pull request #25301 from zzuliys:feature/mismatch_hashcode
fix download file hash value mismatch issue
2024-04-01 11:44:57 +03:00
daiyin
93800a85b2 fix download file hash value mismatch issue 2024-04-01 10:32:37 +08:00
HAN Liutong
eba158fb0c
Merge pull request #25230 from hanliutong/rvv-conv
Optimize int8 layers in DNN modules by using RISC-V Vector intrinsic. #25230

This patch optimize 3 functions in the int8 layer by using RVV Native Intrinsic.

This patch was tested on QEMU using VLEN=128 and VLEN=256 on `./bin/opencv_test_dnn --gtest_filter="*Int8*"`;
On the real device (k230, VLEN=128), `EfficientDet_int8` in `opencv_perf_dnn` showed a performance improvement of 1.46x.

| Name of Test                               |  Original | optimized | Speed-up |
| ------------------------------------------ | -------- | ---------- | -------- |
| EfficientDet_int8::DNNTestNetwork::OCV/CPU | 2843.467 | 1947.013   | 1.46     |


### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-03-31 16:47:06 +03:00
Alexander Smorkalov
8c540a56af
Merge pull request #25299 from Kumataro:add_fix25274
imgcodecs: jpeg: (test) fix condition to compare rgb and cmyk jpeg
2024-03-30 11:42:34 +03:00
Alexander Smorkalov
9f123f8d74
Merge pull request #25285 from johnteslade:cgroupsv2-support
core: Add cgroupsv2 support to parallel.cpp
2024-03-30 11:26:23 +03:00
Alexander Smorkalov
95ffabffdd
Merge pull request #25293 from asmorkalov:as/dct_hal_fix
Fixed HAL invocation for DCT.
2024-03-30 11:03:58 +03:00
Kumataro
9c8606e0c0 imgcodecs: jpeg: fix condition to compare rgb and cmyk jpeg 2024-03-30 13:49:08 +09:00
Kumataro
912cf2a028
Merge pull request #25280 from Kumataro:fix25274
imgcodecs: jpeg: re-support to read CMYK Jpeg #25280

Close #25274 
OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1163

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-03-29 17:38:06 +03:00
Yuantao Feng
b758897c29
Merge pull request #25271 from fengyuentau:matmul_bias
Merge with https://github.com/opencv/opencv_extra/pull/1158

Todo:

- [x] Fix Attention pattern recognition.
- [x] Handle other backends.

Benchmark:

"VIT_B_32 OCV/CPU", M1, results in milliseconds.

| Model | 4.x | This PR |
| - | - | - |
| VIT_B_32 OCV/CPU | 87.66 | **83.83** |


### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-03-29 17:35:23 +03:00
Alexander Smorkalov
9716bf95ae
Merge pull request #25294 from asmorkalov:as/InferROI_TestStreamingInfer_supress
Skip InferROI.TestStreamingInfer as unstable as it hangs on CI time-to-time
2024-03-29 15:54:52 +03:00
Alexander Smorkalov
9fc4b61074
Merge pull request #25291 from dkurt:einsum_openvino
Einsum OpenVINO backend
2024-03-29 15:54:26 +03:00
Dmitry Kurtaev
cfa42e4338 Einsum OpenVINO backend 2024-03-29 14:29:45 +03:00
Alexander Smorkalov
a7d6f105e7 Skip InferROI.TestStreamingInfer as unstable as it hangs on CI time-to-time. 2024-03-29 11:33:12 +03:00
zzuliys
2b9d1a2ff8
Merge pull request #24877 from zzuliys:feature/mac
Orbbec Camera supports MacOS,Gemini2 and Gemini2L support Y16 format #24877

note:
1.Gemini2 and Gemini2L must use the latest firmware -- https://github.com/orbbec/OrbbecFirmware;
2.Administrator privileges are necessary to run on MacOS.
2024-03-29 11:23:41 +03:00
Dmitry Kurtaev
01dc010436
Merge pull request #25273 from dkurt:tflite_new_layers
TFLite new layers #25273

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/25272, https://github.com/opencv/opencv/issues/24965

**Merge with extra**: https://github.com/opencv/opencv_extra/pull/1160

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-03-29 11:21:13 +03:00
Alexander Smorkalov
7945f2cf40 Fixed HAL invocation for DCT. 2024-03-29 11:01:42 +03:00
thewoz
afb91b552e
Merge pull request #24415 from thewoz:imread
Add imread #24415

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [X] I agree to contribute to the project under Apache 2 License.
- [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake

Hello everyone,
I created this new version of the imread function and I think it can be very useful in several cases.
It is actually passed to it object on which you want to upload the image.
The advantages can be different like in case one needs to open several large images all the same in sequence.
one can use the same pointer and the system would not allocate memory each time.
2024-03-29 10:51:19 +03:00
Alexander Smorkalov
7b9de94003
Merge pull request #25255 from Kumataro:refactor_imgcodec_tiff_add_imwrite_tiff
imgcodecs: tiff: to avoid using TIFFTAG_* directly for imwrite() params.
2024-03-29 10:44:34 +03:00
Michael Klatis
f87e1efd2a
Merge pull request #25092 from klatism:libjpeg-upgrade
libjpeg upgrade to version 9f #25092

Upgrade libjpeg dependency from version 9d to 9f.

- [X] I agree to contribute to the project under Apache 2 License.
- [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-03-28 17:03:05 +03:00
John Slade
7f1140b48b core: Add cgroupsv2 support to parallel.cpp
The parallel code works out how many CPUs are on the system by checking
the quota it has been assigned in the Linux cgroup. The existing code
works under cgroups v1 but the file structure changed in cgroups v2.
From [1]:

    "cpu.cfs_quota_us" and "cpu.cfs_period_us" are replaced by "cpu.max"
  which contains both quota and period.

This commit add support to parallel so it will read from the cgroups v2
location. v1 support is still retained.

Resolves #25284

[1] 0d5936344f
2024-03-28 11:52:47 +00:00
Alexander Smorkalov
1894426116
Merge pull request #25282 from asmorkalov:as/deterministic_undistort_test
Added PNG instance of image for fisheye::undistort test
2024-03-28 13:29:27 +03:00
Alexander Smorkalov
fd576d9e8e Added PNG instance of image for fisheye::undistort test as JPG is decoded differently with different libjpeg versions. 2024-03-28 12:02:58 +03:00
Alexander Smorkalov
a132fd401e
Merge pull request #25264 from lpylpy0514:4.x
fix a bug about vittrack post-process
2024-03-28 09:53:29 +03:00
Maxim Smolskiy
ff9aeaceb0
Merge pull request #25177 from MaximSmolskiy:speed-up-adaptive-image-binary-threshold-in-findChessboardCorners
Speed up adaptive threshold in findChessboardCorners #25177

### Pull Request Readiness Checklist

If `block_size` hasn't been changed between iterations for same `k`, then all `adaptiveThreshold` arguments will be same and we can reuse result from previous iteration.

I tested this PR with benchmark
```
python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
```
PR speed up chessboards detection by `7.5/17%` without any changes in detected chessboards number:
```
cell_img_size = 100 (default)

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.904167                      13020             14400                           0.600512
Total detected time:  107.27875600000003 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.904167                      13020             14400                           0.600512
Total detected time:  99.0223499999999 sec

----------------------------------------------------------------------------------------------------------------------------------------------

cell_img_size = 10

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.539792                       7773             14400                           4.209964
Total detected time:  2.989205999999999 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.539792                       7773             14400                           4.209964
Total detected time:  2.4802350000000013 sec
```


See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-03-27 15:34:54 +03:00
Michael Klatis
43666e1308
Merge pull request #25190 from klatism:android-config-flags-enhancement
Add component disable flag to android build #25190

Adding --disable flag to android sdk build script. The flag allows to exclude components from build by concatting -DWITH_XXX cmake flag to the build command. Example : --disable OPENEXR (uppercase).

- [X] I agree to contribute to the project under Apache 2 License.
- [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-03-27 15:10:40 +03:00