Commit Graph

245 Commits

Author SHA1 Message Date
Onur Can KARAMAN
aa11a898a4 sample: tracker parameters updated
Signed-off-by: Onur Can KARAMAN <onurcankaraman340@gmail.com>
2024-09-14 23:36:57 +03:00
ericmariasis
cb72a2131f Added python branch to stitching tutorial. 2024-08-19 16:28:15 +03:00
Arvind Iyer
c9df679943
Merge pull request #25959 from arvind-iyer:4.x
Improved samples/python/tracker.py docstring #25959

This PR removed unused arguments and updated existing argument placeholders to be more descriptive of what they are.

### 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
2024-08-07 15:17:26 +03:00
lpylpy0514
70d7e83dca
Merge pull request #24201 from lpylpy0514:4.x
VIT track(gsoc realtime object tracking model) #24201

Vit tracker(vision transformer tracker) is a much better model for real-time object tracking. Vit tracker can achieve speeds exceeding nanotrack by 20% in single-threaded mode with ARM chip, and the advantage becomes even more pronounced in multi-threaded mode. In addition, on the dataset, vit tracker demonstrates better performance compared to nanotrack. Moreover, vit trackerprovides confidence values during the tracking process, which can be used to determine if the tracking is currently lost.
opencv_zoo: https://github.com/opencv/opencv_zoo/pull/194
opencv_extra: [https://github.com/opencv/opencv_extra/pull/1088](https://github.com/opencv/opencv_extra/pull/1088)

# Performance comparison is as follows:
NOTE: The speed below is tested by **onnxruntime** because opencv has poor support for the transformer architecture for now.

ONNX speed test on ARM platform(apple M2)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| nanotrack| 5.25| 4.86| 4.72| 4.49|
| vit tracker| 4.18| 2.41| 1.97| **1.46 (3X)**|

ONNX speed test on x86 platform(intel i3 10105)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| nanotrack|3.20|2.75|2.46|2.55|
| vit tracker|3.84|2.37|2.10|2.01|

opencv speed test on x86 platform(intel i3 10105)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| vit tracker|31.3|31.4|31.4|31.4|

preformance test on lasot dataset(AUC is the most important data. Higher AUC means better tracker):

|LASOT | AUC| P| Pnorm|
|--------|--------|--------|--------|
| nanotrack| 46.8| 45.0| 43.3|
| vit tracker| 48.6| 44.8| 54.7|

[https://youtu.be/MJiPnu1ZQRI](https://youtu.be/MJiPnu1ZQRI)
 In target tracking tasks, the score is an important indicator that can indicate whether the current target is lost. In the video, vit tracker can track the target and display the current score in the upper left corner of the video. When the target is lost, the score drops significantly. While nanotrack will only return 0.9 score in any situation, so that we cannot determine whether the target is lost.

### 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
- [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
2023-09-19 15:36:38 +03:00
chaebkimm
f834736307
Merge pull request #24116 from chaebkimm/update-samples-python-tst_scene_render
Fix python sample code (tst_scene_render) #24116

Fix bug of python sample code (samples/python/tst_scene_render.py) when backGr or fgr is None (#24114)

1) pass shape tuple to np.zeros arguments instead of integers
2) change np.int to int

### Pull Request Readiness Checklist

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

- [o] I agree to contribute to the project under Apache 2 License.
- [o] 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
- [o] The PR is proposed to the proper branch
- [o] There is a reference to the original bug report and related work
- [o] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [o] The feature is well documented and sample code can be built with the project CMake
2023-08-09 13:46:25 +03:00
Alexander Smorkalov
85ea247cc6 Reworked calibrate.py
- Fixed width and height swap in board size
- Fixed defaults in command line hint
- Fixed board visualization for Charuco case
- Used matchImagePoints method to handle partially detected Charuco boards
2023-06-23 22:19:08 +03:00
Alexander Smorkalov
3f4ec3596e Added Aruco-based QR code detection method to python sample. 2023-06-13 15:38:26 +03:00
Vladimir Ponomarev
d2618bfe11
Merge pull request #23587 from vovka643:4.x_aruco_calibrate_py
Added charuco pattern into calibrate.py #23587

### 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 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-17 18:30:30 +03:00
keith siilats
97d7a4a86e
Update aruco_detect_board_charuco.py 2023-05-05 13:23:09 -04:00
WU Jia
89c5a7584a
Merge pull request #23531 from kaingwade:orbbec_python_sample
Add python sample of how to use Orbbec camera. #23531

### 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
2023-04-24 12:12:01 +03:00
Alexander Smorkalov
86fa0308fc
Merge pull request #23139 from AleksandrPanov:add_py_charuco_sample
add python charuco sample
2023-03-15 13:22:11 +03:00
Alex
0d455e05c1 add py charuco sample+choriginal.jpg+camera_params 2023-03-15 11:27:55 +03:00
Alexander Alekhin
18cbfa4a4f Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00
Christoph Rackwitz
a64b51dd94
Merge pull request #23108 from crackwitz:issue-23107
Usage of imread(): magic number 0, unchecked result

* docs: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* samples, apps: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* tests: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* doc/py_tutorials: check imread() result
2023-01-09 09:55:31 +00:00
Lukas Weber
4df6e39bab add GraphCutSeamFinder 2023-01-03 22:45:49 +01:00
zihaomu
7dbb125a34 add nanotrack v2 at regression test. 2022-12-14 14:41:49 +08:00
Zihao Mu
cb8f1dca3b
Merge pull request #22808 from zihaomu:nanotrack
[teset data in opencv_extra](https://github.com/opencv/opencv_extra/pull/1016)

NanoTrack is an extremely lightweight and fast object-tracking model. 
The total size is **1.1 MB**.
And the FPS on M1 chip is **150**, on Raspberry Pi 4 is about **30**. (Float32 CPU only)

With this model, many users can run object tracking on the edge device.

The author of NanoTrack is @HonglinChu.
The original repo is https://github.com/HonglinChu/NanoTrack.

### 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
2022-12-06 08:54:32 +03:00
Lukas Weber
1bab920cf5
remove static con_thresh for adjuster 2022-08-11 18:04:28 +02:00
Jeremy Ephron
54693cf7b1
Update stitching_detailed.py
###  Critical bugs fixed:
- `seam_finder.find()` returns None and overwrites `masks_warped`
- `indices` is only 1-dimensional

### Nice-to-have bugs fixed:
- avoid invalid value in sqrt and subsequent runtime warning
- avoid printing help string on each run (use argparse builtin behavior)

### New features:
- added graphcut seam finder support

### Test Summary:
Tested on Ubuntu 20.04 with python 3.8.10 and opencv-python-contrib 4.5.5.62
2022-03-02 11:01:53 -08:00
Alexander Alekhin
d573472a86 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2022-01-31 12:53:45 +00:00
Suleyman TURKMEN
2647902fee Update python samples 2022-01-24 11:13:56 +03:00
Alexander Alekhin
a1ec4ea3a9 Merge pull request #21361 from alalek:sample_fix_tracking 2022-01-17 22:26:59 +00:00
berak
5602d2c7bb
Update stitching_detailed.py
resolves: #21406

use constructors consistently
2022-01-09 12:26:24 +01:00
Alexander Alekhin
7f075b0b15 samples(python): update tracker.py 2021-12-29 01:30:13 +00:00
Alexander Alekhin
217fea9667 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-12-24 16:48:07 +00:00
APrigarina
ada16fd188 prevent index error in find_obj sample 2021-12-23 11:29:27 +03:00
Alexander Alekhin
c78a8dfd2d fix 4.x links 2021-12-22 13:24:30 +00:00
Sinitsina Maria
d8b1fc45aa
Merge pull request #20934 from SinM9:spectrogram_samples
AudioIO: add spectrogram samples for C++/python
2021-12-14 17:33:26 +00:00
Alexander Alekhin
d24befa0bc Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-12-11 15:18:57 +00:00
UncleLLD
62a010a25d
Merge pull request #21224 from UncleLLD:fix-cvtColor-error
fix cvtColor-error

* fix gray image channel error

* fix gray image channel error

* fix cvtColor error after the video end

* fix cvtColor error after the video end and change next variable

* fix cvtColor error after the video end

* reset next variable

* fix cvtColor error after the video end

* fix cvtColor error after the video end
2021-12-09 19:11:05 +00:00
Alexander Alekhin
57ee14d62d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-11-27 16:50:55 +00:00
Christian Clauss
ebe4ca6b60 Fix typos discovered by codespell 2021-11-26 12:29:56 +01:00
Alexander Alekhin
824392a1c2 Merge pull request #20910 from lukasalexanderweber:sift_fix 2021-10-20 09:48:20 +00:00
Lukas Weber
9379e85e23 changed no longer patented SIFT 2021-10-20 09:07:48 +02:00
Alexander Alekhin
6fbfc58602 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-08-21 17:25:18 +00:00
Alexander Panov
d6306f8ccb
Merge pull request #20564 from AleksandrPanov:update_kalman_sample
Update kalman sample

* updated view and comments, fixed dims

* updated view and comments, added statePost
2021-08-20 10:57:05 +00:00
Lukas-Alexander Weber
863ab0e72e
fix TypeError when specifying compose_megapix
without rounding the composed image sizes (variable "sz") they will be odly fractions of a pixel (e.g. (5300.965, 3772.897)) and therefore cause a "TypeError: integer argument expected, got float" in line

456        roi = warper.warpRoi(sz, K, cameras[i].R)
2021-07-20 10:59:15 +02:00
APrigarina
0f24d4d2a1 fix samples 2021-07-01 18:26:17 +03:00
Alexander Alekhin
8fad85edda Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-07-01 10:52:31 +00:00
APrigarina
5e80bd3cc9 fix samples 3.4 2021-06-30 12:50:21 +03:00
Anna Prigarina
478663b08c
Merge pull request #20036 from APrigarina:tracking_api
Tracking API: added DaSiamRPN tracker

* added dasiamrpn tracker

* dasiamrpn: add test, rewrite sample

* change python samples

* fix tests

* fix params
2021-05-31 20:23:37 +00:00
deniz.aksayli
dbd65a3b01 fix seam finder 2021-04-27 11:10:41 +03:00
Lukas-Alexander Weber
6c53af8e41
Merge pull request #19931 from lukasalexanderweber:patch-1
Stitching Detailed Tutorial Improvements

* Add Vertical Wave Correction

The user has the possibility to pass "vert" as wave_correct parameter. However, in the code "cv.detail.WAVE_CORRECT_HORIZ" ist fixed. This change proposes changes so that the wave correction is done vertically if the user passes "vert" as wave_correct parameter. The variable "do_wave_correct" is replaced by None which is passed to the variable "wave_correct" if the user chooses "no" for wave correction.

* Correct fixed conf_thresh

According to the documentation, [cv.detail.leaveBiggestComponent](https://docs.opencv.org/4.5.1/d7/d74/group__stitching__rotation.html#ga855d2fccbcfc3b3477b34d415be5e786) takes features, the pairwise_matches and the conf_threshold as input.
In the tutorial, however, conf_threshold is fixed at 0.3 even though the user can pass conf_thresh as parameter which is 1 by default. Fixing this parameter at 0.3 causes the script to include images into the panorama which are not part of it.
2021-04-26 14:47:50 +00:00
Anastasia M
ad333e0d22
Merge pull request #17801 from LupusSanctus:am/pytorch_tf_segm
[GSoC] Added TF and PyTorch segmentation conversion cases

* WIP: Added conversion of segmentation models

* Added tutorial mds

* remove unused
2021-04-01 20:42:08 +00:00
Lukas-Alexander Weber
7c4b873ba3
Merge pull request #19762 from lukasalexanderweber:master
* Error Message for SURF if not implemented

In OpenCV 4.5.1 

import cv2 as cv
cv.xfeatures2d_SURF.create

will not create an AttributeError, even if the function is excluded (no nonfree option)

In Line 305 (now 306) however ´finder = FEATURES_FIND_CHOICES[args.features]()´ will raise an 

error: OpenCV(4.5.1) ..\opencv_contrib\modules\xfeatures2d\src\surf.cpp:1029: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SURF::create'

So we should check with cv.xfeatures2d_SURF.create() correctly if SURF is available
2021-03-24 15:02:20 +00:00
Alexander Alekhin
e0265c67c6 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-27 17:41:57 +00:00
Suleyman TURKMEN
9b399f3960 Update python samples 2021-02-21 23:02:16 +03:00
Alexander Alekhin
e5d78960c6 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-12 21:34:49 +00:00
Suleyman TURKMEN
2387813428 Update imageSegmentation.cpp, imageSegmentation.py 2021-02-07 17:42:52 +03:00
Alexander Alekhin
2b787eb4b8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-31 17:44:15 +00:00