From d17e041007f263aaeee279ca2019e59d26ecac93 Mon Sep 17 00:00:00 2001 From: Shahrul Kamil bin Hassan <shahrulkamil98@g.ucla.edu> Date: Thu, 14 Oct 2021 00:57:42 +0000 Subject: [PATCH] Replace square_tracking.py --- Code/OpenMV Code/square_tracking.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Code/OpenMV Code/square_tracking.py b/Code/OpenMV Code/square_tracking.py index 942c66b..faa702d 100644 --- a/Code/OpenMV Code/square_tracking.py +++ b/Code/OpenMV Code/square_tracking.py @@ -23,7 +23,7 @@ sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... -sensor.set_auto_exposure(False, 25000) +sensor.set_auto_exposure(False, 5000) clock = time.clock() while(True): @@ -38,8 +38,11 @@ while(True): # have larger edge magnitudes the larger and more contrasty they are... for r in img.find_rects(threshold = 5000): - #img.draw_rectangle(r.rect(), color = (255, 0, 0)) - #for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0)) + img.draw_rectangle(r.rect(), color = (255, 0, 0)) + for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0)) print(r) - print("FPS %f" % clock.fps()) + #print("FPS %f" % clock.fps()) + + + -- GitLab