how to controll the focus of the camera with the uvc protocal
-
I wrote a program that which used the camera example offered by the qt .but I found the pro could not control the focus of the camera,not the zoom in or zoom out function.so is there any way to solve this problem?
does the uvc protocal support the camera focus controller? -
I wrote a program that which used the camera example offered by the qt .but I found the pro could not control the focus of the camera,not the zoom in or zoom out function.so is there any way to solve this problem?
does the uvc protocal support the camera focus controller?@nicker-player If you want to get meaningful help you will have to provide more information:
- What camera is that?
- On which platform
- Post the code showing how you're trying to control focuszoom
-
@nicker-player If you want to get meaningful help you will have to provide more information:
- What camera is that?
- On which platform
- Post the code showing how you're trying to control focuszoom
@jsulm
the camera is the common one .I just want to know if the qt camera could support the focus controller of the camera.heres the python code i found that the uvc could support the focus controller.I think maybe thereis some way to control the camera focus the qtimport cv2
import uvcdef do_nothing(x):
pass
dev = uvc.device_list()[0]
cap = uvc.Capture(dev['uid'])
cap.controls[2].value = 0 # close auto focus
cv2.namedWindow('img', cv2.WINDOW_NORMAL)
cv2.createTrackbar('focus', 'img', 0, 127, do_nothing)while True:
focus_val = cv2.getTrackbarPos('focus', 'img')
cap.controls[3].value = focus_val
img = cap.get_frame_robust().bgr
cv2.imshow('img', img)
key = cv2.waitKey(1)
if key == 27:
breakcv2.destoryAllWindow()
cap.close() -
@jsulm
the camera is the common one .I just want to know if the qt camera could support the focus controller of the camera.heres the python code i found that the uvc could support the focus controller.I think maybe thereis some way to control the camera focus the qtimport cv2
import uvcdef do_nothing(x):
pass
dev = uvc.device_list()[0]
cap = uvc.Capture(dev['uid'])
cap.controls[2].value = 0 # close auto focus
cv2.namedWindow('img', cv2.WINDOW_NORMAL)
cv2.createTrackbar('focus', 'img', 0, 127, do_nothing)while True:
focus_val = cv2.getTrackbarPos('focus', 'img')
cap.controls[3].value = focus_val
img = cap.get_frame_robust().bgr
cv2.imshow('img', img)
key = cv2.waitKey(1)
if key == 27:
breakcv2.destoryAllWindow()
cap.close()@nicker-player said in how to controll the focus of the camera with the uvc protocal:
the camera is the common one .I just want to know if the qt camera could support the focus controller of the camera
So, you don't want to tell us what camera it is, you don't want to show us how you're trying to control it in your Qt app (could be that you're doing something wrong), you don't want to tell us on what platform you are, but you want us to tell you whether it can be supported by Qt? Good luck...
P.S.: if you post code, please make it readable...