I have a large real time computer vision project in C with a gui that uses OpenCV 1.1's built-in HighGUI library. As others have pointed out, the OpenCV GUI library is very limited.
I'd like to make a slider bar (trackbar) GUI element like cvCreateTrackbar
that can have values that go either negative or positive. OpenCV currently limits trackbars to positive integer values only. I don't need anything else fancy, just a sliderbar that can go negative.
What is the easiest way to get a slider bar that goes positive and negative?
I am on Windows XP using mingw
and OpenCV 1.1. Ideally any solution should req开发者_如何学Pythonuire minimum dependencies or libraries, and should play nice with Windows and mingw
.
You could write a wrapper around the progress bar class that normalizes your values to the range of the progress bar. For example, if your range is -5 to 5, inclusive, add 5 to the value before sending to the progress widget. The "+5" adjusts the range from 0 to 10.
You may want to consider using a different widget as most definitions of progress measurements don't go negative. (Is your application actually making negative progress?) Also, most progress widgets allow for a positive increment, different than an absolute value. As the application runs, it adds an increment to the widget.
"That's just my opinion, I could be wrong." -- Dennis Miller.
[zGUI][1]https://github.com/zetapark/zGUI
I just uploaded a opencv gui toolkit. Please take a look.. This is solely dependent on opencv. Event driven..
精彩评论