Skip to content

Commit

Permalink
tests: crops: Reduce the size of the lores image
Browse files Browse the repository at this point in the history
Due to a rendering bug, if the lores viewfinder covers the main
viewfinder, updates stall for an unknown reason. Avoid this temporarily
by reducing the preview image resolution.  Also lower the test time
by reducing the number of frames run in each config.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
  • Loading branch information
naushir committed Nov 12, 2024
1 parent adb3513 commit 98a0d46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/crop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@

for m, l in [(False, False), (False, True), (True, False), (True, True)]:
cfg = picam2.create_video_configuration(main={"size": (1920, 1080), "format": 'XRGB8888', "preserve_ar": m},
lores={"size": (640, 640), "format": 'XRGB8888', "preserve_ar": l},
lores={"size": (320, 320), "format": 'XRGB8888', "preserve_ar": l},
display="main")
picam2.configure(cfg)
picam2.start(show_preview=True)

for _ in range(100):
for _ in range(50):
im = picam2.capture_array("lores")
cv2.imshow("lores", im)
cv2.resizeWindow("lores", (640, 640))
cv2.waitKey(1)

picam2.stop()

0 comments on commit 98a0d46

Please sign in to comment.