When I run this code :
def nothing(x):
pass
cv.createTrackbar(‘R’, ‘image’, 0,255,nothing)
I get this error: Using ‘value’ pointer is unsafe and deprecated. Use NULL as value pointer. To fetch trackbar value setup callback.
I couldn’t find what to do.
You didn't show minimal working code which makes problem so I can only guess.
You have to create window
"image"before you usecreateTrackbar()Minimal working example:
EDIT:
More complex example with three trackbars which use the same function but with different index.
Image Lenna from Wikipedia
EDIT:
Your problem is that you use two names for window -
imgandimage- but you should use the same name innamedWindow(),createTrackbar(),getTrackbarPos(),imshow()BTW: If you create trackbar with
'0 : OFF \n1 : ON'then you have to use it aslo to get values = cv.getTrackbarPos(switch, 'image')EDIT:
It seems you have the same code as in demo in documentation and
demouses"image"in all commands.demoalso usescv.getTrackbarPos(switch, ...)The same with code in
nothingso it is executed only when you change value in any trackbar.