Image data transmission method, image processing method and related equipment
Through virtual channel technology, the Ethernet data packets of industrial cameras are divided into different categories of images and protocol packets are processed, which solves the problems of high cost and power consumption in the image transmission process of industrial cameras and achieves more efficient image transmission and processing.
Patent Information
- Application Number
- CN202410006093.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-01-03
AI Technical Summary
Existing industrial cameras have problems with high cost and power consumption during image transmission, especially in applications that require high real-time image processing. Existing solutions such as GigE Vision and similar capture card solutions lead to system hardware complexity. and cost increases.
By constructing a virtual channel, the Ethernet data packet of the industrial camera is parsed into an image to be transmitted, divided into the first type and the second type of transmission image, and packaged into the first type and the second type protocol package respectively, through different The protocol channel is used for transmission, ensuring that the image processing terminal receives and processes the first type of protocol packet first, and waits for the second type of protocol packet simultaneously to reduce bandwidth requirements.
It effectively reduces the cost and power consumption during image transmission and improves the efficiency and cost-effectiveness of the system.
Smart Images

Figure CN117692595B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image transmission, and in particular to an image data transmission method, an image processing method and related equipment. Background Art
[0002] In the current machine vision system composed of industrial cameras, most of them still use GigE Vision industrial cameras and architecture based on X86 CPU running on Windows operating system. However, in some special application fields, there will be higher requirements for the real-time performance of image processing, and this system can no longer meet the higher requirements for power consumption, volume, and processing power. As a result, many embedded intelligent vision solutions (smart cameras, edge computing) based on ARM processors running on Linux or Android systems have emerged. These ARM processors have relatively low power consumption and good performance, and have integrated increasingly powerful AI computing units (such as NPU) and image processing units (such as ISP), which can meet many machine vision application scenarios. However, there has been no good solution for stable and efficient image reception and transmission to the processing unit of the ARM processor. Most edge computing or computing boxes use industrial cameras connected to GigE Vision through Ethernet interfaces. This solution consumes a lot of CPU and is prone to packet and frame loss. If a solution similar to an acquisition card is adopted, through the PCI-E interface, the system hardware will be more complicated, the cost and power consumption will be higher, and the image processing unit of the ARM processor chip will not be fully utilized. Therefore, existing industrial cameras have problems with high cost and power consumption during image transmission. Summary of the invention
[0003] The embodiment of the present invention provides an image data transmission method, which aims to solve the problems of high cost and high power consumption in the image transmission process of existing industrial cameras. The Ethernet data packets of the industrial camera are parsed into images to be transmitted through a virtual channel, and the images to be transmitted are divided into a first type of transmission image and a second type of transmission image, the first type of transmission image is packaged into a first type of protocol packet and the second type of transmission image is packaged into a second type of protocol packet, the first type of protocol packet is transmitted through a first type of protocol channel, and the second type of protocol packet is transmitted through a second type of protocol channel. Since the first type of protocol packet is first transmitted to an image processing terminal, the image processing terminal parses and processes the first type of protocol packet, and synchronously waits for the reception and parsing of the second type of protocol packet during the image processing process, the bandwidth requirement of the first type of protocol channel can be reduced, thereby reducing the cost and power consumption during the image transmission process.
[0004] In a first aspect, an embodiment of the present invention provides a method for image data transmission, the method for image data transmission comprising:
[0005] Constructing virtual channels corresponding to multiple industrial cameras, at least one of the virtual channels communicates with one of the industrial cameras via Ethernet;
[0006] Receiving an Ethernet data packet transmitted by the industrial camera based on the virtual channel, and parsing the Ethernet data packet to obtain an image to be transmitted by the industrial camera;
[0007] The images to be transmitted are divided into a first type of transmission image and a second type of transmission image according to the image division strategy in the virtual channel, and the first type of transmission image is packaged into a first type of protocol package through a first type of protocol, and the second type of transmission image is packaged into a second type of protocol package through a second type of protocol, the first type of protocol package and the second type of protocol package are associated through a unique identifier, and the second type of transmission image is an image corresponding to the image processing algorithm in the image processing terminal;
[0008] The first type of protocol packet is transmitted to the image processing terminal through the first type of protocol channel preconfigured in the virtual channel, and the second type of protocol packet is transmitted to the image processing terminal through the second type of protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packet and the second type of protocol packet.
[0009] Optionally, the step of constructing virtual channels corresponding to multiple industrial cameras includes:
[0010] Obtain the region of interest of each industrial camera and the image processing algorithm type of the image processing terminal for each industrial camera;
[0011] Determine, according to the region of interest and the type of image processing algorithm, the image division strategy, the first type of protocol type, the second type of protocol type, the first type of protocol channel, and the second type of protocol channel corresponding to each of the industrial cameras, wherein the first type of protocol channel corresponds to the first type of protocol type, and the second type of protocol channel corresponds to the second type of protocol type;
[0012] Based on the Ethernet interface of each industrial camera, the image division strategy, the first protocol type, the second protocol type and the first protocol channel, a corresponding virtual channel is constructed for each industrial camera.
[0013] Optionally, dividing the to-be-transmitted images into first-category transmission images and second-category transmission images according to the image division strategy in the virtual channel includes:
[0014] Extracting an image of interest within a region of interest and an image of non-interest outside the region of interest from the image to be transmitted, and determining a processing cost of the image of interest;
[0015] Calculating an incremental image between the image of interest and a previous frame of the image of interest, and determining a processing cost of the incremental image;
[0016] Calculating a cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image;
[0017] If the cost increment is greater than a preset cost increment threshold, determining the incremental image as a first-category transmission image, and determining the image to be transmitted as a second-category transmission image;
[0018] If the cost increment is less than a preset cost increment threshold, the image of interest is determined as a first-category transmission image, and the image of no interest is determined as a second-category transmission image.
[0019] Optionally, determining the processing cost of the image of interest includes:
[0020] Determine the packaging cost of the image of interest according to the first type of protocol type, determine the transmission cost of the first type of protocol package corresponding to the image of interest according to the first type of protocol channel, and determine the parsing cost of the first type of protocol package corresponding to the image of interest according to the image processing terminal and the first type of protocol type;
[0021] A processing cost of the image of interest is determined according to the packaging cost, the transmission cost, and the parsing cost of the image of interest.
[0022] Optionally, the calculating an incremental image between the image of interest and a previous frame of the image of interest, and determining a processing cost of the incremental image, includes:
[0023] Calculating an image difference between the image of interest and a previous frame of the image of interest to obtain an incremental image between the image of interest and the previous frame of the image of interest;
[0024] Determine the packaging cost of the incremental image according to the first type of protocol type, determine the transmission cost of the incremental image corresponding to the first type of protocol package according to the first type of protocol channel, determine the parsing cost of the incremental image corresponding to the first type of protocol package according to the image processing terminal and the first type of protocol type, and determine the reading and writing cost of the previous frame of the image of interest at the image processing terminal;
[0025] The processing cost of the incremental image is determined according to the packaging cost, the transmission cost, the parsing cost, and the reading and writing cost of the incremental image.
[0026] In a second aspect, an embodiment of the present invention further provides an image processing method, the image processing method comprising the following steps:
[0027] receiving a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal by using the image data transmission method described in any one of the embodiments of the present invention;
[0028] Parsing the first type of protocol packets to obtain a first type of transmission image, and performing image processing on the first type of transmission image to obtain a first image processing result;
[0029] The second type of protocol packet is parsed to obtain a second type of transmission image, and the first type of transmission image, the second type of transmission image and the first image processing result are aggregated to obtain a second image processing result.
[0030] In a third aspect, an embodiment of the present invention further provides an image data transmission device, the image data transmission device comprising:
[0031] A construction module, used to construct virtual channels corresponding to multiple industrial cameras, at least one of the virtual channels communicates with one of the industrial cameras via Ethernet;
[0032] A first parsing module, configured to receive an Ethernet data packet corresponding to the industrial camera based on the virtual channel, and parse the Ethernet data packet to obtain an image to be transmitted corresponding to the industrial camera;
[0033] a packaging module, configured to divide the to-be-transmitted images into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and to package the first type of transmission images into a first type of protocol package through a first type of protocol, and to package the second type of transmission images into a second type of protocol package through a second type of protocol, wherein the first type of protocol package and the second type of protocol package are associated through a unique identifier, and the second type of transmission images are images corresponding to the image processing algorithm in the image processing terminal;
[0034] A transmission module is used to transmit the first-type protocol packet to the image processing terminal through the first-type protocol channel preconfigured in the virtual channel, and to transmit the second-type protocol packet to the image processing terminal through the second-type protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first-type protocol packet and the second-type protocol packet.
[0035] In a fourth aspect, an embodiment of the present invention further provides an image processing terminal, the image processing terminal comprising:
[0036] A receiving module, configured to receive a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal by using the image data transmission method described in any one of the embodiments of the present invention;
[0037] A second parsing module is used to parse the first type of protocol packets to obtain a first type of transmission image, and perform image processing on the first type of transmission image to obtain a first image processing result;
[0038] The third parsing module is used to parse the second type of protocol packet to obtain a second type of transmission image, and aggregate the first type of transmission image, the second type of transmission image and the first image processing result to obtain a second image processing result.
[0039] In a fifth aspect, an embodiment of the present invention further provides an image data transmission system, the image data transmission system comprising: a plurality of industrial cameras, an image data transmission device and an image processing terminal, the plurality of industrial cameras being communicatively connected to the image data transmission device via Ethernet, the image data transmission device being communicatively connected to the image processing terminal via a first type protocol channel and a second type protocol channel;
[0040] Wherein, the image data transmission device is used to execute the image data transmission method as described in any one of the embodiments of the present invention;
[0041] The image processing terminal is used to execute the image processing method as described in the embodiment of the present invention.
[0042] In a sixth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of any one of the image data transmission methods provided in the embodiment of the present invention are implemented, or when the processor executes the computer program, the steps of the image processing method provided in the embodiment of the present invention are implemented.
[0043] In an embodiment of the present invention, virtual channels corresponding to multiple industrial cameras are constructed, and at least one virtual channel communicates with one of the industrial cameras via Ethernet; Ethernet data packets corresponding to the industrial cameras are received based on the virtual channels, and the Ethernet data packets are parsed to obtain images to be transmitted corresponding to the industrial cameras; the images to be transmitted are divided into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and the first type of transmission images are packaged into a first type of protocol packets through a first type of protocol, and the second type of transmission images are packaged into a second type of protocol packets through a second type of protocol, the first type of protocol packets and the second type of protocol packets are associated through a unique identifier, and the second type of transmission images are images corresponding to image processing algorithms in an image processing terminal; the first type of protocol packets are transmitted to the image processing terminal through a first type of protocol channel preconfigured in the virtual channel, and the second type of protocol packets are transmitted to the image processing terminal through a preconfigured second type of protocol channel, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packets and the second type of protocol packets. The Ethernet data packets of the industrial camera are parsed into images to be transmitted through a virtual channel, and the images to be transmitted are divided into a first type of transmission images and a second type of transmission images. The first type of transmission images are packaged into a first type of protocol packet and the second type of transmission images are packaged into a second type of protocol packet. The first type of protocol packet is transmitted through a first type of protocol channel and the second type of protocol packet is transmitted through a second type of protocol channel. Since the first type of protocol packet is first transmitted to the image processing terminal, the image processing terminal parses and processes the first type of protocol packet and synchronously waits for the reception and parsing of the second type of protocol packet during the image processing process, which can reduce the bandwidth requirement of the first type of protocol channel, thereby reducing the cost and power consumption during the image transmission process. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1a is an architecture diagram of an image data transmission system provided by an embodiment of the present invention;
[0046] Figure 1b A schematic diagram of writing an Ethernet transceiver packet provided by an embodiment of the present invention;
[0047] Figure 1c A schematic diagram of reading Ethernet transceiver packets provided by an embodiment of the present invention;
[0048] Figure 1d is a data transmission schematic diagram of an image data transmission system provided by an embodiment of the present invention;
[0049] Figure 2 is a flow chart of an image data transmission method provided by an embodiment of the present invention;
[0050] Figure 3 is a flow chart of an image processing method provided by an embodiment of the present invention;
[0051] Figure 4 is a structural schematic diagram of an image data transmission device provided by an embodiment of the present invention;
[0052] Figure 5 is a structural schematic diagram of an image processing device provided by an embodiment of the present invention;
[0053] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] like Figure 1a As shown, Figure 1a is an architecture diagram of an image data transmission system provided by an embodiment of the present invention. Figure 1a As shown, the image data transmission system includes: multiple industrial cameras, an image data transmission device and an image processing terminal, wherein the multiple industrial cameras are connected to the image data transmission device through Ethernet, and the image data transmission device is connected to the image processing terminal through a first type of protocol channel and a second type of protocol channel. The image data transmission device is used to execute any image data transmission method in the embodiments of the present invention; and the image processing terminal is used to execute the image processing method in the embodiments of the present invention.
[0056] In an embodiment of the present invention, the industrial camera may be an Ethernet industrial camera, such as a GigE Vision industrial camera. The GigE Vision industrial camera encodes images using the GigE Vision protocol. The GigE Vision industrial camera communicates with the image data transmission device via Ethernet. The GigE Vision industrial camera packages the image data into an Ethernet data packet, and transmits the Ethernet data packet to the image data transmission device via Ethernet. The Ethernet data packet may be a GVSP protocol data packet.
[0057] The above-mentioned image data transmission device can be a receiving board, which includes an Ethernet port, a physical layer interface chip ETH_PHY and an FPGA (programmable gate array). The number of Ethernet ports is the same as the number of industrial cameras. Of course, when passing through a switch, one Ethernet port can be connected to multiple industrial cameras. The number of physical layer interface chips ETH_PHY is the same as the number of industrial cameras. The receiving board communicates with the industrial camera through the Ethernet port. The physical layer interface chip ETH_PHY is connected to the Ethernet port for communication. The FPGA is provided with virtual channels corresponding to multiple industrial cameras, SPI / I2C / I3C protocol channels, and D_PHY / C_PHY protocol channels. Each industrial camera corresponds to a virtual channel, and the virtual channel may include a MAC layer (media access control), a GVSP depacketizer, and a MIPI CSI-2 packager.
[0058] The image processing terminal can be an application processor (SOC chip) based on ARM / RISC-V / MIPS / x86. The application processor includes I2C / I3C / SPI / QSPI / other interfaces, MIPI CSI-2 controller, ISP PipeLine (Image Sensor Process image signal processing) and Mem address space, wherein the Mem address space includes FrameBufer.
[0059] Specifically, the I2C / I3C / SPI / QSPI / other interface protocol channel in the receiving board is connected to the I2C / I3C / SPI / QSPI / other interface communication in the application processor, and the D_PHY / C_PHY protocol channel in the receiving board is connected to the MIPI CSI-2 controller in the application processor. The channel in which the SPI / I2C / I3C protocol channel in the above-mentioned receiving board is connected to the I2C / I3C / SPI / QSPI / other interface communication in the application processor is a control / command channel, which is mainly used for control commands, status acquisition, register reading and writing, and transmission of low-speed information. The channel in which the D_PHY / C_PHY protocol channel in the receiving board is connected to the MIPI CSI-2 controller in the application processor is a data stream channel, which uses the MIPI CSI-2 protocol as the transmission protocol, supports the transmission of D_PHY / C_PHY signals, and is a board-level transmission method.
[0060] The above receiving board provides a command channel or control channel with the application processor, which can realize Ethernet communication with the camera, such as sending and receiving IP / UDP packets, and further realize the GigE Vision Control Protocol (GVCP) to configure parameters and control operations for industrial cameras. The implementation method is to construct an I2C / I3C / SPI controller and an Ethernet controller in the FPGA, so as to realize the reading and writing of Ethernet transceiver packets. Please refer to Figure 1b and Figure 1c ,in, Figure 1b A schematic diagram of writing an Ethernet transceiver packet provided by an embodiment of the present invention, Figure 1c A schematic diagram of reading Ethernet transceiver packets provided by an embodiment of the present invention. Figure 1b In the write data, the Ethernet header, IP header, UDP header and data are included. The above data includes the GVCP command header and GVR register (GenICamVirtual Register) information (register address and data, which can be multiple). Figure 1c The read data includes an Ethernet header, an IP header, a UDP header, and data, and the above data includes a GVCP command header and GVR register information (register address and data, which can be multiple).
[0061] Please refer to Figure 1a and Figure 1d , Figure 1d FIG. 1 is a data transmission schematic diagram of an image data transmission system provided by an embodiment of the present invention. Figure 1a and Figure 1dThe Ethernet controller controls the communication connection between each Ethernet interface and the corresponding industrial camera, including establishing and disconnecting the communication connection. The industrial camera packages the image data into an Ethernet data packet of the GVSP protocol specification and sends it through the Ethernet communication protocol. The Ethernet interface receives the Ethernet data packet transmitted by the corresponding industrial camera and inputs the Ethernet data packet into the corresponding virtual channel in the FPGA through the corresponding physical layer interface chip ETH_PHY. Through the MAC layer (data link layer) in the virtual channel, the GVSP depacketizer and the MIPI CSI-2 packer, the Ethernet data packet is parsed and repacked into a MIPI-CSI2 protocol packet and transmitted to the MIPI CSI-2 controller in the SOC processor for parsing, and image processing can be performed through ISPPipeLine, and the image processing results are stored in the Mem address space.
[0062] Specifically, the above Ethernet data packet includes a GVSP header block GVSP LeaderPacket (0), a GVSP image data block GVSPImageDate Packet (1), GVSPImageDate Packet (2) ... GVSPImageDate Packet (K-1), and a GVSP trailer block GVSP TrailerPacket (K). A GVSP image data block may include an Ethernet header, an IP header, a UDP header, and image block data, and the image block data includes a GVSP header and image data. The above MIPI-CSI2 protocol packet includes a frame start FrameStart, image data line 1, image data line 2, ..., image data line n, and a frame end FrameEnd. A line of image data may include a MIPI-CSI2 header (virtual channel number, data type DataType, data length, numbering and ECC check), a whole line of image data (which may be YUV / RGB / RAW format data), and a MIPI-CSI2 trailer (check data).
[0063] Furthermore, after receiving the Ethernet data packet, the virtual channel can pass the Ethernet data packet to the GVSP depacketizer through the MAC layer, and the Ethernet data packet is depacketized by the GVSP depacketizer to obtain the image to be transmitted. The above-mentioned virtual channel includes a first-type protocol channel and a second-type protocol channel, and the image to be transmitted is divided into a first-type transmission image and a second-type transmission image through an image division strategy. Specifically, the first-type transmission image and the second-type transmission image are divided according to different business requirements. It can be understood that the urgency of the second-type transmission image for the business is lower than that of the first-type transmission image for the business. For example, the second-type transmission image can be a non-key frame image, and the first-type transmission image can be a key frame image, or the second-type transmission image can be a non-interest area image in the image to be transmitted, and the first-type transmission image can be an interest area image in the image to be transmitted.
[0064] It should be noted that the above-mentioned first and second categories are only used to distinguish different types and do not have the meaning of sorting. Therefore, when understanding "the second category..." and "the first category...", they can be considered as referring to different types of "...", without any distinction of order.
[0065] The second type of transmission image is passed to the first type of MIPI CSI-2 packager, and the second type of transmission image is packaged into a second type of protocol packet through the first type of MIPI CSI-2 packager, and the second type of protocol packet is a MIPI CSI-2 protocol packet. The first type of transmission image is passed to the first type of MIPI CSI-2 packager, and the first type of transmission image is packaged into a first type of protocol packet through the first type of MIPI CSI-2 packager, and the first type of protocol packet can be a MIPI-CSI2 protocol packet. The first type of protocol packet is transmitted to the image processing terminal through the first type of protocol channel, and the second type of protocol packet is transmitted to the image processing terminal through the second type of protocol channel. The MIPI CSI-2 controller of the image processing terminal unpacks the received first-class protocol packet and transmits it to the corresponding image processing thread for image processing. When the image processing thread performs image processing on the first-class transmission image, the MIPI CSI-2 controller of the image processing terminal will also receive the second-class protocol packet for unpacking to obtain the second-class transmission image, and aggregate the first-class transmission image, the image processing result of the first-class transmission image and the second-class transmission image according to the unique identifier between the second-class protocol packet and the first-class protocol packet to obtain the final image for display. The MIPI CSI-2 controller may include multiple receiving interfaces, which are respectively used to receive the second-class protocol packet and the first-class protocol packet, and can receive the protocol packet under high concurrency. The above-mentioned second-class image can be understood as an image that does not require image processing. Therefore, for the image processing terminal, the time spent on the first-class transmission image is the transmission time, the unpacking time and the image processing time, while the time spent on the second-class transmission image is the transmission time and the unpacking time.
[0066] It can be seen that the embodiment of the present invention parses the Ethernet data packet of the industrial camera into images to be transmitted through a virtual channel, and divides the images to be transmitted into a first type of transmission images and a second type of transmission images, packages the first type of transmission images into a first type of protocol packet and packages the second type of transmission images into a second type of protocol packet, transmits the first type of protocol packet through a first type of protocol channel, and transmits the second type of protocol packet through a second type of protocol channel. Since the first type of protocol packet is first transmitted to the image processing terminal, the image processing terminal parses and processes the first type of protocol packet and synchronously waits for the reception and parsing of the second type of protocol packet during the image processing process, which can reduce the bandwidth requirement of the first type of protocol channel, thereby reducing the cost and power consumption during the image transmission process.
[0067] like Figure 2 As shown, Figure 2 1 is a flow chart of an image data transmission method provided by an embodiment of the present invention. The above-mentioned image data transmission method is applied to an image data transmission device, and the image data transmission method comprises the steps of:
[0068] 201. Construct virtual channels corresponding to multiple industrial cameras, and each virtual channel communicates with one industrial camera via Ethernet.
[0069] In an embodiment of the present invention, a plurality of industrial cameras are communicatively connected to an image data transmission device via Ethernet, and the image data transmission device is communicatively connected to an image processing terminal via a first type protocol channel and a second type protocol channel.
[0070] The above-mentioned image data transmission device can be a receiving board based on FPGA, which includes an Ethernet port, a physical layer interface chip ETH_PHY and an FPGA (programmable gate array). The number of Ethernet ports is the same as the number of industrial cameras, and the number of physical layer interface chips ETH_PHY is the same as the number of industrial cameras. The receiving board communicates with the industrial camera through the Ethernet port. The physical layer interface chip ETH_PHY is connected to the Ethernet port for communication. The FPGA is provided with virtual channels corresponding to multiple industrial cameras. The virtual channels can be divided into the second type of protocol channels and the first type of protocol channels. Each industrial camera corresponds to an interface of a virtual channel. Data can be transmitted between virtual channels. The virtual channel can include a MAC layer (data link layer), a GVSP depacketizer and MIPI CSI-2 packager, specifically, virtual channels can be interconnected for data transmission. Before protocol packaging, images to be transmitted of different protocol types are transmitted to protocol channels of corresponding types. For example, after the GVSP depacketizer unpacks the Ethernet data packet, the obtained data to be transmitted is divided into second-type transmission images and first-type transmission images. If the current virtual channel is a virtual channel of the second-type protocol channel, the first-type transmission image will be transferred to the adjacent virtual channel with the first-type protocol channel for packaging and transmission.
[0071] 202. Receive an Ethernet data packet transmitted by a corresponding industrial camera based on a virtual channel, and parse the Ethernet data packet to obtain an image to be transmitted by the corresponding industrial camera.
[0072] In an embodiment of the present invention, the industrial camera packages the image data into an Ethernet data packet of GVSP protocol specification and sends it through the Ethernet communication protocol. The Ethernet interface receives the Ethernet data packet transmitted by the corresponding industrial camera, and inputs the Ethernet data packet into the corresponding virtual channel in the FPGA through the corresponding physical layer interface chip ETH_PHY.
[0073] After the virtual channel receives the Ethernet data packet, it can transfer the Ethernet data packet to the GVSP depacketizer through the MAC layer, and the GVSP depacketizer depackets the Ethernet data packet to obtain the image to be transmitted.
[0074] 203. Divide the images to be transmitted into first-category transmission images and second-category transmission images according to the image division strategy in the virtual channel, and package the first-category transmission images into first-category protocol packages through a first-category protocol, and package the second-category transmission images into second-category protocol packages through a second-category protocol.
[0075] In an embodiment of the present invention, the above-mentioned image division strategy can be determined according to the corresponding industrial camera and the image processing algorithm. It should be noted that for a video stream, the image processing algorithm does not need to perform image processing on each frame. According to the urgency of the image processing algorithm's demand for the image, the frames that need to be processed in real time are called key frames, and the frames that do not need to be processed or do not need to be processed in real time are called non-key frames. The above-mentioned second type of transmission images can be non-key frames, and the above-mentioned first type of transmission images can be key frames.
[0076] Furthermore, for a frame of image, most image processing algorithms do not need to process the entire image, but only need to process the area of interest in the image. For example, to identify whether a product is labeled, it is only necessary to detect the label in the label area in the image, or it is only necessary to identify the identification code (such as a barcode or a QR code, etc.) in the label area in the image. Therefore, the label area in the image can be divided into the first type of transmission image, and the non-label area in the image can be divided into the second type of transmission image. The first type of transmission image is the image that needs to be processed by the image processing algorithm in the image processing terminal, and the second type of transmission image is the image that does not need to be processed by the image processing algorithm in the image processing terminal.
[0077] Specifically, whether the second type of transmitted images are non-key frames or non-areas of interest, and whether the first type of transmitted images are key frames or areas of interest, depends on the image processing algorithm corresponding to the camera service. For example, if the image processing algorithm corresponding to the camera service only needs to process key frames, the division strategy in the virtual channel corresponding to the camera is to divide according to whether it is a key frame; if the image processing algorithm corresponding to the camera service only needs to process the area of interest in each frame of the image, the division strategy in the virtual channel corresponding to the camera is to divide according to whether it is an area of interest; or, if the image processing algorithm corresponding to the camera service needs to process the area of interest in the key frame, the division strategy in the virtual channel corresponding to the camera is to divide according to whether it is an area of interest in the key frame. The embodiment of the present invention takes the division strategy in the virtual channel as an example of dividing according to whether it is an area of interest, and the embodiments of the other division strategies can refer to the embodiment of the division strategy in the virtual channel as dividing according to whether it is an area of interest.
[0078] After dividing the images to be transmitted into first-category transmission images and second-category transmission images, the transmission data volume of the first-category transmission images can be reduced, thereby reducing the transmission bandwidth required for the first-category transmission images, reducing the transmission cost and power consumption of the first-category protocol channel, and using the lower-cost second-category protocol channel to transmit the second-category protocol package. The transmission time difference of the second-category transmission images can be compensated by the image processing time of the first-category transmission images, thereby improving the overall efficiency of the image data transmission system.
[0079] Specifically, the image to be transmitted can be divided into a first type of transmission image and a second type of transmission image through an image division strategy, the first type of transmission image is passed into a first type of MIPI CSI-2 packager, and the first type of transmission image is packaged into a first type of protocol package through the first type of MIPI CSI-2 packager, and the first type of protocol package is a MIPI CSI-2 protocol package. The second type of transmission image is passed into a second type of MIPI CSI-2 packager, and the second type of transmission image is packaged into a second type of protocol package through the second type of MIPI CSI-2 packager, and the second type of protocol package can be a MIPI CSI-2 protocol package. The difference between the above-mentioned first type of protocol package and the second type of protocol package lies in the different amounts of transmission data. Specifically, the amount of transmission data of the first type of protocol package is less than that of the second type of protocol package.
[0080] The first type of protocol package and the second type of protocol package are associated through a unique identifier. After the image processing terminal obtains the first type of protocol package and the second type of protocol package, they can be aggregated through the unique identifier.
[0081] 204. Transmit the first type of protocol packet to the image processing terminal through the first type of protocol channel preconfigured in the virtual channel, and transmit the second type of protocol packet to the image processing terminal through the second type of protocol channel preconfigured, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packet and the second type of protocol packet.
[0082] In the embodiment of the present invention, the first type of protocol packet is transmitted to the image processing terminal through the first type of protocol channel MIPI CSI-2, and the second type of protocol packet is transmitted to the image processing terminal through the second type of protocol channel SPI / I2C.
[0083] The MIPI CSI-2 controller of the image processing terminal unpacks the received first-class protocol packet and transmits it to the corresponding image processing thread for image processing. When the image processing thread processes the first-class transmitted image, the I2C / I3C / SPI / QSPI / other interfaces of the image processing terminal serve as control transmission channels. These interfaces are used to read and write Ethernet control commands and configure virtual channels for unpacking.
[0084] The image processing terminal receives the second type of protocol packet through the second type of protocol channel and unpacks it to obtain the second type of transmission image, aggregates the first type of transmission image, the image processing result of the first type of transmission image and the second type of transmission image to obtain the final image for display. The second type of image can be understood as an image that does not require image processing. Therefore, for the image processing terminal, the time spent on the first type of transmission image is the transmission time, unpacking time and image processing time, while the time spent on the second type of transmission image is the transmission time and unpacking time.
[0085] In an embodiment of the present invention, virtual channels corresponding to multiple industrial cameras are constructed, and each virtual channel communicates with one industrial camera through Ethernet; Ethernet data packets corresponding to the industrial camera are received based on the virtual channel, and the Ethernet data packets are parsed to obtain images to be transmitted of the corresponding industrial camera; the images to be transmitted are divided into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and the first type of transmission images are packaged into a first type of protocol packets through a first type of protocol, and the second type of transmission images are packaged into a second type of protocol packets through a second type of protocol, and the first type of protocol packets and the second type of protocol packets are associated through a unique identifier; the first type of protocol packets are transmitted to an image processing terminal through a first type of protocol channel preconfigured in the virtual channel, and the second type of protocol packets are transmitted to the image processing terminal through a second type of protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packets and the second type of protocol packets. The Ethernet data packets of the industrial camera are parsed into images to be transmitted through a virtual channel, and the images to be transmitted are divided into a first type of transmission images and a second type of transmission images. The first type of transmission images are packaged into a first type of protocol packet and the second type of transmission images are packaged into a second type of protocol packet. The first type of protocol packet is transmitted through a first type of protocol channel and the second type of protocol packet is transmitted through a second type of protocol channel. Since the first type of protocol packet is first transmitted to the image processing terminal, the image processing terminal parses and processes the first type of protocol packet and synchronously waits for the reception and parsing of the second type of protocol packet during the image processing process, which can reduce the bandwidth requirement of the first type of protocol channel, thereby reducing the cost and power consumption during the image transmission process.
[0086] Optionally, constructing virtual channels corresponding to multiple industrial cameras includes: obtaining the region of interest of each industrial camera and the type of image processing algorithm of the image processing terminal for each industrial camera; determining the image division strategy, the first type of protocol type, the second type of protocol type, the first type of protocol channel and the second type of protocol channel corresponding to each industrial camera according to the region of interest and the image processing algorithm type, the first type of protocol channel corresponds to the first type of protocol type, and the second type of protocol channel corresponds to the second type of protocol type; constructing a corresponding virtual channel for each industrial camera based on the Ethernet interface of each industrial camera, the image division strategy, the first type of protocol type, the second type of protocol type and the first type of protocol channel.
[0087] In the embodiment of the present invention, an Ethernet controller may be used to control the construction of a virtual channel corresponding to a multi-channel industrial camera, and a data stream channel between the virtual channel and the image processing terminal may be constructed through a MIPI CSI-2 controller.
[0088] Specifically, the above-mentioned region of interest may be the region where the image processing algorithm acts. Different types of algorithms act on different regions. For example, the region of interest for vehicle recognition is the road, and the region of interest for pedestrian recognition is the sidewalk. After determining the type of image processing algorithm, the above-mentioned region of interest may be determined based on the position and angle of the industrial camera setting. After the industrial camera is set up, it generally does not move again. Therefore, after the industrial camera is set up, the region of interest may be drawn using the image captured by the industrial camera to obtain the coordinates of the region of interest, and the coordinates of the region of interest may be configured in the virtual channel of the industrial camera. After the virtual channel unpacks the image to be transmitted, the image segmentation strategy may be to use the coordinates of the region of interest to draw the region of interest in the image to be transmitted, and to use the image in the region of interest as the first type of transmission image, and the image outside the region of interest as the second type of transmission image.
[0089] The first type of protocol type may be MIPI CSI-2 protocol / D_PHY / C_PHY protocol, the second type of protocol type may be MIPI CSI-2 protocol / D_PHY / C_PHY protocol, the first type of protocol channel may be a transmission channel corresponding to the D_PHY / C_PHY protocol / MIPI CSI-2 protocol, and the second type of protocol channel may be a transmission channel corresponding to the MIPI CSI-2 protocol / D_PHY / C_PHY protocol. It can be understood that the above-mentioned protocol refers to the transmission of differential information between two adjacent frames of images. When unpacking, the differential information is added on the basis of the previous frame of image to obtain the next frame of image. The protocol refers to the information of the transmitted image itself, and the image itself is directly obtained after unpacking. It can be understood that the bandwidth required by the protocol is small, the speed is fast, and the packaging cost is low, but the unpacking cost is high. The bandwidth required by the protocol is large, the speed is slow, and the packaging cost is high, but the unpacking cost is relatively low.
[0090] After determining the image division strategy, the first type of protocol, the second type of protocol and the first type of protocol channel, a corresponding virtual channel is constructed for each industrial camera based on the Ethernet interface of each industrial camera, the image division strategy, the first type of protocol, the second type of protocol and the first type of protocol channel, so that the virtual channel can receive Ethernet data packets through the Ethernet interface for parsing, and after obtaining the image to be transmitted, the image to be transmitted is divided into the first type of transmission image and the second type of transmission image according to the image division strategy, the first type of transmission image is protocol packaged by the first type of protocol, and after obtaining the first type of protocol package, it is transmitted to the image processing terminal through the first type of protocol channel, and the second type of transmission image is protocol packaged by the second type of protocol, and after obtaining the second type of protocol package, it is transmitted to the image processing terminal through the second type of protocol channel.
[0091] Optionally, the image to be transmitted is divided into a first category of transmission images and a second category of transmission images according to the image division strategy in the virtual channel, including: extracting an image of interest within a region of interest and an image of non-interest outside the region of interest from the image to be transmitted, and determining a processing cost of the image of interest; calculating an incremental image between the image of interest and an image of interest in a previous frame, and determining the processing cost of the incremental image; calculating a cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image; if the cost increment is greater than a preset cost increment threshold, determining the incremental image as a first category of transmission image, and determining the image to be transmitted as a second category of transmission image; if the cost increment is less than a preset cost increment threshold, determining the image of interest as a first category of transmission image, and determining the image of non-interest as a second category of transmission image.
[0092] In an embodiment of the present invention, after obtaining the image to be transmitted, the region of interest is drawn in the image to be transmitted using the coordinates of the region of interest, the image in the region of interest is extracted to obtain the image of interest, the image outside the region of interest is extracted to obtain the image of no interest, or the region of interest in the image to be transmitted can be intercepted to obtain the image of interest, and the remaining image after interception is used as the image of no interest.
[0093] In FPGA, the last frame of interest image of each virtual channel can be stored in the on-chip memory, and the interest image of the current frame is subtracted from the interest image of the last frame to obtain an incremental image.
[0094] The above processing cost is related to the pixel area and the richness of content details of the image. Under the same hardware and software, the larger the pixel area and the richer the content details, the greater the processing cost. The above processing cost may include packaging cost, transmission cost, parsing cost and image processing cost. The processing cost of the image of interest and the incremental image can be calculated. If the processing cost of the image of interest is higher than that of the incremental image by a preset cost threshold, the incremental image can be used as the first type of transmission image. If the processing cost of the image of interest is not higher than that of the incremental image by a preset cost threshold, the image of interest can be used as the first type of transmission image.
[0095] Specifically, the processing cost of the incremental image can be subtracted from the processing cost of the image of interest to obtain the cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image. When the cost increment is greater than the preset cost increment threshold, it means that the processing cost of the image of interest is higher than that of the incremental image, and the processing cost of the incremental image is relatively low. The incremental image can be used as the first type of transmission image. At this time, the complete image to be transmitted needs to be used as the second type of transmission image to ensure the integrity and accuracy of the aggregation result of the image processing terminal. When the cost increment is less than or equal to the preset cost increment threshold, it means that the processing cost of the image of interest is not high relative to the processing cost of the incremental image. The image of interest can be used as the first type of transmission image. At this time, the non-interested image can be used as the second type of transmission image to ensure the integrity and accuracy of the aggregation result of the image processing terminal.
[0096] Optionally, determining the processing cost of the image of interest includes: determining the packaging cost of the image of interest according to the first type of protocol type, determining the transmission cost of the first type of protocol package corresponding to the image of interest according to the first type of protocol channel, and determining the parsing cost of the first type of protocol package corresponding to the image of interest according to the image processing terminal and the first type of protocol type; determining the processing cost of the image of interest based on the packaging cost, transmission cost and parsing cost of the image of interest.
[0097] In an embodiment of the present invention, the above-mentioned packaging cost is related to the first-category protocol type, FPGA hardware performance, pixel area of the image of interest, and the richness of content details. For a virtual channel, the above-mentioned first-category protocol type, FPGA hardware performance, and pixel area of the image of interest are fixed. The richness of the above-mentioned content details is related to the number of zero-value pixels in the image of interest. The more zero-value pixels there are, the lower the packaging cost is, and the smaller the first-category protocol packet is obtained. The above-mentioned transmission cost is related to the data volume of the first-category protocol packet after the image of interest is packaged and the first-category protocol type. Under the determined first-category protocol type, the smaller the pixel area of the image of interest and the lower the richness of the content details, the smaller the data volume of the first-category protocol packet is, and the corresponding transmission cost is smaller. The parsing cost is related to the unpacking cost and image processing cost of the first type of protocol packet, wherein the unpacking cost corresponds to the packing cost. For the first type of protocol packet, the unpacking cost of the hardware of the image processing terminal is related to the size of the first type of protocol packet and the hardware performance of the image processing terminal. When the hardware performance of the image processing terminal is determined, the smaller the first type of protocol packet, the smaller the unpacking cost, and the larger the first type of protocol packet, the larger the unpacking cost. The image processing cost is related to the pixel area and content detail richness of the unpacked image of interest. The smaller the pixel area of the image of interest and the lower the content detail richness, the lower the processing cost.
[0098] The packaging cost coefficient corresponding to the first-class protocol type, FPGA hardware performance, and pixel area of the image of interest can be calculated in advance, and the packaging cost coefficient and the richness of content details of the image of interest are calculated to obtain the packaging cost of the image of interest. The transmission cost coefficients under different first-class protocol types are calculated in advance, and the transmission cost coefficient and the data volume of the first-class protocol package are calculated to obtain the transmission cost of the image of interest. The hardware performance of the image processing terminal and the unpacking cost coefficient corresponding to the first-class protocol type are calculated in advance, and the unpacking cost coefficient and the data volume of the first-class protocol package are calculated to obtain the unpacking cost of the image of interest. The image processing cost coefficient corresponding to the hardware performance of the image processing terminal and the image processing algorithm type is calculated in advance, and the image processing cost coefficient and the pixel area and the richness of content details of the image of interest are calculated to obtain the image processing cost of the image of interest.
[0099] The processing cost of the image of interest is obtained by adding the packaging cost of the image of interest, the transmission cost of the image of interest, the unpacking cost of the image of interest, and the image processing cost of the image of interest. Specifically, the processing cost of the image of interest can be calculated by the following formula:
[0100] totalcost1=c1+c2+γ1c3+c4
[0101]
[0102] Among them, the above totalcost1 is the image processing cost of the image of interest, c1 is the packaging cost of the image of interest, c2 is the transmission cost of the image of interest, c3 is the unpacking cost of the image of interest, c4 is the image processing cost of the image of interest, γ1 is the channel abnormality probability when the first type of protocol channel transmits the image of interest, and the above channel abnormality probability is related to the historical packet loss rate δ1, the minimum bandwidth port(min)1, and the maximum bandwidth port(max)1 of the first type of protocol channel to transmit the image of interest. It can be seen that the channel abnormality probability γ1 of the first type of protocol channel to transmit the image of interest is positively correlated with the historical packet loss rate δ1 of the first type of protocol channel to transmit the image of interest, and is negatively correlated with the minimum bandwidth port(min)1 and the maximum bandwidth port(max)1 of the first type of protocol channel to transmit the image of interest. The larger the channel abnormality probability, the higher the transmission cost of the image of interest.
[0103] Optionally, the calculation of the incremental image between the image of interest and the previous frame of image of interest, and determining the processing cost of the incremental image, include: calculating the image difference between the image of interest and the previous frame of image of interest, to obtain the incremental image between the image of interest and the previous frame of image of interest; determining the packing cost of the incremental image according to the first type of protocol type, determining the transmission cost of the incremental image corresponding to the first type of protocol package according to the first type of protocol channel, determining the parsing cost of the incremental image corresponding to the first type of protocol package according to the image processing terminal and the first type of protocol type, and determining the read and write cost of the previous frame of image of interest at the image processing terminal; determining the processing cost of the incremental image according to the packing cost, transmission cost, parsing cost, and read and write cost of the incremental image.
[0104] In an embodiment of the present invention, the image of interest is subtracted from the image of interest of the previous frame, and the image difference between the image of interest and the image of interest of the previous frame is obtained as the incremental image between the image of interest and the image of interest of the previous frame. The above-mentioned packaging cost is related to the first-class protocol type, FPGA hardware performance, pixel area of the incremental image and the richness of content details. For a virtual channel, the above-mentioned first-class protocol type, FPGA hardware performance, and pixel area of the incremental image are fixed. The richness of the above-mentioned content details is related to the number of zero-value pixels in the incremental image. The more zero-value pixels there are, the lower the packaging cost is, and the smaller the first-class protocol packet is obtained. The above-mentioned transmission cost is related to the size of the first-class protocol packet after the incremental image is packaged and the first-class protocol type. Under the determined first-class protocol type, the smaller the pixel area of the incremental image and the lower the richness of the content details, the smaller the first-class protocol packet is, and the corresponding transmission cost is smaller. The parsing cost is related to the unpacking cost and image processing cost of the first type of protocol packet, wherein the unpacking cost corresponds to the packing cost. For the first type of protocol packet, the unpacking cost of the hardware of the image processing terminal is related to the size of the first type of protocol packet and the hardware performance of the image processing terminal. When the hardware performance of the image processing terminal is determined, the smaller the first type of protocol packet, the smaller the unpacking cost, and the larger the first type of protocol packet, the larger the unpacking cost; the image processing cost is related to the pixel area and content detail richness of the unpacked incremental image. The smaller the pixel area of the incremental image and the lower the content detail richness, the lower the processing cost. Furthermore, the image processing cost also includes the reading cost of the previous frame of interest image in the image processing terminal and the addition cost of the previous frame of interest image and the incremental image. In the image processing terminal, the previous frame of interest image is read and added to the incremental image to obtain the current frame of interest image.
[0105] The packaging cost coefficient corresponding to the first-class protocol type, FPGA hardware performance, and pixel area of the incremental image can be calculated in advance, and the packaging cost coefficient and the content detail richness of the incremental image are calculated to obtain the packaging cost of the incremental image. The transmission cost coefficients under different first-class protocol types are calculated in advance, and the transmission cost coefficient and the data volume of the first-class protocol package are calculated to obtain the transmission cost of the incremental image. The unpacking cost coefficient corresponding to the hardware performance of the image processing terminal and the first-class protocol type are calculated in advance, and the unpacking cost coefficient and the data volume of the first-class protocol package are calculated to obtain the unpacking cost of the incremental image. The image processing cost coefficient corresponding to the hardware performance of the image processing terminal and the image processing algorithm type is calculated in advance, and the image processing cost coefficient and the pixel area and content detail richness of the incremental image are calculated to obtain the image processing cost of the incremental image. The reading cost coefficient corresponding to the hardware performance and I / O performance of the image processing terminal can be calculated in advance, and the reading cost coefficient and the data reading volume of the previous frame of interest image are calculated to obtain the reading cost of the previous frame of interest image. The addition cost coefficient corresponding to the hardware performance of the image processing terminal can be calculated in advance, the addition calculation amount of the incremental image can be determined according to the non-zero value in the incremental image, and the addition cost coefficient and the addition calculation amount of the incremental image can be coefficient-calculated to obtain the addition cost of the incremental image.
[0106] The processing cost of the incremental image is obtained by adding the packaging cost of the incremental image, the transmission cost of the incremental image, the unpacking cost of the incremental image, and the image processing cost of the incremental image. Specifically, the processing cost of the incremental image can be calculated by the following formula:
[0107] totalcost2=c5+c6+γ2c7+c8
[0108]
[0109] Among them, the above totalcost2 is the image processing cost of the incremental image, c5 is the packaging cost of the incremental image, c6 is the transmission cost of the incremental image, c7 is the unpacking cost of the incremental image, c8 is the image processing cost of the incremental image, γ2 is the channel abnormality probability of the incremental image transmitted by the first type of protocol channel, and the above channel abnormality probability is negatively correlated with the historical packet loss rate δ2, the minimum bandwidth port (min) 2, and the maximum bandwidth port (max) 2 of the incremental image transmitted by the first type of protocol channel. It can be seen that the channel abnormality probability γ2 of the incremental image transmitted by the first type of protocol channel is positively correlated with the historical packet loss rate δ2, and is positively correlated with the minimum bandwidth port (min) 2 and the maximum bandwidth port (max) 2. The larger the channel abnormality probability γ2 of the incremental image transmitted by the first type of protocol channel is, the higher the transmission cost of the incremental image is.
[0110] After calculating the processing cost of the image of interest and the processing cost of the incremental image, the image of interest or the incremental image with a smaller processing cost can be determined as the first type of transmission image. When the image of interest is used as the first type of transmission image, the second type of transmission image is the non-interested image. When the incremental image is used as the first type of transmission image, the entire image to be transmitted is the non-interested image. This facilitates the image processing terminal to perform image aggregation processing in the later stage.
[0111] The embodiment of the present invention takes into account the processing costs of the image of interest and the incremental image, and can select the corresponding image for the first type of transmission with a smaller processing cost, thereby reducing the overall cost of the data transmission system and improving the overall operating efficiency of the data transmission system.
[0112] It should be noted that the image data transmission method provided in the embodiment of the present invention can be applied to devices such as integrated boards, computers, servers, etc. that can perform image data transmission.
[0113] like Figure 3 As shown, Figure 3 : is a method flow chart of an image processing method provided by an embodiment of the present invention. The image processing method comprises the steps of:
[0114] 301. Receive a first-type protocol packet and a second-type protocol packet.
[0115] In an embodiment of the present invention, the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal by using any image data transmission method in the embodiment of the present invention;
[0116] 302. Parse the first type of protocol packet to obtain a first type of transmission image, and perform image processing on the first type of transmission image to obtain a first image processing result.
[0117] In the embodiment of the present invention, after the first type of transmission image is obtained, the first type of transmission image can be directly processed by a corresponding image processing algorithm to obtain a first image processing result.
[0118] Furthermore, if the first type of transmitted image is an image of interest, the first type of transmitted image can be directly processed by a corresponding image processing algorithm to obtain a first image processing result. If the first type of transmitted image is an incremental image, the previous frame of the image of interest is read from the Mem address space, the previous frame of the image of interest is added to the incremental image to obtain the image of interest of the current frame, and the image of interest of the current frame is directly processed by a corresponding image processing algorithm to obtain the first image processing result. The image of interest of the current frame will be stored in the Mem address space.
[0119] 303. Parse the second type of protocol packet to obtain a second type of transmission image, aggregate the first type of transmission image, the second type of transmission image, and the first image processing result to obtain a second image processing result.
[0120] In the embodiment of the present invention, since it takes time to process the first type of transmission image, the image processing terminal will wait for the transmission of the second type of protocol packet while processing the image. After receiving the second type of protocol packet, the second type of protocol packet is unpacked. If the first type of transmission image is an image of interest, the second type of transmission image is an image of no interest. After unpacking to obtain the image of no interest, the image of no interest and the image of interest are spliced to obtain a complete image, and the first image processing result is added to the complete image to obtain a second image result. If the first type of transmission image is an incremental image, the second type of transmission image is an image to be transmitted. After unpacking to obtain the image to be transmitted, the first image processing result is added to the image to be transmitted to obtain a second image result.
[0121] The embodiment of the present invention parses the Ethernet data packets of the industrial camera into images to be transmitted through a virtual channel, and divides the images to be transmitted into a first type of transmission images and a second type of transmission images, packages the first type of transmission images into a first type of protocol packets and packages the second type of transmission images into a second type of protocol packets, transmits the first type of protocol packets through a first type of protocol channel, and transmits the second type of protocol packets through a second type of protocol channel. Since the first type of protocol packets are first transmitted to the image processing terminal, the image processing terminal parses and processes the first type of protocol packets and synchronously waits for the reception and parsing of the second type of protocol packets during the image processing process, the bandwidth requirement of the first type of protocol channel can be reduced, thereby reducing the cost and power consumption during the image transmission process.
[0122] It should be noted that the image processing method provided by the embodiment of the present invention can be applied to image processing boards that can perform image processing, industrial computers dedicated to image and automatic control, industrial smart cameras, image or visual edge computing processing equipment, etc.
[0123] like Figure 4 As shown, an embodiment of the present invention provides an image data transmission device, the image data transmission device comprising:
[0124] A construction module 401 is used to construct virtual channels corresponding to multiple industrial cameras, at least one of the virtual channels communicates with one of the industrial cameras via Ethernet;
[0125] A first parsing module 402 is used to receive an Ethernet data packet corresponding to the industrial camera based on the virtual channel, and parse the Ethernet data packet to obtain an image to be transmitted corresponding to the industrial camera;
[0126] The packaging module 403 is used to divide the to-be-transmitted images into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and to package the first type of transmission images into a first type of protocol package through a first type of protocol, and to package the second type of transmission images into a second type of protocol package through a second type of protocol, wherein the first type of protocol package and the second type of protocol package are associated through a unique identifier, and the second type of transmission images are images corresponding to the image processing algorithm in the image processing terminal;
[0127] The transmission module 404 is used to transmit the first-type protocol packet to the image processing terminal through the first-type protocol channel preconfigured in the virtual channel, and to transmit the second-type protocol packet to the image processing terminal through the second-type protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first-type protocol packet and the second-type protocol packet.
[0128] Optionally, the construction module 401 is also used to obtain the area of interest of each industrial camera and the type of image processing algorithm of the image processing terminal for each industrial camera; determine the image division strategy, the first type of protocol type, the second type of protocol type, the first type of protocol channel and the second type of protocol channel corresponding to each industrial camera according to the area of interest and the image processing algorithm type, the first type of protocol channel corresponds to the first type of protocol type, and the second type of protocol channel corresponds to the second type of protocol type; based on the Ethernet interface of each industrial camera, the image division strategy, the first type of protocol type, the second type of protocol type and the first type of protocol channel, a corresponding virtual channel is constructed for each industrial camera.
[0129] Optionally, the first parsing module 402 is also used to extract an image of interest within the region of interest and an image of non-interest outside the region of interest from the image to be transmitted, and determine the processing cost of the image of interest; calculate an incremental image between the image of interest and the image of interest in the previous frame, and determine the processing cost of the incremental image; calculate a cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image; if the cost increment is greater than a preset cost increment threshold, determine the incremental image as a first type of transmission image, and determine the image to be transmitted as a second type of transmission image; if the cost increment is less than a preset cost increment threshold, determine the image of interest as a first type of transmission image, and determine the image of non-interest as a second type of transmission image.
[0130] Optionally, the first parsing module 402 is also used to determine the packaging cost of the image of interest according to the first type of protocol type, determine the transmission cost of the first type of protocol package corresponding to the image of interest according to the first type of protocol channel, and determine the parsing cost of the first type of protocol package corresponding to the image of interest according to the image processing terminal and the first type of protocol type; determine the processing cost of the image of interest based on the packaging cost, transmission cost and parsing cost of the image of interest.
[0131] Optionally, the first parsing module 402 is also used to calculate the image difference between the image of interest and the previous frame of image of interest to obtain an incremental image between the image of interest and the previous frame of image of interest; determine the packaging cost of the incremental image according to the first type of protocol type, determine the transmission cost of the incremental image corresponding to the first type of protocol package according to the first type of protocol channel, determine the parsing cost of the incremental image corresponding to the first type of protocol package according to the image processing terminal and the first type of protocol type, and determine the reading and writing cost of the previous frame of image of interest at the image processing terminal; determine the processing cost of the incremental image based on the packaging cost, transmission cost, parsing cost and reading and writing cost of the incremental image.
[0132] It should be noted that the image data transmission device provided in the embodiment of the present invention can be applied to image processing boards that can perform image data transmission, industrial computers dedicated to image and automatic control, industrial smart cameras, image or visual edge computing processing equipment, etc.
[0133] The image data transmission device provided in the embodiment of the present invention can implement each process implemented by the image data transmission method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0134] like Figure 5 As shown, an embodiment of the present invention provides an image processing terminal, the image processing terminal comprising:
[0135] A receiving module 501 is used to receive a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal through any image data transmission method in the embodiments of the present invention;
[0136] A second parsing module 502 is used to parse the first type of protocol packets to obtain a first type of transmission image, and perform image processing on the first type of transmission image to obtain a first image processing result;
[0137] The third parsing module 503 is used to parse the second-type protocol packet to obtain a second-type transmission image, and aggregate the first-type transmission image, the second-type transmission image and the first image processing result to obtain a second image processing result.
[0138] It should be noted that the image data transmission device provided in the embodiment of the present invention can be applied to image processing boards that can perform image data transmission, industrial computers dedicated to image and automatic control, industrial smart cameras, image or visual edge computing processing equipment, etc.
[0139] The image processing terminal provided in the embodiment of the present invention can implement each process implemented by the image processing method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0140] See also Figure 6 , Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 6 As shown, it includes: a memory 602, a processor 601, and a computer program of an image data transmission method or a computer program of an image processing method stored in the memory 602 and executable on the processor 601, wherein:
[0141] The processor 601 is used to call the computer program of the image data transmission method stored in the memory 602 and execute the following steps:
[0142] Constructing virtual channels corresponding to multiple industrial cameras, at least one virtual channel communicates with one of the industrial cameras via Ethernet;
[0143] Receiving an Ethernet data packet transmitted by the industrial camera based on the virtual channel, and parsing the Ethernet data packet to obtain an image to be transmitted by the industrial camera;
[0144] The images to be transmitted are divided into a first type of transmission image and a second type of transmission image according to the image division strategy in the virtual channel, and the first type of transmission image is packaged into a first type of protocol package through a first type of protocol, and the second type of transmission image is packaged into a second type of protocol package through a second type of protocol, the first type of protocol package and the second type of protocol package are associated through a unique identifier, and the second type of transmission image is an image corresponding to the image processing algorithm in the image processing terminal;
[0145] The first type of protocol packet is transmitted to the image processing terminal through the first type of protocol channel preconfigured in the virtual channel, and the second type of protocol packet is transmitted to the image processing terminal through the second type of protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packet and the second type of protocol packet.
[0146] Optionally, the step of constructing virtual channels corresponding to the multiple industrial cameras executed by the processor 601 includes:
[0147] Obtain the region of interest of each industrial camera and the image processing algorithm type of the image processing terminal for each industrial camera;
[0148] Determine, according to the region of interest and the type of image processing algorithm, the image division strategy, the first type of protocol type, the second type of protocol type, the first type of protocol channel, and the second type of protocol channel corresponding to each of the industrial cameras, wherein the first type of protocol channel corresponds to the first type of protocol type, and the second type of protocol channel corresponds to the second type of protocol type;
[0149] Based on the Ethernet interface of each industrial camera, the image division strategy, the first protocol type, the second protocol type and the first protocol channel, a corresponding virtual channel is constructed for each industrial camera.
[0150] Optionally, the processor 601 performs the division of the to-be-transmitted images into first-category transmission images and second-category transmission images according to the image division strategy in the virtual channel, including:
[0151] Extracting an image of interest within a region of interest and an image of non-interest outside the region of interest from the image to be transmitted, and determining a processing cost of the image of interest;
[0152] Calculating an incremental image between the image of interest and a previous frame of the image of interest, and determining a processing cost of the incremental image;
[0153] Calculating a cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image;
[0154] If the cost increment is greater than a preset cost increment threshold, determining the incremental image as a first-category transmission image, and determining the image to be transmitted as a second-category transmission image;
[0155] If the cost increment is less than a preset cost increment threshold, the image of interest is determined as a first-category transmission image, and the image of no interest is determined as a second-category transmission image.
[0156] Optionally, the determining of the processing cost of the image of interest performed by the processor 601 includes:
[0157] Determine the packaging cost of the image of interest according to the first type of protocol type, determine the transmission cost of the first type of protocol package corresponding to the image of interest according to the first type of protocol channel, and determine the parsing cost of the first type of protocol package corresponding to the image of interest according to the image processing terminal and the first type of protocol type;
[0158] A processing cost of the image of interest is determined according to the packaging cost, the transmission cost, and the parsing cost of the image of interest.
[0159] Optionally, the calculating of the incremental image between the image of interest and the previous frame of the image of interest and determining the processing cost of the incremental image performed by the processor 601 includes:
[0160] Calculating an image difference between the image of interest and a previous frame of the image of interest to obtain an incremental image between the image of interest and the previous frame of the image of interest;
[0161] Determine the packaging cost of the incremental image according to the first type of protocol type, determine the transmission cost of the incremental image corresponding to the first type of protocol package according to the first type of protocol channel, determine the parsing cost of the incremental image corresponding to the first type of protocol package according to the image processing terminal and the first type of protocol type, and determine the reading and writing cost of the previous frame of the image of interest at the image processing terminal;
[0162] The processing cost of the incremental image is determined according to the packaging cost, the transmission cost, the parsing cost, and the reading and writing cost of the incremental image.
[0163] It should be noted that the electronic device provided by the embodiment of the present invention can be applied to image processing boards that can perform image data transmission methods, industrial computers dedicated to image and automatic control, industrial smart cameras, image or visual edge computing processing equipment, etc.
[0164] The processor 601 is used to call the computer program of the image processing method stored in the memory 602 and perform the following steps:
[0165] receiving a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal by using the image data transmission method described in any one of the embodiments of the present invention;
[0166] Parsing the first type of protocol packets to obtain a first type of transmission image, and performing image processing on the first type of transmission image to obtain a first image processing result;
[0167] The second type of protocol packet is parsed to obtain a second type of transmission image, and the first type of transmission image, the second type of transmission image and the first image processing result are aggregated to obtain a second image processing result.
[0168] It should be noted that the electronic device provided by the embodiment of the present invention can be applied to image processing boards that can perform image processing methods, industrial computers dedicated to image and automatic control, industrial smart cameras, image or visual edge computing processing equipment, etc.
[0169] The electronic device provided by the embodiment of the present invention can implement each process implemented by the image data transmission method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0170] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). Alternatively, all or part of the processes in the above-mentioned embodiment method can be implemented by a logic circuit, which can be a logic circuit in an FPGA.
[0171] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for transmitting image data, characterized in that: Applied to an image data transmission device, the image data transmission method comprises the following steps: Constructing virtual channels corresponding to multiple industrial cameras, at least one of the virtual channels communicates with one of the industrial cameras via Ethernet; Receiving an Ethernet data packet transmitted by the industrial camera based on the virtual channel, and parsing the Ethernet data packet to obtain an image to be transmitted by the industrial camera; The images to be transmitted are divided into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and the first type of transmission images are packaged into a first type of protocol package through a first type of protocol, and the second type of transmission images are packaged into a second type of protocol package through a second type of protocol, the first type of protocol package and the second type of protocol package are associated through a unique identifier, the first type of transmission image is an image corresponding to an image processing algorithm in an image processing terminal; the first type of transmission image is a key frame or an area of interest, and the second type of transmission image is a non-key frame or an area of non-interest; the transmission data volume of the first type of protocol package is less than the transmission data volume of the second type of protocol package; The first type of protocol packet is transmitted to the image processing terminal through the first type of protocol channel preconfigured in the virtual channel, and the second type of protocol packet is transmitted to the image processing terminal through the second type of protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first type of protocol packet and the second type of protocol packet; the first type of protocol packet is first transmitted to the image processing terminal, and the image processing terminal parses and processes the first type of protocol packet, and synchronously waits for the reception and parsing of the second type of protocol packet during the image processing process.
2. The image data transmission method according to claim 1, characterized in that: The step of constructing virtual channels corresponding to multiple industrial cameras includes: Obtain the region of interest of each industrial camera and the image processing algorithm type of the image processing terminal for each industrial camera; Determine, according to the region of interest and the type of image processing algorithm, the image division strategy, the first type of protocol type, the second type of protocol type, the first type of protocol channel, and the second type of protocol channel corresponding to each of the industrial cameras, wherein the first type of protocol channel corresponds to the first type of protocol type, and the second type of protocol channel corresponds to the second type of protocol type; Based on the Ethernet interface of each industrial camera, the image division strategy, the first protocol type, the second protocol type and the first protocol channel, a corresponding virtual channel is constructed for each industrial camera.
3. The image data transmission method according to claim 2, characterized in that: The step of dividing the to-be-transmitted images into first-category transmission images and second-category transmission images according to the image division strategy in the virtual channel comprises: Extracting an image of interest within the region of interest and an image of non-interest outside the region of interest from the image to be transmitted, and determining a processing cost of the image of interest; Calculating an incremental image between the image of interest and a previous frame of the image of interest, and determining a processing cost of the incremental image; Calculating a cost increment of the processing cost of the image of interest relative to the processing cost of the incremental image; If the cost increment is greater than a preset cost increment threshold, determining the incremental image as a first-category transmission image, and determining the image to be transmitted as a second-category transmission image; If the cost increment is less than a preset cost increment threshold, the image of interest is determined as a first-category transmission image, and the image of no interest is determined as a second-category transmission image.
4. The image data transmission method according to claim 3, characterized in that: The determining the processing cost of the image of interest comprises: Determine the packaging cost of the image of interest according to the first type of protocol type, determine the transmission cost of the first type of protocol package corresponding to the image of interest according to the first type of protocol channel, and determine the parsing cost of the first type of protocol package corresponding to the image of interest according to the image processing terminal and the first type of protocol type; A processing cost of the image of interest is determined according to the packaging cost, the transmission cost, and the parsing cost of the image of interest.
5. The image data transmission method according to claim 3, characterized in that: The calculating the incremental image between the image of interest and the previous frame of the image of interest, and determining the processing cost of the incremental image, includes: Calculating an image difference between the image of interest and a previous frame of the image of interest to obtain an incremental image between the image of interest and the previous frame of the image of interest; Determine the packaging cost of the incremental image according to the first type of protocol type, determine the transmission cost of the incremental image corresponding to the first type of protocol package according to the first type of protocol channel, determine the parsing cost of the incremental image corresponding to the first type of protocol package according to the image processing terminal and the first type of protocol type, and determine the reading and writing cost of the previous frame of the image of interest at the image processing terminal; The processing cost of the incremental image is determined according to the packaging cost, the transmission cost, the parsing cost, and the reading and writing cost of the incremental image.
6. An image processing method, characterized in that: Used in an image processing terminal, the image processing method comprises the following steps: receiving a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal through the image data transmission method according to any one of claims 1 to 5; Parsing the first type of protocol packets to obtain a first type of transmission image, and performing image processing on the first type of transmission image to obtain a first image processing result; The second type of protocol packet is parsed to obtain a second type of transmission image, and the first type of transmission image, the second type of transmission image and the first image processing result are aggregated to obtain a second image processing result.
7. An image data transmission device, characterized in that: The image data transmission device comprises: A construction module, used to construct virtual channels corresponding to multiple industrial cameras, at least one of the virtual channels communicates with one of the industrial cameras via Ethernet; A first parsing module, configured to receive an Ethernet data packet corresponding to the industrial camera based on the virtual channel, and parse the Ethernet data packet to obtain an image to be transmitted corresponding to the industrial camera; A packaging module, used for dividing the to-be-transmitted images into a first type of transmission images and a second type of transmission images according to the image division strategy in the virtual channel, and packaging the first type of transmission images into a first type of protocol package through a first type of protocol, and packaging the second type of transmission images into a second type of protocol package through a second type of protocol, wherein the first type of protocol package and the second type of protocol package are associated through a unique identifier, the first type of transmission images are images corresponding to the image processing algorithm in the image processing terminal; the first type of transmission images are key frames or regions of interest, and the second type of transmission images are non-key frames or regions of non-interest; the transmission data volume of the first type of protocol package is less than the transmission data volume of the second type of protocol package; A transmission module is used to transmit the first-type protocol packet to the image processing terminal through the first-type protocol channel preconfigured in the virtual channel, and to transmit the second-type protocol packet to the image processing terminal through the second-type protocol channel preconfigured in the virtual channel, so that the image processing terminal performs image processing after respectively parsing the first-type protocol packet and the second-type protocol packet; the first-type protocol packet is first transmitted to the image processing terminal, and the image processing terminal parses and processes the first-type protocol packet, and synchronously waits for the reception and parsing of the second-type protocol packet during the image processing process.
8. An image processing terminal, characterized in that: The image processing terminal comprises: A receiving module, configured to receive a first type of protocol packet and a second type of protocol packet, wherein the first type of protocol packet and the second type of protocol packet are transmitted to the image processing terminal through the image data transmission method according to any one of claims 1 to 5; A second parsing module is used to parse the first type of protocol packets to obtain a first type of transmission image, and perform image processing on the first type of transmission image to obtain a first image processing result; The third parsing module is used to parse the second type of protocol packet to obtain a second type of transmission image, and aggregate the first type of transmission image, the second type of transmission image and the first image processing result to obtain a second image processing result.
9. An image data transmission system, characterized in that: The image data transmission system comprises: a plurality of industrial cameras, an image data transmission device and an image processing terminal, wherein the plurality of industrial cameras are communicatively connected to the image data transmission device via Ethernet, and the image data transmission device is communicatively connected to the image processing terminal via a first type protocol channel and a second type protocol channel; Wherein, the image data transmission device is used to perform the image data transmission method according to any one of claims 1 to 5; The image processing terminal is used to execute the image processing method as claimed in claim 6.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image data transmission method as described in any one of claims 1 to 5 when executing the computer program, or implements the steps of the image processing method as described in claim 6 when executing the computer program.
