У меня сейчас есть такой код.
/>Клиент
Код: Выделить всё
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]