python receiving image from socket stream
问题 I'm trying to send a frame and throw socket by python, using opencv . The image is sent as string stream but when i remake the image on the server,the bytes are not in the right order. Client code : import socket import numpy as np import cv2 UDP_IP = "127.0.0.1" UDP_PORT = 5005 cap = cv2.VideoCapture(1) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) while 1: ret, frame = cap.read() cv2.imshow('client', frame) d = frame.flatten() s = d.tostring() #sock.sendall(s) #print len(s) for i