Trouble with preview overlays #580
-
The following code is intended to show a preview window of the entire camera image, which it does. It then adds an overlay which should be a 900x900 square over the centre of the image, the actual result is a rectangle that is 3 times as wide as it is high but it is centred over the camera image import time from picamera2 import Picamera2, Preview picam2 = Picamera2() Create an array the same size as the imageoverlay = np.zeros((2304,1296,4), dtype=np.uint8) Fill a 900x900 pixel square centred with blueishoverlay[702:1602, 198:1098] = (0, 0, 255, 64) Set it as an overlaypicam2.set_overlay(overlay) Can anyone help with what I may be doing wrong. regards Mike Lerwill |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, I haven't had time to try out your example, but my first thought is just to check the order of your numpy dimensions. Remember, numpy is height first, width second. If that doesn't sort it out please post back. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi, I haven't had time to try out your example, but my first thought is just to check the order of your numpy dimensions. Remember, numpy is height first, width second. If that doesn't sort it out please post back. Thanks!