Update module camera settings
Include reset settings function
This commit is contained in:
@ -31,3 +31,20 @@ def check_settings():
|
||||
print(f'{attrib} = {VIDEO_CHECK.get(index)}')
|
||||
|
||||
VIDEO_CHECK.release()
|
||||
|
||||
def reset_settings():
|
||||
if not os.path.exists('camera_settings.log'):
|
||||
print('"camera_settings.log" does not exist!')
|
||||
print('Verify your camera settings!')
|
||||
return False
|
||||
else:
|
||||
VIDEO_CHECK = cv2.VideoCapture(0)
|
||||
f = open('camera_settings.log', 'r')
|
||||
lines = f.read().split('\n')
|
||||
for line in lines:
|
||||
attrib = line.split(' = ')
|
||||
if attrib[0] in attrib_list.keys():
|
||||
VIDEO_CHECK.set(attrib_list[attrib[0]], eval(attrib[1]))
|
||||
f.close()
|
||||
VIDEO_CHECK.release()
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user