Real time PICam with 18 fps - Raspberry Pi Forums
hello friends , morning !
today came here show simple solution stream using socket between raspberry pi , pc.
hear simple algorithm.
send me suggestions improvement !
problem :
needed send raspberry pictures laptop in real time 15-20 fps rate ( camera vision of robot. )
solution:
created udp socket in python,
capture 1 frame of camera , record on binarystream , send socket server ( notebook. )
in server , have program reads port 32123 , takes binary , convert image , fills in picturebox .. = d
made algorithm, , very, good. saw on internet, streams of high latency , make low latency of hard work ...
today came here show simple solution stream using socket between raspberry pi , pc.
hear simple algorithm.
send me suggestions improvement !
problem :
needed send raspberry pictures laptop in real time 15-20 fps rate ( camera vision of robot. )
solution:
created udp socket in python,
capture 1 frame of camera , record on binarystream , send socket server ( notebook. )
in server , have program reads port 32123 , takes binary , convert image , fills in picturebox .. = d
made algorithm, , very, good. saw on internet, streams of high latency , make low latency of hard work ...
code: select all
def send_images_to_server(): host = '10.0.0.100' port = 32123 #define o tipo da familia protocolo e o tipo de socket, nesse caso, udp udp = socket.socket(socket.af_inet, socket.sock_dgram) dest = (host, port) #tupla contendo o host e porta servidor camera = picamera.picamera() camera.framerate=10 camera.resolution = (300,200) camera.start_preview() time.sleep(2) x = 1 while(x < 1000 ): #time.sleep(0.1) camera.capture(str,'jpeg',use_video_port=true) str.seek(0) udp.sendto(str.read(), dest) #faz o envio str.seek(0) str.truncate() x += 1 #encerra conexao udp.close() return;
raspberrypi
Comments
Post a Comment