Posts

Showing posts from July, 2024

Python + cv2 exercises to resize jpg and save in bmp

Image
Python + cv2 exercises to resize jpg and save in bmp, tested on Raspberry Pi 5/64 bit Raspberry Pi OS (bookworm). py_cv_resize.py , resize jpg and save in bmp, the file name is hard-coded in the program. You can also save the image in other file name/format in cv.imwrite() interface. # Python exercise to resize jpg and save in bmp # tested on Raspberry Pi 5/64 bit Raspberry Pi OS (bookworm) import cv2 as cv target_width = 240 target_height = 240 path = "./images/" file = "05" ext_jpg = ".jpg" ext_bmp = ".bmp" img = cv.imread(path + file + ext_jpg) img = cv.resize(img, (target_width, target_height)) cv.imwrite(path + file + ext_bmp, img) cv.imshow("img", img) cv.waitKey(0) cv.destoryAllWindows() py_cv_batch_resize.py , resize in batch. It's used to prepare bmp images in my next " Adafruit_GFX/ImageReader exercises to load bmp images from MicroSD and display on 240×320 ST7789 SPI TFT, run on Seeed Studio XIAO...

Seeed Studio XIAO ESP32S3 Sense display on 2.4" TFT 240×320 ST7789V using Adafruit_ST7789 lib in Arduino framework.

Image
Exercise running on  Seeed Studio XIAO ESP32S3 Sense , to display on 2.4" TFT 240×320 ST7789V using Adafruit_ST7789 lib in Arduino framework. Board and library installed: esp32 by Espressif System (arduino-esp32) 3.0.3 Adafruit ST7735 and ST7789 Library 1.10.4 Connection: Code: XiaoS3_ST7789_SPI_240x320_color.ino /************************************************************************** XIAO ESP32S3 Connect display on 2.4" IPS 240x320 SPI (ST7789V) : Color Test Connection: ST7789 XIAO ESP32S3 1 GND GND 2 VCC 3V3 3 SCL GPIO7 (hardware SPI SCK) 4 SDA GPIO9 (hardware SPI MOSI) 5 RST GPIO2 6 DC GPIO3 7 CS GPIO4 8 BL 3V3 **************************************************************************/ #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7789.h> // Hardware-specific library for ST7789 #include <SPI.h> #define TFT_RST ...

2.4 inch TFT Module 240×320 ST7789V (GMT024-08-SPI8P VER 1.3)

Image
 2.4 inch TFT Module 240×320 ST7789V, marked "GMT024-08-SPI8P VER 1.3". Pin assignment: 1 GND 2 VCC 3 SCL 4 SDA 5 RST 6 DC 7 CS 8 BL Related exercise: ~  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) .

First try CameraWebServer on Seeed Studio XIAO ESP32S3 Sense + ov5640 Camera (Auto-Focusing), in Arduino framework.

Image
First try CameraWebServer on Seeed Studio XIAO ESP32S3 Sense + ov5640 Camera (Auto-Focusing) , in Arduino framework. Make sure  ESP32 (Arduino-ESP32) is installed to your Arduino IDE , 3.0.2 is installed in this video. Select board of esp32 > XIAO ESP32S3 Open Examples for XIAO_ESP32S3 > ESP32 > Camera > CameraWebServer un-comment the line: #define CAMERA_MODEL_XIAO_ESP32S3 and comment all other CAMERA_MODEL. Edit ssid and password to match with your WiFi network. optionally, you can compare with Seeed Studio XIAO ESP32S3 Sense Schematic . To check the supported camera sensor: Right click on any _PID (OV3660_PID here) in the code, click on Go to Definition. You can add code to check the attached camera sensor at runtime. CameraWebServer.ino #include "esp_camera.h" #include <WiFi.h> // // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality // Ensure ESP32 Wrover Module or other board ...