Lossless image data acquisition method, device, equipment and medium
By performing lossless compression and assembly on the original lossless data from local devices in cloud gaming, the problem of image loss on cloud devices is solved, achieving efficient image data transmission and accurate face recognition, thus improving the user experience.
Patent Information
- Application Number
- CN202310152778.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-02-16
AI Technical Summary
In existing technologies, the process of real-name authentication for cloud gaming involves capturing facial images through camera devices, compressing them, and then transmitting them to cloud devices, resulting in image loss and affecting the accuracy of facial recognition and user experience.
Lossless compression technology is used to process the raw lossless data obtained by the local device, including lossless compression and assembly of each color coding component. After being transmitted to the cloud device, the data is decompressed to ensure that the cloud device obtains the raw lossless data.
It enables lossless acquisition of image data by cloud devices, improves the accuracy of facial recognition and user experience, simplifies the data transmission process, and shortens the transmission time.
Smart Images

Figure CN116170598B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to methods, apparatus, devices and media for acquiring lossless image data. Background Technology
[0002] With the rapid development of 5G technology, cloud computing technology, and the mobile gaming industry, various large-scale games are emerging one after another, and even traditional PC (Personal Computer) games are being made mobile. As a result, the requirements for mobile phone performance and hardware are getting higher and higher, including mobile phone refresh rate, memory, heat dissipation, motor, etc. This has greatly increased the entry barrier for players. In order to reduce the requirements for players' mobile phone performance and maximize the user base, game developers have come up with various solutions, and cloud gaming is one of the more advanced technical solutions.
[0003] Cloud gaming is an online gaming technology based on cloud computing, which enables mobile devices with relatively average graphics rendering and data processing capabilities to easily run high-performance games. Players do not need to perform traditional operations such as downloading, installing, or upgrading versions on their mobile phones. They only need to connect to the cloud device. The cloud device renders the game scene as an audio and video stream, which is transmitted to the mobile device through the network. The mobile device converts the user's control commands into corresponding protocols and transmits them to the cloud device to trigger the corresponding game operations.
[0004] In the aforementioned model, efficiently and quickly implementing real-name authentication login for cloud gaming has become a common requirement. Currently, existing technologies still involve capturing facial images using camera devices, compressing these images, and transmitting them to cloud devices for recognition. Because the captured facial images are compressed, the final facial images obtained by the cloud devices are somewhat lossy. This can lead to incorrect recognition during subsequent facial recognition, affecting game login and resulting in a poor user experience.
[0005] In summary, how to enable cloud devices to acquire lossless image data is a problem that needs to be solved in this field. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for acquiring lossless image data, enabling cloud devices to acquire lossless image data. The specific solution is as follows:
[0007] In a first aspect, this application discloses a lossless image data acquisition method, including:
[0008] Acquire raw, lossless data obtained by the local device through its camera function;
[0009] The original lossless data is subjected to lossless compression to obtain compressed data;
[0010] The compressed data is transmitted to a cloud device so that the cloud device can decompress the compressed data, allowing the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0011] Optionally, the lossless compression process performed on the original lossless data to obtain compressed data includes:
[0012] Each original color-coded component of the original lossless data is subjected to lossless compression to obtain the corresponding compressed color-coded components; wherein, the original color-coded components are the Y component, U component and V component in the YUV image format.
[0013] The compressed color-coded components are assembled to obtain assembled data, and the assembled data is then subjected to lossless compression to obtain compressed data.
[0014] Optionally, assembling the compressed color-coded components to obtain assembled data includes:
[0015] The compressed color-coded components are sequentially assembled according to the order of Y, U, and V components to obtain the assembled data.
[0016] Optionally, after performing lossless compression on each original color-coded component of the original lossless data to obtain the corresponding compressed color-coded components, the process includes:
[0017] Determine the component length of each of the compressed color-coded components;
[0018] Accordingly, transmitting the compressed data to the cloud device includes:
[0019] The compressed data and the component lengths of each of the compressed color-coded components are transmitted to the cloud device.
[0020] Optionally, the cloud device decompresses the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform functions that the application needs to complete via camera functionality, including:
[0021] The cloud device decompresses the compressed data to obtain the assembled data, and decomposes the assembled data using the component length of each of the compressed color-coded components to obtain each of the compressed color-coded components.
[0022] Each of the compressed color-coded components is decompressed again to obtain the original color-coded components, and the original color-coded components are assembled to obtain the original lossless data. This allows the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0023] Optionally, assembling the individual original color-coded components to obtain the original lossless data includes:
[0024] Using the pixel step size and data width of the original lossless data, each of the original color coding components is assembled to obtain the original lossless data; wherein, the pixel step size is the distance between two adjacent pixels in the same row of the original lossless data, and the data width is the distance between two adjacent pixels in the same column of the original lossless data.
[0025] Optionally, acquiring the raw, lossless data obtained by the local device through the camera function includes:
[0026] Obtain a set of multiple preset color planes, each corresponding to one of the original color coding components, constructed based on a byte buffer and obtained by the local device through the camera function;
[0027] The byte buffers in each of the preset color plane sets are read respectively to obtain the original color coding components corresponding to the original lossless data, as well as the pixel step size and data width of the original lossless data;
[0028] Accordingly, transmitting the compressed data to the cloud device includes:
[0029] The compressed data, as well as the pixel step size and data width of the original lossless data, are transmitted to the cloud device.
[0030] Secondly, this application discloses a lossless image data acquisition device, comprising:
[0031] The raw data acquisition module is used to acquire raw, lossless data obtained by the local device through the camera function;
[0032] The raw data compression module is used to perform lossless compression processing on the raw lossless data to obtain compressed data;
[0033] The decompression module is used to transmit the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0034] Thirdly, this application discloses an electronic device, including:
[0035] Memory, used to store computer programs;
[0036] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed lossless image data acquisition method.
[0037] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed lossless image data acquisition method.
[0038] The beneficial effects of this application are as follows: It acquires raw, lossless data obtained by a local device through its camera function; performs lossless compression processing on the raw, lossless data to obtain compressed data; and transmits the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the raw, lossless data through the local device to perform the functions that the application needs to complete through the camera function. The cloud device is, for example, a mobile phone, and the local device is also a mobile phone. When the cloud device needs to use raw, lossless data to complete a corresponding function, it is more convenient for the local device to transmit the raw, lossless data to the cloud device. Therefore, this application uses raw, lossless data obtained through the camera function without needing to acquire facial images, making it simpler and avoiding the loss that occurs during the image generation process. Lossless compression processing of the raw, lossless data to obtain compressed data, and transmitting the compressed data to the cloud device, improves transmission efficiency and shortens data transmission time. After decompression, the cloud device obtains the raw, lossless data obtained by the local device through its camera function, allowing direct use of the raw, lossless data to perform the functions that the application needs to complete through the camera function, thus improving the user experience. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 This is a flowchart of a lossless image data acquisition method disclosed in this application;
[0041] Figure 2 This is a flowchart of a specific lossless image data acquisition method disclosed in this application;
[0042] Figure 3 This is a schematic diagram of a specific component assembly disclosed in this application;
[0043] Figure 4 This is a schematic diagram of the structure of a lossless image data acquisition device disclosed in this application;
[0044] Figure 5 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0046] Cloud gaming is an online gaming technology based on cloud computing, which enables mobile devices with relatively average graphics rendering and data processing capabilities to easily run high-performance games. Players do not need to perform traditional operations such as downloading, installing, or upgrading versions on their mobile phones. They only need to connect to the cloud device. The cloud device renders the game scene as an audio and video stream, which is transmitted to the mobile device through the network. The mobile device converts the user's control commands into corresponding protocols and transmits them to the cloud device to trigger the corresponding game operations.
[0047] In the above-mentioned model, how to efficiently and quickly realize real-name authentication login for cloud games has become a common need. Currently, the existing technology still involves capturing facial images through camera devices, compressing the facial images, and transmitting them to cloud devices. The cloud devices then use the facial images for recognition, which results in the loss of the facial images obtained by the cloud devices. Subsequent facial recognition using the obtained facial images may fail to recognize the images correctly, thus affecting game login and resulting in a poor user experience.
[0048] Therefore, this application provides a lossless image data acquisition scheme that enables cloud devices to acquire lossless image data.
[0049] See Figure 1 As shown in the figure, this application discloses a lossless image data acquisition method, including:
[0050] Step S11: Obtain the raw, lossless data obtained by the local device through the camera function.
[0051] To acquire raw, lossless data from a local device via its camera function, for example, using an Android phone as the local device, the Camera standard interface requests data from the camera, the acquisition format is YUV, and the acquisition frame rate is set to 30 FPS (a frame rate comfortable for the human eye). The camera acquisition mode is set to preview mode. This allows one frame of raw, lossless YUV data to be acquired every 33ms. YUV is a color encoding format, where Y represents luminance information and UV represents color information. YUV is a raw streaming data format, similar to RGB (Red, Green, Blue) color encoding format. Compared to RGB color encoding format, YUV format occupies less bandwidth during data transmission.
[0052] In this embodiment, the step of acquiring the original lossless data obtained by the local device through the camera function includes: acquiring a set of multiple preset color planes that are constructed based on byte buffers and correspond one-to-one with each of the original color coding components, obtained by the local device through the camera function; reading the byte buffers in each of the preset color plane sets to obtain each of the original color coding components corresponding to the original lossless data, as well as the pixel step size and data width of the original lossless data.
[0053] Understandably, after setting the Android camera's capture format to YUV, the raw lossless data obtained from the system interface is stored in three preset color plane sets (i.e., PLANEs) of length 1. For example, the byte buffer of preset color plane set 1 stores the Y component, the byte buffer of preset color plane set 2 stores the U component, and the byte buffer of preset color plane set 3 stores the V component. Therefore, the Y component, U component, and V component can be obtained from the byte buffers of preset color plane set 1, preset color plane set 2, and preset color plane set 3, respectively. It should be noted that when obtaining the Y component, U component, and V component from the byte buffers of the preset color plane sets, the pixel step size and data width of the raw lossless data are also obtained. The pixel step size represents the distance between two adjacent pixels in the same row of the raw lossless data, and the data width represents the distance between two adjacent pixels in the same column of the raw lossless data.
[0054] Step S12: Perform lossless compression processing on the original lossless data to obtain compressed data.
[0055] In this embodiment, after lossless compression of each original color-coded component of the original lossless data, the length of each compressed color-coded component is recorded. The compressed color-coded components are then assembled and lossless compression is performed again. This second compression can greatly reduce the amount of data that needs to be transmitted subsequently, thereby improving transmission speed.
[0056] Step S13: The compressed data is transmitted to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0057] In this embodiment, the cloud device decompresses the compressed data to obtain the assembled data, and decomposes the assembled data using the component length of each compressed color-coded component to obtain each compressed color-coded component; each compressed color-coded component is then decompressed again to obtain each original color-coded component, and the original color-coded components are assembled to obtain the original lossless data, so that the application of the cloud device can obtain the original lossless data through the local device to realize the functions that the application needs to complete through the camera function.
[0058] Because lossless compression involves two compression steps, cloud devices need to perform two decompression steps on the compressed data to obtain the original lossless data. Understandably, after the first decompression, the assembled data is obtained. This assembled data is then decomposed based on the length of each compressed color-coded component. For example, if the total length of the assembled data is 10, and the lengths of each compressed color-coded component are 3, 3, and 4 respectively, and the assembly of these components follows the order of Y, U, and V, then the assembled data is decomposed according to this order to obtain the corresponding compressed color-coded components. These compressed color-coded components are then decompressed to obtain the original color-coded components. Finally, these original color-coded components are assembled to obtain the original lossless data.
[0059] In this embodiment, assembling each of the original color-coded components to obtain the original lossless data includes: assembling each of the original color-coded components using the pixel step size and data width of the original lossless data to obtain the original lossless data; wherein, the pixel step size is the distance between two adjacent pixels in the same row of the original lossless data, and the data width is the distance between two adjacent pixels in the same column of the original lossless data.
[0060] In this embodiment, transmitting the compressed data to the cloud device includes transmitting the compressed data and the pixel step size and data width of the original lossless data to the cloud device.
[0061] Applications on cloud devices acquire raw, lossless data from local devices to perform functions that require camera access. For example, facial recognition is needed when logging into a cloud game; the cloud device can then use the raw, lossless data for this purpose. Video calls can also be made, where the local phone transmits raw, lossless data to the cloud device, which then transmits it to another phone. It's important to note that because this embodiment enables the cloud device to acquire raw, lossless data, it can perform functions that would otherwise require camera access.
[0062] The beneficial effects of this application are as follows: It acquires raw, lossless data obtained by a local device through its camera function; performs lossless compression processing on the raw, lossless data to obtain compressed data; and transmits the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the raw, lossless data through the local device to perform the functions that the application needs to complete through the camera function. The cloud device is, for example, a mobile phone, and the local device is also a mobile phone. When the cloud device needs to use raw, lossless data to complete a corresponding function, it is more convenient for the local device to transmit the raw, lossless data to the cloud device. Therefore, this application uses raw, lossless data obtained through the camera function without needing to acquire facial images, making it simpler and avoiding the loss that occurs during the image generation process. Lossless compression processing of the raw, lossless data to obtain compressed data, and transmitting the compressed data to the cloud device, improves transmission efficiency and shortens data transmission time. After decompression, the cloud device obtains the raw, lossless data obtained by the local device through its camera function, allowing direct use of the raw, lossless data to perform the functions that the application needs to complete through the camera function, thus improving the user experience.
[0063] See Figure 2 As shown in the figure, this application discloses a specific method for acquiring lossless image data, including:
[0064] Step S21: Obtain the raw, lossless data obtained by the local device through the camera function.
[0065] Step S22: Perform lossless compression on each original color-coded component of the original lossless data to obtain the corresponding compressed color-coded components; wherein the original color-coded components are the Y component, U component and V component in the YUV image format.
[0066] For example, the GZIP compression algorithm built into the JDK (Java Development Kit) can be used to perform lossless compression on each original color-coded component of the original lossless data. This can effectively reduce the size of the original lossless data without damaging it. The GZIP compression algorithm can achieve a data compression ratio of up to 60%, which is high and fast, and does not require the introduction of any additional support libraries.
[0067] In this embodiment, after performing lossless compression on each original color-coded component of the original lossless data to obtain the corresponding compressed color-coded components, the process includes determining the component length of each compressed color-coded component. For example, the component lengths of compressed color-coded components Y, U, and V are 3, 4, and 5, respectively.
[0068] Step S23: Assemble each of the compressed color-coded components to obtain assembled data, and perform lossless compression on the assembled data again to obtain compressed data.
[0069] For example Figure 3 The diagram illustrates a specific component assembly process. The compressed color-coded components Y, U, and V are assembled in the order of Y, U, and V to obtain the assembled data. The assembled data is then compressed a second time using the GZIP compression algorithm to obtain compressed data. The compressed data is 30% of the original lossless data, thus significantly reducing the amount of data that needs to be transmitted subsequently.
[0070] It is important to note that compressing the Y, U, and V components individually will reduce redundant data within each component. Since the three components are somewhat correlated, compressing them together after assembly will further reduce redundant data between the three components and result in better compression.
[0071] Step S24: The compressed data is transmitted to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0072] In this embodiment, transmitting the compressed data to the cloud device includes: transmitting the compressed data and the component lengths of each compressed color-coded component to the cloud device. The cloud device performs a first decompression process on the compressed data to obtain the assembled data. It can be understood that the cloud device decomposes the assembled data using the component lengths of each compressed color-coded component to restore it to its original compressed color-coded components. Then, a second decompression is performed to obtain the original color-coded components. Finally, the original color-coded components are assembled to obtain the original lossless data.
[0073] Therefore, this application requires transmitting the raw lossless data obtained by the local device to the cloud device. However, the amount of raw lossless data is too large, and direct transmission will seriously affect the transmission efficiency and have a negative impact on the user experience. In order to shorten the transmission time, the raw lossless data is compressed, which can reduce the amount of data to be transmitted and thus shorten the transmission time. Specifically, this application performs a first compression on the raw lossless data, and the resulting compressed color coding component can be 60% of the original lossless data. The data volume is still relatively large. After assembling the compressed color coding component, a second compression is performed, and the resulting compressed data can be 30% of the original lossless data. In this way, the amount of data to be transmitted is greatly reduced, thereby improving the transmission efficiency and enhancing the user experience.
[0074] The following uses the login process of the Xingyou App (application) as an example to illustrate the technical solution in this application. During the Xingyou login process, facial recognition is required. Therefore, the Camera2Api of an Android phone can be used, setting the acquisition format to YUV_420_888 and the acquisition mode to TEMPLATE_PREVIEW. The local device's camera is opened, and the result ImageReader is obtained in the camera data callback. The Image is obtained through the ImageReader, and then the Plane set is obtained. From the Plane set, the original color-coded components of the original lossless data are obtained, namely the Y component, U component, and V component. The pixel step size and data width of the original lossless data are also obtained.
[0075] The original color-coded component Y, original color-coded component U, and original color-coded component V are compressed using the GZIP compression algorithm to obtain compressed color-coded components Y, U, and V. The component lengths of the compressed color-coded components Y, U, and V are recorded.
[0076] The compressed color-coded components Y, U, and V are combined in the order of Y, U, and V to obtain the assembled data.
[0077] The assembled data is further compressed using the GZIP compression algorithm. After the second compression, the compressed data is about 30% of the original lossless data size.
[0078] The compressed data is transmitted over the network to the cloud gaming server, i.e., the cloud device, while transmitting the component lengths of the compressed color-coded component Y, U, and V, as well as the pixel step size and data width of the original lossless data.
[0079] The cloud gaming server performs a first GZIP decompression on the compressed data to obtain the assembled data. Then, based on the component lengths of the compressed color-coded component Y, U, and V, the assembled data is decomposed to obtain compressed color-coded components Y, U, and V. A second decompression process is then performed on each of these components to obtain the original color-coded components. Finally, the original color-coded components are assembled using the pixel stride and data width of the original lossless data to obtain the original lossless data.
[0080] The original, lossless data is sent back to the game application's face recognition during the login process of the Xingyou App via the Android system framework in order to complete the face recognition.
[0081] See Figure 4 As shown in the figure, this application discloses a lossless image data acquisition device, including:
[0082] Raw data acquisition module 11 is used to acquire raw, lossless data obtained by the local device through the camera function;
[0083] The raw data compression module 12 is used to perform lossless compression processing on the raw lossless data to obtain compressed data;
[0084] The decompression module 13 is used to transmit the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
[0085] The beneficial effects of this application are as follows: It acquires raw, lossless data obtained by a local device through its camera function; performs lossless compression processing on the raw, lossless data to obtain compressed data; and transmits the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the raw, lossless data through the local device to perform the functions that the application needs to complete through the camera function. Therefore, the cloud device is, for example, a mobile phone, and the local device is also a mobile phone. When the cloud device needs to use raw, lossless data to complete a corresponding function, it is more convenient for the local device to transmit the raw, lossless data to the cloud device. Thus, this application uses raw, lossless data obtained through the camera function without needing to acquire facial images, making it simpler and avoiding the loss that occurs during the image generation process. Lossless compression processing of the raw, lossless data to obtain compressed data, and transmitting the compressed data to the cloud device, improves transmission efficiency and shortens data transmission time. After decompression, the cloud device obtains the raw, lossless data obtained by the local device through its camera function, allowing direct use of the raw, lossless data to perform the functions that the application needs to complete through the camera function, thus improving the user experience.
[0086] Furthermore, embodiments of this application also provide an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0087] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the lossless image data acquisition method performed by the electronic device disclosed in any of the foregoing embodiments.
[0088] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0089] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0090] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0091] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the lossless image data acquisition method executed by the electronic device as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0092] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the method steps performed during the lossless image data acquisition process disclosed in any of the foregoing embodiments.
[0093] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0094] The above provides a detailed description of the lossless image data acquisition method, apparatus, device, and medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A lossless image data acquisition method, characterized in that, include: Acquire raw, lossless data obtained by the local device through its camera function; The original lossless data is subjected to lossless compression to obtain compressed data; The compressed data is transmitted to a cloud device so that the cloud device can decompress the compressed data, allowing the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function; The lossless compression process performed on the original lossless data to obtain compressed data includes: Each original color-coded component of the original lossless data is subjected to lossless compression to obtain the corresponding compressed color-coded components; wherein, the original color-coded components are the Y component, U component and V component in the YUV image format; the compressed color-coded components are assembled to obtain the assembled data, and the assembled data is subjected to lossless compression again to obtain compressed data. The lossless compression process performed on each original color-coded component of the original lossless data includes: The GZIP compression algorithm is used to perform lossless compression on each of the original color-coded components of the original lossless data.
2. The lossless image data acquisition method according to claim 1, characterized in that, The step of assembling the compressed color-coded components to obtain the assembled data includes: The compressed color-coded components are sequentially assembled according to the order of Y, U, and V components to obtain the assembled data.
3. The lossless image data acquisition method according to claim 1, characterized in that, The step of performing lossless compression on each original color-coded component of the original lossless data to obtain the corresponding compressed color-coded components includes: Determine the component length of each of the compressed color-coded components; Accordingly, transmitting the compressed data to the cloud device includes: The compressed data and the component lengths of each of the compressed color-coded components are transmitted to the cloud device.
4. The lossless image data acquisition method according to claim 3, characterized in that, The cloud device decompresses the compressed data, enabling the cloud device's application to obtain the original lossless data through the local device to perform functions that the application needs to complete via camera functionality, including: The cloud device decompresses the compressed data to obtain the assembled data, and decomposes the assembled data using the component length of each of the compressed color-coded components to obtain each of the compressed color-coded components. Each of the compressed color-coded components is decompressed again to obtain the original color-coded components, and the original color-coded components are assembled to obtain the original lossless data. This allows the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function.
5. The lossless image data acquisition method according to claim 4, characterized in that, The assembly of the original color-coded components to obtain the original lossless data includes: Using the pixel step size and data width of the original lossless data, each of the original color coding components is assembled to obtain the original lossless data; wherein, the pixel step size is the distance between two adjacent pixels in the same row of the original lossless data, and the data width is the distance between two adjacent pixels in the same column of the original lossless data.
6. The lossless image data acquisition method according to claim 5, characterized in that, The acquisition of raw, lossless data obtained by the local device through its camera function includes: Obtain a set of multiple preset color planes, each corresponding to one of the original color coding components, constructed based on a byte buffer and obtained by the local device through the camera function; The byte buffers in each of the preset color plane sets are read respectively to obtain the original color coding components corresponding to the original lossless data, as well as the pixel step size and data width of the original lossless data; Accordingly, transmitting the compressed data to the cloud device includes: The compressed data, as well as the pixel step size and data width of the original lossless data, are transmitted to the cloud device.
7. A lossless image data acquisition device, characterized in that, include: The raw data acquisition module is used to acquire raw, lossless data obtained by the local device through the camera function; The raw data compression module is used to perform lossless compression processing on the raw lossless data to obtain compressed data; The decompression module is used to transmit the compressed data to a cloud device so that the cloud device can decompress the compressed data, enabling the application on the cloud device to obtain the original lossless data through the local device to perform the functions that the application needs to complete through the camera function. The raw data compression module is specifically used for: Each original color-coded component of the original lossless data is subjected to lossless compression to obtain the corresponding compressed color-coded components; wherein, the original color-coded components are the Y component, U component and V component in the YUV image format; the compressed color-coded components are assembled to obtain the assembled data, and the assembled data is subjected to lossless compression again to obtain compressed data. The lossless image data acquisition device is specifically used for: The GZIP compression algorithm is used to perform lossless compression on each of the original color-coded components of the original lossless data.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the lossless image data acquisition method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the lossless image data acquisition method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Image compression method and apparatus for encoding pixel data of frame into interleaved bit-stream, and related image decompression method and apparatus
CN104718754A
Image compression method and device
CN108111858A