Skip to content

Updated trackbar callback function and improved documentation#26524

Merged
asmorkalov merged 13 commits intoopencv:4.xfrom
MurtazaSaherwala:DocumentationUpdation
Dec 9, 2024
Merged

Updated trackbar callback function and improved documentation#26524
asmorkalov merged 13 commits intoopencv:4.xfrom
MurtazaSaherwala:DocumentationUpdation

Conversation

@MurtazaSaherwala
Copy link
Copy Markdown
Contributor

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

  • I agree to contribute to the project under Apache 2 License.
  • 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

@MurtazaSaherwala
Copy link
Copy Markdown
Contributor Author

MurtazaSaherwala commented Nov 26, 2024

Hey @sturkmen72 @asmorkalov
I have taken into consideration your notes and have opened a new PR
please go through it when you can.

cheers

@sturkmen72
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov added the category: documentation Documentation fix or update label Dec 9, 2024
@asmorkalov asmorkalov self-assigned this Dec 9, 2024
@asmorkalov asmorkalov added this to the 4.11.0 milestone Dec 9, 2024
@asmorkalov asmorkalov merged commit 3a8d7ec into opencv:4.x Dec 9, 2024
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
NanQin555 pushed a commit to NanQin555/opencv that referenced this pull request Feb 24, 2025
…dation

Updated trackbar callback function and improved documentation opencv#26524

This Fixes opencv#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: documentation Documentation fix or update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

out of date: trackbar tutorial (createTrackbar)

4 participants