[go: up one dir, main page]

CN119324989B - Image compression method, device, electronic equipment and storage medium - Google Patents

Image compression method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN119324989B
CN119324989B CN202411877019.4A CN202411877019A CN119324989B CN 119324989 B CN119324989 B CN 119324989B CN 202411877019 A CN202411877019 A CN 202411877019A CN 119324989 B CN119324989 B CN 119324989B
Authority
CN
China
Prior art keywords
image
compression
remote sensing
peak signal
noise ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411877019.4A
Other languages
Chinese (zh)
Other versions
CN119324989A (en
Inventor
吴日红
卜冬冬
谢永虎
谢珠利
范猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Guanwei Technology Co ltd
Original Assignee
Beijing Guanwei Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Guanwei Technology Co ltd filed Critical Beijing Guanwei Technology Co ltd
Priority to CN202411877019.4A priority Critical patent/CN119324989B/en
Publication of CN119324989A publication Critical patent/CN119324989A/en
Application granted granted Critical
Publication of CN119324989B publication Critical patent/CN119324989B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请提供一种图像压缩方法、装置、电子设备和存储介质,涉及图像处理技术领域。该方法包括:在对遥感图像进行压缩时,可以先对遥感图像进行分块处理,得到多个图像块;针对各图像块,按照目标压缩比对图像块进行压缩,得到第一压缩图像块,并对第一压缩图像块进行解压缩,得到第一解压缩图像块;对多个第一解压缩图像块进行合成,得到第一合成图像;基于第一合成图像与遥感图像之间的峰值信噪比,确定遥感图像的图像压缩结果;其中,峰值信噪比用于表征各第一压缩图像块的压缩质量。本申请提供的技术方案,可以保证压缩图像的图像质量,从而可以在提高压缩效率的同时,保证压缩图像的图像质量。

The present application provides an image compression method, device, electronic device and storage medium, which relate to the field of image processing technology. The method includes: when compressing a remote sensing image, the remote sensing image can be first processed into blocks to obtain multiple image blocks; for each image block, the image block is compressed according to the target compression ratio to obtain a first compressed image block, and the first compressed image block is decompressed to obtain a first decompressed image block; multiple first decompressed image blocks are synthesized to obtain a first synthesized image; based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image, the image compression result of the remote sensing image is determined; wherein the peak signal-to-noise ratio is used to characterize the compression quality of each first compressed image block. The technical solution provided by the present application can ensure the image quality of the compressed image, thereby ensuring the image quality of the compressed image while improving the compression efficiency.

Description

Image compression method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image compression method, an image compression device, an electronic device, and a storage medium.
Background
With the rapid development of satellite remote sensing technology in China, the data volume of the remote sensing image is considered to be huge, and a limited on-board storage and satellite-ground link are brought with a large pressure, so that the compression of the remote sensing image is of great importance.
Because satellite remote sensing imaging has higher cost, the generated remote sensing image is extremely precious, and therefore, when the remote sensing image is compressed, the quality of the compressed image needs to be ensured, namely, a compressed image with high quality needs to be obtained. However, a problem of low compression efficiency is often associated with a high-quality compressed image, and therefore, how to obtain a high-quality compressed image while improving compression efficiency is a problem to be solved by those skilled in the art.
Disclosure of Invention
The application provides an image compression method, an image compression device, electronic equipment and a storage medium, which can improve the compression efficiency and ensure the image quality of a compressed image when the remote sensing image is compressed.
The application provides an image compression method, which comprises the following steps:
performing blocking processing on a remote sensing image to be processed to obtain a plurality of image blocks;
compressing the image blocks according to a target compression ratio for each image block to obtain a first compressed image block, and decompressing the first compressed image block to obtain a first decompressed image block;
synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image;
and determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing the compression quality of each first compressed image block.
According to the image compression method provided by the application, the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image, and the method comprises the following steps:
Reducing the target compression ratio under the condition that the peak signal-to-noise ratio is smaller than a peak signal-to-noise ratio threshold;
Compressing the image blocks based on the reduced target compression ratio for each image block to obtain a second compressed image block, decompressing the second compressed image block to obtain a second decompressed image block;
synthesizing the plurality of second decompressed image blocks to obtain a new first synthesized image;
continuing to reduce the target compression ratio under the condition that the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold value, and repeatedly executing the steps until the target compression ratio is reduced to a preset compression ratio;
And determining the image compression result based on the preset compression ratio.
According to the image compression method provided by the application, the image compression result is determined based on the preset compression ratio, and the method comprises the following steps:
compressing the image blocks according to the preset compression ratio for each image block to obtain a third compressed image block, and decompressing the third compressed image block to obtain a third decompressed image block;
Synthesizing the plurality of third decompressed image blocks to obtain a second synthesized image;
Under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, compressing each image block by adopting an LZW compression algorithm to obtain a fourth compressed image block corresponding to each image block;
And synthesizing the fourth decompressed image blocks, and determining the synthesized image as the image compression result.
According to the image compression method provided by the application, the method further comprises the following steps:
And synthesizing a plurality of third compressed image blocks under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is greater than or equal to the peak signal-to-noise ratio threshold, and determining the synthesized image as the image compression result.
According to the image compression method provided by the application, the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image, and the method comprises the following steps:
and under the condition that the peak signal-to-noise ratio is greater than or equal to a peak signal-to-noise ratio threshold, synthesizing a plurality of first compressed image blocks, and determining the synthesized image as the image compression result.
According to the image compression method provided by the application, the method further comprises the following steps:
Determining an image mean square error based on the gray value of each pixel point in the first composite image and the gray value of each pixel point in the remote sensing image;
And determining the peak signal-to-noise ratio based on the image mean square error and a maximum gray value, wherein the maximum gray value is the maximum gray value in gray values corresponding to all pixel points in the remote sensing image.
The present application also provides an image compression apparatus including:
The blocking unit is used for carrying out blocking processing on the remote sensing image to be processed to obtain a plurality of image blocks;
The compression and decompression unit is used for compressing the image blocks according to a target compression ratio to obtain a first compressed image block, and decompressing the first compressed image block to obtain a first decompressed image block;
A first synthesizing unit, configured to synthesize a plurality of first decompressed image blocks to obtain a first synthesized image;
And the processing unit is used for determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing the compression quality of each first compressed image block.
According to the image compression device provided by the application, the processing unit is used for determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, and comprises the following steps:
Reducing the target compression ratio under the condition that the peak signal-to-noise ratio is smaller than a peak signal-to-noise ratio threshold;
Compressing the image blocks based on the reduced target compression ratio for each image block to obtain a second compressed image block, decompressing the second compressed image block to obtain a second decompressed image block;
synthesizing the plurality of second decompressed image blocks to obtain a new first synthesized image;
continuing to reduce the target compression ratio under the condition that the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold value, and repeatedly executing the steps until the target compression ratio is reduced to a preset compression ratio;
And determining the image compression result based on the preset compression ratio.
According to the image compression device provided by the application, the processing unit is used for determining the image compression result based on the preset compression ratio, and comprises the following steps:
compressing the image blocks according to the preset compression ratio for each image block to obtain a third compressed image block, and decompressing the third compressed image block to obtain a third decompressed image block;
Synthesizing the plurality of third decompressed image blocks to obtain a second synthesized image;
Under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, compressing each image block by adopting an LZW compression algorithm to obtain a fourth compressed image block corresponding to each image block;
And synthesizing the fourth decompressed image blocks, and determining the synthesized image as the image compression result.
According to the present application, there is provided an image compression apparatus, the apparatus further comprising:
And the second synthesis unit is used for synthesizing the plurality of third compressed image blocks under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is greater than or equal to the peak signal-to-noise ratio threshold value, and determining the synthesized image as the image compression result.
According to the present application, there is provided an image compression apparatus, the apparatus further comprising:
and the third synthesis unit is used for synthesizing the plurality of first compressed image blocks under the condition that the peak signal-to-noise ratio is greater than or equal to the peak signal-to-noise ratio threshold value, and determining the synthesized image as the image compression result.
According to the present application, there is provided an image compression apparatus, the apparatus further comprising:
The first determining unit is used for determining an image mean square error based on the gray value of each pixel point in the first composite image and the gray value of each pixel point in the remote sensing image;
And the second determining unit is used for determining the peak signal-to-noise ratio based on the image mean square error and the maximum gray value, wherein the maximum gray value is the maximum gray value in gray values corresponding to all pixel points in the remote sensing image.
The application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the image compression method as described in any one of the above when executing the computer program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements an image compression method as described in any of the above.
The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the image compression method as described in any one of the above.
The image compression method, the device, the electronic equipment and the storage medium can firstly carry out block division processing on the remote sensing image to obtain a plurality of image blocks when the remote sensing image is compressed, compress the image blocks according to a target compression ratio for each image block to obtain a first compressed image block, decompress the first compressed image block to obtain a first decompressed image block, synthesize the plurality of first decompressed image blocks to obtain a first synthesized image, and determine an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing compression quality of each first compressed image block. In addition, the peak signal-to-noise ratio is considered to be better used for evaluating the compression quality of the remote sensing image after compression, so that the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first composite image and the remote sensing image, the image quality of the compressed image can be ensured, and the image quality of the compressed image can be ensured while the compression efficiency is improved.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an image compression method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a framework for determining an image compression result of a remote sensing image according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an image compression apparatus according to an embodiment of the present application.
Fig. 4 is a schematic entity structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or" describes an association relationship of associated objects, meaning that there may be three relationships, e.g., A and/or B, and that there may be three cases where A exists alone, while A exists with B, and B exists alone, where A and B may be singular or plural. In the text description of the present application, the character "/" generally indicates that the front-rear associated object is an or relationship.
The technical scheme provided by the embodiment of the application can be suitable for an image compression scene, taking a remote sensing image compression scene as an example, because the satellite remote sensing imaging cost is high, the generated remote sensing image is extremely precious, and therefore, when the remote sensing image is compressed, the quality of the compressed image needs to be ensured, namely, a compressed image with high quality needs to be obtained.
However, since a high-quality compressed image is generally associated with a problem of low compression efficiency, in order to improve the compression efficiency and ensure the image quality of the compressed image when the remote sensing image is compressed, the embodiment of the application provides an image compression method, and an execution subject of the method may be electronic equipment such as a computer or a server, or an image compression device provided in the electronic equipment, and the image compression device may be implemented by software, hardware or a combination of the two.
Hereinafter, the image compression method provided by the present application will be described in detail by the following several specific examples. It is to be understood that the following embodiments may be combined with each other and that some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 1 is a flowchart of an image compression method according to an embodiment of the present application, for example, please refer to fig. 1, the image compression method may include:
S101, performing blocking processing on the remote sensing image to be processed to obtain a plurality of image blocks.
Illustratively, in the embodiment of the present application, in order to effectively improve the compression efficiency of the remote sensing image, a multi-core architecture parallelization process may be adopted. The multi-core architecture realizes a divide-and-conquer strategy, and by dividing tasks, the thread application can fully utilize a plurality of execution cores and execute more tasks in a specific time.
In the embodiment of the application, a process-thread model in a multi-core architecture can be adopted, and a main process reads a remote sensing image to be processed and carries out blocking processing on the remote sensing image according to the number of a plurality of threads included in the remote sensing image to obtain a plurality of image blocks.
For example, the number of image blocks may be equal to the number of threads or may be smaller than the number of sub-threads, so as to ensure that one image block corresponds to one thread. In the embodiment of the application, the number of the image blocks can be equal to the number of threads, so that the compression efficiency can be effectively improved compared with the compression of the whole remote sensing image by carrying out the blocking processing on the remote sensing image and carrying out the parallel compression on the image blocks through the threads corresponding to the image blocks.
S102, compressing the image blocks according to a target compression ratio for each image block to obtain a first compressed image block, and decompressing the first compressed image block to obtain a first decompressed image block.
The target compression ratio may be 20, 25, or other values, for example, and may be specifically set according to actual needs.
When the image block is compressed, considering that the JPEG2000 compression algorithm has good low bit rate compression performance, can progressively transmit according to pixel precision and resolution, supports lossless compression and lossy compression, and has access and processing of region-of-interest coding and random code streams, for example, in the embodiment of the present application, the image block can be compressed by adopting the JPEG2000 compression algorithm, so that the data volume of the compressed image block can be effectively reduced under the condition of ensuring the compression quality of the image block.
The JPEG2000 compression algorithm discards a block coding mode mainly based on discrete cosine transform, changes a multi-resolution coding mode mainly based on discrete wavelet transform DWT algorithm, and can be applied to coding scenes of different types (such as gray level images, color images, multi-component images, etc.), different properties (such as natural images, remote sensing images, drawing graphics, etc.), and different imaging models (such as real-time transmission, limited buffering, bandwidth resources, etc.).
After the image blocks are compressed by adopting a JPEG2000 compression algorithm to obtain first compressed image blocks, the first compressed image blocks can be decompressed by adopting a decompression method corresponding to the JPEG2000 compression algorithm to obtain corresponding first decompressed image blocks.
S103, synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image.
In the embodiment of the present application, a method of direct pixel operation may be used to synthesize the plurality of first decompressed image blocks, a method based on feature matching and fusion may be used to synthesize the plurality of first decompressed image blocks, or a deep learning manner may be used to synthesize the plurality of first decompressed image blocks, which may be specifically set according to actual needs.
After synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image, the following S104 may be performed:
S104, determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing compression quality of each first compressed image block.
Considering that the peak signal-to-noise ratio can be monitored in real time, and when the peak signal-to-noise ratio exceeds 30dB, the difference between the original image and the compressed image is difficult to distinguish by human vision, so in the embodiment of the application, the compressed quality of the remote sensing image after compression is evaluated based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image.
According to the embodiment of the application, when the remote sensing image is compressed, the remote sensing image can be firstly subjected to block division processing to obtain a plurality of image blocks, the image blocks are compressed according to the target compression ratio for each image block to obtain a first compressed image block, the first compressed image block is decompressed to obtain a first decompressed image block, the plurality of first decompressed image blocks are synthesized to obtain a first synthesized image, and the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing the compression quality of each first compressed image block. In addition, the peak signal-to-noise ratio is considered to be better used for evaluating the compression quality of the remote sensing image after compression, so that the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first composite image and the remote sensing image, the image quality of the compressed image can be ensured, and the image quality of the compressed image can be ensured while the compression efficiency is improved.
Based on the embodiment shown in fig. 1, for example, in the embodiment of the present application, when determining the peak signal-to-noise ratio between the first composite image and the remote sensing image, the image mean square error may be determined based on the gray value of each pixel point in the first composite image and the gray value of each pixel point in the remote sensing image, and the peak signal-to-noise ratio may be determined based on the image mean square error and the maximum gray value.
The maximum gray value is the maximum gray value in the gray values corresponding to the pixel points in the remote sensing image.
The remote sensing image corresponds to a two-dimensional matrix, each pixel point is a sample point, the row number of the pixel point is the coordinate position (i, j) of the pixel point in the remote sensing image, wherein i represents the row number of the pixel point in the remote sensing image, j represents the column number of the pixel point in the remote sensing image, and,M represents the total line number of the pixel points in the remote sensing image, and N represents the total column number of the pixel points in the remote sensing image.
For example, when determining the mean square error of an image based on the gray value of each pixel in the first composite image and the gray value of each pixel in the remote sensing image, the following equation 1 may be referred to.
Equation 1
Wherein, Representing the mean square error of the image,Representing the gray value of the pixel point of the ith row and the jth column in the remote sensing image,And representing the gray value of the pixel point of the ith row and the jth column in the first composite image.
For example, when determining the peak signal-to-noise ratio based on the image mean square error and the maximum gray value, see equation 2 below.
Equation 2
Where PSNR represents the peak signal-to-noise ratio,And representing the maximum gray value in the gray values corresponding to the pixel points in the remote sensing image. In general, the larger the PSNR, the higher the consistency of the first composite image and the remote sensing image is represented, and the better the corresponding compressed image quality is, and conversely, the smaller the PSNR, the lower the consistency of the first composite image and the remote sensing image is represented, the larger the corresponding compressed image distortion degree is, and the worse the image quality is.
In combination with the above description, after determining the peak signal-to-noise ratio between the first composite image and the remote sensing image, the step S104 may be performed to determine the image compression result of the remote sensing image based on the peak signal-to-noise ratio between the first composite image and the remote sensing image. Referring to fig. 2, fig. 2 is a schematic diagram of a framework for determining an image compression result of a remote sensing image according to an embodiment of the present application, and detailed description can be made on how to determine the image compression result of the remote sensing image based on a peak signal-to-noise ratio between a first composite image and the remote sensing image.
Illustratively, in the embodiment of the present application, when determining the image compression result of the remote sensing image based on the peak signal-to-noise ratio between the first composite image and the remote sensing image, at least two possible scenarios may be included as follows.
In one scenario, a peak signal-to-noise ratio between the first composite image and the remote sensing image is greater than or equal to a peak signal-to-noise ratio threshold.
Under the condition that the peak signal-to-noise ratio is greater than or equal to the peak signal-to-noise ratio threshold, the compression quality of the plurality of first compressed image blocks is better, in this case, the plurality of first compressed image blocks can be directly synthesized, and the synthesized image is determined as an image compression result. After the image compression result is obtained, the image compression result can be stored in the disk file, and all threads are closed, so that thread resources are realized.
In another scenario, a peak signal-to-noise ratio between the first composite image and the remote sensing image is less than a peak signal-to-noise ratio threshold.
Under the condition that the peak signal-to-noise ratio is smaller than the peak signal-to-noise ratio threshold, the compression quality of the image blocks of the plurality of first compression blocks is poor, and under the condition, the target compression ratio can be reduced; taking the target compression ratio as 20 as an example, the target compression ratio may be reduced to 10, that is, the reduced target compression ratio is 10, for each image block, the image block is compressed based on the reduced target compression ratio to obtain a second compressed image block, the second compressed image block is decompressed to obtain a second decompressed image block, the plurality of second decompressed image blocks are synthesized to obtain a new first synthesized image, and when the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is greater than or equal to the peak signal-to-noise ratio threshold, it is indicated that the compression quality of the plurality of second compressed image blocks is better, in this case, the plurality of second compressed image blocks may be directly synthesized, and the synthesized image is determined as an image compression result. After the image compression result is obtained, the image compression result can be stored in the disk file, and all threads are closed, so that thread resources are realized.
In contrast, in the case that the new peak signal-to-noise ratio between the new first composite image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, it is indicated that the compression quality of the plurality of second compressed block image blocks is poor, in this case, the target compression ratio may be continuously reduced, for example, taking the reduced target compression ratio as 10 as an example, the target compression ratio may be continuously reduced as 5, and the above steps are repeatedly performed until the target compression ratio is reduced to the preset compression ratio, and the image compression result is determined based on the preset compression ratio.
The preset compression ratio may be 5, 6, etc. as an example, and may be specifically set according to actual needs.
Illustratively, in the embodiment of the present application, when determining the image compression result based on the preset compression ratio, it may include:
The method comprises the steps of compressing image blocks according to a preset compression ratio to obtain third compressed image blocks, decompressing the third compressed image blocks to obtain third decompressed image blocks, synthesizing the plurality of third decompressed image blocks to obtain a second synthesized image, and under the condition that the peak signal-to-noise ratio between the second synthesized image and a remote sensing image is greater than or equal to a peak signal-to-noise ratio threshold value, indicating that the compression quality of the plurality of third compressed image blocks is good, and under the condition, directly synthesizing the plurality of third compressed image blocks, and determining the synthesized image as an image compression result. After the image compression result is obtained, the image compression result can be stored in the disk file, and all threads are closed, so that thread resources are realized.
In contrast, when the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, the compression quality of the image blocks of the plurality of second compression blocks is poor, in this case, the LZW compression algorithm may be adopted to compress each image block to obtain a fourth compression image block corresponding to each image block, and the plurality of fourth decompression image blocks are synthesized, and the synthesized image is determined as an image compression result.
The LZW compression algorithm is a dictionary-based compression algorithm, the information sequence output by the information source is regarded as various entries in the dictionary, and the basic idea is to build the dictionary, map the input character string into a codeword with a fixed length and output the codeword. The dictionary is dynamically established according to the data characteristics of the information source, and the coding process is the process of establishing the dictionary. In the compression process, new character strings are continuously generated in the dictionary, and codewords corresponding to prefixes of the new character strings are also stored when the new character strings are stored. The advantage of the LZW compression algorithm is to dynamically label repeated data strings that occur in the data stream. The character string encountered in the compression process is recorded in a dictionary, and when the character string is encountered next time, the character string is represented by a code, and the data volume is compressed by representing a relatively long character string by a short code, so that the data compression software such as Pkzip, winzip, winRAR has the LZW data compression algorithm and has better compression effect.
It can be seen that, in the embodiment of the application, when the remote sensing image is compressed, the remote sensing image is firstly subjected to block division processing, and the image blocks are compressed according to the target compression ratio for each image block to obtain a first compressed image block, the first compressed image block is decompressed to obtain a first decompressed image block, a plurality of first decompressed image blocks are synthesized to obtain a first synthesized image, and the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first synthesized image and the remote sensing image. In addition, the peak signal-to-noise ratio is considered to be better used for evaluating the compression quality of the remote sensing image after compression, so that the image compression result of the remote sensing image is determined based on the peak signal-to-noise ratio between the first composite image and the remote sensing image, the image quality of the compressed image can be ensured, and the image quality of the compressed image can be ensured while the compression efficiency is improved.
The image compression apparatus provided by the present application will be described below, and the image compression apparatus described below and the image compression method described above may be referred to correspondingly to each other.
Fig. 3 is a schematic structural diagram of an image compression apparatus according to an embodiment of the present application, for example, referring to fig. 3, the image compression apparatus 30 may include:
The blocking unit 301 is configured to perform blocking processing on a remote sensing image to be processed, so as to obtain a plurality of image blocks;
A compression and decompression unit 302, configured to compress the image blocks according to a target compression ratio for each image block to obtain a first compressed image block, and decompress the first compressed image block to obtain a first decompressed image block;
a first synthesizing unit 303, configured to synthesize a plurality of first decompressed image blocks to obtain a first synthesized image;
The processing unit 304 is configured to determine an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first composite image and the remote sensing image, where the peak signal-to-noise ratio is used to characterize compression quality of each of the first compressed image blocks.
Illustratively, in the embodiment of the present application, the processing unit 304 is configured to determine, based on a peak signal-to-noise ratio between the first composite image and the remote sensing image, an image compression result of the remote sensing image, including:
Reducing the target compression ratio under the condition that the peak signal-to-noise ratio is smaller than a peak signal-to-noise ratio threshold;
Compressing the image blocks based on the reduced target compression ratio for each image block to obtain a second compressed image block, decompressing the second compressed image block to obtain a second decompressed image block;
synthesizing the plurality of second decompressed image blocks to obtain a new first synthesized image;
continuing to reduce the target compression ratio under the condition that the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold value, and repeatedly executing the steps until the target compression ratio is reduced to a preset compression ratio;
And determining the image compression result based on the preset compression ratio.
Illustratively, in the embodiment of the present application, the processing unit 304 is configured to determine the image compression result based on the preset compression ratio, including:
compressing the image blocks according to the preset compression ratio for each image block to obtain a third compressed image block, and decompressing the third compressed image block to obtain a third decompressed image block;
Synthesizing the plurality of third decompressed image blocks to obtain a second synthesized image;
Under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, compressing each image block by adopting an LZW compression algorithm to obtain a fourth compressed image block corresponding to each image block;
And synthesizing the fourth decompressed image blocks, and determining the synthesized image as the image compression result.
Illustratively, in an embodiment of the present application, the image compression apparatus 30 further includes:
And the second synthesis unit is used for synthesizing the plurality of third compressed image blocks under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is greater than or equal to the peak signal-to-noise ratio threshold value, and determining the synthesized image as the image compression result.
Illustratively, in an embodiment of the present application, the image compression apparatus 30 further includes:
and the third synthesis unit is used for synthesizing the plurality of first compressed image blocks under the condition that the peak signal-to-noise ratio is greater than or equal to the peak signal-to-noise ratio threshold value, and determining the synthesized image as the image compression result.
Illustratively, in an embodiment of the present application, the image compression apparatus 30 further includes:
The first determining unit is used for determining an image mean square error based on the gray value of each pixel point in the first composite image and the gray value of each pixel point in the remote sensing image;
And the second determining unit is used for determining the peak signal-to-noise ratio based on the image mean square error and the maximum gray value, wherein the maximum gray value is the maximum gray value in gray values corresponding to all pixel points in the remote sensing image.
The image compression apparatus 30 provided in the embodiment of the present application may execute the technical scheme of the image compression method in any of the embodiments, and the implementation principle and beneficial effects of the image compression method are similar to those of the image compression method, and reference may be made to the implementation principle and beneficial effects of the image compression method, and no further description is given here.
Fig. 4 is a schematic physical structure of an electronic device according to an embodiment of the present application, as shown in fig. 4, the electronic device may include a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430, and a communication bus 440, where the processor 410, the communication interface 420, and the memory 430 complete communication with each other through the communication bus 440. The processor 410 may invoke logic instructions in the memory 430 to perform an image compression method, where the method includes performing a blocking process on a remote sensing image to be processed to obtain a plurality of image blocks, compressing the image blocks according to a target compression ratio for each of the image blocks to obtain a first compressed image block, decompressing the first compressed image block to obtain a first decompressed image block, synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image, and determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, where the peak signal-to-noise ratio is used to characterize compression quality of each of the first compressed image blocks.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
In another aspect, the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program is capable of being stored on a non-transitory computer readable storage medium, and where the computer program, when executed by a processor, is capable of executing an image compression method provided by the above methods, where the method includes performing a blocking process on a remote sensing image to be processed to obtain a plurality of image blocks, compressing the image blocks according to a target compression ratio for each of the image blocks to obtain a first compressed image block, decompressing the first compressed image block to obtain a first decompressed image block, synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image, and determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, where the peak signal-to-noise ratio is used to characterize a compression quality of each of the first compressed image block.
In yet another aspect, the present application further provides a non-transitory computer readable storage medium, on which a computer program is stored, the computer program being implemented when executed by a processor to perform the image compression method provided by the above methods, the method comprising performing a blocking process on a remote sensing image to be processed to obtain a plurality of image blocks, compressing the image blocks according to a target compression ratio for each of the image blocks to obtain a first compressed image block, decompressing the first compressed image block to obtain a first decompressed image block, synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image, determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used to characterize a compression quality of each of the first compressed image blocks.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same, and although the present application has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present application.

Claims (9)

1. An image compression method, comprising:
performing blocking processing on a remote sensing image to be processed to obtain a plurality of image blocks;
compressing the image blocks according to a target compression ratio for each image block to obtain a first compressed image block, and decompressing the first compressed image block to obtain a first decompressed image block;
synthesizing the plurality of first decompressed image blocks to obtain a first synthesized image;
determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing compression quality of each first compressed image block;
the determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first composite image and the remote sensing image includes:
Reducing the target compression ratio under the condition that the peak signal-to-noise ratio is smaller than a peak signal-to-noise ratio threshold;
Compressing the image blocks based on the reduced target compression ratio for each image block to obtain a second compressed image block, decompressing the second compressed image block to obtain a second decompressed image block;
synthesizing the plurality of second decompressed image blocks to obtain a new first synthesized image;
continuing to reduce the target compression ratio under the condition that the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold value, and repeatedly executing the steps until the target compression ratio is reduced to a preset compression ratio;
And determining the image compression result based on the preset compression ratio.
2. The image compression method according to claim 1, wherein the determining the image compression result based on the preset compression ratio includes:
compressing the image blocks according to the preset compression ratio for each image block to obtain a third compressed image block, and decompressing the third compressed image block to obtain a third decompressed image block;
Synthesizing the plurality of third decompressed image blocks to obtain a second synthesized image;
Under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold, compressing each image block by adopting an LZW compression algorithm to obtain a fourth compressed image block corresponding to each image block;
And synthesizing the fourth decompressed image blocks, and determining the synthesized image as the image compression result.
3. The image compression method according to claim 2, characterized in that the method further comprises:
And synthesizing a plurality of third compressed image blocks under the condition that the peak signal-to-noise ratio between the second synthesized image and the remote sensing image is greater than or equal to the peak signal-to-noise ratio threshold, and determining the synthesized image as the image compression result.
4. A method of image compression according to any one of claims 1 to 3, further comprising:
and under the condition that the peak signal-to-noise ratio is greater than or equal to a peak signal-to-noise ratio threshold, synthesizing a plurality of first compressed image blocks, and determining the synthesized image as the image compression result.
5. A method of image compression according to any one of claims 1 to 3, further comprising:
Determining an image mean square error based on the gray value of each pixel point in the first composite image and the gray value of each pixel point in the remote sensing image;
And determining the peak signal-to-noise ratio based on the image mean square error and a maximum gray value, wherein the maximum gray value is the maximum gray value in gray values corresponding to all pixel points in the remote sensing image.
6. An image compression apparatus, comprising:
The blocking unit is used for carrying out blocking processing on the remote sensing image to be processed to obtain a plurality of image blocks;
The compression and decompression unit is used for compressing the image blocks according to a target compression ratio to obtain a first compressed image block, and decompressing the first compressed image block to obtain a first decompressed image block;
A first synthesizing unit, configured to synthesize a plurality of first decompressed image blocks to obtain a first synthesized image;
The processing unit is used for determining an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first synthesized image and the remote sensing image, wherein the peak signal-to-noise ratio is used for representing the compression quality of each first compressed image block;
The processing unit is configured to determine an image compression result of the remote sensing image based on a peak signal-to-noise ratio between the first composite image and the remote sensing image, and includes:
Reducing the target compression ratio under the condition that the peak signal-to-noise ratio is smaller than a peak signal-to-noise ratio threshold;
Compressing the image blocks based on the reduced target compression ratio for each image block to obtain a second compressed image block, decompressing the second compressed image block to obtain a second decompressed image block;
synthesizing the plurality of second decompressed image blocks to obtain a new first synthesized image;
continuing to reduce the target compression ratio under the condition that the new peak signal-to-noise ratio between the new first synthesized image and the remote sensing image is smaller than the peak signal-to-noise ratio threshold value, and repeatedly executing the steps until the target compression ratio is reduced to a preset compression ratio;
And determining the image compression result based on the preset compression ratio.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the image compression method of any one of claims 1 to 5 when the computer program is executed.
8. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the image compression method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program which, when executed by a processor, implements the image compression method according to any one of claims 1 to 5.
CN202411877019.4A 2024-12-19 2024-12-19 Image compression method, device, electronic equipment and storage medium Active CN119324989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411877019.4A CN119324989B (en) 2024-12-19 2024-12-19 Image compression method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411877019.4A CN119324989B (en) 2024-12-19 2024-12-19 Image compression method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN119324989A CN119324989A (en) 2025-01-17
CN119324989B true CN119324989B (en) 2025-04-08

Family

ID=94231251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411877019.4A Active CN119324989B (en) 2024-12-19 2024-12-19 Image compression method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN119324989B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103400349A (en) * 2013-07-20 2013-11-20 西安电子科技大学 Method for reconstructing image based on blind compressed sensing module
CN117939128A (en) * 2023-12-29 2024-04-26 北京声智科技有限公司 Image compression method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002314821A (en) * 2001-04-18 2002-10-25 Ricoh Co Ltd Image compression method, image expansion method, image compression device, and image expansion device
KR101367777B1 (en) * 2012-08-22 2014-03-06 주식회사 핀그램 Adaptive predictive image compression system and method thereof
CN115514976B (en) * 2022-07-15 2025-03-21 中国电信股份有限公司 Image encoding method, decoding method, device, readable medium and electronic device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103400349A (en) * 2013-07-20 2013-11-20 西安电子科技大学 Method for reconstructing image based on blind compressed sensing module
CN117939128A (en) * 2023-12-29 2024-04-26 北京声智科技有限公司 Image compression method and device and electronic equipment

Also Published As

Publication number Publication date
CN119324989A (en) 2025-01-17

Similar Documents

Publication Publication Date Title
CN111641826B (en) Method, device and system for encoding and decoding data
CN111630570A (en) Image processing method, device, and computer-readable storage medium
US8170334B2 (en) Image processing systems employing image compression and accelerated image decompression
CN103873877A (en) Image transmission method and device for remote desktop
US8170333B2 (en) Image processing systems employing image compression
CN115150628B (en) Method for coding coarse-to-fine depth video with super-priori guided mode prediction
TWI479456B (en) Method and apparatus for data compression using error plane coding
CN117939128A (en) Image compression method and device and electronic equipment
CN113079378B (en) Image processing method and device and electronic equipment
CN111050170A (en) GAN-based image compression system construction method, compression system and method
CN119254971A (en) A video data compression and reconstruction method, system, device and medium
Wang et al. A customized deep network based encryption-then-lossy-compression scheme of color images achieving arbitrary compression ratios
CN114979665B (en) Image compression method, device, electronic device and storage medium
US8170335B2 (en) Image processing systems employing image compression and accelerated decompression
CN111787321A (en) Image compression and decompression method and system for edge end based on deep learning
US9948928B2 (en) Method and apparatus for encoding an image
CN108182712B (en) Image processing method, device and system
CN116112673A (en) Encoding and decoding method and electronic equipment
CN109474826B (en) Picture compression method and device, electronic equipment and storage medium
CN119324989B (en) Image compression method, device, electronic equipment and storage medium
US12278957B2 (en) Video encoding and decoding methods, encoder, decoder, and storage medium
Hussin et al. A comparative study on improvement of image compression method using hybrid DCT-DWT techniques with Huffman encoding for wireless sensor network application
CN114882133B (en) Image encoding and decoding method, system, device and medium
US20120155749A1 (en) Method and device for coding a multidimensional digital signal
CN111107360A (en) Spectrum-space dimension combined hyperspectral image lossless compression method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Image compression method device electronic equipment storage medium

Granted publication date: 20250408

Pledgee: Beijing Rural Commercial Bank Co.,Ltd. Business Center District Branch

Pledgor: BEIJING GUANWEI TECHNOLOGY Co.,Ltd.

Registration number: Y2025980030271