Use a slider for color adjustment—cv2.getTrackbarPos(), cv2.createTrackbar().
发布时间
阅读量:
阅读量
滑动轨迹栏作为调色板的应用
cv.createTrackbar(‘R’, ‘image’, 0, 255, nothing)
参数说明:滑动条的标识名称、所属窗口的名称、设定的最小数值、设定的最大数值以及对应的回调函数
cv.getTrackbarPos(‘R’, ‘image’)
参数说明:滑动条的标识名称、所属窗口的名称
import numpy as np
import cv2 as cv
def nothing(x):
pass
img = np.zeros((600, 512, 3), np.uint8)
cv.namedWindow('image', 0)
cv.createTrackbar('R', 'image', 0, 255, nothing)
cv.createTrackbar('G', 'image', 0, 255, nothing)
cv.createTrackbar('B', 'image', 0, 255, nothing)
switch = 'OFF : ON'
cv.createTrackbar(switch, 'image', 0, 1, nothing)
while(1)
全部评论 (0)
还没有任何评论哟~
