Skip to content

Commit

Permalink
Merge pull request #417 from mprib/mprib/issue416
Browse files Browse the repository at this point in the history
non emeet cameras perform poorly...hold off
  • Loading branch information
mprib committed Jul 9, 2023
2 parents d89d725 + d5f5853 commit ceada44
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pyxy3d/cameras/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, port, verified_resolutions = None):

# check if source has a data feed before proceeding...if not it is
# either in use or fake
logger.info(f"Attempting to connect video capure at port {port}")
logger.info(f"Attempting to connect video capture at port {port}")
test_capture = cv2.VideoCapture(port,self.device_connection)
for _ in range(0, TEST_FRAME_COUNT):
good_read, frame = test_capture.read()
Expand Down Expand Up @@ -260,15 +260,18 @@ def calibration_summary(self):
######################### TEST FUNCTIONALITY OF CAMERAS ########################
if __name__ == "__main__":

cam = Camera(0, verified_resolutions=[(640,480), (1280,720)])
cam = Camera(4, verified_resolutions=[(640,480), (1280,720)])
logger.info(f"Camera {cam.port} has possible resolutions: {cam.verified_resolutions}")

for res in cam.verified_resolutions:
logger.info(f"Testing Resolution {res}")

logger.info("Disconnecting from camera")
cam.disconnect()
logger.info("Reconnecting to camera")
cam.connect()
logger.info(f"Setting camera size to {res}")
cam.size = res
logger.info(f"Resolution successfully updated...")

while True:
success, frame = cam.capture.read()
Expand Down Expand Up @@ -305,3 +308,5 @@ def calibration_summary(self):
cam.disconnect()
cv2.destroyAllWindows()
break

# %%

0 comments on commit ceada44

Please sign in to comment.