Mcc add perf tests improve performance #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
Use proper C++ types. #3703
This is necessary to get https://github.com/opencv/opencv/pull/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
Add to mcc detect and infer test #3647
merge with https://github.com/opencv/opencv_extra/pull/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
Fixes #25081:Latch input corruption fix#3646
Fixes https://github.com/opencv/opencv/issues/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 <dmitry.kurtaev@gmail.com>
Move Aruco tutorials and samples to main repo #3401
merge with https://github.com/opencv/opencv/pull/23018
merge with merge with https://github.com/opencv/opencv_extra/pull/1143
### 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.
- [ ] The feature is well documented and sample code can be built with the project CMake
updated readme for several opencv_contrib modules (done by Gary)
Sorry for not putting it through pull requests, but I was citing it in GSoC idea projects and wanted the Google Reviewers to see something visually more compelling.
Fix a bug in knnMatchConvert when a feature couldn't be matched #3632
After I started using a mask with `knnMatchAsync`, I found that the result from `knnMatchConvert` would be clipped at random.
Investigating the issue, I found that `knnMatchAsync` will initialize all `trainIdx` to `-1`, which will be overwritten by the CUDA kernel. A mask can be used to prevent certain features from being matched and this will prevent the CUDA kernel from setting the match distance. `knnMatchConvert` is not properly incrementing the pointers when `trainIdx == -1`, so an unmatched feature will get it stuck at `if (trainIdx == -1)`. Eventually the outer for-loop finishes and returns a vector with the matches up until the first missing match distance.
My solution is to increment the counters the same way as a successful iteration would.
### 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
cudaimgproc: update for CUDA 8.0 and fix out of bounds memory error in cuda::moments #3618
Fix https://github.com/opencv/opencv_contrib/issues/3612 and address out of bounds memory error when not calculating all image moments.
### 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
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 <cmq0113@163.com>