Image coding method and device, and image decoding method and device

By using parallel computing nodes and quadtree decomposition algorithms for image compression and encoding in distributed systems, the problem of low image processing efficiency in the prior art is solved, and efficient image compression and rapid transmission are achieved.

CN119865613AInactive Publication Date: 2025-04-22SHANGHAI HANSHUO ZHIRONG INFORMATION TECHNOLOGY TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510024174.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the image processing efficiency is low, and it is not possible to effectively solve the problem of high computing cost during image compression and the encoding sorting length longer than decoding.

Method used

The parallel computing nodes in the distributed system are used for image compression and encoding, and the image blocks are divided into value blocks of different sizes using the quad-tree decomposition algorithm, and the image compression process is performed in combination with the bilinear interpolation algorithm.

Benefits of technology

By distributing image processing tasks to multiple computing nodes in parallel processing, the compression time and data storage space are significantly reduced, and efficient compressed storage and rapid transmission of massive images are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865613A_ABST
    Figure CN119865613A_ABST
Patent Text Reader

Abstract

The invention relates to an image coding method and device and an image decoding method and device, and the coding method comprises the steps: obtaining a to-be-coded target image; the target image is divided into a plurality of image blocks, the image blocks are distributed to a plurality of computing nodes in a distributed system, and the computing nodes in the distributed system are computing nodes running in parallel; image compression coding is carried out on the computational nodes by adopting a quadtree decomposition algorithm, the quadtree decomposition algorithm is used for dividing an image block into value blocks of different sizes according to the set maximum depth of a quadtree, the minimum depth of the quadtree and the maximum allowable error, each value block has a matched domain block, and the domain blocks are matched with the domain blocks; therefore, the rough and large-area part in the image can be transformed and compressed in a manner of improving the compression ratio, and the fine and small-area part in the image can be transformed and compressed in a manner of ensuring the image restoration quality. Through the image processing method and device, the problem of low image processing efficiency in related technologies is solved.
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 an image encoding method and device, and an image decoding method and device. Background Art

[0002] With the popularization of the Internet, the rapid development of multimedia technology and the increasing demand for images, digital images are growing at an exponential rate. Image compression technology has become a vital technology. Image compression can reduce the size of image files, thereby reducing storage and transmission costs, increasing network transmission speeds, and reducing the demand for storage devices. Traditional image compression technology has disadvantages such as high computational cost, longer encoding length than decoding, and time-consuming.

[0003] Currently, no effective solution has been proposed for the problem of low image processing efficiency in related technologies. Summary of the invention

[0004] The purpose of the present application is to provide an image encoding method and device, a decoding method and device to address the deficiencies in the prior art, so as to at least solve the problem of low image processing efficiency in the related art.

[0005] To achieve the above purpose, the technical solution adopted by this application is:

[0006] In a first aspect, an embodiment of the present application provides an image encoding method, comprising: obtaining a target image to be encoded; dividing the target image into multiple image blocks, and distributing the multiple image blocks to multiple computing nodes in a distributed system, the computing nodes in the distributed system are computing nodes running in parallel; using a quadtree decomposition algorithm on the computing nodes to perform image compression encoding, the quadtree decomposition algorithm being used to divide the image blocks into value blocks of different sizes according to a set quadtree maximum depth, quadtree minimum depth, and maximum allowable error, each value block having a matching domain block, so that the rough and larger parts of the image are transformed and compressed in a manner to improve the compression ratio, while the fine and smaller parts of the image are transformed and compressed in a manner to ensure the image restoration quality.

[0007] In some of the embodiments, a target image is divided into multiple image blocks, and the multiple image blocks are distributed to multiple computing nodes in a distributed system, including: converting the format of the target image into a target format to meet the format requirements for subsequent processing; dividing the target image in the target format into multiple image blocks; distributing the multiple image blocks to Map tasks on the computing nodes in the distributed system, wherein each computing node has at least one Map task, and each Map task is used to encode an image block.

[0008] In some of the embodiments, a quadtree decomposition algorithm is used on a computing node to perform image compression encoding, including: using a quadtree decomposition algorithm combined with a bilinear interpolation algorithm to compress image blocks to obtain multiple data blocks; extracting features from the data blocks, using the extracted features as values ​​and the index or position of the data block as a key, thereby converting the image data into key-value pairs; partitioning all key-value pairs according to the key, and sorting the values ​​of the same key; merging the key-value pairs of each partition; and reducing all key-value pairs, and merging the outputs to obtain the encoding result.

[0009] In some of the embodiments, a quadtree decomposition algorithm is used to compress the image block, including: when the position of the current data block in the quadtree does not meet the minimum depth of the quadtree, dividing the current data block into four data blocks, wherein the current data block is obtained by dividing the image block or the data block on the parent node of the current data block in the quadtree; when the position of the current data block in the quadtree does not meet the minimum depth of the quadtree, judging whether the current data block meets the consistency standard, wherein the consistency standard means that there is a matching data block within the maximum allowable error of the current data block; when the current data block meets the consistency standard, or the position of the current data block in the quadtree meets the maximum depth of the quadtree, stopping the segmentation of the current data block; when the current data block does not meet the consistency standard, segmenting the current data block until the divided data blocks meet the consistency standard or the position of the divided data blocks in the quadtree meets the maximum depth of the quadtree.

[0010] In some of the embodiments, in the process of compressing the image block using the quadtree decomposition algorithm combined with the bilinear interpolation algorithm, the method also includes: for a first pixel point at any position in the compressed data block, obtaining the pixel values ​​of four second pixel points around the corresponding position in the data block before compression: f(x1,y1), f(x0,y1), f(x1,y0), f(x0,y0); using the pixel values ​​of the four second pixel points, calculating the pixel value of the first pixel point by the following formula: z=v×[u×f(x1,y1)+(1-u)×f(x0,y1)]+(1-v)×[u×f(x1,y0)+(1-u)×f(x0,y0)], where u and v are floating point numbers with values ​​in the interval [0,1).

[0011] In some embodiments, determining whether the current data block meets the consistency standard includes: searching from a virtual code table whether there is a domain block D matching the current data block R, such that R=sD+o, wherein the virtual code table stores a plurality of domain blocks, coefficient s is a compression coefficient, coefficient o is a grayscale shift coefficient, and coefficient s and coefficient o are obtained by using a least square method; in the case where the domain block D is searched, determining whether a matching error of the current data block R is less than a maximum allowable error; in the case where the matching error of the current data block R is less than the maximum allowable error, determining that the current data block meets the consistency standard; in the case where no domain block D matching the current data block R is searched, or the matching error of the current data block R is not less than the maximum allowable error, determining that the current data block does not meet the consistency standard.

[0012] In a second aspect, an embodiment of the present application provides an image decoding method, comprising: writing the numerical value read from the root node of a quadtree into a target matrix, and assigning the value of the root node to each element of the matrix, wherein the quadtree is obtained after compressing and encoding the target image; making corresponding adjustments according to the different values ​​of each element in the target matrix, and each adjustment expands the rows and columns of the target matrix by 2 times until the target image is restored.

[0013] In a third aspect, an embodiment of the present application provides an image encoding device, comprising: an acquisition unit, for acquiring a target image to be encoded; a distribution unit, for dividing the target image into multiple image blocks, and distributing the multiple image blocks to multiple computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel; an encoding unit, for performing image compression encoding using a quadtree decomposition algorithm on the computing nodes, wherein the quadtree decomposition algorithm is used to divide the image blocks into value blocks of different sizes according to a set quadtree maximum depth, quadtree minimum depth, and maximum allowable error, each value block having a matching domain block, so that the rough and larger parts of the image are transformed and compressed in a manner to improve the compression ratio, while the fine and smaller parts of the image are transformed and compressed in a manner to ensure the image restoration quality.

[0014] In a fourth aspect, an embodiment of the present application provides an image decoding device, comprising: a writing unit, used to write the numerical value read from the root node of a quadtree into a target matrix, and assign the value of the root node to each element of the matrix, wherein the quadtree is obtained after compressing and encoding the target image; a decoding unit, used to make corresponding adjustments according to the different values ​​of each element in the target matrix, and each adjustment expands the rows and columns of the target matrix by 2 times until the target image is restored.

[0015] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of the first aspect or the second aspect described above when executing the computer program.

[0016] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of the first aspect or the second aspect described above.

[0017] The present application adopts the above technical scheme to obtain the target image to be encoded; divide the target image into multiple image blocks, and distribute the multiple image blocks to multiple computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel; and use a quadtree decomposition algorithm on the computing nodes to perform image compression encoding, wherein the quadtree decomposition algorithm is used to divide the image block into value blocks of different sizes according to the set quadtree maximum depth, quadtree minimum depth and maximum allowable error, and each value block has a matching domain block, so that the rough and large area parts of the image are transformed and compressed in a way to improve the compression ratio, and the fine and small area parts of the image are transformed and compressed in a way to ensure the image restoration quality. Compared with the prior art, the scheme provided by the embodiment of the present application solves the problem of low image processing efficiency in the related art by dividing the image processing task into several subtasks to be executed simultaneously by multiple computing nodes, and reduces the compression time, reduces the data storage space, and realizes the effect of compressed storage and rapid transmission of massive images.

[0018] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a structural block diagram of a device terminal according to an embodiment of the present application;

[0021] Figure 2 is a flowchart of an image encoding method according to an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of an image distributed processing code according to an embodiment of the present application;

[0023] Figure 4 is a flow chart of a quadtree algorithm according to an embodiment of the present application;

[0024] Figure 5 is a flow chart of a quadtree algorithm according to an embodiment of the present application;

[0025] Figure 6 is a schematic diagram of an image reconstruction operation according to an embodiment of the present application;

[0026] Figure 7 is a schematic diagram of bilinear interpolation according to an embodiment of the present application;

[0027] Figure 8 is a structural block diagram of an image encoding device according to an embodiment of the present application;

[0028] Fig. 9 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0030] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0031] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0032] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0033] This embodiment provides a device terminal (which may be a mobile device, a computer device, a server, etc.). Figure 1 is a structural block diagram of a device terminal according to an embodiment of the present application. Figure 1 As shown, the device terminal may include some or all of the following components: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180, and a power supply 190. Those skilled in the art will appreciate that Figure 1 The device terminal structure shown in the figure does not constitute a limitation on the device terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0034] Combine the following Figure 1 A detailed introduction to the various components of the device terminal:

[0035] The RF circuit 110 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0036] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the device terminal by running the software programs and modules stored in the memory 120. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the device terminal (such as audio data, a phone book, etc.), etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0037] The input unit 130 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the device terminal. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 131 or near the touch panel 131 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 180, and can receive and execute the command sent by the processor 180. In addition, the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 131, the input unit 130 may also include other input devices 132. Specifically, other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0038] The display unit 140 may be used to display information input by the user or information provided to the user and various menus of the device terminal. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 131 may cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 131 and the display panel 141 are used as two independent components to implement the input and output functions of the device terminal, but in some embodiments, the touch panel 131 and the display panel 141 can be integrated to implement the input and output functions of the device terminal.

[0039] The device terminal may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the device terminal is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the device terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the device terminal, they will not be repeated here.

[0040] The speaker 161 and microphone 162 in the audio circuit 160 can provide an audio interface between the user and the device terminal. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another device terminal through the RF circuit 110, or the audio data is output to the memory 120 for further processing.

[0041] WiFi is a short-range wireless transmission technology. The device terminal can help users send and receive emails, browse web pages and access streaming media through the WiFi module 170, which provides users with wireless broadband Internet access. Figure 1 A WiFi module 170 is shown, but it is understandable that it is not a necessary component of the device terminal and can be omitted as needed without changing the essence of the invention, or replaced with other short-range wireless transmission modules, such as a Zigbee module or a WAPI module.

[0042] The processor 180 is the control center of the device terminal. It uses various interfaces and lines to connect various parts of the entire device terminal. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the device terminal and processes data, thereby monitoring the device terminal as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.

[0043] The device terminal also includes a power supply 190 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0044] Although not shown, the device terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0045] In this embodiment, the processor 180 is configured to: obtain a target image to be encoded; divide the target image into multiple image blocks, and distribute the multiple image blocks to multiple computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel; use a quadtree decomposition algorithm on the computing nodes to perform image compression encoding, wherein the quadtree decomposition algorithm is used to divide the image blocks into value blocks of different sizes according to a set quadtree maximum depth, quadtree minimum depth, and maximum allowable error, each value block has a matching domain block, so that the rough and larger parts of the image are transformed and compressed in a manner to improve the compression ratio, while the fine and smaller parts of the image are transformed and compressed in a manner to ensure the image restoration quality.

[0046] In some of the embodiments, the processor 180 is further configured to: write the values ​​read from the root node of the quadtree into the target matrix, and assign the value of the root node to each element of the matrix, wherein the quadtree is obtained after compressing and encoding the target image; make corresponding adjustments according to the different values ​​of each element in the target matrix, and each time the adjustment is made, the rows and columns of the target matrix are expanded by 2 times until the target image is restored.

[0047] This embodiment provides an image encoding method. Figure 2 is a flowchart of an image encoding method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0048] Step S201, obtaining a target image to be encoded.

[0049] Step S202: divide the target image into a plurality of image blocks, and distribute the plurality of image blocks to a plurality of computing nodes in a distributed system, where the computing nodes in the distributed system are computing nodes running in parallel.

[0050] Step S203, using a quadtree decomposition algorithm on the computing node to perform image compression coding. The quadtree decomposition algorithm is used to divide the image block into value blocks of different sizes according to the set quadtree maximum depth, quadtree minimum depth and maximum allowable error. Each value block has a matching domain block, so that the rough and large-area parts of the image can be transformed and compressed in a manner to improve the compression ratio, while the fine and small-area parts of the image can be transformed and compressed in a manner to ensure the image restoration quality.

[0051] Through the above steps, the target image to be encoded is obtained; the target image is divided into multiple image blocks, and the multiple image blocks are distributed to multiple computing nodes in the distributed system, and the computing nodes in the distributed system are computing nodes running in parallel; the quadtree decomposition algorithm is used on the computing nodes to perform image compression encoding, wherein the quadtree decomposition algorithm is used to divide the image block into value blocks of different sizes according to the set quadtree maximum depth, quadtree minimum depth and maximum allowable error, and each value block has a matching domain block, so that the rough and large area parts of the image are transformed and compressed in a way to improve the compression ratio, and the fine and small area parts of the image are transformed and compressed in a way to ensure the image restoration quality. Compared with the image processing method of a single device in the prior art, the solution provided by the embodiment of the present application solves the problem of low image processing efficiency in the related art by dividing the image processing task into several subtasks executed simultaneously by multiple computing nodes, and reduces the compression time, reduces the data storage space, and achieves the effect of compressed storage and rapid transmission of massive images.

[0052] In some of the embodiments, when dividing the target image and assigning tasks, the format of the target image is converted into a target format according to the format requirements of a subsequent MapReduce task (i.e., the task of dividing the image blocks); the MapReduce task divides the target image in the target format into multiple image blocks; and then distributes the multiple image blocks to Map tasks on computing nodes in a distributed system, each computing node having at least one Map task, i.e., a computing node can have one or more Map tasks, and each Map task can encode one image block.

[0053] In some of the embodiments, during image compression encoding, a quadtree decomposition algorithm combined with a bilinear interpolation algorithm can be used to compress image blocks to obtain multiple data blocks; feature extraction is performed on the data blocks, and the extracted features are used as values, and the index or position of the data block is used as a key, thereby converting the image data into key-value pairs; all key-value pairs are partitioned according to the key, and the values ​​of the same key are sorted; the key-value pairs of each partition are merged; all key-value pairs are reduced, and the encoding result is obtained after merging the outputs.

[0054] In the above embodiment, when the image block is compressed using the quadtree decomposition algorithm:

[0055] 1) Take the image block (during initial division) or data block as the current data block and determine whether it meets the minimum depth of the quadtree.

[0056] 2) When the position of the current data block (i.e., the data block to be processed) in the quadtree (referring to the number of nodes on the longest path from the root node to the node where the current data block is located) does not meet the minimum depth of the quadtree, further division (to meet the minimum depth requirement of the quadtree) is performed, that is, the current data block is divided into four data blocks.

[0057] 3) When the position of the current data block in the quadtree does not meet the minimum depth of the quadtree, determine whether the current data block meets the consistency standard. The consistency standard means that there is a matching data block within the maximum allowable error of the current data block.

[0058] Specifically, when judging whether the current data block meets the consistency standard: searching from the virtual code table whether there is a domain block D matching the current data block R, such that R=sD+o, wherein the virtual code table stores multiple domain blocks, coefficient s is a compression coefficient, coefficient o is a grayscale shift coefficient, and coefficient s and coefficient o are obtained by using the least square method; when the domain block D is searched, judging whether the matching error of the current data block R is less than the maximum allowable error; when the matching error of the current data block R is less than the maximum allowable error, determining that the current data block meets the consistency standard; when the domain block D matching the current data block R is not searched, or the matching error of the current data block R is not less than the maximum allowable error, determining that the current data block does not meet the consistency standard.

[0059] 4) When the current data block meets the consistency standard or the position of the current data block in the quadtree meets the maximum depth of the quadtree, stop segmenting the current data block.

[0060] 5) When the current data block does not meet the consistency standard, the current data block is divided until the divided data blocks meet the consistency standard or the position of the divided data blocks in the quadtree meets the maximum depth of the quadtree.

[0061] In some of the embodiments, in the process of compressing an image block using a quadtree decomposition algorithm combined with a bilinear interpolation algorithm, for a first pixel point at any position in the compressed data block, the pixel values ​​of four second pixel points around the corresponding position in the data block before compression can be obtained: f(x1,y1), f(x0,y1), f(x1,y0), and f(x0,y0); the pixel value of the first pixel point is calculated using the pixel values ​​of the four second pixel points using the following formula: z=v×[u×f(x1,y1)+(1-u)×f(x0,y1)]+(1-v)×[u×f(x1,y0)+(1-u)×f(x0,y0)], where u and v are floating point numbers with values ​​in the interval [0,1).

[0062] Correspondingly, this embodiment also provides an image decoding method, for the quadtree data structure obtained by the above compression, the value read from the root node of the quadtree is written into the target matrix, and the value of the root node is assigned to each element of the matrix, wherein the quadtree is obtained after compression encoding of the target image; corresponding adjustments are made according to the different values ​​of each element in the target matrix, and each adjustment expands the rows and columns of the target matrix by 2 times until the target image is restored.

[0063] In order to compress digital images more effectively, in the distributed quadtree-based image compression algorithm provided in the present application, a bilinear interpolation method is introduced to solve the interpolation problem during quadtree reconstruction. Through this scheme, the image processing task is divided into several subtasks, which are executed simultaneously by multiple computers. This can greatly improve the processing efficiency, make full use of the resources of each computer, give full play to the performance of the entire system, reduce the compression time, improve the image compression ratio through the algorithm, reduce data storage space, and realize the compressed storage and rapid transmission of massive images.

[0064] The embodiments of the present application are described and illustrated below through preferred embodiments.

[0065] The preferred embodiment of the present application provides a distributed enhanced image compression processing solution. This solution uses a distributed solution to compress images and shorten the compression time of massive images. MapReduce divides image data into multiple small blocks and processes them in parallel on multiple computing nodes (the general process of image distributed processing can be referred to in Figure 3 The code shown in the figure) specifically includes the following steps:

[0066] Step 1: pre-process the input image data (i.e., the target image) and convert the image data into a format that can be processed by the MapReduce task, such as JPEG, PNG, BMP, etc.

[0067] Step 2: segmentation: segment the image data into multiple small image data blocks (referred to as image blocks), each of which is called an input split.

[0068] Step 3: Distribution: Distribute the split image data blocks to multiple Map tasks for processing. These Map tasks are executed in parallel on different nodes in the cluster. Each node may run multiple Map tasks at the same time, thereby achieving parallel processing. Each Map task reads the image data block it is responsible for.

[0069] Step 4: Image compression processing: Use the quadtree combined with bilinear interpolation method to compress the image data block split in each Map task.

[0070] In step 4, the purpose of quadtree partitioning is to reasonably divide the image into R blocks of different sizes so that any block can find a suitable D block to correspond to it. In this way, the coarse parts of the image can be transformed and compressed with larger image blocks to improve the compression ratio; while the fine parts of the image can be transformed and compressed with smaller image blocks to ensure higher image restoration quality. Compared with the classic fixed-block fractal image coding, the quadtree method can further improve the compression ratio.

[0071] In order to ensure image quality and reduce the number of blocks, the maximum and minimum depths of the quadtree and the maximum allowable error are generally set before segmenting the image, that is, the minimum and maximum R block sizes and the matching block search criteria are set, and the image is segmented by the quadrisection method according to the set minimum depth level, and the best matching block is found for each square image in the image corresponding to the depth level. If found, it is marked as R, the corresponding matching block is recorded as D, and the block is no longer subdivided. If the best matching block is not found for a certain image block under the specified error, the sub-block is subdivided into four blocks of equal size, and then the matching blocks are found for each of the four blocks. This process is repeated until the set maximum depth level is reached (refer to the quadtree algorithm process). Figure 4 and Figure 5 ). The steps are as follows:

[0072] Step 4.1, create LinkedList h, as well as arrays bits and pixcls.

[0073] The above h represents the linked list of sub-blocks that meet the matching criteria. The array bits is used to store the bytes of the sub-blocks that meet the matching criteria. The array pixcls is used to store the pixel values ​​of the sub-blocks that meet the matching criteria. It is used for image compression processing. The image sub-blocks before and after compression are mapped according to the array pixcls. The compression ratio of the original image block and the compressed image block is mapped according to the array bits. Then, the pixel values ​​around the sub-block matching the standard are obtained according to the bilinear interpolation method, and finally the compressed image is obtained.

[0074] Step 4.2, put the input compressed image string into the single linked list h.

[0075] Step 4.3, determine whether h is empty and whether the pixel value is single, if not, initialize it to a quadtree for image compression.

[0076] Step 4.4, determine whether it is satisfied according to the depth range of the division. If it meets the minimum depth range of the division, no further division will be carried out (even if the consistency standard is not met); otherwise, if the consistency standard is not met, it will be subdivided into four blocks, and the depth range and consistency of the subdivided blocks will be checked.

[0077] Step 4.5, repeat the above step 4.4 until all blocks meet the consistency criteria.

[0078] In image compression coding, image partitioning is very important. The coding process is as follows: if the image is divided into 8x8 non-overlapping blocks, these blocks are called value blocks, and each value block R can be matched with a domain block D, so that R = sD + o, where D is the 8x8 block searched from the virtual code table; consider any domain block of size 16x16, and then average it through pixels to get 8x8 blocks, all of which are added to the virtual code table; for any 256x256 image, this process will generate a code table of 241x241 = 58081 blocks. In order to reduce the number of blocks in the code table, only those pixels in the upper left corner are located on a regular square grid point with a horizontal and vertical spacing of m>1. For example, when m = 8, only 1024 adjacent domain blocks can be obtained.

[0079] The encoding process in step 4.4 above is to find the best approximation R = sD + o for each value block. In encoding, the coefficients s and o are the compression coefficient and the grayscale shift coefficient respectively. In order to obtain the best s, o and D, all blocks in the code table must be searched. For each block D in the code table, the best coefficients s and o must be determined. The coefficients s and o can be obtained by the least squares method, and the obtained s and o and the position of the corresponding domain block are stored.

[0080] Step 4.4.1, set the search window width W, window height H, and window increment step step.

[0081] Step 4.4.2, start the search, and perform it in the entire domain block subspace, recording the coefficients s,o of the affine transformation and the position Dx1, Dy1 of the domain block D, and the quadtree flag.

[0082] Step 4.4.3, i=i+1, search for the next matching block R i .

[0083] Step 4.4.4, in Dx i=1 ,Dy i=1 Centered on Ri, search for the best matching mapping of Ri in a window with W and H as width and height.

[0084] Step 4.4.5, calculate the matching error and compare it with the threshold e. If it is greater than the threshold, determine whether the block can continue to be divided using the quadtree. If so, divide the block into four equal parts and continue to search for a match for each block. Otherwise, run step 4.4.6. If it is less than the threshold, run step 4.4.7.

[0085] In step 4.4.6, if the current window is the same size as the image, it means that the entire image has been searched and the requirements cannot be met, so you can only run step 4.4.7 to record the matching affine transformation: otherwise, increase the window by step and continue to search for the matching affine transformation. At this time, you only need to search within the enlarged range of the original window to find the best match and run step 4.4.5.

[0086] Step 4.4.7, record the best matching affine transformation and determine whether the search is complete; if the search is not complete, run step 4.4.3.

[0087] Step 4.4.8, output the results.

[0088] In step 4 above, a bilinear interpolation algorithm can be used to solve the interpolation problem of the quadtree reconstructed image (refer to the image reconstruction operation Figure 6 ).

[0089] In image compression, if the original image is image a and the compressed image is image b, then the scaling ratios of the original image and the compressed image in the xy direction are a / m and b / n.

[0090] The pixel value at position (i, j) of the compressed image should correspond to the pixel value at position (i, j) of the original image. The pixel value at the position. However, due to are all floating point numbers, so It may also be a floating point number. And, since the positions of pixels are integers, we need to find The 4 nearby pixel positions.

[0091] Since it does not exist in the original image In order to obtain the pixel value corresponding to the compressed image at position (i, j), we need to perform bilinear interpolation based on the pixel values ​​of the four pixels around the position to obtain the pixel value of the point. In this way, we can obtain the pixel value of the scaled image at position (i, j). By traversing each pixel of the compressed image, we can get the entire compressed image.

[0092] Bilinear interpolation graph reference Figure 7 , the formula for bilinear interpolation is:

[0093]

[0094] In the formula, (x1-x0)=(y1-y0)=1;

[0095] Therefore, after sorting, we can get:

[0096] z=v×[u×f(x1,y1)+(1-u)×f(x0,y1)]+(1-v)×[u×f(x1,y0)+(1-u)×f(x0,y0)],

[0097] Where u and v are the decimal parts of the floating point coordinates, which are floating point numbers in the range [0,1). The implementation code is as follows:

[0098]

[0099]

[0100]

[0101] Step 5, mapping, extract features from the image, such as color, texture, shape, etc., and then use the extracted features as values ​​and the index or position of the image block as the key to convert the image data into<key,value> Key-value pairs.

[0102] Step 6, intermediate processing, the Shuffle stage partitions the output results of the Map task by key and sorts the values ​​of the same key.

[0103] Step 7: Merge each partition<key,value> Combine the packets to reduce the amount of data transferred.

[0104] Step 8, reduction, the merged<key,value> The data is distributed to multiple Reduce tasks for processing. In each Reduce task, the intermediate results generated in the grouping and sorting phases are reduced, and the key-value pairs with the same key are sent to the same Reduce task for processing to generate output results.

[0105] Step 9: Merge the outputs to integrate the output results of multiple Reduce tasks to form the final result.

[0106] This solution divides the image processing task into several subtasks, which are executed simultaneously by multiple computers. This greatly improves the processing efficiency, fully utilizes the resources of each computer, fully utilizes the performance of the entire system, and reduces the compression time.

[0107] Step 10, using quadtree to process image decoding.

[0108] Read the root node value from the top layer of the quadtree. Generate a 2X2 matrix and assign the root node value to each element of the matrix. Then check the value of each element and make corresponding adjustments based on their different values. Each time you make an adjustment, the matrix will be enlarged by 2 times. Repeat this process until the quadtree is restored to an image.

[0109] Step 10.1, read the value of the root node from the item layer of the quadtree.

[0110] Step 10.2, generate a 2x2 element matrix IN2 and assign the root node values ​​to them.

[0111] Step 10.3, initialize M=2.

[0112] Step 10.4, perform decoding processing according to the following logic.

[0113]

[0114]

[0115] Expand the rows and columns of matrix IN2 by 2 times.

[0116] Step 10.5, repeat step 10.4.

[0117] Step 10.6, end END.

[0118] The present invention is an image compression processing based on a distributed quadtree algorithm. For images with continuous shadows or a large number of continuous identical pixels, the compression ratio can be improved, and the compression processing of massive digital image data can be processed faster. Distributed tasks process massive image data, and the image is processed in blocks through a quadtree algorithm. The quadtree decoding partition is combined with conditional search to further improve the image coding efficiency. The image reconstruction is interpolated in combination with the bilinear interpolation method, which can accelerate the image processing speed, improve the compression ratio and reduce the processing time. By using distributed computing, computer nodes are increased to provide the processing power of the algorithm. Distributed processing can also reduce the loss of image data, improve fault tolerance, and ensure the quality and performance of the final result.

[0119] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a 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.

[0120] This embodiment provides an image encoding device, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0121] Figure 8 is a structural block diagram of an image encoding device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:

[0122] An acquisition unit 81, used to acquire a target image to be encoded;

[0123] A distribution unit 82, configured to divide the target image into a plurality of image blocks, and distribute the plurality of image blocks to a plurality of computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel;

[0124] The coding unit 83 is used to perform image compression coding using a quadtree decomposition algorithm on a computing node. The quadtree decomposition algorithm is used to divide the image block into value blocks of different sizes according to a set quadtree maximum depth, a quadtree minimum depth, and a maximum allowable error. Each value block has a matching domain block, so that the rough and large-area parts of the image can be transformed and compressed in a manner to improve the compression ratio, while the fine and small-area parts of the image can be transformed and compressed in a manner to ensure the image restoration quality.

[0125] In some of the embodiments, the distribution unit is also used to: convert the format of the target image into a target format to meet the format requirements for subsequent processing; divide the target image in the target format into multiple image blocks; and distribute the multiple image blocks to Map tasks on the computing nodes in the distributed system, wherein each computing node has at least one Map task, and each Map task is used to encode an image block.

[0126] In some of the embodiments, the encoding unit is also used to: compress the image block using a quadtree decomposition algorithm combined with a bilinear interpolation algorithm to obtain multiple data blocks; extract features from the data block, use the extracted features as values, and the index or position of the data block as a key, thereby converting the image data into a key-value pair; partition all key-value pairs according to the key, and sort the values ​​of the same key; merge the key-value pairs of each partition; reduce all key-value pairs, and obtain the encoding result after merging the outputs.

[0127] In some of the embodiments, the encoding unit is also used to: when the position of the current data block in the quadtree does not meet the minimum depth of the quadtree, divide the current data block into four data blocks, wherein the current data block is obtained by dividing the image block or the data block on the parent node of the current data block in the quadtree; when the position of the current data block in the quadtree does not meet the minimum depth of the quadtree, determine whether the current data block meets the consistency standard, wherein the consistency standard means that there is a matching data block within the maximum allowable error of the current data block; when the current data block meets the consistency standard, or the position of the current data block in the quadtree meets the maximum depth of the quadtree, stop segmenting the current data block; when the current data block does not meet the consistency standard, segment the current data block until the divided data blocks meet the consistency standard or the position of the divided data blocks in the quadtree meets the maximum depth of the quadtree.

[0128] In some of the embodiments, the encoding unit is further used to: for a first pixel point at any position in the compressed data block, obtain the pixel values ​​of four second pixel points around the corresponding position in the data block before compression: f(x1,y1), f(x0,y1), f(x1,y0), f(x0,y0); and use the pixel values ​​of the four second pixel points to calculate the pixel value of the first pixel point: z=v×[u×f(x1,y1)+(1-u)×f(x0,y1)]+(1-v)×[u×f(x1,y0)+(1-u)×f(x0,y0)], where u and v are floating point numbers with values ​​in the interval [0,1).

[0129] In some of the embodiments, the encoding unit is further used for: searching from a virtual code table whether there is a domain block D matching the current data block R, such that R=sD+o, wherein the virtual code table stores a plurality of domain blocks, coefficient s is a compression coefficient, coefficient o is a grayscale shift coefficient, and coefficient s and coefficient o are obtained by using a least square method; in the case where the domain block D is searched, determining whether a matching error of the current data block R is less than a maximum allowable error; in the case where the matching error of the current data block R is less than the maximum allowable error, determining that the current data block meets a consistency standard; in the case where no domain block D matching the current data block R is searched, or the matching error of the current data block R is not less than the maximum allowable error, determining that the current data block does not meet the consistency standard.

[0130] This embodiment provides an image decoding device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware of predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived. The device includes: a writing unit, which is used to write the value read from the root node of the quadtree into the target matrix, and assign the value of the root node to each element of the matrix, wherein the quadtree is obtained after compression encoding of the target image; a decoding unit, which is used to make corresponding adjustments according to the different values ​​of each element in the target matrix, and each adjustment will expand the rows and columns of the target matrix by 2 times until the target image is restored.

[0131] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0132] The embodiment provides a computer device. The encoding or decoding method in combination with the embodiment of the present application can be implemented by the computer device. Fig. 9 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present application.

[0133] The computer device may include a processor 51 and a memory 52 storing computer program instructions.

[0134] Specifically, the processor 51 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0135] Among them, the memory 52 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 52 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 52 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 52 may be inside or outside the data processing device. In a specific embodiment, the memory 52 is a non-volatile memory. In a specific embodiment, the memory 52 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable ProgrammableRead-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable ProgrammableRead-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0136] The memory 52 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 51 .

[0137] The processor 51 implements any one of the encoding or decoding methods in the above embodiments by reading and executing computer program instructions stored in the memory 52 .

[0138] In some of the embodiments, the computer device may further include a communication interface 53 and a bus 50. Fig. 9 As shown, the processor 51, the memory 52, and the communication interface 53 are connected via a bus 50 and communicate with each other.

[0139] The communication interface 53 is used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 53 can also realize data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.

[0140] The bus 50 includes hardware, software or both, and couples the components of the computer device to each other. The bus 50 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 50 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 50 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0141] In addition, in combination with the encoding or decoding method in the above embodiments, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the encoding or decoding methods in the above embodiments is implemented.

[0142] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0143] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for encoding an image, characterized in that: include: Obtain a target image to be encoded; Dividing the target image into a plurality of image blocks, and distributing the plurality of image blocks to a plurality of computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel; A quadtree decomposition algorithm is used on the computing node to perform image compression coding, wherein the quadtree decomposition algorithm is used to divide the image block into value blocks of different sizes according to the set quadtree maximum depth, quadtree minimum depth and maximum allowable error, each value block has a matching domain block, so that the rough and large-area parts of the image can be transformed and compressed in a way to improve the compression ratio, while the fine and small-area parts of the image can be transformed and compressed in a way to ensure the image restoration quality.

2. The encoding method according to claim 1, characterized in that Dividing the target image into a plurality of image blocks, and distributing the plurality of image blocks to a plurality of computing nodes in a distributed system, comprises: Converting the target image into a target format to meet the format requirements for subsequent processing; dividing the target image in the target format into a plurality of image blocks; The multiple image blocks are distributed to Map tasks on computing nodes in the distributed system, wherein each computing node has at least one Map task, and each Map task is used to encode an image block.

3. The encoding method according to claim 1 or 2, characterized in that: The image compression coding is performed by using a quadtree decomposition algorithm on the computing node, including: The image blocks are compressed using a quadtree decomposition algorithm combined with a bilinear interpolation algorithm to obtain multiple data blocks; Extracting features from the data block, using the extracted features as values ​​and the index or position of the data block as keys, thereby converting the image data into key-value pairs; Partition all key-value pairs according to the key and sort the values ​​of the same key; Merge the key-value pairs of each partition; All key-value pairs are processed and merged to obtain the encoding result.

4. The encoding method according to claim 3, characterized in that: The image blocks are compressed using a quadtree decomposition algorithm, including: When the position of the current data block in the quadtree does not satisfy the minimum depth of the quadtree, the current data block is divided into four data blocks, wherein the current data block is obtained by dividing the image block or the data block on the parent node of the current data block in the quadtree; In the case where the position of the current data block in the quadtree does not satisfy the minimum depth of the quadtree, determining whether the current data block satisfies a consistency criterion, wherein the consistency criterion refers to the existence of a matching data block within a maximum allowable error of the current data block; When the current data block meets the consistency standard or the position of the current data block in the quadtree meets the maximum depth of the quadtree, stop segmenting the current data block; When the current data block does not meet the consistency standard, the current data block is segmented until the segmented data blocks meet the consistency standard or the positions of the segmented data blocks in the quadtree meet the maximum depth of the quadtree.

5. The encoding method according to claim 4, characterized in that: In the process of compressing the image block using the quadtree decomposition algorithm combined with the bilinear interpolation algorithm, the method further includes: For a first pixel point at any position in the compressed data block, obtain the pixel values ​​of four second pixel points around the corresponding position in the data block before compression: f(x1,y1), f(x0,y1), f(x1,y0), f(x0,y0); The pixel value of the first pixel point is calculated by using the pixel values ​​of the four second pixel points using the following formula: z=v×[u×f(x1,y1)+(1-u)×f(x0,y1)]+(1-v)×[u×f(x1,y0)+(1-u)×f(x0,y0)], where u and v are floating point numbers in the interval [0,1).

6. The encoding method according to claim 4, characterized in that: Determining whether the current data block meets the consistency standard includes: Searching from the virtual code table whether there is a domain block D matching the current data block R, so that R=sD+o, wherein the virtual code table stores a plurality of domain blocks, the coefficient s is a compression coefficient, the coefficient o is a grayscale shift coefficient, and the coefficient s and the coefficient o are obtained by using a least square method; In the case where the domain block D is searched, determining whether the matching error of the current data block R is less than the maximum allowable error; When the matching error of the current data block R is less than the maximum allowable error, determining that the current data block meets the consistency standard; In the case that no domain block D matching the current data block R is searched, or the matching error of the current data block R is not less than the maximum allowable error, it is determined that the current data block does not meet the consistency standard.

7. A method for decoding an image, characterized in that: include: Writing the value read from the root node of the quadtree into the target matrix, and assigning the value of the root node to each element of the matrix, wherein the quadtree is obtained after compression encoding the target image; Corresponding adjustments are made according to the different values ​​of each element in the target matrix, and each adjustment is performed by expanding the rows and columns of the target matrix by 2 times until the target image is restored.

8. An image encoding device, characterized in that: include: An acquisition unit, used for acquiring a target image to be encoded; A distribution unit, used for dividing the target image into a plurality of image blocks, and distributing the plurality of image blocks to a plurality of computing nodes in a distributed system, wherein the computing nodes in the distributed system are computing nodes running in parallel; The coding unit is used for performing image compression coding by using a quadtree decomposition algorithm on the computing node, wherein the quadtree decomposition algorithm is used for dividing the image block into value blocks of different sizes according to a set quadtree maximum depth, a quadtree minimum depth and a maximum allowable error, each value block having a matching domain block, so that the rough and large-area parts of the image are transformed and compressed in a manner to improve the compression ratio, while the fine and small-area parts of the image are transformed and compressed in a manner to ensure the image restoration quality.

9. An image decoding device, characterized in that: include: A writing unit, used to write the value read from the root node of the quadtree into the target matrix, and assign the value of the root node to each element of the matrix, wherein the quadtree is obtained after compression encoding the target image; The decoding unit is used to make corresponding adjustments according to the different values ​​of each element in the target matrix, and each time the adjustment is made, the rows and columns of the target matrix are expanded by 2 times until the target image is restored.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Fractal image compression method based on combination of quad tree and neighborhood searching

    CN102595141A

  • Image sequence coding and recovering method based on cloud computing platform

    CN103428494A

  • Remote sensing satellite data decompression processing system and method based on cloud calculation

    CN110855638A

  • Image scaling method and device based on bilinear interpolation algorithm, equipment and medium

    CN114092336A

  • Image fractal coding lossless compression method based on complex exponential moment

    CN116437021A