Image transmission method, image data analysis method, and related devices
By splitting and reassembling the pixel data of the depth camera into multiple data packets for transmission, the problems of bandwidth consumption and frame loss in depth camera image transmission are solved, achieving efficient image data transmission and integrity assurance.
Patent Information
- Application Number
- CN202211447294.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-11-18
AI Technical Summary
In existing technologies, depth cameras use a 16-bit packetization method per pixel when transmitting speckle and depth images, resulting in a lot of invalid data, consuming bandwidth resources, and potentially causing image frame drops.
Each pixel data in the image is split into multiple sets of split data, and then reassembled into multiple reassembled data packets in units of at least one byte. These reassembled data packets are sent to the host, which then splits the reassembled data packets back into the original data.
This reduces bandwidth usage during image transmission, avoids image frame drops, and ensures image integrity and efficiency.
Smart Images

Figure CN115883745B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of depth cameras, and in particular to an image transmission method, an image data analysis method and related devices. BACKGROUND
[0002] The UVC (USB Video Class) protocol is a standard USB universal protocol, which can be used to implement image transmission from a camera to a host. At present, in order to facilitate data image processing, when transmitting speckle images and depth images, the depth camera packs each pixel in the speckle image and the depth image according to 16 bits, that is, the pixel is sent from the device end to the host end in units of 16 bits. Although the effective bits of the pixels in the speckle image and the depth image are 14 bits, 12 bits or 10 bits, they are actually packed and sent according to 16 bits, for example, 14 bits need to be supplemented with two empty data to become 16 bits before transmission. However, such a packing method is prone to generate a large amount of invalid data (i.e. empty data), which will occupy bandwidth resources, and in the case of bandwidth shortage, image frame loss may occur. SUMMARY
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an image transmission method, an image data analysis method and related devices, which can reduce the bandwidth resources occupied by image data transmission and avoid image frame loss.
[0004] In a first aspect, the present application provides an image transmission method applied to a depth camera, the image being a depth image or a speckle image, the image transmission method comprising: splitting each pixel data in the image into a plurality of groups of split data; recombining the plurality of groups of split data in units of at least one byte to obtain a plurality of recombined data packets, the number of recombined data packets being less than the number of groups of split data; and sending the plurality of recombined data packets to a host.
[0005] In some embodiments, splitting each pixel data in the image into a plurality of split data includes: obtaining a pixel format of the image, and determining a pixel bit number of pixels in the image according to the pixel format; configuring a split rule of each pixel data based on the pixel bit number; and splitting each pixel data according to the split rule to obtain the plurality of split data. In some embodiments, recombining the plurality of split data in at least one byte to obtain a plurality of recombination data packets includes: determining a combination relationship between the plurality of split data according to a bit number of each split data and a length of the recombination data packet; and recombining the plurality of split data according to the combination relationship to obtain the plurality of recombination data packets. In some embodiments, when the plurality of split data is recombined, if the last split data has no combination object and the bit number is less than one byte, a zero padding operation is performed on the last split data to obtain a recombination data packet, so that the length of each recombination data packet is at least one byte.
[0006] In a second aspect, the present application provides an image data parsing method applied to a host, which includes: receiving a plurality of data packets sent by a depth camera, and the length of each data packet is at least one byte; splitting the plurality of data packets into a plurality of split data, and the number of split data groups is greater than the number of data packets; and restoring and combining the plurality of split data to obtain original data of each pixel of the image.
[0007] In some embodiments, splitting the plurality of data packets into a plurality of split data includes: obtaining a device descriptor of the depth camera; determining a pixel format corresponding to the image according to the device descriptor, and determining a bit number of pixels in the image according to the pixel format; determining a packet combination rule when recombining the recombination data packet according to the bit number of the pixels; and splitting at least part of the recombination data packet according to the packet combination rule to obtain the plurality of split data. In some embodiments, restoring and combining the plurality of split data to obtain original data of each pixel of the image includes: determining a pixel corresponding to each split data; and restoring and combining the split data corresponding to each pixel to obtain the original data of each pixel.
[0008] In a third aspect, the present application provides an image transmission system including a depth camera and a host, and the depth camera and the host communicate through a UVC protocol. The depth camera is configured to: split each pixel data of a depth image or a speckle image into a plurality of split data; recombine the plurality of split data in at least one byte to obtain a plurality of recombination data packets, and the number of recombination data packets is less than the number of split data groups; and send the plurality of recombination data packets to the host. The host is configured to: receive the plurality of recombination data packets sent by the depth camera, and the length of each recombination data packet is at least one byte; split the plurality of recombination data packets into a plurality of split data, and the number of split data groups is greater than the number of recombination data packets.
[0009] In a fourth aspect, the present application provides an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program which can be executed by the at least one processor, so that the at least one processor can execute the image transmission method of the first aspect or the image data analysis method of the second aspect.
[0010] In a fifth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the image transmission method of the first aspect or the image data analysis method of the second aspect.
[0011] In the embodiment of the present application, the depth camera splits the pixel data of the depth image or the speckle image, recombines the split data according to a fixed byte, and then transmits the recombined data to the host, instead of directly filling the empty data, so as to avoid transmitting more invalid data in the process of transmitting the image to the host, effectively reduce the bandwidth resources occupied by the depth image or the speckle image in the transmission process, and avoid the situation of image frame loss. When the host receives the multiple groups of recombined data packets transmitted by the depth camera, the original data of each pixel of the speckle image or the depth image is obtained by splitting the multiple groups of recombined data packets and restoring the combination, so as to ensure the integrity of the speckle image or the depth image. BRIEF DESCRIPTION OF DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0014] Figure 1 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in the figure.
[0015] Figure 2 An interaction schematic diagram of an image transmission system provided by an embodiment of the present application is shown in the figure.
[0016] Figure 3 A scene schematic diagram of an image transmission method provided by an embodiment of the present application is shown in the figure.
[0017] Figure 4 A module schematic diagram of an image transmission device provided by an embodiment of the present application is shown in the figure.
[0018] Figure 5A module schematic diagram of the image data analysis device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts are within the scope of the present application.
[0020] Referring to Figure 1 An electronic device 1 provided by an embodiment of the present application includes a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and can further include a computer program stored in the memory 11 and executable on the processor 10. In one embodiment, the electronic device 1 is a depth camera configured to acquire a speckle image or a depth image, the memory 11 can store an image transmission program, and the processor 10 can implement an embodiment of an image transmission method when executing the image transmission program to transmit the speckle image or the depth image to a host. In another example, the electronic device 1 is a host configured to process the speckle image or the depth image, the memory 11 can store an image data analysis program, and the processor 10 can implement an embodiment of an image analysis method when executing the image analysis program to analyze data transmitted by the depth camera to obtain the depth image or the speckle image.
[0021] In some embodiments, the processor 10 can be composed of integrated circuits, for example, composed of a single packaged integrated circuit, or composed of multiple packaged integrated circuits with the same function or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors and various control chips. The processor 10 is the control unit of the electronic device, which connects various components of the electronic device through various interfaces and lines, executes programs or modules stored in the memory 11 (such as executing an image transmission program, an image data analysis program, etc.), and calls data stored in the memory 11 to perform various functions and process data of the electronic device.
[0022] The storage 11 includes at least one type of readable storage medium, including a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., an SD or a DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The storage 11 can be an internal storage unit of the electronic device in some embodiments, such as a mobile hard disk of the electronic device. The storage 11 can also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. The storage 11 can include both the internal storage unit and the external storage device. The storage 11 can be used to store not only application software and various data installed on the electronic device, such as the code of the image transmission method and the image data analysis program, but also to temporarily store data that has been output or will be output.
[0023] The communication bus 12 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, an Inter-Integrated Circuit (IIC) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the storage 11 and the at least one processor 10, etc.
[0024] The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. The network interface can include a wired interface and / or a wireless interface. The user interface can be an interface connected to a display, an input unit such as a keyboard, a host computer, etc. The user interface can be a standard wired interface, a wireless interface, such as a USB interface, an HDMI interface, etc. Figure 1 The structure shown does not constitute a limitation on the electronic device 1, which can include fewer or more components than shown, or combine certain components, or arrange different components. For example, although not shown, the electronic device 1 can also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which are not described here in detail.
[0025] As Figure 2As shown, an embodiment of the present application provides an image transmission system, the image transmission system comprises a depth camera 100 and a host 200, the depth camera 100 and the host 200 are connected through a UVC protocol. Wherein, the depth camera 100 and the host 200 can be two independent electronic devices, or the depth camera 100 and the host 200 can also be two functional modules in an electronic device, and the host 200 can be a main processor (such as an algorithm board, a main control chip) or an upper computer (such as a mobile phone, a computer, a tablet computer, etc.). The depth camera 100 transmits a depth image or a speckle image to the host 200 through an embodiment of an image transmission method, and the host 200 receives the data transmitted by the depth camera 100 through a UVC protocol, and obtains the depth image or the speckle image by analyzing the data transmitted by the depth camera 100 through an embodiment of an image data analysis method.
[0026] Referring to Figure 2 As shown, an embodiment of the present application provides an image transmission method applied to the depth camera 100. Wherein, the image transmission method comprises steps 101 to 103.
[0027] Step 101, split each pixel data of an image into a plurality of split data groups.
[0028] Step 102, recombine the plurality of split data groups in at least one byte unit to obtain a plurality of recombined data packets, and the number of recombined data packets is less than the number of split data groups.
[0029] Step 103, send the plurality of recombined data packets to the host 200.
[0030] In an embodiment of the present application, the image can be understood as an image collected or processed by the depth camera 100 in an actual business scenario, such as a speckle image, a depth image, etc., and there are a plurality of pixels in the image, and each pixel has a corresponding pixel bit number (bit), such as 10 bits, 12 bits and 14 bits, etc. In this step, each pixel data in the image is split into a plurality of split data groups.
[0031] The image data is usually transmitted from the depth camera to the host in byte units, therefore, in this embodiment of the present application, the plurality of split data groups are recombined in at least one byte unit, and the recombination can be performed according to the bit number of each split data group, and then in the subsequent transmission process, the phenomenon of transmitting invalid data can be avoided, and the bandwidth resources occupied during data transmission are reduced. The number of recombined data packets after recombination is less than the number of split data groups, that is, some split data are combined into one recombined data packet, and the length of the plurality of data packets can be set based on different business requirements, for example, it can be set to one byte (8 bits), two bytes (16 bits) and three bytes (24 bits), etc., which is not limited here.
[0032] As an embodiment of the present application, step 101 comprises: obtaining a pixel format of the image, determining a pixel bit number of each pixel in the image according to the pixel format, configuring a splitting rule of each pixel data based on the pixel bit number, and splitting each pixel data according to the splitting rule of each pixel data to obtain a plurality of groups of split data.
[0033] The pixel format is also referred to as color sampling or chroma sampling, which is used to describe the format used for storing the pixel data in the image. The pixel bit number can be understood as a size used to represent the pixel data in the image, which is determined based on different pixel formats. For example, Y10 indicates that each pixel is 10 bits, Y12 indicates that each pixel is 12 bits, and Y14 indicates that each pixel is 14 bits. The splitting rule can be understood as a strategy used for splitting the image, such as splitting the pixel data in the image into two groups of data or three groups of data, and which data is a group. The splitting rules of some pixels are different, and the splitting rules of some pixels are the same, which can be determined according to the pixel format.
[0034] As an embodiment of the present application, step 102 comprises: determining a combination relationship between the plurality of groups of split data according to the bit number of each group of split data and the length of the recombined data packet, and recombining the plurality of groups of split data according to the combination relationship to obtain a plurality of recombined data packets.
[0035] The bit number refers to the computer memory occupied by the plurality of groups of split data when recombined, which corresponds to the recombined byte. For example, if the recombined byte is 1 byte, the recombined bit number is 8 bits. The combination relationship refers to the association relationship of the plurality of groups of split data when recombined, which is used to ensure the orderliness of the plurality of groups of split data when recombined. It should be noted that, in the present application, after the plurality of groups of split data are recombined, if the last group of split data has no combination object and the bit number is less than one byte, the last group of split data is subjected to a zero padding operation to obtain a recombined data packet, so that the lengths of the plurality of recombined data packets are all at least one byte.
[0036] For example, the bit number of each pixel in the image is m bits, 10≤m<16, and the recombined data packet is one byte (8 bits). The pixel data splitting and recombination processing can be implemented in the following manner one or manner two:
[0037] The first 8 bits in front of the first pixel are split into a first group of split data, and the last m-8 bits are split into a second group of data. The first n bits in the second pixel are split into a third group of split data, and the n+1 to n+8 bits in the second pixel are split into a fourth group of split data. If there is a remainder, the remaining m-n-8 bits are split into a fifth group of split data. The first s bits in the third pixel are split into a sixth group of split data, and the s+1 to s+8 bits are split into a seventh group of split data. If there is a remainder, the remaining m-s-8 bits are split into an eighth group of split data. In this way, each pixel data is split into two or three groups of split data from front to back, and a plurality of groups of split data are obtained, wherein n=16-m and s=32-2m. Then, the first group of split data is taken as a reorganized data packet, the second group of split data and the third group of split data are reorganized into a reorganized data packet, the fourth group of split data is taken as a reorganized data packet, the fifth group of split data and the sixth group of split data are taken as a reorganized data packet, and a plurality of groups of data packets are obtained in this way.
[0038] The last 8 bits in the first pixel are split into a first group of split data, and the first m-8 bits are split into a second group of data. The last n bits in the second pixel are split into a third group of split data, and the n+1 to n+8 bits in the second pixel are split into a fourth group of split data. If there is a remainder, the first m-n-8 bits are split into a fifth group of split data. The last s bits in the third pixel are split into a sixth group of split data, and the s+1 to s+8 bits are split into a seventh group of split data. If there is a remainder, the first m-s-8 bits are split into an eighth group of split data. In this way, each pixel data is split into two or three groups of split data from front to back, and a plurality of groups of split data are obtained, wherein n=16-m and s=32-2m. Then, the first group of split data is taken as a reorganized data packet, the second group of split data and the third group of split data are reorganized into a reorganized data packet, the fourth group of split data is taken as a reorganized data packet, the fifth group of split data and the sixth group of split data are taken as a reorganized data packet, and a plurality of groups of data packets are obtained in this way.
[0039] Referring to Figure 3 As shown in FIG. 2, Figure 3For example, three original pixels P1, P2 and P3 are taken as an example, the pixel bit number of the original pixels P1, P2 and P3 is 14 bits, in step 101, the first pixel P1 can be split into a first group of split data S1 (8 bits) and a second group of split data S2 (6 bits), the second pixel P2 is split into a third group of split data S3 (2 bits), a fourth group of split data S4 (8 bits) and a fifth group of split data S5 (4 bits), and the third pixel P3 is split into a third group of split data S6 (4 bits), a third group of split data S7 (8 bits) and a third group of split data S8 (2 bits); in step 102, one byte (8 bits) is taken as a reorganization unit, since the first group of split data S1 corresponds to one byte, the first reorganization data packet N1 is formed, the second group of split data S2 and the third group of split data S3 add up to one byte, and the second group of split data S2 and the third group of split data S3 are reorganized into the second data packet N2, and the fourth group of split data S4, the fifth group of split data S5, the sixth group of split data S6 and the seventh group of split data S7 are sequentially concatenated in the form of one byte, so that the third reorganization data packet N3, the fourth reorganization data packet N4 and the fifth reorganization data packet N5 are obtained, and the eighth group of split data S8 needs to be reorganized with the next group of split data (not shown in the figure).
[0040] For example, continuing to take Figure 3 as an example, in step 103, when the multiple reorganization data packets are sent, the sending order of the reorganization data packets can be defined in advance, for example Figure 3 The packet sending order in the example is the second reorganization data packet N2, the first reorganization data packet N1, the fourth reorganization data packet N4, the third reorganization data packet N3 and the fifth reorganization data packet N5. In other embodiments, the first reorganization data packet N1, the second reorganization data packet N2, the third reorganization data packet N3, the fourth reorganization data packet N4 and the fifth reorganization data packet N5 can be sequentially sent. The sending order of the multiple reorganization data packets is not limited herein. The embodiment of the application realizes the transmission of the speckle image or the depth image from the depth camera 100 to the host computer 200 by sending the multiple reorganization data packets to the host computer 200.
[0041] As an embodiment of the application, the depth camera 100 sends the multiple reorganization data packets to the host computer 200 through the UVC protocol. The transmission rule of each reorganization data packet to the host computer 200 and the transmission channel of each reorganization data packet to the host computer 200 are defined, and each reorganization data packet is transmitted to the host computer 200 based on the transmission rule and the transmission channel.
[0042] The transmission rule refers to a strategy to be followed by the reorganized data packet in the transmission process, and includes an interface protocol, a power supply mode, a transmission attribute, etc. The transmission channel can be understood as a data channel adopted by the reorganized data packet in the transmission process. It should be understood that, in the present application, the transmission channel is created based on the UVC protocol, and the UVC protocol is a standard protocol for defining a USB transmission interface, so the transmission channel can be understood as a USB channel.
[0043] As an embodiment of the present application, the depth camera 100 can also send device descriptors, check codes and other data to the host 200, so as to facilitate the host 200 to identify the model and pixel format of the depth camera 100, and at the same time facilitate the host 200 to perform integrity checking to avoid packet loss.
[0044] After the depth camera 100 transmits a plurality of reorganized data packets to the host 200, the host 200 can analyze and restore the corresponding image by using an image data analysis method. As shown in Figure 2 The image data analysis method includes steps 201 to 203.
[0045] Step 201, receiving a plurality of reorganized data packets transmitted by the depth camera, and the length of each reorganized data packet is at least one byte.
[0046] Step 202, splitting the plurality of reorganized data packets into a plurality of groups of split data, and the number of groups of split data is greater than the number of data packets.
[0047] Step 203, restoring and combining the plurality of groups of split data to obtain the original data of each pixel of the image.
[0048] The embodiment of the present application splits the plurality of reorganized data packets into a plurality of groups of split data to ensure the premise of subsequent image data restoration. The number of groups of split data is greater than the number of data packets. When splitting the reorganized data packets, if the last reorganized data packet transmitted by the depth camera 100 is processed by zero padding, the zero padded in the reorganized data packet needs to be removed, and then the real valid data is taken as a group of split data. In this way, the influence of the padded zero on image restoration is avoided. If the depth camera 100 is processed by zero padding, the reorganized data packet can be marked to facilitate the host 200 to distinguish.
[0049] As an embodiment of the present application, after the plurality of reorganized data packets are received in step 201, integrity checking is performed on the plurality of reorganized data packets to avoid packet loss and cause errors in subsequent steps 202 and 203, thereby causing a large deviation in the restored image. In addition, the device descriptor of the depth camera 200 can be identified to facilitate the execution of steps 202 and 203.
[0050] As an embodiment of the present application, step 202 comprises: obtaining a device descriptor of the depth camera; determining a pixel format corresponding to the image according to the device descriptor, and determining the number of bits of the pixel in the image according to the pixel format; determining a packet assembling rule when reassembling the reassembled data packet according to the number of bits of the pixel; and splitting at least part of the reassembled data packet to obtain a plurality of groups of split data according to the packet assembling rule. The device descriptor can comprise image information corresponding to the depth camera, such as the number of bits of the pixel, the reassembling order, and the like.
[0051] In order to accurately split the reassembled data packet, the host 200 needs to know the packet assembling rule when the depth camera 100 assembles the packet, and then can split the reassembled data packet according to the packet assembling rule. In an embodiment, each data in the reassembled data packet has an identifier indicating which group of split data it belongs to, so as to more accurately identify the split point. When the reassembled data packet is not composed of two or three groups of split data, the reassembled data packet is directly taken as one group of split data without splitting; when the reassembled data packet is composed of a plurality of groups of split data, the reassembled data packet is split into a plurality of groups of split data.
[0052] As an embodiment of the present application, step 203 comprises: determining a pixel corresponding to each group of split data; and restoring and combining the split data corresponding to each pixel to obtain the original data of each pixel.
[0053] The pixel to which the split data belongs refers to the pixel to which the split data belongs in the packet assembling process. In step 202, a plurality of groups of split data are obtained, and then the plurality of groups of split data can be restored and combined according to the rule when the depth camera 100 splits. For example, each split data can have an identifier indicating which pixel it belongs to, and then the corresponding split data can be restored and combined according to the identifier to obtain the original data of each pixel, and then the original depth image or speckle image of the depth camera 100 is obtained.
[0054] Exemplarily, the above Figure 3The illustrated embodiment sets forth steps 201, 202 and 203 of the host 200. The recombined data packet N2 is composed of the second set of split data S2 and the second set of split data S3, the recombined data packet N1 is composed of the first set of split data S1, the recombined data packet N4 is composed of the fourth set of split data S5 and the sixth set of split data S6, the recombined data packet N3 is composed of the fourth set of split data S4, the first set of split data S1 and the second set of split data S2 belong to the first pixel P1, the third set of split data S3, the fourth set of split data S4 and the fifth set of split data S5 belong to the second pixel P2, the sixth set of split data S6 and the seventh set of split data S7 belong to the third pixel P3. The host 200 receives the recombined data packets N1 to N5 in step 201, then in step 202, splits the recombined data packet N2 into the second set of split data S2 and the second set of split data S3, the recombined data packet N1 into the first set of split data S1, splits the fourth data packet N4 into the fifth set of split data S5 and the sixth set of split data S6, the recombined data packet N3 into the fourth set of split data S4, and the recombined data packet N5 into the seventh set of split data S7; in step 203, the first set of split data S1 and the second set of split data S2 are restored and combined into the first pixel P1, the third set of split data S3, the fourth set of split data S4 and the fifth set of split data S5 are restored and combined into the second pixel P2, and the sixth set of split data S6 and the seventh set of split data S7 are restored and combined into a part of the third pixel P3, and so on, to obtain the restored depth image or speckle image.
[0055] In the above image transmission system, the depth camera 100 splits each pixel data of the speckle image or the depth image into a plurality of sets of split data, recombines the plurality of sets of split data in units of at least one byte to obtain a plurality of recombined data packets, and transmits the plurality of recombined data packets to the host 200. The host 200 receives the plurality of recombined data packets, splits the plurality of recombined data packets into a plurality of sets of split data, and restores and combines the plurality of sets of split data to obtain the corresponding speckle image or depth image.
[0056] The image transmission system, the image transmission method and the image data analysis method of the present application can avoid transmitting more invalid data when the depth camera 100 transmits image data, effectively reducing the bandwidth resources occupied by the depth image or the speckle image in the transmission process, and are less likely to cause image frame loss. At the same time, the host 200 can correspondingly analyze and restore the depth image or the speckle image to ensure the integrity of the image.
[0057] As Figure 4The diagram shown is a schematic representation of an image transmission device according to an embodiment of this application. The image transmission device 400 of this application can be installed in an electronic device. Depending on the functions implemented, the image transmission device 400 may include an image data splitting module 401, a split data reassembly module 402, and a data packet transmission module 403. A module in this application can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0058] In this embodiment, the functions of each module / unit are as follows: the image data splitting module 401 is used to split each pixel data in the image into multiple sets of split data; the split data reassembly module 402 is used to reassemble the multiple sets of split data in units of at least one byte to obtain multiple reassembled data packets, the number of reassembled data packets being less than the number of sets of split data; the data packet transmission module 403 is used to send multiple reassembled data packets to the host.
[0059] In this embodiment, each module in the image transmission device 400 performs the same operation as described above. Figure 2 The embodiment of the image transmission method applied to the depth camera 100 is described in detail here, and can produce the same technical effect.
[0060] like Figure 5 The diagram shown is a schematic representation of an image data parsing apparatus according to an embodiment of this application. The image data parsing apparatus 500 of this application can be installed in an electronic device. Depending on the functions implemented, the image transmission method and the image data parsing apparatus 500 may include a data packet receiving module 501, a data packet splitting module 502, and a data restoration and combination module 503. A module in this application can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0061] In this embodiment, the functions of each module / unit are as follows: the data packet receiving module 501 is used to receive multiple data packets transmitted by the depth camera, and the length of each data packet is at least one byte; the data packet splitting module 502 is used to split the multiple data packets into multiple sets of split data, and the number of sets of split data is greater than the number of data packets; the data restoration and combination module 503 is used to restore and combine the multiple sets of split data to obtain the original data of each pixel of the image.
[0062] In this embodiment, each module in the image data parsing device 500 performs the same operation as described above. Figure 2 The embodiment of the image data parsing method applied to the host 200 is described above, and it can produce the same technical effect, so it will not be described in detail here.
[0063] The modules / units described above, if implemented in the form of software functional units and sold or used as independent products, can be stored in a nonvolatile computer readable storage medium. The computer readable storage medium can be volatile or nonvolatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).
[0064] The application also provides a computer readable storage medium, the readable storage medium stores a computer program, and the computer program can implement the embodiments corresponding to the image transmission method or the embodiments corresponding to the image data analysis method when executed by a processor of an electronic device. For example, the following steps are implemented: split each pixel data in the image of the depth camera into a plurality of split data; recombine the plurality of split data in units of at least one byte to obtain a plurality of recombined data packets; and send the plurality of recombined data packets to a host. For another example, the following steps are implemented: receive a plurality of recombined data packets sent by a depth camera; split the plurality of data packets into a plurality of split data; and restore and combine the plurality of split data to obtain original data of each pixel of the image.
[0065] In several embodiments provided in the present application, the disclosed devices, apparatuses and methods can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and the division of modules can be different from the above. For example, the division of modules can be performed in another manner.
[0066] The modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.
[0067] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software functional modules.
[0068] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
[0069] The above examples are merely illustrative of the present application, and are not intended to limit the scope of the application, which is defined by the appended claims, and which encompasses all variations equivalent to those recited. No limitation is intended to the details of construction or design herein shown, other than as described in the claims.
[0070] It has to be noted that, hereinafter, the term "comprising" is not used in the sense of "only comprising", rather in the sense of "at least comprising". Any reference to claims herein shall not be construed as limiting the present application to the specific claims appended hereto.
[0071] The preceding merely illustrates the principles of the application. Various modifications and alterations to this method will be apparent to those skilled in the art in view of the teachings herein. It will be appreciated that these teachings are given as examples to stimulate further research and development. The application is not limited in scope by the exemplified embodiments, which are intended as illustrations of single aspects of the application. Other aspects of the application are set forth in the claims and in the full scope of equivalents therefor. Various references are cited herein, the disclosures of which are incorporated by reference in their entireties.
Claims
1. An image transmission method, characterized in that, Applied to a depth camera, wherein the image is a depth image or a speckle image, the image transmission method includes: Each pixel data of the image is split into multiple sets of split data; The multiple sets of split data are reassembled in units of at least one byte, instead of directly padding with empty data, to obtain multiple reassembled data packets. The number of reassembled data packets is less than the number of sets of split data. Send the multiple reassembled data packets to the host.
2. The image transmission method as claimed in claim 1, characterized in that, The step of splitting each pixel data of the image into multiple sets of split data includes: Obtain the pixel format of the image, and determine the number of pixels in the image based on the pixel format; Configure the splitting rules for each pixel data based on the pixel bit depth; According to the splitting rules, each pixel data is split to obtain the multiple sets of split data.
3. The image transmission method as claimed in claim 1, characterized in that, The reassembly of the multiple sets of split data into multiple reassembled data packets, using at least one byte as a unit instead of directly padding with empty data, includes: The combination relationship between the multiple sets of split data is determined based on the number of bits in each set of split data and the length of the reconstructed data packet; Based on the combination relationship, the multiple sets of split data are recombined to obtain the multiple reconstructed data packets.
4. The image transmission method as described in claim 3, characterized in that, When the multiple sets of split data are recombined, if the last set of split data has no recombining object and the number of bits is less than one byte, zero-padding is performed on the last set of split data to obtain a recombined data packet, so that the length of each recombined data packet is at least one byte.
5. An image data parsing method, characterized in that, Applied to a host computer, the image is a depth image or a speckle image, and the image data parsing method includes: Receive multiple reconstructed data packets sent by a depth camera, each of which has a length of at least one byte; The plurality of reassembled data packets are split into multiple groups of split data, wherein the number of groups of split data is greater than the number of reassembled data packets; By restoring and combining the multiple sets of split data, the original data of each pixel of the image is obtained.
6. The image data parsing method as described in claim 5, characterized in that, The step of splitting the multiple reassembled data packets into multiple sets of split data includes: Obtain the device descriptor of the depth camera; The pixel format corresponding to the image is determined based on the device descriptor, and the number of bits in the pixels in the image is determined based on the pixel format; The packet reassembly rules for the reassembled data packets are determined based on the number of bits in the pixels. At least a portion of the reassembled data packets are split according to the packet reassembly rules to obtain the multiple sets of split data.
7. The image data parsing method as described in claim 5, characterized in that, The restoration and combination of the multiple sets of split data to obtain the original data of each pixel of the image includes: Determine the pixels corresponding to each group of split data; The split data corresponding to each pixel is restored and combined to obtain the original data of each pixel.
8. An image transmission system, characterized in that, It includes a depth camera and a host computer, wherein the depth camera and the host computer communicate via the UVC protocol; The depth camera is used to: split each pixel data of a depth image or speckle image into multiple sets of split data; and reassemble the multiple sets of split data in units of at least one byte, instead of directly padding with empty data, to obtain multiple reassembled data packets, wherein the number of reassembled data packets is less than the number of sets of split data; Send the plurality of reassembled data packets to the host; The host is configured to: receive the plurality of reconstructed data packets sent by the depth camera, each of the reconstructed data packets having a length of at least one byte; and split the plurality of reconstructed data packets into multiple groups of split data, wherein the number of groups of split data is greater than the number of reconstructed data packets.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image transmission method as described in any one of claims 1 to 4, and the image data parsing method as described in any one of claims 5 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image transmission method as described in any one of claims 1 to 4 and the image data parsing method as described in any one of claims 5 to 7.
Citation Information
Patent Citations
Image encoding and decoding method and codec
CN112055223A