Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(5.x) Merge 4.x #3710

Merged
merged 28 commits into from
Apr 2, 2024
Merged

(5.x) Merge 4.x #3710

merged 28 commits into from
Apr 2, 2024

Conversation

asmorkalov
Copy link
Contributor

Extra: opencv/opencv_extra#1164

#3608 from MengqingCao:dvpp_support
#3614 from hipudding:ascendc
#3638 from mshabunin:doc-upgrade
#3645 from AleksandrPanov:update_mcc_CCHecker
#3646 from Dhanwanth1803:latch
#3647 from AleksandrPanov:add_to_mcc_detect_and_infer_test
#3689 from LiuPeiqiCN:faster_thinning
#3695 from vpisarev:disabled_aruco_tutorial_tests
#3697 from fengyuentau:float16_datatype_renaming
#3698 from elatkin:4.x_wechat_qrcode_fix_dims_and_size
#3699 from AleksandrPanov:mcc_add_perf_tests_improve_performance
#3701 from elatkin:4.x_fix_data_corruption_wechat_qrcode_impl_detect
#3702 from mshabunin:fix-wechat-test
#3703 from vrabaud:cpp
#3705 from vrabaud:cpp

Previous "Merge 4.x": #3644

hipudding and others added 28 commits December 28, 2023 16:33
AscendC is an extended syntax for the C/C++ language that can be used to
write operators that run on Ascend NPU.

This commit introduce an operator(threshold) written in AscendC. Others
can refer to this to implement other operators.

AscendC can implement efficient fusion operators according to needs, in
this case, threshold execution speed increased by nearly 4 times.

Co-authored-by: CaoMengqing <[email protected]>
1. remove threshold_opencv_kernel
2. typo ASCENDC_KERNELS_H
3. add ALIGN_UP macro
Fixes #25081:Latch input corruption fix opencv#3646

Fixes opencv/opencv#25081

As mentioned by WennPaper making it `grayImage = image.clone();` will make a deep copy. It prevents the `InputArray` from being modified.

- [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

---
Co-authored-by: Dhanwanth1803 <dhanwanthvarala@gmail,com>
Co-authored-by: Dmitry Kurtaev <[email protected]>
Documentation transition to fresh Doxygen opencv#3638

Merge with opencv/opencv#25042
…and_infer_test

Add to mcc detect and infer test opencv#3647

merge with opencv/opencv_extra#1153

Added a full pipeline tests:

1. detector->process(img, (TYPECHART)0, 1, true);
2. ColorCorrectionModel model(src, COLORCHECKER_Macbeth); model.run();
3. calibratedImage = model.infer(calibratedImage)*255.;


### 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.
- [ ] The feature is well documented and sample code can be built with the project CMake
- decodemgr.cpp: fix messed: width <--> height
- unicomblock.cpp: fix wrong type at sizeof(...)
as this image appears too difficult, so that test fails on it
(it may lead to incorrect results if multiple QR found at image)
* rename cv::float16_t to cv::fp16_t

* fp16_t -> hfloat
Use proper C++ types. opencv#3703

This is necessary to get opencv/opencv#25248 working.

### 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
…_improve_performance

Mcc add perf tests improve performance opencv#3699

Added perf tests to mcc module.
Also these optimizations have been added:

- added `parallel_for_` to `performThreshold()`
- removed `toL`/`fromL` and added `dst` to avoid copy data
- added `parallel_for_` to `elementWise()` ("batch" optimization improves performance of Windows version, Linux without changes).

Configuration:
Ryzen 5950X, 2x16 GB 3000 MHz DDR4
OS: Windows 10, Ubuntu 20.04.5 LTS

Performance results in milliseconds:

| OS and alg version   | process, ms | infer, ms |
| -------------------- | ----- | ------ |
| win_default          | 63.09 | 457.57 |
| win_optimized_without_batch       | 48.69 | 111.78 |
| win_optimized_batch  | 48.42 | 47.28  |
| linux_default        | 50.88 | 300.7  |
| linux_optimized_batch| 36.06 | 41.62  |

### 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.
- [ ] The feature is well documented and sample code can be built with the project CMake
This is necessary to get opencv/opencv#25248 working.
This was missed in 5300337
Use proper C++ types again.
Add additional image processing operators for Ascend NPU by utilizing DVPP opencv#3608

The user base for [Ascend NPU](https://www.hiascend.com/en/) and programming with CANN is increasing rapidly, with a growing number of users joining each day. To facilitate the use of these users, this PR provides more support for Ascend backend operators. All operators this PR offers are using use DVPP as the computational unit. Digital Vision Pre-Processing (DVPP) is an image processing unit built into the Ascend AI processor. Its main functions include image and video encoding/decoding, as well as image cropping and scaling. 

The high-frequency operators with NPU as the backend and basic data structure AscendMat has been provided in opencv#3552, while it still lacks many image processing operators. Moreover, only two interpolation algorithms for the resize operator are supported in opencv#3552. In this PR, the bilinear interpolation algorithm and nearest neighbour interpolation algorithm are implemented for the resize operator, as well as the Ascend implementation of the copyMakeBorder operator. 

In addition, the serialization of image processing operations is widely used in the preprocessing and post-processing stages of computer vision deep learning methods. Therefore, providing integrated operators is very meaningful for improving the convenience of use for OpenCV and deep learning crossover users. For example, torchvision also provides similar operators: [RESIZED_CROP](https://pytorch.org/vision/stable/generated/torchvision.transforms.functional.resized_crop.html?highlight=resizedcrop).
Thus, this PR also provides two serialization processing operators: cropResize and cropResizeMakeBorder. 

### 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
- [N/A] 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
@asmorkalov asmorkalov changed the title 5.x merge 4.x (5.x) Merge 4.x Apr 1, 2024
@asmorkalov asmorkalov merged commit 542e22a into opencv:5.x Apr 2, 2024
1 check failed
@asmorkalov asmorkalov mentioned this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.