wsh32 / airhockey

PIE Final - Air Hockey Playing Robot
2 stars 0 forks source link

Camera out of focus #78

Open wsh32 opened 3 years ago

wsh32 commented 3 years ago

Camera autofocus isn't reliable, it consistently blurs the entire image. While this is mostly okay, it harms performance when the puck is in motion.

The table is far away enough that we can set it to the infinite focus setting (0) as seen here: https://stackoverflow.com/questions/16319759/disable-webcams-autofocus-in-linux

wsh32 commented 3 years ago

Setting it using v4l2-ctl works, though we should use the cv2.CAP_PROP settings

wsh32 commented 2 years ago
v4l2-ctl --set-ctrl=focus_auto=0
v4l2-ctl --set-ctrl=focus_absolute=0