Answer the question
In order to leave comments, you need to log in
How to send Iplimage and collect it on the receiving side using the UDP protocol?
There are two applications (server and client). Server sends imageData via udp socket. The client, in turn, accepts imageData inserts into Iplimage and displays.
Part of the server code.
IplImage *small is already filled with data.
char *buff;
buff=small->imageData;
int result = sendto(SendSocket,
buff, strlen(buff), 0, (SOCKADDR *) & RecvAddr, sizeof (RecvAddr));
int UDPMAX = 65507;
cvNamedWindow("Client", CV_WINDOW_AUTOSIZE);
char *buff = (char*)malloc(UDPMAX);
int result = recvfrom(RecvSocket,
buff, strlen(buff), 0, (SOCKADDR *) & SenderAddr, &SenderAddrSize);
IplImage *small = cvCreateImage(cvSize(683,384), IPL_DEPTH_8U, 3);
buff[result]='\0';//обрезаю buff
small->imageData=buff;
cvShowImage("Client", small );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question