Skip to content

Commit

Permalink
tests: Fixups for corp test
Browse files Browse the repository at this point in the history
Switch to RGB output for the lores image so that it displays correctly.

Skip this test on a VC4 platform as it cannot do different crops per
output.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir committed Nov 5, 2024
1 parent 87b709f commit 913bbaa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/crop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

import cv2

from picamera2 import Picamera2
from picamera2 import Picamera2, Platform

# VC4 platforms do not support different crops for the two outputs.
if Picamera2.platform == Platform.VC4:
print("SKIPPED (VC4 platform)")
quit(0)

picam2 = Picamera2()

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": 'YUV420', "preserve_ar": l},
lores={"size": (640, 640), "format": 'XRGB8888', "preserve_ar": l},
display="main")
picam2.configure(cfg)
picam2.start(show_preview=True)
Expand Down

0 comments on commit 913bbaa

Please sign in to comment.