1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

387 Commits

Author SHA1 Message Date
Alexander Smorkalov d8263a9899 Merge branch 4.x 2026-05-25 17:49:25 +03:00
Alexander Smorkalov 852c3d2fb9 Replace codecs.open() with open() since codecs.open() deprecated in Python 3.14 2026-05-24 16:54:39 +03:00
s-trinh 0abd5c86f7 Merge pull request #28824 from s-trinh:update_ArUco_doc
Update ArUco doc #28824

See https://github.com/opencv/opencv/pull/28823

Update of the ArUco doc but targeted for OpenCV 4.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2026-05-20 15:05:51 +03:00
Kumataro 28b1f54468 core,objdetects,dnn,features2d: fix build warnings with GCC 16 2026-05-02 10:41:24 +09:00
Vincent Rabaud 5622958189 Replace pow with std::pow
The C pow casts to double while std::pow has overloads that can be
optimized by the compiler.
Also replace pow(*, 1./3) by cbrt.
2026-01-04 15:12:59 +01:00
Mykhailo Trushch 71c2b944a1 Merge pull request #27491 from MykhailoTrushch:ca_cpp
Chromatic aberration correction #27491

Merge with https://github.com/opencv/opencv_extra/pull/1266

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

Parent issue: https://github.com/opencv/opencv/issues/27206
Related PR: [#27490](https://github.com/opencv/opencv/pull/27490)

This PR adds chromatic aberration correction in C++ based on calibration data from the python app.

This code adds a function for chromatic aberration correction based on the calibration file (Mat correctChromaticAberration(InputArray image, const String& calibration_file)), and a class ChromaticAberrationCorrector which can be used to correct images of the same camera under the same settings (so for the same calibration data that is initialized in the beginning).

Also, basic functionality and performance tests are added.
2025-12-19 15:02:57 +03:00
Alexander Smorkalov 98bf72b319 Merge branch 4.x 2025-10-23 08:11:04 +03:00
Alexander Smorkalov a489d9d557 Save board size in multiview calibration report for further visualization. 2025-10-16 17:51:39 +03:00
Alexander Smorkalov 703f0bb0f2 Merge pull request #27906 from asmorkalov:as/cairosvg
Use cairosvg for pattern rendering to get rid of double resize. #27906

Depends on https://github.com/opencv/ci-gha-workflow/pull/269

### 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
- [ ] 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
2025-10-16 12:06:35 +03:00
Maxim Smolskiy 514d362ad8 Merge pull request #27876 from MaximSmolskiy:fix_charuco_board_pattern_in_generate_pattern.py
Fix charuco_board_pattern in generate_pattern.py #27876

### Pull Request Readiness Checklist

Fix #27871 

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
2025-10-13 09:09:56 +03:00
Alexander Smorkalov 1c1d2f923b Merge branch 4.x 2025-10-08 14:55:14 +03:00
Dmitry Kurtaev 387afc4eb4 Rename fields in camera calibration results 2025-10-05 21:51:58 +03:00
Alexander Smorkalov eb4e853134 Merge branch 4.x 2025-10-01 10:27:32 +03:00
Alexander Smorkalov e9bded6ff3 Merge pull request #27833 from asmorkalov:as/move_gen_pattern
Moved pattern generator to apps and rewrote tutorial #27833

### 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
- [ ] 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
2025-10-01 09:42:22 +03:00
Alexander Smorkalov eac7e794ba Merge pull request #27843 from asmorkalov:as/calib_generator
Moved synthetic data generator for calibration from main repo to benchmarks
2025-09-29 16:04:41 +03:00
Alexander Smorkalov 61f723e2de Moved syntethic data generator for calibration from main repo to benchmarks. 2025-09-29 11:42:58 +03:00
Alexander Smorkalov a6c88cde7f Converted multiview calibration sample to application. 2025-09-29 10:24:14 +03:00
Alexander Smorkalov d1a5723864 Merge branch 4.x 2025-09-09 10:27:19 +03:00
Alexander Smorkalov 87320416ce Merge branch 4.x 2025-08-13 13:48:41 +03:00
Alexander Smorkalov a0639446cc Skip couple of intro frames in interactive calibration tool, if VideoCapture is opened correctly. 2025-08-12 13:58:28 +03:00
Alexander Smorkalov 96fdbc58e1 Convert grayscale frames into color in nteractive calibration preview 2025-08-05 10:09:12 +03:00
Alexander Smorkalov 3b2d7b3f1b Merge branch 4.x 2025-07-28 10:04:17 +03:00
Alexander Smorkalov e4fabe393c More intrinsic calibration flags in integractive calibration tool. 2025-07-25 11:31:51 +03:00
Alexander Smorkalov bd67770dcb Merge branch 4.x 2025-07-22 09:47:19 +03:00
Alexander Smorkalov f59a955bea Added command line option to select VideoCapture backend. 2025-07-16 10:09:23 +03:00
omahs 0bc95d9256 Merge pull request #27338 from omahs:patch-1
Fix typos #27338

### 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
2025-05-21 12:13:50 +03:00
Vincent Rabaud bfb54aa691 Remove useless C headers 2025-01-13 16:34:28 +01:00
MurtazaSaherwala 3a8d7ec75a Merge pull request #26524 from MurtazaSaherwala:DocumentationUpdation
Updated trackbar callback function and improved documentation #26524

This Fixes #26467

Description:
This pull request improve the OpenCV documentation regarding the Trackbar functionality. The current documentation does not provide clear guidance on certain aspects, such as handling the value pointer deprecation and utilizing callback arguments in C. This update addresses those gaps and provides an updated example for better clarity.

Changes:
Updated Documentation:

Clarified the usage of the value pointer and explained how to pass an initial value, since the value pointer is deprecated.
Added more detailed explanations about callback arguments in C, ensuring that users understand how to access and use them in Trackbar callbacks.
Added a note on how to properly handle initial value passing without relying on the deprecated value pointer.
Updated Tutorial Example:

Renamed and used callback function parameters to make them more understandable.
Included a demonstration on how to utilize userdata in the callback function.
Additional Notes:

Removed reliance on the value pointer for updating trackbar values. Users are now encouraged to use other mechanisms as per the current implementation to avoid the runtime warning.

### 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
2024-12-09 16:23:07 +03:00
WU Jia 614e250fd3 Merge pull request #26405 from kaingwade:rename_features2d
Rename features2d #26405

This PR renames the module _features2d_ to _features_ as one of the Big OpenCV Cleanup #25007. 
Related PR: opencv/opencv_contrib: [#3820](https://github.com/opencv/opencv_contrib/pull/3820) opencv/ci-gha-workflow: [#192](https://github.com/opencv/ci-gha-workflow/pull/192)
2024-11-12 11:04:48 +03:00
Alexander Smorkalov 9773694527 Added DNN engine selector to model diagnostics tool. 2024-10-17 15:09:13 +03:00
Maksim Shabunin 26ea34c4cb Merge branch '4.x' into '5.x' 2024-06-26 19:01:34 +03:00
Yuantao Feng bc0618b688 Merge pull request #25582 from fengyuentau:dnn/dump_pbtxt
Current net exporter `dump` and `dumpToFile` exports the network structure (and its params) to a .dot file which works with `graphviz`. This is hard to use and not friendly to new user. What's worse, the produced picture is not looking pretty.
dnn: better net exporter that works with netron #25582

This PR introduces new exporter `dumpToPbtxt` and uses this new exporter by default with environment variable `OPENCV_DNN_NETWORK_DUMP`. It mimics the string output of a onnx model but modified with dnn-specific changes, see below for an example.

![image](https://github.com/opencv/opencv/assets/17219438/0644bed1-da71-4019-8466-88390698e4df)

## Usage

Call `cv::dnn::Net::dumpToPbtxt`:

```cpp
TEST(DumpNet, dumpToPbtxt) {
    std::string path = "/path/to/model.onnx";
    auto net = readNet(path);

    Mat input(std::vector<int>{1, 3, 640, 480}, CV_32F);
    net.setInput(input);

    net.dumpToPbtxt("yunet.pbtxt");
}
```

Set `export OPENCV_DNN_NETWORK_DUMP=1`

```cpp
TEST(DumpNet, env) {
    std::string path = "/path/to/model.onnx";
    auto net = readNet(path);

    Mat input(std::vector<int>{1, 3, 640, 480}, CV_32F);
    net.setInput(input);

    net.forward();
}
```

---

Note:
- `pbtxt` is registered as one of the ONNX model suffix in netron. So you can see `module: ai.onnx` and such in the model.
- We can get the string output of an ONNX model with the following script

```python
import onnx
net = onnx.load("/path/to/model.onnx")
net_str = str(net)
file = open("/path/to/model.pbtxt", "w")
file.write(net_str)
file.close()
```

### 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
2024-05-17 11:07:05 +03:00
Kumataro c577b24406 Merge pull request #25445 from Kumataro:fix25403
apps: createsamples: fix comment to remove last backslash #25445

Close #25403

### 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-18 18:11:07 +03:00
WU Jia aa5ea340f7 Move objdetect HaarCascadeClassifier and HOGDescriptor to contrib xobjdetect (#25198)
* Move objdetect parts to contrib

* Move objdetect parts to contrib

* Minor fixes.
2024-03-21 23:40:10 +03:00
Maksim Shabunin 8cbdd0c833 Merge pull request #25075 from mshabunin:cleanup-imgproc-1
C-API cleanup: apps, imgproc_c and some constants #25075

Merge with https://github.com/opencv/opencv_contrib/pull/3642

* Removed obsolete apps - traincascade and createsamples (please use older OpenCV versions if you need them). These apps relied heavily on C-API
* removed all mentions of imgproc C-API headers (imgproc_c.h, types_c.h) - they were empty, included core C-API headers
* replaced usage of several C constants with C++ ones (error codes, norm modes, RNG modes, PCA modes, ...) - most part of this PR (split into two parts - all modules and calib+3d - for easier backporting)
* removed imgproc C-API headers (as separate commit, so that other changes could be backported to 4.x)

Most of these changes can be backported to 4.x.
2024-03-05 12:18:31 +03:00
Alexander Smorkalov daa8f7dfc6 Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
Alexander Smorkalov 12b7aac1a0 Dump board poses human-readable and machine-readable format. 2024-02-14 15:17:01 +03:00
lpanaf 0957437bbe Save ground truth in calibration data generator. 2024-02-14 14:26:18 +03:00
Alexander Smorkalov fdab565711 Merge branch 4.x 2023-09-13 14:49:25 +03:00
Yuriy Chernyshov 494d201fda Add missing <sstream> includes 2023-09-05 22:04:26 +03:00
Alexander Smorkalov 47188b7c7e Merge branch 4.x 2023-07-28 13:05:36 +03:00
Alexander Smorkalov 5af40a0269 Merge branch 4.x 2023-07-05 15:51:10 +03:00
Alexander Smorkalov 004801f1c5 Merge remote-tracking branch 'origin/3.4' into merge-3.4 2023-06-20 09:56:57 +03:00
Alexander Smorkalov 66f86e898c Fixed potential buffer overflow of user file name in create_samples_app 2023-06-02 10:33:24 +03:00
Fabrizio Di Vittorio 044a322519 Merge pull request #23594 from fdivitto:fdivitto-traincascade-patch
fix: traincascade, use C++ persistence API #23594

This pull allows to compile traincascade application with OpenCV 4.6. Changes uses new persistence C++ API in place of legacy one.
2023-05-23 09:19:27 +03:00
Vladimir Ponomarev 9931da772d Merge pull request #23363 from vovka643:4.x_generate_charuco
Added charuco board generation to gen_pattern.py #23363

added charuco board generation in gen_pattern.py
moved aruco_dict_utils.cpp to samples from opencv_contrib (https://github.com/opencv/opencv_contrib/pull/3464)

### 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
2023-05-19 20:25:59 +03:00
unknown 2c4079fa4b remove unused var 2023-05-15 17:51:12 +02:00
Alexander Smorkalov f7bee7883b Merge pull request #23479 from vovka643:4.x_charuco_calib
Charuco board into interactive calibration
2023-05-05 11:25:36 +03:00
vovka643 f7e52076b6 Define charuco board parameters with command line 2023-05-05 10:08:21 +03:00
Sean McBride 47bea69322 Merge pull request #23055 from seanm:sprintf2
* Replaced most remaining sprintf with snprintf
* Deprecated encodeFormat and introduced new method that takes the buffer length
* Also increased buffer size at call sites to be a little bigger, in case int is 64 bit
2023-04-18 09:22:59 +03:00