refactored BallFinder and live detection demo

This commit is contained in:
2018-06-03 13:44:11 +02:00
parent 79f9b587db
commit cb649daa15
4 changed files with 60 additions and 56 deletions

View File

@@ -67,8 +67,14 @@ class Colorpicker(object):
return cv2.waitKey(1)
def save(self, filename):
try:
with open(filename) as f:
conf = json.load(f)
except FileNotFoundError:
conf = {}
conf.update(self.settings)
with open(filename, 'w') as f:
json.dump(self.settings, f, indent=4)
json.dump(conf, f, indent=4)
def load(self, filename):
with open(filename) as f: