Picamera2+OpenCV+matplotlib Python exercise to display histogram, run on Raspberry Pi
Previous exercise of Python/OpenCV run on Raspberry Pi to capture images from Camera Module 3 using Picamera2 and display using OpenCV . The exercise plot the histogram using matplotlib. To install OpenCV and matplotlib on Raspberry Pi OS, read the HERE . picam2_cv2_histogram.py """ Picamera2 + OpenCV exercise: Run on Raspberry Pi 5 + Camera Module 3, capture image using capture_array() and display using cv2.imshow(). - plot histogram of the images. Press: S/s to save Q/q to quit My cameras: Picamera2(0) - Camera Module 3 NoIR Wide Picamera2(1) - Camera Module 3 """ import cv2 import picamera2 from libcamera import controls import platform from importlib.metadata import version import time import matplotlib import matplotlib.pyplot as plt print("Python:", platform.python_version()) print(picamera2.__name__ + ":", version(picamera2.__name__)) print(cv2.__name__ + ":", cv2.__version__) print(matplotlib.__nam...