Skip to main content

Posts

Showing posts from 2024

Install python and opencv on the raspberry

Setup Conda and Python and opencv Setup venv python -m venv ocv2-env ocv2-env/bin/pip install opencv-python  Try python script import cv2 # Open the default camera cam = cv2.VideoCapture(0) # Get the default frame width and height frame_width = int(cam.get(cv2.CAP_PROP_FRAME_WIDTH)) frame_height = int(cam.get(cv2.CAP_PROP_FRAME_HEIGHT)) # Define the codec and create VideoWriter object fourcc = cv2.VideoWriter_fourcc(*'mp4v') out = cv2.VideoWriter('output.mp4', fourcc, 20.0, (frame_width, frame_height)) while True:     ret, frame = cam.read()     # Write the frame to the output file     out.write(frame)     # Display the captured frame     cv2.imshow('Camera', frame)     # Press 'q' to exit the loop     if cv2.waitKey(1) == ord('q'):         break # Release the capture and writer objects cam.release() out.release() cv2.destroyAllWindows() Add Wayland export QT_QPA_PLATFORM=xcb Test alias py='~/ocv2-env/bin/python' py r

Setting up my new raspberry

What did i buy? Raspberry Pi-C 8g vormontiert RASP PI-C 8GB Raspberry Pi-C mit Raspberry Pi 5B 8GB, vormontiert 142.95€ Camera  RASP CAM 2 Raspberry Pi - Kamera, 8MP, 67°, v2 18.95€ Cable to camera needed for raspberry pi-5 Raspberry Pi 5 Kamera Adapterkabel, offizielles Kamera Adapterkabel für Raspberry Pi 5, 300mm 2.35€ Hdmi mini to hdmi cable  Mini-Displayport Kabel, Mini-DP-HDMI, 1080p, 2,0 m Keyboard  Rii i8 Mini Tastatur Wireless 16.99€ the box unpacked connected booting configure What will i configure? Wifi network New user with sudo rights; at configuration menu Setup remote desktop Find my ip nmcli device show IP4.ADDRESS[1]: 192.168.180.111/24 Activate ssh and vnc In raspberry config, activate ssh and vnc. Next install tigervnc and ssh on client PC, and connect to IP address above.    vncviewer 192.168.180.111 user jan