Compare commits

...

2 Commits

Author SHA1 Message Date
da2319cd51 Fixes for the RPi 2022-11-24 19:23:04 +01:00
ea3855f0ed Adapt to rpi-camera 2022-02-01 12:00:47 +01:00
2 changed files with 14 additions and 2 deletions

View File

@ -1,16 +1,24 @@
# sample code from https://stackoverflow.com/questions/43111029/how-to-find-the-average-colour-of-an-image-in-python-with-opencv
import matplotlib
matplotlib.use('TkAgg')
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import cv2
import numpy as np
from skimage import io
import colorsys
import time
img_path = 'IMG_20211204_220355.jpg'
img_path = 'input.jpg'
from picamera import PiCamera
camera = PiCamera()
time.sleep(2) # wait for the camera to initialize
camera.capture(img_path)
# Read the result
img = io.imread(img_path)[:, :, :]
# Average color

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
picamera
opencv-python
matplotlib
numpy