Image transfer over the ethernet
You can download the source codes here( https://github.com/raspberry-pi-maker/OpenCV ) In this post, I'll show you how to display an image you've created or read from a file using OpenCV, on another computer. As a protocol for transmitting image data to another computer via Ethernet, UDP or TCP can be selected. We will use UDP here. The reason for this is as follows. In the same subnet, even if UDP communication is used, packet loss or duplication does not occur. It's faster and lighter than TCP, so it's even better if you need to transfer multiple images per second, such as video. prerequisite There are several protocols for transferring images, but in this post, I will send uncompressed image data directly in the form of numpy arrays. Numpy over network The most important part of numpy data transfer and recovery is byte sorting of numpy data. The sender sorts bytes using the numpy tobytes () function. The receiver then creates a one-dimensional ...