Posts

Showing posts from June, 2024

Seeed Studio XIAO ESP32S3 Sense (with ov2640) & XIAO ov5640 Camera (Auto-Focusing)

Image
Seeed Studio XIAO ESP32S3 Sense (with ov2640) Seeed Studio XIAO ov5640 Camera (Auto-Focusing) Pinout: Related Links: ~  Getting Started with Seeed Studio XIAO ESP32S3 (Sense) ~  Installation of expansion boards and camera sensor ~  DroneBot Workshop for Seeeduino XIAO ESP32S3 Sense Board – A Tiny ESP32 Camera ~  TinyML Case Studies Related post: ~  First try CameraWebServer on Seeed Studio XIAO ESP32S3 Sense + ov5640 Camera (Auto-Focusing), in Arduino framework . ~  Seeed Studio XIAO ESP32S3 Sense display on 2.4" TFT 240×320 ST7789V using Adafruit_ST7789 lib in Arduino framework . ~  Adafruit_GFX/ImageReader exercises to load bmp images from MicroSD and display on 240×320 ST7789 SPI TFT, run on Seeed Studio XIAO ESP32S3 Sense (Arduino Platform) .

Picamera2+OpenCV+matplotlib Python exercise to display histogram, run on Raspberry Pi

Image
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

Python/OpenCV exercises on Raspberry Pi - Capture images from Camera Module 3 using Picamera2, display using OpenCV.

Image
It's a Python/OpenCV exercise run on Raspberry Pi OS (Bookworm), to capture images using Picamera2 and show using OpenCV. Test on: Raspberry Pi 5B/Raspberry Pi OS 64-bit (Bookworm) Python: 3.11.2 picamera2: 0.3.18 cv2: 4.6.0 ( OpenCV was installed from apt ) Code: picam2_cv2_capture_array.py """ Picamera2 + OpenCV exercise: Run on Raspberry Pi 5 + Camera Module 3, capture image using capture_array() and display using cv2.imshow(). 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 print("Python:", platform.python_version()) print(picamera2.__name__ + ":", version(picamera2.__name__)) print(cv2.__name__ + ":", cv2.__version__) print() time.sleep(1) cv2.startWindowThread() picam2 = picamera2.Picamera2(1) pica

Install OpenCV & matplotlib on Raspberry Pi OS (Bookworm)

Image
Install OpenCV & matplotlib on Raspberry Pi OS (Bookworm) to make it compatible with Picamera2. Tested on Raspberry Pi 5B/64-bit Raspberry Pi OS (Bookworm). It's suggested in Raspberry Pi official Picamera2 Document , to install OpenCV compatible with the Qt GUI toolkit that is installed with Picamera2. Install OpenCV from apt. To install OpenCV, enter the commands in Terminal: sudo apt install -y python3-opencv sudo apt install -y opencv-data To install matplotlib: sudo apt install python3-matplotlib picam2_cv2_and_info.py Python code to check if Picamera2/OpenCV related packages are installed, include: picamera2, cv2, numpy, matplotlib. """ Python code to check if Picamera2/OpenCV related packages installed, include: - picamera2 - cv2 - numpy - matplotlib """ import platform from importlib.metadata import version print("Python:", platform.python_version()) # import picamera2 try: import pi

Capture screenshots in Raspberry Pi OS (bookworm)/Wayland

Image
  grim is a Linux utility to grab images from Wayland compositor, it's pre-installed in Raspberry Pi OS (bookworm). $ grim To capture screenshot after a certain time; such as seconds: $ sleep 5 && grim To capture mouse cursor, add the -c option: $ sleep 5 && grim -c

CircuitPython ESP-NOW: Remote control on-board RGB LED via wireless, between ESP32-S3.

Image
With previous CircuitPython  exercises of  CircuitPython/ESP-NOW and  Touch buttons on ILI9341 SPI LCD with FT6336 Cap. Touch , this exercise implement remote control on-board RGB LED wirelessly, between ESP32-S3-DevKitC-1 (sender) and Waveshare ESP32-S3-Zero (receiver). cpyS3_ili9341_FT6336_grouped_color_TouchButtons_espnow_sender.py """ ESP32-S3/CircuitPython 9.0.5 exercise, act as ESP-NOW sender, send msg to receiver to control onboard RGB, with ILI9341 SPI LCD + FT6336 cap. touch. --------------------------- Display Module: 3.2 inch IPS SPI Module ILI9341 with cap. touch FT6336U Test on: dev. board: Espressif ESP32-S3-DevKitC-1 CircuitPython: 9.0.5 Libraries needed: - adafruit_ili9341.mpy - adafruit_focaltouch.mpy - adafruit_display_text folder - adafruit_button folder - adafruit_cursorcontrol folder - adafruit_display_shapes folder (It's needed by adafruit_button, so you have to load in /lib folder.) """ import os, sys import b