JPEG image compression method, device, equipment and readable medium

文档序号:1802496 发布日期:2021-11-05 浏览:27次 中文

阅读说明:本技术 一种jpeg图像的压缩方法、装置、设备及可读介质 (JPEG image compression method, device, equipment and readable medium ) 是由 宋金凤 于 2021-06-18 设计创作,主要内容包括:本发明公开了一种JPEG图像的压缩方法,包括:读取当前子块作为基准子块,基于基准子块进行DCT压缩,并将压缩图像数据存入内存;读取下一子块作为相邻子块,并判断相邻子块的源图像数据和基准子块的源图像数据是否相等;响应于相邻子块的源图像数据和基准子块的源图像数据相等,则将省略压缩数加一,并判断省略压缩数是否大于预设次数;响应于省略压缩数不大于预设次数,则将基准子块的压缩图像数据作为相邻子块的压缩图像数据存入内存;以及将相邻子块作为新的基准子块,并将相邻子块的压缩图像数据作为基准子块的压缩图像数据,并返回读取下一子块作为相邻子块的步骤。本发明还公开了一种JPEG图像的压缩装置、计算机设备和可读存储介质。(The invention discloses a JPEG image compression method, which comprises the following steps: reading the current sub-block as a reference sub-block, performing DCT (discrete cosine transformation) compression based on the reference sub-block, and storing compressed image data into an internal memory; reading the next sub-block as an adjacent sub-block, and judging whether the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block; adding one to the omitted compression number in response to the fact that the source image data of the adjacent sub-blocks are equal to the source image data of the reference sub-blocks, and judging whether the omitted compression number is greater than a preset number of times; in response to the omitted compression number not being greater than the preset number, storing the compressed image data of the reference sub-block into the memory as the compressed image data of the adjacent sub-block; and a step of taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the reference sub-block, and returning to read the next sub-block as the adjacent sub-block. The invention also discloses a JPEG image compression device, computer equipment and a readable storage medium.)

1. A JPEG image compression method is characterized by comprising the following steps:

reading a current sub-block as a reference sub-block, performing DCT (discrete cosine transformation) compression based on the reference sub-block, and storing compressed image data into an internal memory;

reading a next sub-block as an adjacent sub-block, and judging whether source image data of the adjacent sub-block is equal to source image data of the reference sub-block or not;

adding one to the omitted compression number in response to the fact that the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block, and judging whether the omitted compression number is greater than a preset number of times;

in response to the omitted compression number not being greater than the preset number, storing the compressed image data of the reference sub-block into a memory as the compressed image data of the adjacent sub-block; and

and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

2. The method of compressing a JPEG image in accordance with claim 1, further comprising:

and judging whether the adjacent subblock is the last subblock or not, if so, performing DCT (discrete cosine transformation) compression on the basis of the adjacent subblock, and storing compressed image data into an internal memory.

3. The method of compressing a JPEG image in accordance with claim 1, further comprising:

responding to the fact that the source image data of the adjacent sub-blocks are not equal to the source image data of the reference sub-blocks, and further judging whether the source image data of the adjacent sub-blocks are similar to the source image data of the reference sub-blocks;

in response to the fact that the source image data of the adjacent sub-blocks are not similar to the source image data of the reference sub-blocks, performing DCT compression based on the adjacent sub-blocks, and storing compressed image data into a memory;

and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

4. The method of compressing a JPEG image in accordance with claim 3, further comprising:

predicting the compressed image data of the adjacent subblock based on the compressed image data of the reference subblock and the compressed image data of the previous reference subblock in response to the similarity between the source image data of the adjacent subblock and the source image data of the reference subblock, and storing the predicted compressed image data into an internal memory;

and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

5. The JPEG image compression method according to claim 4, wherein the predicting the compressed image data of the adjacent sub-block based on the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block comprises:

judging whether the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block;

if the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block, predicting the compressed image data of the adjacent sub-block to be the compressed image data of the reference sub-block;

and if the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block are not equal and are graded in a threshold range, predicting the compressed image data of the adjacent sub-block based on the equal difference value of the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block.

6. The JPEG image compression method of claim 3, wherein the step of determining whether the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are similar comprises the steps of:

judging whether the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within a threshold range;

if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within a threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be similar;

and if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are not graded within the threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be dissimilar.

7. The method of compressing a JPEG image in accordance with claim 1, further comprising:

in response to the omitted compression number being greater than the preset number, performing DCT compression based on the adjacent sub-blocks, and storing compressed image data into a memory;

resetting the omitted compression number to zero, taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

8. An apparatus for compressing a JPEG image, comprising:

the first module is configured to read a current subblock as a reference subblock, perform DCT (discrete cosine transformation) compression based on the reference subblock and store compressed image data into a memory;

the second module is configured to read a next sub-block as an adjacent sub-block and judge whether source image data of the adjacent sub-block is equal to source image data of the reference sub-block;

a third module, configured to add one to the omitted compression number in response to that the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block, and determine whether the omitted compression number is greater than a preset number of times;

a fourth module configured to store the compressed image data of the reference subblock as the compressed image data of the adjacent subblock in a memory in response to the omitted compression number not being greater than a preset number of times; and

and the fifth module is configured to take the adjacent sub-block as a new reference sub-block, take the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and return the compressed image data to the second module.

9. A computer device, comprising:

at least one processor; and

a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.

Technical Field

The present invention relates to the field of image compression technologies, and in particular, to a method, an apparatus, a device, and a readable medium for compressing a JPEG image.

Background

With the rapid development of microelectronic technology, computer technology and communication technology, the human society gradually advances into the information age, images are widely used as information carriers, visual information accounts for 60% of information received by human beings, the data volume of digitized images is huge, and compression of images is necessary and important in the transmission and storage processes of the images.

Jpeg (joint Photographic Experts group) is a first set of encoding algorithm of the international color still image compression standard established by the joint Photographic Experts group, and is widely used because of its good image quality and high compression rate. The main steps include DCT (Discrete Cosine Transform), quantization, and encoding.

In the process of DCT compression of JPEG images, each component of a frame of image needs to be sequentially divided into a plurality of blocks (sub-blocks) from left to right from top to bottom, and DCT transform, quantization and encoding are performed with the blocks as the minimum unit to obtain compressed image data.

In the JPEG image compression algorithm, each sub-block is subjected to DCT, quantization, coding and the like, so that repeated operation is caused, a large amount of calculated amount is generated, and the calculated resource image is wasted.

Disclosure of Invention

In view of this, an object of the embodiments of the present invention is to provide a method, an apparatus, a device, and a readable medium for compressing a JPEG image, which simplify a compression process by detecting the correlation between two adjacent sub-blocks, thereby greatly reducing the amount of computation in the discrete cosine transform compression process, saving resource images, and achieving optimization of image compression.

Based on the above object, an aspect of the embodiments of the present invention provides a method for compressing a JPEG image, including the following steps: reading a current sub-block as a reference sub-block, performing DCT (discrete cosine transformation) compression based on the reference sub-block, and storing compressed image data into an internal memory; reading a next sub-block as an adjacent sub-block, and judging whether source image data of the adjacent sub-block is equal to source image data of the reference sub-block or not; adding one to the omitted compression number in response to the fact that the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block, and judging whether the omitted compression number is greater than a preset number of times; in response to the omitted compression number not being greater than the preset number, storing the compressed image data of the reference sub-block into a memory as the compressed image data of the adjacent sub-block; and a step of taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments, further comprising: and judging whether the adjacent subblock is the last subblock or not, if so, performing DCT (discrete cosine transformation) compression on the basis of the adjacent subblock, and storing compressed image data into an internal memory.

In some embodiments, further comprising: responding to the fact that the source image data of the adjacent sub-blocks are not equal to the source image data of the reference sub-blocks, and further judging whether the source image data of the adjacent sub-blocks are similar to the source image data of the reference sub-blocks; in response to the fact that the source image data of the adjacent sub-blocks are not similar to the source image data of the reference sub-blocks, performing DCT compression based on the adjacent sub-blocks, and storing compressed image data into a memory; and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments, further comprising: predicting the compressed image data of the adjacent subblock based on the compressed image data of the reference subblock and the compressed image data of the previous reference subblock in response to the similarity between the source image data of the adjacent subblock and the source image data of the reference subblock, and storing the predicted compressed image data into an internal memory; and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments, predicting the compressed image data of the neighboring sub-block based on the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block includes: judging whether the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block; if the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block, predicting the compressed image data of the adjacent sub-block to be the compressed image data of the reference sub-block; and if the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block are not equal and are graded in a threshold range, predicting the compressed image data of the adjacent sub-block based on the equal difference value of the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block.

In some embodiments, determining whether the source image data of the adjacent sub-block and the source image data of the reference sub-block are similar comprises: judging whether the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within a threshold range; if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within a threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be similar; and if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are not graded within the threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be dissimilar.

In some embodiments, further comprising: in response to the omitted compression number being greater than the preset number, performing DCT compression based on the adjacent sub-blocks, and storing compressed image data into a memory; resetting the omitted compression number to zero, taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In another aspect of the embodiments of the present invention, there is also provided a JPEG image compression apparatus, including: the first module is configured to read a current subblock as a reference subblock, perform DCT (discrete cosine transformation) compression based on the reference subblock and store compressed image data into a memory; the second module is configured to read a next sub-block as an adjacent sub-block and judge whether source image data of the adjacent sub-block is equal to source image data of the reference sub-block; a third module, configured to add one to the omitted compression number in response to that the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block, and determine whether the omitted compression number is greater than a preset number of times; a fourth module configured to store the compressed image data of the reference subblock as the compressed image data of the adjacent subblock in a memory in response to the omitted compression number not being greater than a preset number of times; and a fifth module configured to take the adjacent sub-block as a new reference sub-block, take the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and return to the second module.

In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method.

In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.

The invention has the following beneficial technical effects: the relevance of two adjacent small blocks is detected, and the compression process is simplified, so that the calculated amount in the discrete cosine transform compression process is greatly reduced, resource images are saved, and the optimization of image compression is realized.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.

FIG. 1 is a diagram illustrating a JPEG image compression method according to an embodiment of the present invention;

FIG. 2 is a diagram of an embodiment of a JPEG image compression device provided by the present invention;

FIG. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention;

FIG. 4 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.

It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.

In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of a method for compressing a JPEG image. Fig. 1 is a schematic diagram illustrating an embodiment of a compression method for JPEG images according to the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:

s01, reading the current sub-block as a reference sub-block, performing DCT compression based on the reference sub-block, and storing compressed image data into a memory;

s02, reading the next sub-block as an adjacent sub-block, and judging whether the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block;

s03, in response to the fact that the source image data of the adjacent sub-block is equal to the source image data of the reference sub-block, adding one to the omitted compression number, and judging whether the omitted compression number is larger than the preset number of times;

s04, in response to the fact that the compression omission number is not larger than the preset number, storing the compressed image data of the reference sub-block into the memory as the compressed image data of the adjacent sub-block; and

and S05, taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In this embodiment, in the DCT-based JPEG image compression process, one frame of image is divided into sub-blocks before compression, and then the sub-blocks are DCT-transformed, quantized, and encoded to form compressed image data. A typical value for the sub-block size is 8 x 8. Two adjacent sub-blocks in a frame of image have great relevance, and compressed image data of the next sub-block can be predicted by detecting the relevance of the two adjacent sub-blocks, so that the condition that each sub-block needs DCT (discrete cosine transformation), quantization and coding is avoided. The compression process is simplified, so that the calculation amount in the DCT compression process is greatly reduced, resource images are saved, and the DCT compression optimization of the JPEG images is realized.

In this embodiment, by comparing the source image data of two adjacent sub-blocks, if the source image data of two sub-blocks are equal, the compressed image data of the previous sub-block may be directly used without repeating the compression process. And predicting the compressed image data of the next sub-block by comparing the compressed image data of the two adjacent sub-blocks, wherein if the compressed image data of the two sub-blocks can directly use the predicted compressed image data, the compression process does not need to be carried out again. And when the two adjacent sub-blocks are not equal and similar, performing a normal compression process on the adjacent sub-blocks. The last sub-block of a frame of image is subjected to the normal compression process to maintain the integrity of the whole frame of image.

In this embodiment, the specific steps include: reading first (b is 0) sub-block source image data of a frame of image, and performing DCT-based compression on the sub-blocks to obtain compressed image data and storing the compressed image data in an internal memory; reading source image data of a second (b is 1) sub-block of the image, taking the source image data as a reference sub-block, and performing DCT-based compression on the sub-block to obtain reference compressed image data and storing the reference compressed image data into an internal memory; the compressed image data of the two subblocks are compared, the initialized first comparison is the compressed image data with b being 0 and b being 1, the reference compressed image data and the adjacent compressed image data are obtained after the second comparison, and the compressed image data of the next subblock is predicted by the method that if the two compressed image data are equal, the compressed image data of the next subblock is equal to the adjacent compressed image data, and if the compressed image data is changed in a gradient manner within the threshold range, the compressed image data of the next subblock is changed in a gradient manner; reading source image data of a next sub-block, namely b +1 as an adjacent sub-block; judging whether the adjacent subblock is the last subblock of a frame image or not, and obtaining the sequence number b of the last subblock according to the row-column size of the resolution; if the last subblock is the last subblock of the frame of image, performing DCT-based compression to complete image compression of the frame, and storing compressed image data into an internal memory; if the sub-block is not the last sub-block of the frame image, comparing the source image data of the reference sub-block and the source image data of the adjacent sub-block; if the source image data of the reference sub-block and the source image data of the adjacent sub-block are equal, DCT compression is not needed to be carried out on the source image data of the adjacent sub-block, and the compression number is omitted and increased by one; judging the compression omission number and a preset maximum value, if the compression omission number is greater than the preset maximum value, namely that a plurality of continuous sub-blocks are not compressed, performing DCT (discrete cosine transformation) compression on adjacent sub-blocks in order to keep the continuity of the whole frame of image and the continuity of data, and storing the compressed image data of the adjacent sub-blocks into an internal memory; if the omitted compression number is smaller than the preset maximum value, namely the source image data of the two sub-blocks are the same, omitting a DCT compression process, storing the compressed image data of the reference sub-block into an internal memory, and updating the compressed image data of the reference sub-block to the adjacent compressed image data; if the source image data of the reference sub-block and the source image data of the adjacent sub-blocks are not equal, continuously comparing whether the source image data of the reference sub-block and the source image data of the adjacent sub-blocks have similarity or not; if the reference sub-block and the adjacent sub-block source image data are graded within the threshold range, the adjacent sub-block source image data do not need to be compressed based on DCT, the predicted compressed image data are stored in the memory, and meanwhile, the predicted compressed image data are updated to the adjacent compressed image data; if the reference sub-block and the adjacent sub-block source image data do not have similarity, DCT compression is carried out on the adjacent sub-block source image data, and the adjacent sub-block compressed image data is stored in a memory; and changing the adjacent sub-block into a reference sub-block, changing the adjacent sub-block compressed image data into the reference sub-block compressed image data, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments of the invention, further comprising: and judging whether the adjacent subblock is the last subblock or not, if so, performing DCT (discrete cosine transformation) compression on the basis of the adjacent subblock, and storing compressed image data into an internal memory.

In some embodiments of the invention, further comprising: responding to the fact that the source image data of the adjacent sub-blocks are not equal to the source image data of the reference sub-blocks, and further judging whether the source image data of the adjacent sub-blocks are similar to the source image data of the reference sub-blocks; in response to the fact that the source image data of the adjacent sub-blocks are not similar to the source image data of the reference sub-blocks, DCT compression is conducted on the basis of the adjacent sub-blocks, and compressed image data are stored in an internal memory; and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments of the invention, further comprising: in response to the similarity between the source image data of the adjacent subblock and the source image data of the reference subblock, predicting the compressed image data of the adjacent subblock based on the compressed image data of the reference subblock and the compressed image data of the previous reference subblock, and storing the predicted compressed image data into an internal memory; and taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

In some embodiments of the present invention, predicting compressed image data of a neighboring sub-block based on compressed image data of a reference sub-block and compressed image data of a previous reference sub-block includes: judging whether the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block; if the compressed image data of the reference sub-block is equal to the compressed image data of the previous reference sub-block, predicting the compressed image data of the adjacent sub-block as the compressed image data of the reference sub-block; and if the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block are not equal and are graded in the threshold range, predicting the compressed image data of the adjacent sub-block based on the equal difference value of the compressed image data of the reference sub-block and the compressed image data of the previous reference sub-block.

In some embodiments of the present invention, determining whether the source image data of the adjacent sub-block and the source image data of the reference sub-block are similar comprises: judging whether the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within a threshold range; if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are graded within the threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be similar; and if the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are not graded within the threshold range, the source image data of the adjacent sub-blocks and the source image data of the reference sub-blocks are considered to be dissimilar.

In some embodiments of the invention, further comprising: in response to the omitted compression number being greater than the preset number, performing DCT compression based on the adjacent sub-blocks, and storing the compressed image data into the memory; resetting the omitted compression number to zero, taking the adjacent sub-block as a new reference sub-block, taking the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and returning to the step of reading the next sub-block as the adjacent sub-block.

It should be particularly noted that, the steps in the embodiments of the compression method for JPEG images may be intersected, replaced, added, or deleted, and therefore, these compression methods for JPEG images that are transformed by reasonable permutation and combination should also fall within the scope of the present invention, and should not limit the scope of the present invention to the embodiments.

In view of the above object, according to a second aspect of the embodiments of the present invention, an apparatus for compressing a JPEG image is provided. Fig. 2 is a schematic diagram of an embodiment of a compression apparatus for JPEG images according to the present invention. As shown in fig. 2, the embodiment of the present invention includes the following modules: a first module S11 configured to read the current subblock as a reference subblock, perform DCT compression based on the reference subblock, and store compressed image data in a memory; a second module S12 configured to read a next sub-block as an adjacent sub-block, and determine whether source image data of the adjacent sub-block is equal to source image data of the reference sub-block; a third module S13 configured to add one to the omitted compression number in response to the source image data of the adjacent sub-block being equal to the source image data of the reference sub-block, and determine whether the omitted compression number is greater than a preset number of times; a fourth module S14 configured to, in response to the omitted compression number not being greater than the preset number of times, store the compressed image data of the reference subblock as compressed image data of an adjacent subblock in the memory; and a fifth block S15 configured to take the adjacent sub-block as a new reference sub-block and the compressed image data of the adjacent sub-block as the compressed image data of the new reference sub-block, and return to the second block.

In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the steps of the above method.

The invention also provides a computer readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method as described above S32.

Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware to complete the processes, and the program of the compression method for JPEG images can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods as described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.

Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.

Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.

Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.

In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.

It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.

It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于云网融合的慧眼监控系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类