Depth image compression method and device, computer equipment and storage medium

Through sliding window technology, the depth image is divided into multiple image blocks, and the reference value and pixel difference value are calculated, which solves the problem of high consumption of deep image storage resources and realizes efficient storage and transmission.

CN119676444APending Publication Date: 2025-03-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411833354.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The storage of deep images requires a large amount of storage resources, resulting in the problem of large amount of data and large amount of storage resources.

Method used

Through sliding window technology, the depth image is divided into multiple image blocks, the reference value and pixel difference value of each image block are calculated, and the pixel difference value set and reference value are generated, and the data are sent to the server for storage.

Benefits of technology

It effectively reduces the amount of data required to be stored, reduces the storage cost and the use of storage resources, and improves storage efficiency and data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676444A_ABST
    Figure CN119676444A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a depth image compression method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining at least one depth image; the method comprises the steps of reading a depth characteristic in a first image, dividing the first image into N image blocks by utilizing a sliding window technology according to the depth characteristic, calculating a reference value of each image block in the N image blocks according to a plurality of pixel points, and calculating a pixel difference between at least one pixel value in each image block and the corresponding reference value, generating N pixel difference sets corresponding to the N image blocks, wherein each pixel difference set comprises at least one pixel difference; and sending the N pixel difference sets and the N reference values to a server. According to the method, the pixel difference value set and the reference value are stored instead of directly storing the original value of each pixel, so that the data volume required to be stored is effectively reduced, the storage cost is reduced, and the storage resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a deep image compression method, device, computer equipment and storage medium. Background Art

[0002] Devices such as depth cameras and TOF (Time of Flight) cameras have the function of detecting the depth of field distance (or depth information) of the shooting space. The depth camera can obtain the distance of each point in the image from the camera, and then combine the two-dimensional coordinates of each point in the 2D image to obtain the three-dimensional spatial coordinates of each point in the image. In the depth image, the image depth is used to characterize the spatial distance between the object in the image and the card setting. For example, the image depth of the depth image is set to 16 bits, 2 to the 16th power, and the data range represented is 0-65535 mm, that is, the depth information that can be recorded at a distance of up to 65535 mm from the depth camera. In addition, some scenes with high precision requirements require the use of 32-bit data to record depth information.

[0003] For the storage of depth information, the data is generally stored by directly saving the original depth value. Although this method is simple and direct, due to the large value of the depth information and the large amount of data, the storage requires a lot of storage resources. Summary of the invention

[0004] In view of this, the present invention provides a depth image compression method to solve the problem of large amount of depth information storage data and high consumption of storage resources.

[0005] In a first aspect, the present invention provides a deep image compression method, the method comprising:

[0006] Acquire at least one depth image, wherein the at least one depth image includes the first image;

[0007] Reading a depth characteristic in the first image, and dividing the first image into N image blocks using a sliding window technique according to the depth characteristic, wherein each image block includes a number of pixels, and N ≥ 2 is a positive integer;

[0008] Calculating a reference value of each of the N image blocks according to a number of pixel points, and calculating a pixel difference between at least one pixel value in each image block and the corresponding reference value, to generate N pixel difference sets corresponding to the N image blocks, each of the pixel difference sets including at least one pixel difference;

[0009] The N pixel difference sets and N reference values ​​are sent to a server.

[0010] In combination with the first aspect, in a possible implementation manner, the reading a depth characteristic in the first image and dividing the first image into N image blocks by using a sliding window technology according to the depth characteristic includes:

[0011] Acquire a predefined sliding window; slide the predefined sliding window on the first image according to the depth information and distribution characteristics read in the first image, determine the size of each image block one by one, and obtain the N image blocks.

[0012] In combination with the first aspect, in another possible implementation manner, the N image blocks include a first image block and a second image block, and the first image block and the second image block are adjacent;

[0013] The method slides the predefined sliding window on the first image according to the depth information and distribution characteristics read in the first image, determines the size of each image block one by one, and obtains the N image blocks, including:

[0014] According to the depth information and distribution characteristics of the first image block and the second image block, sliding the predefined sliding window on the first image block and the second image block to determine a third image block;

[0015] The step of sliding the predefined sliding window on the first image block and the second image block according to the depth information and distribution characteristics of the first image block and the second image block to determine the third image block comprises:

[0016] Calculating an average pixel value of all pixels in the first image block as a first average pixel value, and calculating an average pixel value of all pixels in the second image block as a second average pixel value;

[0017] comparing a difference between the first average pixel value and the second average pixel value;

[0018] Determine whether the difference is greater than a preset value;

[0019] If it is greater than the preset value, dividing the third image block, the size of the third image block is a part of the predefined sliding window size;

[0020] If it is less than or equal to the preset value, the third image block is divided, and the size of the third image block is larger than the second image block or the first image block.

[0021] In combination with the first aspect, in another possible implementation, when the difference is greater than the preset value, the size of the divided third image block is half of the predefined sliding window size; when the difference is less than or equal to the preset value, the size of the divided third image block is the sum of the areas of the first image block and the second image block.

[0022] In combination with the first aspect, in yet another possible implementation manner, calculating the reference value of each of the N image blocks according to a number of pixel points includes:

[0023] For each image block, the average pixel value of all pixels in each image block is calculated to obtain N average pixel values; the difference between each pixel value in the current image block and the corresponding average pixel value is calculated, and the pixel value with the smallest difference is compared as the reference value of the current image block.

[0024] In combination with the first aspect, in yet another possible implementation, calculating a pixel difference between at least one pixel value in each image block and a corresponding reference value to generate N pixel difference sets corresponding to the N image blocks includes:

[0025] For each image block, a pixel value corresponding to each pixel point in the current image block is calculated, and a pixel difference between the pixel value and a reference value of the current image block is calculated to obtain a pixel difference set including at least one pixel difference; and the N pixel difference sets of the N image blocks after the pixel difference calculation are counted.

[0026] In combination with the first aspect, in yet another possible implementation manner, after sending the N pixel difference sets and the N reference values ​​to the server, the method further includes:

[0027] Reading N image block information divided by a target depth image, wherein the target depth image is one of the at least one depth image;

[0028] According to the information of N image blocks, the reference distance, relative distance and flag bit of each image block are read, and the original pixel data of each image block is parsed;

[0029] The N reference values ​​and at least part of the pixel differences in the N pixel difference sets are integrated and calculated to generate the target depth image.

[0030] In a second aspect, the present invention provides a depth image compression device, the device comprising:

[0031] A receiving module, configured to acquire at least one depth image, wherein the at least one depth image includes a first image;

[0032] A processing module, configured to read a depth characteristic in the first image, and divide the first image into N image blocks using a sliding window technique according to the depth characteristic, where N ≥ 2 and is a positive integer;

[0033] a calculation module, configured to calculate a reference value of each of the N image blocks, and calculate a difference between at least one pixel value in each image block and the corresponding reference value, and to count N pixel difference sets corresponding to the N image blocks, each pixel difference set including a plurality of difference values;

[0034] A sending module is used to send the N pixel difference sets and N reference values ​​to a server.

[0035] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the depth image compression method described in the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0036] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the depth image compression method described in the first aspect or any corresponding embodiment thereof.

[0037] In addition, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the depth image compression method described in the above-mentioned first aspect or any corresponding embodiment thereof.

[0038] The deep image compression method provided in this embodiment first divides the image blocks one by one according to the sliding window technology, calculates the mean of all pixel values, and selects the pixel value closest to the mean as the reference value. During the storage process, the difference between each pixel value and the reference value is recorded and stored. This method stores the pixel difference set and the reference value instead of directly storing the original value of each pixel, thereby effectively reducing the amount of data required to be stored, reducing storage costs and storage resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1is a schematic diagram of a scene photographed by a depth camera according to an embodiment of the present invention;

[0041] Figure 2 is a flowchart of a deep image compression method according to an embodiment of the present invention;

[0042] Figure 3 is a schematic flow chart of another deep image compression method according to an embodiment of the present invention;

[0043] Figure 4 is a flowchart of another depth image compression method according to an embodiment of the present invention;

[0044] Figure 5 is a flowchart of another deep image compression method according to an embodiment of the present invention;

[0045] Figure 6 is a structural block diagram of a depth image compression device according to an embodiment of the present invention;

[0046] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0048] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0049] Furthermore, the terms “first” and “second” are used for descriptive purposes only and should not be understood as indicating or implying relative importance.

[0050] The technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0051] First, the technical scenarios and related technical terms involved in the technical solution of the present invention are introduced.

[0052] The present invention relates to the field of image processing technology, and in particular to a storage and compression method for depth image data, which aims to improve the storage efficiency of depth images, reduce the occupancy of storage space, and improve the transmission efficiency of depth images.

[0053] With the development of SLAM (Simultaneous Localization and Mapping) technology and intelligent driving technology, the information carried by the two-dimensional color images taken by ordinary cameras cannot meet the technical requirements. Specifically, the information carried by the two-dimensional color images is limited to the two-dimensional plane, and it is impossible to display the accurate vertical depth information between objects in the image and between objects and the photographer, and it cannot provide strong data support for accurate real-time map construction, path planning and other technologies.

[0054] Therefore, the depth of field distance (i.e., depth information) of the space is captured by using depth cameras, TOF cameras and other equipment to make up for the lack of accuracy. However, the storage capacity required to directly save the depth image data (such as depth value) captured by the depth camera to the memory is extremely large, which limits its feasibility in practical applications. Therefore, the technical solution of the present invention is committed to finding an efficient image compression and processing solution to reduce the burden on storage facilities and improve the efficiency of data transmission.

[0055] See also Figure 1 As shown, it is a schematic diagram of a scene captured by a depth camera provided in an embodiment of the present invention. The application scenario includes: a depth camera, at least one terminal device, such as a PC, and at least one server. In addition, the scenario may also include other more or fewer devices, equipment, such as switches, etc., which are not limited in this embodiment.

[0056] Among them, the depth camera obtains the depth information of each pixel in the image through the depth sensor, so that it can not only obtain the traditional two-dimensional (2D) image, but also obtain three-dimensional (3D) point cloud information. Depth cameras include but are not limited to: binocular cameras, TOF cameras, etc.

[0057] Terminal devices include but are not limited to various personal computers, PCs, laptops, smart phones, tablets, and portable wearable devices.

[0058] The server can be implemented as an independent server or a server cluster consisting of multiple servers. Furthermore, the server can be an independent server or a server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0059] Terminal devices, such as PCs, and servers can be connected via wired or wireless networks.

[0060] An embodiment of the present invention provides an embodiment of a deep image compression method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0061] In this embodiment, a deep image compression method is provided, which can be used in the above-mentioned terminal device, such as a PC. Figure 2 is a flowchart of a depth image compression method according to an embodiment of the present invention. Figure 2 As shown, the process includes:

[0062] Step S101: Acquire at least one depth image, wherein the at least one depth image includes a first image.

[0063] Specifically, a depth camera or a TOF camera captures a set of depth images and sends the depth images to a terminal device, such as a PC. The PC receives at least one depth image from the depth camera or the TOF camera.

[0064] The first image includes color information and depth information of the captured scene.

[0065] In this embodiment, an example is taken in which a depth camera or a TOF camera sends at least one depth image including a first image, and a receiving end PC receives and processes the first image.

[0066] Step S102: read the depth characteristics in the first image, and divide the first image into N image blocks using a sliding window technique according to the depth characteristics.

[0067] Each image block includes a number of pixels, N≥2 and is a positive integer. The first image is composed of hundreds or thousands of pixels, each of which corresponds to a pixel value. The pixel value (PIXEL or PX) can be used to represent depth information.

[0068] The depth characteristic, also referred to as the color depth of an image, refers to the number of bits used to store each pixel. These bits determine the maximum number of colors that may appear in a color image, or the maximum number of gray levels in a grayscale image. Image depth is the color detail of a single pixel, such as 16 bits (65536 colors), 24 bits (16777216 colors), etc.

[0069] The sliding window technology uses the size (width and height) and step size (horizontal and vertical movement distance) of the sliding window. These information need to be defined in advance. After the definition is completed, the sliding window is slid on the first image according to the characteristics of the depth image to obtain the divided image blocks one by one. This embodiment uses a slider to dynamically adjust the block size, so that when processing different depth value areas, the optimal block size can be adaptively selected, thereby improving storage efficiency.

[0070] Step S103: Calculate the reference value of each image block in the N image blocks according to a number of pixel points, and calculate the pixel difference between at least one pixel value in each image block and the corresponding reference value, to generate N pixel difference sets corresponding to the N image blocks.

[0071] Each pixel difference set includes at least one pixel difference, for example, a pixel difference set includes 1000 pixel differences.

[0072] A specific implementation of the above step S103 includes:

[0073] Step S103 - 1 : For each image block, calculate the average pixel value of all pixels in each image block to obtain N average pixel values.

[0074] In this embodiment, for N image blocks, the average value of the pixels in each image block is calculated to obtain N average pixel values. For example, for the first image block in the first image, the average value of all pixels in the first image block is calculated to obtain a first average pixel value.

[0075] Step S103 - 2 : Calculate the difference between each pixel value in the current image block and the corresponding average pixel value, and compare the pixel value with the smallest difference value to take it as the reference value of the current image block.

[0076] The first average pixel value is compared with each pixel value in the first image block, and the pixel value closest to or the same as the first average pixel value is found as the first reference value of the first image block. Optionally, if there are two or more pixel values ​​that are the same as the first average pixel value, one of them is randomly selected as the first reference value, or one is selected as the first reference value according to the coordinate distance.

[0077] Similarly, the reference values ​​in other image blocks are also calculated and confirmed according to the above method, and N reference values ​​are obtained after calculation. Each image block corresponds to a reference value, which serves as a reference value for all pixels.

[0078] The process also includes: for each image block, calculating the pixel difference (△PX) between the pixel value corresponding to each pixel point in the current image block and the reference value of the current image block to obtain a pixel difference set including at least one pixel difference; and counting the N pixel difference sets of the N image blocks after the pixel difference calculation.

[0079] For example, there are 1001 pixels in the first image block, corresponding to 1001 pixel values, and the difference (△PX) between the 1001 pixel values ​​and the first reference value of the image block is calculated to obtain 1000 pixel differences (△PX), and these 1000 △PX are used to generate a first pixel difference set. Similarly, all pixel differences (△PX) in other image blocks are used to generate corresponding pixel difference sets.

[0080] Step S104: Send N pixel difference sets and N reference values ​​to the server.

[0081] In one implementation, the terminal device PC transmits N pixel difference sets and N reference values ​​to a server via a wireless network, so that the server stores the N pixel difference sets and N reference values ​​in the cloud.

[0082] The method provided in this embodiment first divides the image blocks one by one according to the sliding window technology, calculates the mean of all pixel values, and selects the pixel value closest to the mean as the reference value. During the storage process, the difference between each pixel value and the reference value is recorded and stored. This method stores the pixel difference set and the reference value instead of directly storing the original value of each pixel, thereby effectively reducing the amount of data required to be stored, reducing storage costs and storage resources.

[0083] Optionally, in this embodiment, the step S102 of reading the depth characteristics in the first image and dividing the first image into N image blocks using a sliding window technique according to the depth characteristics specifically includes:

[0084] Obtain a predefined sliding window; slide the predefined sliding window on the first image according to the depth information and distribution characteristics in the read first image, determine the size of each image block one by one, and obtain N image blocks.

[0085] The length and width of the predefined sliding window are determined according to the characteristics of the depth image. Specifically, according to the characteristics of the depth image, a dynamic block size configuration is implemented. Different parts of the depth image often have different depth distribution characteristics, and using a uniform fixed block size often cannot achieve effective compression. Therefore, a sliding window is predefined, and the predefined sliding window is used to slide on the first image.

[0086] A specific implementation of the slider window configuration provided in this embodiment includes: dynamically selecting the size of the next image block in the depth image through the sliding window technology. The division principle is: for areas with relatively gentle depth changes, larger image blocks can be divided, while in areas with drastic depth changes, smaller image blocks are used, so that each image block can better adapt to its corresponding depth features and ensure the integrity and accuracy of the information.

[0087] In a possible implementation manner of this embodiment, the N image blocks include: a first image block and a second image block, and the first image block and the second image block are two image blocks at adjacent positions.

[0088] The above step S102, according to the depth information and distribution characteristics in the read first image, slides the predefined sliding window on the first image, determines the size of each image block one by one, and obtains N image blocks, including: according to the depth information and distribution characteristics of the first image block and the second image block, slides the predefined sliding window on the first image block and the second image block to determine the third image block.

[0089] Furthermore, if Figure 3 As shown, an implementation manner of sliding a predefined sliding window on a first image block and a second image block to determine a third image block includes:

[0090] Step S201: calculating the average pixel value of all pixels in the first image block as the first average pixel value, and calculating the average pixel value of all pixels in the second image block as the second average pixel value.

[0091] Step S202: Compare the difference between the first average pixel value and the second average pixel value.

[0092] Step S203: Determine whether the difference is greater than a preset value. If yes, execute step S204; if no, execute step S205.

[0093] Step S204: If it is greater than a preset value, divide the image into a third image block, and the size of the third image block is a part of the predefined sliding window size.

[0094] Step S205: If it is less than or equal to the preset value, divide the image into a third image block, where the size of the third image block is larger than that of the second image block or the first image block.

[0095] For example, a predefined sliding window is defined, the length of the sliding window is L1, the width is W1, and the area of ​​the sliding window is L1×W1; wherein L1=2l, W1=2w, l is the minimum dividend of the total length of the first image, and w is the minimum dividend of the total width of the first image. First, a first image block and a second image block are divided from the first image, wherein the sizes of the first image block and the second image block are the same as the size of the predefined sliding window, such as L1×W1.

[0096] Calculate the first average pixel value of the first image block as a1, the second average pixel value of the second image block as a2, and the preset value as a preset; and compare the sizes of a1 and a2.

[0097] If the absolute value of the difference a1-a2 is ≤ a preset, step S205 is executed, and the size of the third image block is larger than the area of ​​the first image block and the second image block. For example, the size of the third image block is the sum of the areas of the first image block and the second image block, that is, the third image block = the first image block + the second image block. In this example, the third image block is 2 times the predefined sliding window (that is, 2×L1×W1).

[0098] If the absolute value of the difference a1-a2 is greater than a preset value, step S204 is executed to divide the size of the third image block into a part of the predefined sliding window size; for example, the size of the third image block is half of the first image block or the second image block, that is, the third image block == 1 / 2 (predefined sliding window) = 1 / 2×(L1×W1).

[0099] And so on, until the entire image slider is fully divided.

[0100] In this embodiment, the current image is divided into N image blocks using sliding window technology. During the image block division process, the depth distribution of the current processing area is monitored in real time, and the size of the processing block is automatically adjusted based on the depth statistics and distribution characteristics of the image. During the implementation process, the algorithm can select a suitable block size for efficient storage and processing based on the depth value range and distribution characteristics of the pixels in the current block.

[0101] In addition, this embodiment also includes a process of reading image data stored in the server, specifically, as follows: Figure 4 As shown, after the above step S104, in which the N pixel difference sets and the N reference values ​​are sent to the server, the following further comprises:

[0102] Step S105: reading information of N image blocks divided from a target depth image, where the target depth image is one of the at least one depth image.

[0103] The target depth image may be an image that the user wishes to read on the client or terminal device. The target depth image may be the aforementioned first image, or another image in the at least one image, which is not limited in this embodiment.

[0104] Step S106: Read the reference distance, relative distance and flag of each image block according to the information of the N image blocks, and parse the original pixel data of each image block.

[0105] Step S107: performing integration calculation on the N reference values ​​and at least part of the pixel differences in the N pixel difference sets to generate a target depth image.

[0106] In the process of reading the depth image of this embodiment, in the stage of reading the depth image data, the block size information divided by the current depth image is first read, and then the reference distance, relative distance and reference distance pixel position with a flag bit of each block are read, and the original data of the current block is parsed by reverse calculation, and each block is parsed in turn to complete the reading of the entire current depth image data.

[0107] The depth image compression storage method based on the slider mean method provided in this embodiment demonstrates its significant advantages in storage efficiency, data compression, processing performance, etc. through steps such as dynamic adjustment of block size, selection of mean reference value, difference storage, adaptive update mechanism, and optimization of reading process. It is not only of great significance to improve the efficiency of depth image processing, but also provides reference value for research and application in related fields.

[0108] In a specific embodiment, a deep image compression method based on a slider mean method is provided, which demonstrates significant advantages in storage efficiency, data compression, processing performance, etc. through steps such as dynamic adjustment of block size, selection of mean reference value, difference storage, adaptive update mechanism, and optimization of reading process. Figure 5 As shown, it mainly includes the following steps:

[0109] Step 1: Divide the image into blocks.

[0110] First, according to the characteristics of the depth image, the dynamic block size configuration process is implemented. Different parts of the depth image often have different depth distribution characteristics. Therefore, using a unified image block size often cannot achieve effective compression. The specific implementation method of image block size division is:

[0111] The size of the image block is dynamically selected in the depth image through the sliding window technology. For areas with relatively gentle depth changes, larger image blocks can be used, while smaller image blocks are used in areas with drastic depth changes. This allows each image block to better adapt to its corresponding depth characteristics, ensuring the integrity and accuracy of the information. Adaptive adjustment: Real-time monitoring of the depth distribution of the current processing area, and automatic adjustment of the image block size based on the depth statistics and distribution characteristics of the image. During implementation, the algorithm can select the appropriate block size for efficient storage and processing based on the depth value range and distribution characteristics of the pixels in the current block.

[0112] Step 2: Selection of mean and benchmark values.

[0113] After the sliding window block size is configured, the mean and reference value selection operation is performed. The purpose of this process is to calculate the mean (i.e., average pixel value) for each image block and use the mean as the reference value to reduce the redundant storage of subsequent data.

[0114] A specific implementation includes: for each image block, calculating the mean of all pixel values ​​in the block. The calculation of the mean can reflect the depth information of the area, so that the value of subsequent difference records is improved. After obtaining the mean, the pixel value closest to the mean is selected from all pixel values ​​in the block as the reference value. This reference value can effectively reduce the calculation complexity of subsequent differences and play a key role in the subsequent storage and decompression process.

[0115] Step 3: Difference storage.

[0116] The purpose of difference storage is to significantly reduce the amount of raw data required for storage by recording the difference between each pixel value and a reference value. One possible implementation includes: performing a difference calculation between each pixel value and a reference value in each image block. This approach ensures that the amount of stored data is greatly reduced because, in general, the difference between pixel values ​​is relatively small. When storing data, the pixel data is saved in a difference form, including a flag bit to indicate the validity and specific identification of the data. Each image block records the reference value and all difference information, thereby achieving efficient compressed storage.

[0117] Step 4: Reading the depth image.

[0118] After completing the storage of the depth image, read the difference set and reference value compressed and stored on the server. By effectively parsing the stored data, the purpose of reconstructing the original image is achieved. A specific implementation method includes: in the reading stage, first read the block size information of the current depth image to understand the basic structure of each block. Read the reference distance, relative distance and flag bit of each block in turn, and parse the original pixel data of each block. Through the combined calculation of the reference value and the relative difference, the reconstruction of the entire depth image is completed to ensure the accuracy and completeness of the reading.

[0119] The method provided in this embodiment records the difference between each pixel value and the mean reference value, stores N reference values ​​of the N divided image blocks and the corresponding pixel difference sets, and significantly reduces the total amount of data required for storage compared to storing specific image data, thereby reducing storage costs and improving the overall efficiency of the storage system.

[0120] In addition, while maintaining image quality, it effectively reduces unnecessary information redundancy, meeting the dual requirements of data security and storage economy. This method dynamically divides the size of the next image block according to the size of two adjacent image blocks, achieves adaptive adjustment of image blocks based on depth characteristics, improves the compression efficiency of depth images during transmission, reduces data transmission costs, and provides practical technical support for real-time depth image applications.

[0121] In this embodiment, a depth image compression device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0122] This embodiment provides a depth image compression device, such as Figure 6 As shown, the device includes: a receiving module 610, a processing module 620, a calculating module 630 and a sending module 640. In addition, the device may also include other more or fewer modules, such as a storage module, etc., which is not limited in this embodiment.

[0123] The receiving module 610 is used to obtain at least one depth image, and the at least one depth image includes the first image.

[0124] The processing module 620 is used to read the depth characteristics in the first image, and divide the first image into N image blocks according to the depth characteristics by using a sliding window technology, where N is greater than or equal to 2 and is a positive integer.

[0125] The calculation module 630 is used to calculate the reference value of each image block in the N image blocks, and calculate the difference between at least one pixel value in each image block and the corresponding reference value, and count N pixel difference sets corresponding to the N image blocks, each pixel difference set including multiple difference values.

[0126] The sending module 640 is used to send N pixel difference sets and N reference values ​​to the server.

[0127] In a possible implementation, the processing module 620 is specifically used to obtain a predefined sliding window; according to the depth information and distribution characteristics in the read first image, the predefined sliding window is slid on the first image, the size of each image block is determined one by one, and N image blocks are obtained.

[0128] In addition, in another possible implementation manner, the compression device provided in this embodiment further includes a reading module. Figure 6 Not shown.

[0129] The reading module is used to read information of N image blocks divided by a target depth image, where the target depth image is one of the at least one depth image.

[0130] The processing module 620 is also used to read the reference distance, relative distance and flag of each image block according to the information of the N image blocks, and parse the original pixel data of each image block; integrate and calculate at least part of the pixel differences in the N reference values ​​and the N pixel difference sets to generate a target depth image.

[0131] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0132] The depth image compression device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0133] The embodiment of the present invention also provides a computer device having the above Figure 6 The deep image compression device shown.

[0134] See also Figure 7, is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface).

[0135] In some optional embodiments, if desired, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0136] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0137] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the depth image compression method shown in the above embodiment.

[0138] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0139] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0140] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0141] The input device 30 can receive input digital or character information, and generate signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0142] Optionally, the computer device further includes at least one communication interface for the computer device to communicate with other devices or a communication network.

[0143] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.

[0144] The storage medium may be a disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the depth image compression method shown in the above embodiment is implemented.

[0145] Embodiments of the present application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the above method. Wherein, the computer program product may be written in any combination of one or more programming languages ​​to perform program codes for performing the operations of the disclosed embodiments, wherein the programming languages ​​include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server.

[0146] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A deep image compression method, characterized in that: The method comprises: Acquire at least one depth image, wherein the at least one depth image includes the first image; Reading a depth characteristic in the first image, and dividing the first image into N image blocks using a sliding window technique according to the depth characteristic, wherein each image block includes a number of pixels, and N ≥ 2 is a positive integer; Calculating a reference value of each of the N image blocks according to a number of pixel points, and calculating a pixel difference between at least one pixel value in each image block and the corresponding reference value, to generate N pixel difference sets corresponding to the N image blocks, each of the pixel difference sets including at least one pixel difference; The N pixel difference sets and N reference values ​​are sent to a server.

2. The method according to claim 1, characterized in that: The step of reading the depth characteristic in the first image and dividing the first image into N image blocks by using a sliding window technique according to the depth characteristic includes: Get a predefined sliding window; According to the depth information and distribution characteristics in the read first image, the predefined sliding window is slid on the first image, and the size of each image block is determined one by one to obtain the N image blocks.

3. The method according to claim 2, characterized in that The N image blocks include a first image block and a second image block, and the first image block and the second image block are adjacent; The method slides the predefined sliding window on the first image according to the depth information and distribution characteristics read in the first image, determines the size of each image block one by one, and obtains the N image blocks, including: According to the depth information and distribution characteristics of the first image block and the second image block, sliding the predefined sliding window on the first image block and the second image block to determine a third image block; The step of sliding the predefined sliding window on the first image block and the second image block according to the depth information and distribution characteristics of the first image block and the second image block to determine the third image block comprises: Calculating an average pixel value of all pixels in the first image block as a first average pixel value, and calculating an average pixel value of all pixels in the second image block as a second average pixel value; comparing a difference between the first average pixel value and the second average pixel value; Determine whether the difference is greater than a preset value; If it is greater than the preset value, dividing the third image block, the size of the third image block is a part of the predefined sliding window size; If it is less than or equal to the preset value, the third image block is divided, and the size of the third image block is larger than the second image block or the first image block.

4. The method according to claim 3, characterized in that When the difference is greater than the preset value, the size of the divided third image block is half of the predefined sliding window size; When the difference is less than or equal to the preset value, the size of the divided third image block is the sum of the areas of the first image block and the second image block.

5. The method according to any one of claims 1 to 3, characterized in that: The calculating the reference value of each image block in the N image blocks according to a plurality of pixel points includes: For each image block, the average pixel value of all pixels in each image block is calculated to obtain N average pixel values; The difference between each pixel value in the current image block and the corresponding average pixel value is calculated, and the pixel value with the smallest difference among all the pixel values ​​is compared to obtain the pixel value as the reference value of the current image block.

6. The method according to any one of claims 1 to 3, characterized in that: The step of calculating a pixel difference between at least one pixel value in each image block and a corresponding reference value to generate N pixel difference sets corresponding to the N image blocks comprises: For each image block, calculating a pixel difference between a pixel value corresponding to each pixel point in the current image block and a reference value of the current image block, to obtain a pixel difference set including at least one pixel difference; The N pixel difference sets of the N image blocks after the pixel difference calculation are counted.

7. The method according to any one of claims 1 to 3, characterized in that: After sending the N pixel difference sets and the N reference values ​​to the server, the method further includes: Reading N image block information divided by a target depth image, wherein the target depth image is one of the at least one depth image; According to the information of N image blocks, the reference distance, relative distance and flag bit of each image block are read, and the original pixel data of each image block is parsed; The N reference values ​​and at least part of the pixel differences in the N pixel difference sets are integrated and calculated to generate the target depth image.

8. A depth image compression device, characterized in that: The device comprises: A receiving module, configured to acquire at least one depth image, wherein the at least one depth image includes a first image; A processing module, configured to read a depth characteristic in the first image, and divide the first image into N image blocks using a sliding window technique according to the depth characteristic, where N ≥ 2 and is a positive integer; a calculation module, configured to calculate a reference value of each of the N image blocks, and calculate a difference between at least one pixel value in each image block and the corresponding reference value, and to count N pixel difference sets corresponding to the N image blocks, each pixel difference set including a plurality of difference values; The sending module is used to send the N pixel difference sets and N reference values ​​to a server.

9. A computer device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions, and the processor executes the depth image compression method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the depth image compression method according to any one of claims 1 to 7.