Захватывать и отправлять изображения в формате JPEG с Raspberry Pi на сокет ПК Python?Python

Программы на Python
Anonymous
Захватывать и отправлять изображения в формате JPEG с Raspberry Pi на сокет ПК Python?

Сообщение Anonymous »

Я хотел бы отправлять изображения, снятые с камеры Rasberry Pi, на ПК в прямом эфире как поток, но не как поток, поскольку у меня не так много пропускной способности.
У меня сейчас есть такой код.
/>Клиент

Код: Выделить всё

import io
import cv2
import socket
import struct
from PIL import Image
import numpy

# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means
# all interfaces)
cv2.namedWindow('Network Image')
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8200))
server_socket.listen(0)

# Accept a single connection and make a file-like object out of it
connection = server_socket.accept()[0].makefile('rb')
try:
while True:
# Read the length of the image as a 32-bit unsigned int. If the
# length is zero, quit the loop
image_len = struct.unpack('

Подробнее здесь: [url]https://stackoverflow.com/questions/46726757/capture-and-send-jpeg-images-from-raspberry-pi-to-pc-socket-python[/url]

Вернуться в «Python»