Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

is there a way to set trackbar position?

$
0
0
I have a program, with six trackbars that helps me find the range of colours I can use to detect an object. There are sets of sliders, and the low values, should never exceed the high values, or the output is rendered useless. I can adjust the trackbars manually, to set the high values as always greater than the low value, but its a little tedious. I would like to have a function update the position of the high trackbar, if the value on the low trackbar exceeds it. # create track bars cv2.createTrackbar('B-low','image',0,255,nothing) cv2.createTrackbar('B-high','image',255,255,nothing) while (1): bl = cv2.getTrackbarPos('B-low','image') bh = cv2.getTrackbarPos('B-high','image') if bh < bl: print(bl) bh == cv2.getTrackbarPos('B-high','image') + 1 I dont see an option for SetTrackBar position in [the user interface documentation.](http://docs.opencv.org/3.0-beta/modules/highgui/doc/user_interface.html) If anyone has an idea how I might do this, I'd be very interested. This is python, But I would be interested in C++ as well. Full source: http://pastebin.com/7JHJsFxf

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>