-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Does setTrackbarMax work correctly? #21002
Description
System information (version)
- OpenCV => 4.5.4
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2019
Detailed description
I’m new to openCV, and I tested my code using the cv::setTrackbarMax() function with opencv 4.5.4.
Using the Visual C++ (MSVC) debugger, I found that after executing the setTrackbarMax() function, the trackbar in the window was broken and I could not grab the trackbar to change its value.
The same phenomenon can be seen in the tutorial code “samples/cpp/falsecolor.cpp”
https://docs.opencv.org/4.5.3/d2/dcf/samples_2cpp_2falsecolor_8cpp-example.html
The following line in window_w32.cpp seems to cause the error.
opencv/modules/highgui/src/window_w32.cpp
Line 2987 in 17234f8
| trackbar.maxval = range.start; |
In the above, should “range.end” be assigned to trackbar.maxval instead of “range.start”?
Thanks in advance.
Steps to reproduce
The same phenomenon can be seen in the tutorial code “samples/cpp/falsecolor.cpp”
https://docs.opencv.org/4.5.3/d2/dcf/samples_2cpp_2falsecolor_8cpp-example.html
(In my environment,
setTrackbarPos("colormap", winName, -1);
did not work correctly and I commented out the line. )
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc