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

3508 Commits

Author SHA1 Message Date
Pranav Kaushik 4dee742731 Merge pull request #29281 from pranavkaushik1:improve-qrcode-colors
samples: add color-coded bounding boxes for multi QR code detection #29281

Improves the existing qrcode.py sample by adding color-coded bounding boxes when multiple QR codes are detected simultaneously.

Previously all QR codes were drawn with the same green color, making it hard to distinguish between them visually.

This change adds a QR_COLORS palette so each detected QR code gets a unique color, improving visual clarity for multi-QR detection.

Co-authored-by: Ayush Gupta <gupta.ayushg@gmail.com>
2026-06-11 18:43:27 +03:00
Alexander Smorkalov a77474f3b1 Merge pull request #29255 from ArneshBanerjee:samples-blob-contours-29254
samples: demonstrate SimpleBlobDetector contour collection
2026-06-11 18:30:34 +03:00
Alexander Smorkalov 3d55d2fcef Merge pull request #29201 from Primary-H:project4_David
features2d: improve detector parameter validation
2026-06-10 14:10:56 +03:00
Alexander Smorkalov 6f29af625b Merge pull request #29268 from asmorkalov:as/disable_ocl_imterop_sample_4.x
Disable OpenCV-OpenCL interop sample for now 4.x
2026-06-08 17:03:23 +03:00
Arnesh Banerjee 11b0bd15cf samples: demonstrate SimpleBlobDetector contour collection
Enable collectContours in detect_blob.cpp and draw the per-blob
contours returned by getBlobContours(), so the sample exercises the
public contour-collection API added in #21942.

Refs #25904
2026-06-07 12:18:39 +05:30
Primary-H a7bb1d1e1e features2d: improve detector parameter validation 2026-05-31 23:40:50 +08: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
Maksim Shabunin 201381e019 core: deprecate MatCommaInitializer_ 2026-05-19 07:33:18 +03:00
Ismail d16f2bfef2 imgproc: optimize tiled parallel filter with TLS buffers and custom border fill 2026-05-02 14:56:41 +02:00
Souriya Trinh a02fcb360d By default, exif orientation is ignored when reading images sequence for the calibration exe. Add an option to apply exif image orientation. 2026-03-11 09:02:32 +01:00
Souriya Trinh 918244763d Create Charuco objects only if the selected pattern is a Charuco board. Otherwise it gives the following error:
opencv/modules/objdetect/src/aruco/aruco_board.cpp:543: error: (-215:Assertion failed) size.width > 1 && size.height > 1 && markerLength > 0 && squareLength > markerLength in function 'CharucoBoard'
2026-03-10 12:15:50 +01:00
happy-capybara-man 78c27ba4a6 Revert "Merge pull request #27985 from happy-capybara-man:docs/fix-mat-clone-js"
This reverts commit db207c88b0.
2025-12-20 15:23:15 +08:00
HARSH SUMAN e3e87055bd Merge pull request #28195 from harsh-suman5:fix-coverage-regex
Fix regex escape warning in _coverage.py by using raw string #2819

while i am running '_coverage.py' I noticed there is a syntax warning:"\." It is an invalid escape sequence
The regex was written as a normal string with '\.' which is not valid escape in string literals and give problems and error in a new python versions. 
To fix this switch to raw string(r'cv2?\.\w+') which can passes the backslashes directly to the regex engine. This removes the warning and keeps the code  and pattern working properly.

This is a small fix but important for future compatibilities.
2025-12-18 14:52:20 +03:00
Alexander Smorkalov 75ede342cf Merge pull request #28186 from shahkarnav115-beep:fix-stitching-argparse-safety
samples(python): fix argparse boolean flag for --try_cuda
2025-12-16 10:22:19 +03:00
Karnav Shah 4e2c39b1a0 Fix crash in sample launcher when no item is selected 2025-12-16 11:30:55 +05:30
Karnav Shah 1eb1157490 samples(python): fix argparse boolean flag for --try_cuda 2025-12-15 15:53:04 +05:30
Karnav Shah 9a7e88eb3e samples(python): guard against invalid STFT time step 2025-12-15 15:04:10 +05:30
Alessandro de Oliveira Faria (A.K.A.CABELO) 9c3d3dbee7 Merge pull request #28082 from cabelo:4.x
Analog Gauge Reader - cabelo@opensuse.org #28082

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

I humbly offer this example so that all developers can understand that many problems can be solved without VLM models.

<img width="269" height="267" alt="image" src="https://github.com/user-attachments/assets/d31f1557-7648-4e9c-8933-dcadb1f326aa" />
<img width="269" height="267" alt="image" src="https://github.com/user-attachments/assets/4039417c-b5c9-4228-ac7b-5336aeb88325" />
<img width="840" height="288" alt="image" src="https://github.com/user-attachments/assets/53f8ddf9-63cd-43b1-bff0-2e9e39d14153" />
2025-12-03 10:05:50 +03:00
happy-capybara-man db207c88b0 Merge pull request #27985 from happy-capybara-man:docs/fix-mat-clone-js
docs(js): Fix Mat.clone() documentation to use mat_clone() for deep copy #27985

- Update code example to use ```mat_clone()``` instead of ```clone()```
- Add explanatory note about shallow copy issue due to Emscripten embind
Problem
- OpenCV.js documentation shows ```Mat.clone()``` usage, but this method performs shallow copy instead of deep copy due to Emscripten embind limitations, causing unexpected behavior where modifications to cloned matrices affect the original.

Related Issues and PRs
- Fixes documentation aspect of issue #27572
- Related to PR #26643 (js_clone_fix)

### 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
2025-11-10 10:47:40 +03:00
Dave Merchant 0ee9c27966 Merge pull request #27810 from D00E:known-foreground-mask
2025-10-14T05:53:31.5387050Z C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\opencv\modules\imgcodecs\src\bitstrm.cpp(156,57): warning C4244: 'argument': conversion from 'int64_t' to 'ptrdiff_t', possible loss of data [C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\build\modules\imgcodecs\opencv_imgcodecs.vcxproj]

### Pull Request Readiness Checklist

Optional Known Foreground Mask for Background Subtractors #27810

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

### Description
This adds an optional foreground input mask parameter to the MOG2 and KNN background subtractors, in line with issue https://github.com/opencv/opencv/issues/26476

4 tests are added under test_bgfg2.cpp:
2 for each subtractor type (1 with shadow detection and 1 without)
A demo shows the feature with only 3 parameters and with a 4th optional foreground mask for both core subtractor types.

Note: To patch contrib inheritance of the background subtraction class, empty apply method which throws a not implemented error is added to contrib subclasses. This is done to keep the overloaded apply function as pure virtual. Contrib PR to be made and linked shortly.  
Contrib Repo Paired Pull Request: https://github.com/opencv/opencv_contrib/pull/4017
2025-10-14 09:56:06 +03:00
D00E acc76304d5 Updated Tutorial PSNR for identical images 2025-10-02 00:03:28 +01:00
Alexander Smorkalov 52ae1cfc29 Fixed logical error in camera calibration tutorial. 2025-08-18 13:07:09 +03:00
Alexander Smorkalov f4538f5020 Expose Orbbec color camera distortion coefficients as API. 2025-08-12 15:46:28 +03:00
Alexander Smorkalov 9f88e9ae31 Added options to initialize Orbbec cameras with custom fps and resolution. 2025-08-05 17:29:29 +03:00
Alexander Smorkalov ac9d0e0d0d Removed hack for calibration boards in samples and tutorials. 2025-07-24 11:27:20 +03:00
Yan Wen f54286b672 Merge pull request #27453 from MELSunny:4.x
Add Raspberry Pi 4 and 5 V4L2 Stateless HEVC Hardware Acceleration with FFmpeg #27453

This PR enables V4L2 stateless HEVC hardware acceleration for Raspberry Pi 5 within OpenCV's videoio module. It leverages FFmpeg's drm acceleration ([FFmpeg API changes](https://github.com/FFmpeg/FFmpeg/blob/ee1f79b0fa4c82da9c19328b049b593c71611402/doc/APIchanges#L1529)), significantly improving HEVC decoding performance on RPi5 for robotics and embedded vision applications.

I have a working proof-of-concept with local benchmarks showing clear gains.

Checklist Status:

Ready: License, branch (4.x), FFmpeg reference, and (linked) related issue (#27452).
Seeking Guidance: Need help with formal C++ performance/accuracy tests, opencv_extra integration, and full documentation/examples.
As a Python developer, I welcome C++ best practice feedback and assistance with testing setup.

### 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
2025-07-18 11:19:58 +03:00
ClaudioMartino 6a5884c04f New normalization in histogram comparison tutorial to use KV divergence
The Kullback-Leibler divergence works with histogram that have integral = 1,
otherwise it can return negative values. The normalization of the histograms
have been changed accordingly, and all the six comparison methods have been
used in the histogram comparison tutorial.
2025-07-07 08:43:16 +02:00
krikera 27867cc72c Add MORPH_DIAMOND support to samples and tutorials 2025-06-27 21:09:53 +05:30
leopardracer bbaed6f377 Merge pull request #27455 from leopardracer:4.x
Fix Typos in Comments and Documentation #27455

Description:
This pull request corrects minor typos in comments and documentation within the codebase:
- Replaces "representitive" with "representative" in kmeans.cpp.
- Replaces "indices" with the correct spelling in a comment in main.cu.
2025-06-18 15:28:25 +03:00
Maxim Evtush f09de671be Update person_reid.py 2025-06-16 12:09:29 +03:00
kilavvy c5ef3948cf Update CMakeLists.txt 2025-06-12 17:03:07 +02:00
leopardracer b395a2e307 Merge pull request #27434 from leopardracer:4.x
Fix Typos in Comments and Error Messages Across Multiple Files #27434
 
Description:  
This pull request corrects several typographical errors in comments and error messages in the following files:
- `samples/directx/d3d11_interop.cpp`: Fixed typo in the error message ("betweem" → "between").
- `samples/dnn/yolo_detector.cpp`: Fixed typo in a comment ("elemets" → "elements").
- `samples/winrt/ImageManipulations/MediaExtensions/OcvTransform.cpp`: Fixed typo in a comment ("peferred" → "preferred").

These changes improve code readability and maintain consistency in documentation and error reporting. No functional code was modified.
2025-06-11 16:19:05 +03:00
Kavyansh Tyagi b13704b583 Fix coordinate generation in drawing sample 2025-06-09 23:43:34 +05:30
Abhishek Gola aef6ae4872 Merge pull request #27396 from abhishek-gola:hdr_bug_fix
Fix NaNs in HDR Triangle Weights and Tonemapping and Update LDR Ground Truth in tutorial #27396

The PR closes #27392 

Updated the triangle weights to use a small epsilon value instead of zero to prevent NaN issues in HDR processing.
Also fixed a float-to-double division issue by explicitly casting double values to float, which was previously producing garbage values and leading to NaNs in tonemapping.

The current LDR ground truth image used in the tutorial [ldr.png](https://github.com/opencv/opencv/blob/4.x/doc/tutorials/others/images/ldr.png) was originally generated using TonemapDurand (check this commit https://github.com/opencv/opencv/commit/833f8d16fab5e57c5e800a55fa0fb08c7a31c3b1), which was moved to opencv_contrib a long time ago in this commit: https://github.com/opencv/opencv/commit/742f22c09bd0c27b450f141bc984f280c8cde98e. However, the current Tonemap implementation in OpenCV main only performs normalization and gamma correction, which produces noticeably different results. This PR updates the LDR grouth truth image in tutorial with the result of TonemapDrago, and tutorials to use TonemapDrago as Tonemap gives a darker image.

Tonemap output:
![ldr2](https://github.com/user-attachments/assets/e4f0cb97-ee4f-47b9-8962-2020ff211fd5)

TonemapDrago output:
![ldr](https://github.com/user-attachments/assets/4a898101-22bd-49e5-8db0-9e1062974ba3)


### 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
2025-06-05 09:02:58 +03:00
Ken Shirriff d5a5b0e85f Update match_template.py to fix doc bug
shape has Y first, then X. See issue #27292
2025-05-12 17:06:24 +03:00
nina16448 6f8f846288 Update houghcircles.py 2025-04-25 15:39:50 +08:00
Dan Dennedy cb8030809e Fix configuring with CMake version 4
fixes #27122
2025-04-02 13:45:08 -07:00
shyama7004 ef474e06fc minor changes : Replace ndarray.ptp() with np.ptp() for NumPy 2.0 Compatibility 2025-03-23 23:38:33 +05:30
Kababey 2364f4b0b9 Update optical_flow.cpp
ref: push_back is changed to emplace_back in order to avoid unnecessary conversions [Scalar(r, g, b))] .
2025-02-11 13:30:48 +03:00
MaximSmolskiy 8cb3ef177c Fix data01.xml file for example_cpp_logistic_regression 2025-01-25 00:53:52 +03:00
Skreg 055dbbb848 Merge pull request #26815 from shyama7004:fix-deprecation
Replaced sprintf with snprintf #26815

Fixes : #26814

### 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
2025-01-22 13:53:59 +03:00
Alexander Smorkalov 38b86591ba Merge pull request #26729 from MaximSmolskiy:change-article-for-fitEllipseDirect-function
Change article for fitEllipseDirect function
2025-01-08 12:14:45 +03:00
MaximSmolskiy 0331af01ae Change article for fitEllipseDirect function 2025-01-07 22:24:48 +03:00
Masahiro Ogawa fc994a6ae8 Merge pull request #21407 from sensyn-robotics:feature/weighted_hough
Feature: weighted Hough Transform #21407

### 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 other license that is incompatible with OpenCV
- [x] The PR is proposed to proper branch
- [x] There is reference to 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
2025-01-06 15:35:35 +03:00
Rüdiger Ihle a6f72f813d Merge pull request #26698 from warped-rudi:mediandk2
AndroidMediaNdkVideoWriter pixel format enhancement #26698

* videoio(Android): Add source pixel formats RGBA and GRAY to AndroidMediaNdkVideoWriter

Let AndroidMediaNdkVideoWriter::write() deduce source pixel format from matrix type:

CV_8UC3 -> BGR   (as before)
CV_8UC4 -> RGBA  (use in conjunction with CvCameraViewFrame)
CV_8UC1 -> GRAY

* samples/android/video-recorder: Send images to VideoWriter in RGBA format

### 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-01-03 17:53:00 +03:00
Alexander Smorkalov c803aa2ddd Merge pull request #26057 from asmorkalov:as/android_16k_pages
Android builds update #26057

Fixes https://github.com/opencv/opencv/issues/26027
Should also address https://github.com/opencv/opencv/issues/26542
 
Changes:
- Switched to Android build tools 34, NDK 26d, target API level 34 (required by Google Play).
- Use flexible page size on Android by default to support Android 15+.
- Dummy stub for R and BuildConfig classes for javadoc.
- Java 17 everywhere.
- Strict ndkVersion and ABI list in release package.

Related:
- Docker: https://github.com/opencv-infrastructure/opencv-gha-dockerfile/pull/41
- Pipeline: https://github.com/opencv/ci-gha-workflow/pull/183

Related IPP issue with NDK 27+: https://github.com/opencv/opencv/issues/26072

Google documentation for 16kb pages support : https://developer.android.com/guide/practices/page-sizes?hl=en

### 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-12-31 11:53:04 +03:00
Rüdiger Ihle d39aae6bdf Merge pull request #26656 from warped-rudi:mediandk
AndroidMediaNdkCapture pixel format enhancement #26656

### 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
- [ 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-12-30 11:09:11 +03:00
Suleyman TURKMEN d9a139f9e8 Merge pull request #25608 from sturkmen72:animated_webp_support
Animated WebP Support #25608

related issues #24855 #22569 

### 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-12-20 13:06:28 +03:00
Alexander Smorkalov 03f90aaf85 Merge pull request #26614 from KangJialiang:fix-multi-channel-mean-scale-sample-dnn-yolo
Fix normalization parameters in YOLO example to support multi-channel mean and scale factors
2024-12-16 15:29:43 +03:00
KangJialiang 25fe85bbbb Fix yoloPostProcessing` to handle variable number of classes (nc)
Previously, the yoloPostProcessing function assumed that the number of classes (nc) was fixed at 80. This caused incorrect behavior when a different number of classes was specified, leading to mismatched output shapes.

This update modifies the code to use the provided `nc` value dynamically, ensuring that the output shapes are correctly calculated based on the specified number of classes. This prevents issues when `nc` is not equal to 80 and allows for greater flexibility in model configurations.
2024-12-12 15:41:14 +08:00