Question: I'm trying to capture an image using OpenCV and save it with both OpenCV and PIL on my Raspberry Pi 4. Here's my Python code: import cv2 from PIL import Image print("1") cap = cv2.VideoCapture(0) for i in range(100): ret, frame = cap.read() if not ret: print("Failed to grab frame") break if i == 99: print("3") cv2.imshow("Captured Image", frame) cv2.imwrite("captured_image.jpg", frame) frame = cv2.resize(frame, (160, 90)) pil_image = Image.fromarray(frame) pil_image.save("captured_image_pil.jpg") print("4") Problem: cv2.imwrite() does not actually save the image — the file doesn't show up or is empty. The image saved by PIL is completely black. When I run libcamera-hello, the camera works fine and shows output. What I tried: Verified camera works using libcamera-hello. Checked if the frames are being captured (they seem to be). My question: Why doesn't OpenCV save the image, and why is the PIL image black, even though the camera works with libcamera-hello? How can I fix this? My camera model is Arducam IMX 708 Continue reading...