我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用cv2.setTrackbarPos()。
def setValue(self, value): cv2.setTrackbarPos(self._param_name, self._win_name, value)
def set_upper_trackbar( self, value, window ): cv2.setTrackbarPos('H_Max',window,value[0]) cv2.setTrackbarPos('S_Max',window,value[1]) cv2.setTrackbarPos('V_Max',window,value[2]) # Sets the lower trackbar values. # Usage: self.set_lower_trackbar( [ h, s, v ], "window_name" ) # Sets the lower trackbar values to the given values
def set_lower_trackbar( self, value, window ): cv2.setTrackbarPos('H_Min',window,value[0]) cv2.setTrackbarPos('S_Min',window,value[1]) cv2.setTrackbarPos('V_Min',window,value[2]) # Gets the values of the upper HSV values from the trackbar # Usage: self.get_upper_trackbar( "window_name" ) # Returns a numpy array: ap.array( [ h, s, v ] )
def __setitem__(self, name, value): self.values[name] = value cv2.setTrackbarPos(name, self.windowName, value)