Efficient compression method for gray-scale images based on image processing

By performing size feature segmentation and grayscale histogram analysis on grayscale images, single-peak and multi-peak feature image sub-blocks are distinguished. Different compression methods are then applied to process these sub-blocks, solving the problem of balancing quality and ratio in grayscale image compression and achieving efficient image compression.

CN120881279BActive Publication Date: 2025-12-09XIAN AERONAUTICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511386799.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-12-09
Estimated Expiration
2045-09-26

AI Technical Summary

Technical Problem

Existing technologies struggle to improve the compression ratio while maintaining grayscale image quality. Direct lossless compression is computationally complex, while direct lossy compression leads to a decrease in image quality.

Method used

By dividing the grayscale image into size features, the grayscale histogram feature values ​​of the image sub-blocks are obtained, distinguishing between single-peak and multi-peak feature image sub-blocks, and processing them with different compression methods according to the peak domain features, including lossy and lossless compression.

Benefits of technology

It achieves improved compression ratio, reduced computational complexity, and preservation of image detail information while maintaining image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120881279B_ABST
    Figure CN120881279B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image compression, and particularly relates to a gray-scale image efficient compression method based on image processing; the image is divided into sub-blocks according to the size characteristics of the gray-scale image; unimodal characteristic image sub-blocks and multimodal characteristic image sub-blocks are obtained according to the pixel number characteristics of the gray levels in the gray-scale histogram of the image sub-blocks; different peak domains are obtained according to the pixel number characteristics of the different gray levels of the multimodal characteristic image sub-blocks; the overlapping characteristic values are obtained according to the peak interval characteristics and distribution characteristics between the peak domains; the peak value difference degree is obtained according to the height difference characteristics between the peak domains; the gray levels of the pixel points in the multimodal characteristic image sub-blocks are mapped and the kurtosis properties of the multimodal characteristic image sub-blocks are re-judged according to the overlapping characteristic values and the peak value difference degree. The present application uses different compression methods to compress the multimodal characteristic image sub-blocks and the unimodal characteristic image sub-blocks, thereby improving the compression effect while ensuring the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image compression technology, and particularly relates to a gray image efficient compression method based on image processing. BACKGROUND

[0002] With the increasingly wide application of digital images, the amount of image data is growing explosively, for example, a high-resolution gray medical image may occupy several megabytes or tens of megabytes of storage space; through efficient compression processing, the size of the image file can be significantly reduced, the transmission speed can be improved and the storage cost can be saved. For the compression processing of gray images, the existing technology is usually divided into two processing methods of lossy compression and lossless compression; the principle of direct lossless compression is to establish a redundancy model between the gray image data, and to remove redundant information without losing any original image data by using coding technology, but due to the limited redundancy information in the image, the compression ratio of lossless compression is usually low, and the calculation complexity of lossless compression is too high, which consumes more computing resources and time. And the principle of direct lossy compression is to discard some secondary information in the image to reduce the data volume, but this method cannot avoid the decline of image quality and even the distortion of image, which limits the reuse value of the image.

[0003] Therefore, in the process of compressing the gray image, direct lossless compression and direct lossy compression are difficult to balance the relationship between the image quality after compression and the compression ratio, and cannot achieve the purpose of improving the compression ratio while ensuring the image quality. SUMMARY

[0004] In order to solve the above technical problems, the purpose of the present application is to provide a gray image efficient compression method based on image processing, and the technical scheme adopted is as follows:

[0005] Obtaining a gray image to be compressed;

[0006] According to the size characteristics of the gray image, the image sub-blocks are divided; according to the pixel point number difference characteristics of each gray level in the gray histogram of the image sub-blocks, a first peak state characteristic value is obtained; according to the pixel point number proportion characteristics of the gray levels in the gray histogram, a second peak state characteristic value is obtained;

[0007] According to the first peak state characteristic value and the second peak state characteristic value, single-peak characteristic image sub-blocks and multi-peak characteristic image sub-blocks are obtained; according to the pixel point number characteristics of different gray levels of the multi-peak characteristic image sub-blocks, different peak domains in the gray histogram are obtained; according to the peak interval characteristics and distribution characteristics between the peak domains, an overlap characteristic value is obtained; according to the height difference characteristics between the peak domains, a peak value difference degree is obtained;

[0008] mapping the gray scale of the pixel points in the multi-peak feature image sub-block according to the overlap characteristic value and the peak difference degree, and re-determining the peak property of the multi-peak feature image sub-block; and compressing the multi-peak feature image sub-block and the unimodal feature image sub-block using different compression modes.

[0009] Further, the step of dividing the image sub-block according to the size characteristic of the gray scale image comprises:

[0010] wherein n represents the side length of the image sub-block, a represents a preset first adjustment parameter, b represents a preset second adjustment parameter, and s represents the geometric mean value of the gray scale image; the gray scale image is divided by the side length n to obtain different image sub-blocks.

[0011] Further, the step of obtaining the first peak characteristic value according to the pixel point quantity difference characteristic of each gray scale level in the gray scale histogram of the image sub-block comprises:

[0012] calculating the peak coefficient of the pixel point quantity corresponding to all gray scale levels in the gray scale histogram of the image sub-block and positively correlating mapping to obtain the first peak characteristic value of the image sub-block.

[0013] Further, the step of obtaining the second peak characteristic value according to the pixel point quantity proportion characteristic of the gray scale level in the gray scale histogram comprises:

[0014] calculating the ratio of the pixel point quantity of the gray scale level with the largest pixel point quantity to the pixel point quantity of all gray scale levels in the gray scale histogram to obtain the second peak characteristic value of the image sub-block.

[0015] Further, the step of obtaining the unimodal feature image sub-block and the multi-peak feature image sub-block according to the first peak characteristic value and the second peak characteristic value comprises:

[0016] when the first peak characteristic value exceeds a preset first threshold value and the second peak characteristic value exceeds a preset second threshold value, the image sub-block is a unimodal feature image sub-block, otherwise it is a multi-peak feature image sub-block.

[0017] Further, the step of obtaining different peak domains in the gray scale histogram according to the pixel point quantity characteristic of different gray scale levels of the multi-peak feature image sub-block comprises:

[0018] constructing the envelope line of the gray scale histogram of the multi-peak feature image sub-block and obtaining the peak points in the envelope line, calculating the product of the peak points and a preset drop multiple and taking the integer part to obtain the boundary corresponding to the peak points; taking the gray scale level interval corresponding to the boundary as a peak domain.

[0019] Further, the step of obtaining the overlap characteristic value according to the peak interval characteristic and the distribution characteristic between the peak domains comprises:

[0020] , wherein, represents the overlap characteristic value of the peak domain x and the peak domain y, represents an exponential function with a natural constant as a base, represents the mean value of the gray scale of the peak domain x, represents the mean value of the gray scale of the peak domain y, represents the difference degree value, represents the interval length between the left boundary gray scale and the right boundary gray scale of the peak domain x and y, represents the width of the peak domain x, represents the width of the peak domain y, represents the distribution interval degree.

[0021] Further, the step of obtaining the peak value difference degree according to the height difference characteristic between the peak domains comprises:

[0022] The ratio of the maximum value of the pixel point number of each peak domain to the pixel point number of the multi-peak characteristic image sub-block is calculated to obtain a significant degree; the difference between the maximum value of the significant degree and the significant degree corresponding to any other peak domain is calculated and normalized to obtain the peak value difference degree between the peak domains.

[0023] Further, the step of mapping the gray scale of the pixel point in the multi-peak characteristic image sub-block according to the overlap characteristic value and the peak value difference degree and re-determining the peak state attribute of the multi-peak characteristic image sub-block comprises:

[0024] When the peak value difference degree exceeds a preset difference threshold, the pixel point gray scale in the significant degree maximum value peak domain is mapped into the median value of the gray scale; when the overlap characteristic value of any two peak domains exceeds a preset overlap threshold, the pixel point gray scale in the any two peak domains is mapped into the mean value of the gray scale of the any two peak domains; when only one peak domain exists in the multi-peak characteristic image sub-block after the mapping is completed, the peak state attribute of the multi-peak characteristic image sub-block is converted into a single-peak characteristic image sub-block.

[0025] Further, the step of compressing the multi-peak characteristic image sub-block and the single-peak characteristic image sub-block using different compression modes comprises:

[0026] The single-peak characteristic image sub-block is compressed using a lossy compression mode, and the multi-peak characteristic image sub-block is compressed using a lossless compression mode.

[0027] The present application has the following beneficial effects:

[0028] In the present application, dividing the image sub-blocks can use different ways to compress the image sub-blocks, preliminarily realize guaranteeing the image quality while improving the compression ratio. Obtaining the first kurtosis characteristic value and the second kurtosis characteristic value can determine the kurtosis characteristics of the pixel gray scale distribution in the gray scale histogram of the image sub-blocks, and then obtain the unimodal characteristic image sub-blocks and the multimodal characteristic image sub-blocks according to the kurtosis characteristics of the image sub-blocks in the gray scale histogram; obtaining the unimodal characteristic image sub-blocks and the multimodal characteristic image sub-blocks can determine the compression methods suitable for different image sub-blocks, and further realize guaranteeing the image quality while improving the compression ratio. Obtaining the peak domain can determine the gray scale range of a large number of pixels in the multimodal characteristic image sub-blocks. Obtaining the overlap characteristic value can represent the overlap degree between the peak domains, and obtaining the peak value difference degree can determine the difference degree between the peak domains, so as to determine the peak domains that can perform the gray scale mapping according to the overlap characteristic value and the peak value difference degree, further improve the compression effect and as much as possible retain the image detail information. Finally, using different compression methods to compress the multimodal characteristic image sub-blocks and the unimodal characteristic image sub-blocks can guarantee the image quality while improving the compression ratio. BRIEF DESCRIPTION OF DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, and the advantages thereof, below will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0030] Figure 1 A flow chart of a gray scale image efficient compression method based on image processing provided by an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to further illustrate the technical means and effects taken by the present application to achieve the predetermined purposes, below will combine the drawings and the preferred embodiments to specifically describe the specific implementation, structure, features and effects of the gray scale image efficient compression method based on image processing according to the present application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.

[0033] The specific scheme of the gray scale image efficient compression method based on image processing provided by the present application will be specifically described below with reference to the drawings.

[0034] Referring to Figure 1 , which shows a flow chart of an efficient compression method of a gray-scale image based on image processing provided by an embodiment of the present application, the method comprises the following steps:

[0035] Step S1, obtaining a gray-scale image to be compressed.

[0036] Before the compression processing of the gray-scale image, preprocessing is needed, the purpose of which is to eliminate irrelevant information, enhance key features and simplify data structure, so as to improve the efficiency and reliability of subsequent processing; the specific steps include: geometric correction, the purpose of which is to correct the geometric distortion caused by the shooting angle, lens distortion or equipment in the image acquisition process, to ensure that the image content is consistent with the real scene, and the method is affine transformation or projection transformation. After correction, image enhancement is performed, the purpose of which is to highlight key information, suppress noise or irrelevant details, and improve image contrast and clarity, and the method is histogram equalization, contrast stretching, mean filtering, median filtering and Gaussian filtering algorithm. It should be noted that the implementer can select different existing geometric correction and image enhancement algorithms for preprocessing operation according to the characteristics of the gray-scale image, so as to improve the efficiency and reliability of subsequent compression processing; after preprocessing is completed, the gray-scale image to be compressed is obtained.

[0037] Step S2, dividing the image sub-block according to the size characteristics of the gray-scale image; obtaining a first kurtosis characteristic value according to the pixel point number difference characteristics of each gray level in the gray-scale histogram of the image sub-block; obtaining a second kurtosis characteristic value according to the pixel point number proportion characteristics of the gray levels in the gray-scale histogram.

[0038] The prior art usually performs lossless compression or lossy compression on the entire gray-scale image, but since the information amount contained in each region of the gray-scale image is different, it is difficult to achieve the purpose of high quality and high compression ratio using the same compression method. The embodiment of the present application proposes an efficient and intelligent compression idea, which first divides the gray-scale image to obtain different sub-blocks, and then dynamically selects a compression strategy according to the characteristics in the sub-blocks; wherein the characteristic analysis is mainly based on the kurtosis characteristics shown in the gray-scale histogram corresponding to the sub-blocks, when the gray-scale histogram presents multiple kurtosis characteristics, it means that there are multiple objects and regions of different gray levels in the image, and theoretically more gray levels need to be retained to avoid information loss; and based on this idea, further analysis is carried out, by analyzing the kurtosis characteristics in the histogram, the gray levels are reasonably quantized or discarded under certain conditions, to achieve lossy but efficient compression.

[0039] Firstly, the gray-scale image is divided, and the gray-scale image is divided into sub-blocks of the same size through a basic uniform grid division method, so the image sub-block is divided according to the size characteristics of the gray-scale image; preferably, in the embodiment of the present application, the step of obtaining the image sub-block comprises: , wherein n represents the side length of the image sub-block, a represents a preset first adjustment parameter, b represents a preset second adjustment parameter, and s represents the geometric mean of the gray-scale image; the gray-scale image is divided by the side length n to obtain different image sub-blocks. , wherein w and h respectively represent the number of pixel points on two sides of the gray-scale image; s represents the equivalent size of the gray-scale image and can be calculated by using a geometric mean or an arithmetic mean; taking the calculation of the geometric mean in the embodiment of the present application as an example, the trend of the image sub-block changing with the size of the gray-scale image can be controlled by adjusting the values of a and b; if it is desired that the size of the image sub-block be more sensitive to the change of the image size, the value of a can be increased; if it is desired that the size of the image sub-block not be too small when the image size is small, the value of b can be appropriately increased; the implementer can determine the values of a and b according to the implementation scene. It should be noted that the uniform grid division method belongs to the prior art and the specific process will not be described again; compared with the dynamic division method combining the features of the internal edge texture and gradient of the image, the uniform grid division method has the advantages of high calculation efficiency, low algorithm complexity and higher stability, and the division method can ensure that the whole image is uniformly divided, facilitating subsequent analysis and processing, thereby realizing efficient compression of the gray-scale image.

[0040] Further, the lossy compression can realize the efficiency and real-time performance of image compression, the core of which is to remove the redundant information in the image and retain the visual important information as much as possible by reducing the gray scale or frequency domain conversion; the gray-scale histogram of the image sub-block can directly reflect the redundant features and analyze the compression distortion degree of the lossy compression on the image sub-block, the more concentrated the gray scale of the pixel points in the histogram, the smaller the influence of the lossy compression on the visual effect; therefore, the kurtosis feature in the gray-scale histogram of the image sub-block can be analyzed to select a suitable compression strategy, and thus the first kurtosis feature value is obtained according to the difference characteristics of the pixel point number of each gray scale in the gray-scale histogram of the image sub-block.

[0041] Preferably, in the embodiment of the present application, the step of obtaining the first kurtosis feature value comprises: calculating the kurtosis coefficient of the pixel point number corresponding to all gray scales in the gray-scale histogram of the image sub-block and performing positive correlation mapping to obtain the first kurtosis feature value of the image sub-block; in the embodiment of the present application, the positive correlation mapping is performed by using the tanh hyperbolic tangent function. The kurtosis coefficient belongs to the prior art, the greater the kurtosis coefficient, the greater the first kurtosis feature value, which means that the distribution characteristics of the pixel point gray scale in the gray-scale histogram are more obvious than the sharp peak characteristics of the normal distribution, the pixel point gray value is highly concentrated, and a unimodal feature is presented; on the contrary, the smaller the kurtosis coefficient, the smaller the first kurtosis feature value, which means that the pixel point gray scale is relatively flat or exists multiple peaks. The formula for obtaining the first kurtosis feature value comprises:

[0042] wherein Z represents a first kurtosis characteristic value, N represents the number of gray levels in the histogram, represents the number of pixel points of the i-th gray level, represents the mean value of the number of pixel points in the gray levels, represents the standard deviation of the number of pixel points in the gray levels, and the minus 3 is to make the kurtosis coefficient of the normal distribution 0, represents the kurtosis coefficient, represents the hyperbolic tangent function, which can make the value range map to -1 to 1, and when the first kurtosis characteristic value is greater than 0, it means that the unimodal feature is more obvious.

[0043] Further, if the pixel point quantity corresponding to a certain gray level in the gray histogram accounts for a higher proportion, the unimodal feature of the histogram is more obvious, so the second kurtosis characteristic value is obtained according to the pixel point quantity proportion characteristic of the gray levels in the gray histogram; preferably, in the embodiment of the present application, the step of obtaining the second kurtosis characteristic value comprises: calculating the ratio of the pixel point quantity of the gray level with the most pixel points to the pixel point quantity of all the gray levels, to obtain the second kurtosis characteristic value of the image sub-block; when the second kurtosis characteristic value is greater, it means that the pixel point gray values of the image sub-block are more consistent, and the gray histogram presents more unimodal features.

[0044] Step S3, obtaining the unimodal feature image sub-block and the multi-peak feature image sub-block according to the first kurtosis characteristic value and the second kurtosis characteristic value; obtaining different peak domains in the gray histogram according to the pixel point quantity characteristics of different gray levels of the multi-peak feature image sub-block; obtaining the overlap characteristic value according to the peak interval characteristics and distribution characteristics between the peak domains; obtaining the peak value difference degree according to the height difference characteristics between the peak domains.

[0045] After the first peak state characteristic value and the second peak state characteristic value are obtained, a unimodal characteristic image sub-block and a multimodal characteristic image sub-block can be obtained according to the first peak state characteristic value and the second peak state characteristic value; preferably, in the embodiment of the present application, when the first peak state characteristic value exceeds a preset first threshold value and the second peak state characteristic value exceeds a preset second threshold value, the image sub-block is a unimodal characteristic image sub-block, otherwise, it is a multimodal characteristic image sub-block. In the embodiment of the present application, the preset first threshold value is 0, and the preset second threshold value is 0.8, which can meet the robustness in various image sub-block scenarios, and the implementer can determine it according to the implementation scenario. For the unimodal characteristic image sub-block presenting obvious unimodal characteristic, it means that there are a large number of similar gray values in the image, which can be compressed efficiently through coarse quantization or entropy coding, such as reducing the gray level or Huffman coding, which can improve the compression effect while retaining important information. For the multimodal characteristic image sub-block presenting multimodal characteristic, it means that the pixel points have multiple gray scale ranges, and coarse quantization is easy to cause the gray levels between different peaks to be incorrectly merged, thereby causing edge blur, texture distortion and other details loss. Therefore, the multimodal characteristic image sub-block needs to be further analyzed to avoid details loss while improving the compression effect.

[0046] Further, when the gray histogram presents multimodal characteristic, if the gray level ranges of multiple peaks overlap or the peak spacing is small, it means that the gray characteristics of a large number of pixel points are similar, so the gray levels of such peak domains can be mapped to the same representative value by merging the overlapping peaks, thereby reducing the distribution of gray levels, and improving the compression effect while minimizing the loss of image details. First, different peak domains in the gray histogram are obtained according to the pixel point quantity characteristics of different gray levels of the multimodal characteristic image sub-block; preferably, in the embodiment of the present application, obtaining different peak domains includes: constructing an envelope line of the gray histogram of the multimodal characteristic image sub-block and obtaining peak points in the envelope line, it should be noted that constructing an envelope line belongs to the prior art, and the specific steps are not described again, and the envelope line can weaken the small change characteristics of the pixel point quantity of the gray level, so that the selection of the peak point is more representative. The product of the peak point and a preset drop factor is calculated and rounded down to obtain the boundary corresponding to the peak point; in the embodiment of the present application, the preset drop factor is 0.8, for example, the peak point is 100, and the boundary value is 80, and the gray level with a pixel point quantity of 80 on the left and right sides of the peak point is taken as the boundary of the peak domain, and the implementer can determine the preset drop factor according to the implementation scenario; the gray level interval corresponding to the boundary is taken as the peak domain. The peak domain represents the gray interval in which a large number of pixel points in the multimodal characteristic image sub-block are concentrated; further, an overlap characteristic value can be obtained according to the peak spacing characteristics and distribution characteristics between the peak domains; preferably, in the embodiment of the present application, the step of obtaining the overlap characteristic value includes:

[0047] In the formula, an overlap characteristic value representing the overlap of peak domain x and peak domain y, an exponential function with a natural constant as base, a gray level mean value of peak domain x, a gray level mean value of peak domain y, a difference degree value, when the gray level mean values of the two peak domains are closer, the difference degree value is smaller, meaning that the peak distance is closer and the pixel gray level characteristics are more similar. a left boundary gray level of peak domain x and y, and a right boundary gray level, a interval length between the left boundary of the left peak domain and the right boundary of the right peak domain, when the two peak domains are farther apart, the interval length is longer. a width of peak domain x, a width of peak domain y, a distribution interval degree, when the two peak domains overlap, the width of the two peak domains exceeds the interval length, and the distribution interval degree is smaller; on the contrary, when the two peak domains are farther apart, the interval length is larger due to the gray levels in the middle that do not belong to the peak domains, and the width of the two peak domains is larger, so the distribution interval degree is larger. Therefore, when the overlap characteristic value is larger, it means that the overlap of the two peak domains is larger, and the gray level range of a large number of pixel points in the multi-peak characteristic image sub-block is closer, so that the gray levels of the two peak domains that overlap too much can be mapped in the same gray level, thereby improving the compression effect while ensuring the image quality.

[0048] Further, if the main peak height in the gray level histogram of the multi-peak characteristic image sub-block is obviously higher than the secondary peak, and the area of the secondary peak corresponding region is small, it can be considered that the secondary peak is more likely to be caused by noise, reflection or irrelevant details, and has limited overall visual impact, so the secondary peak corresponding gray level can be discarded and mapped to the vicinity of the main peak gray level, thereby ensuring the image quality while improving the compression effect. Therefore, a peak value difference degree between the peak domains is obtained according to the height difference characteristics of the peak domains; preferably, in the embodiment of the present application, the step of obtaining the peak value difference degree comprises: calculating the ratio of the maximum number of pixel points of each peak domain to the number of pixel points of the multi-peak characteristic image sub-block to obtain a significant degree; when the significant degree is larger, it means that the number of pixel points in the gray level corresponding to the peak domain is larger. The maximum value of the significant degree is calculated, and the difference between the significant degree of any other peak domain is normalized to obtain the peak value difference degree between the peak domains; when the peak value difference degree is larger, it means that the number of pixel points of the maximum peak domain is larger than the number of pixel points of the any other peak domain; the smaller the number of pixel points of the any other peak domain is, the more the corresponding gray level can be discarded.

[0049] In step S4, the gray scale of the pixel points in the multi-peak feature image sub-block is mapped according to the overlap characteristic value and the peak difference degree, and the peak state attribute of the multi-peak feature image sub-block is re-determined; and different compression modes are used to compress the multi-peak feature image sub-block and the single-peak feature image sub-block.

[0050] After the overlap characteristic value and the peak difference degree of the multi-peak feature image sub-block are obtained, the gray scale of the pixel points in the multi-peak feature image sub-block is mapped according to the overlap characteristic value and the peak difference degree, and the peak state attribute of the multi-peak feature image sub-block is re-determined; preferably, in the embodiment of the present application, when the peak difference degree exceeds a preset difference threshold, the gray scale of the pixel points in any other peak domain is mapped to the middle value of the gray scale of the peak domain with the maximum saliency degree; the mapping step specifically includes: calculating the middle value of the gray scale of the peak domain with the maximum saliency degree, and replacing the gray scale of the pixel points in the any other peak domain with the middle value. In the embodiment of the present application, the preset difference threshold is 0.7, which can be determined by the implementer according to the implementation scene; through the mapping, the gray scale range of the pixel points in the image sub-block can be more concentrated, the compression effect can be improved, and the loss of visual effect can be reduced. When the overlap characteristic value of any two peak domains exceeds a preset overlap threshold, it means that the two peak domains have high overlap; in the embodiment of the present application, the preset overlap threshold is 0.5, which can be determined by the implementer according to the implementation scene; the gray scale of the pixel points in the any two peak domains is mapped to the average value of the gray scale of the any two peak domains; the gray scale of a large number of pixel points with high similarity in gray scale distribution is kept consistent, the compression effect is improved, and the image quality is not excessively affected; the mapping step specifically includes: calculating the average value of the gray scale of the pixel points in the any two peak domains, and replacing the gray scale of the pixel points in the any two peak domains with the average value. When there is only one peak domain in the multi-peak feature image sub-block after the mapping is completed, the peak state attribute of the multi-peak feature image sub-block is converted into a single-peak feature image sub-block, otherwise, it is still a multi-peak feature image sub-block. The implementer can determine the value of the mapping of the gray scale of the peak domain according to the implementation scene.

[0051] Further, the multi-peak features of the multi-peak feature image sub-block are mapped and re-divided into peak state attributes, and then the multi-peak feature image sub-block and the single-peak feature image sub-block are compressed by using different compression methods; preferably, in the embodiment of the present application, the single-peak feature image sub-block is compressed by using a lossy compression method, and the multi-peak feature image sub-block is compressed by using a lossless compression method. Since the single-peak feature image sub-block has more redundant information, a coarse quantization method can be used, for example, the 256 levels are compressed to 32 levels, so as to reduce the number of stored gray levels; or an existing entropy encoding algorithm is used for compression, for example, a DPCM differential pulse code modulation, which uses the spatial correlation of pixels to store only the difference between the current pixel point and the left or upper pixel point, and by using the algorithm combined with the single-peak feature, the number of bits of entropy encoding can be reduced, and the compression effect can be improved. For the multi-peak feature image sub-block, if the compression scene requires high image quality, lossless compression can be directly performed; if the image quality requirement is low, an adaptive lossy compression algorithm can be selected according to the peak state feature, for the peak domain with a high pixel point ratio, a fine quantization method is used to reduce the gray level compression degree, for example, 256 levels are compressed to 128 levels, so as to retain details, and for the peak domain with a low pixel point ratio, a coarse quantization method is used, for example, 256 levels are compressed to 32 levels, so as to improve the compression effect. By using different compression methods for different image sub-blocks, the display effect of important details in the entire gray scale image can be ensured, and the compression effect can be improved; the implementer can set the compression method according to the peak state attribute of the image sub-block, which is not limited herein.

[0052] In summary, the embodiment of the present application provides a gray scale image efficient compression method based on image processing; the image sub-blocks are divided according to the size characteristics of the gray scale image; the single-peak feature image sub-block and the multi-peak feature image sub-block are obtained according to the pixel point number characteristics of the gray levels in the gray scale histogram of the image sub-block; different peak domains are obtained according to the pixel point number characteristics of different gray levels of the multi-peak feature image sub-block; the overlapping characteristic value is obtained according to the peak interval characteristics and the distribution characteristics between the peak domains; the peak value difference degree is obtained according to the height difference characteristics between the peak domains; the gray levels of the pixel points in the multi-peak feature image sub-block are mapped and the peak state attribute of the multi-peak feature image sub-block is re-determined according to the overlapping characteristic value and the peak value difference degree. The multi-peak feature image sub-block and the single-peak feature image sub-block are compressed by using different compression methods, so that the image quality is ensured and the compression effect is improved.

[0053] It should be noted that the above-mentioned embodiment of the present application is only for description, and does not represent the advantages and disadvantages of the embodiment. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or may be advantageous.

[0054] The various embodiments described in this specification are presented by way of example, and each embodiment is not inherently more important than any other embodiment.

Claims

1. A method for efficient compression of gray scale images based on image processing, characterized in that, The method comprises the following steps: Obtaining a gray image to be compressed; According to the size characteristics of the gray image, the image sub-blocks are divided; according to the pixel number difference characteristics of each gray level in the gray histogram of the image sub-blocks, the first kurtosis characteristic value is obtained; according to the pixel number proportion characteristics of the gray levels in the gray histogram, the second kurtosis characteristic value is obtained; According to the first kurtosis characteristic value and the second kurtosis characteristic value, the unimodal characteristic image sub-blocks and the multimodal characteristic image sub-blocks are obtained; according to the pixel number characteristics of different gray levels of the multimodal characteristic image sub-blocks, the different peak domains in the gray histogram are obtained; according to the peak interval characteristics and the distribution characteristics between the peak domains, the overlapping characteristic value is obtained; according to the height difference characteristics between the peak domains, the peak value difference degree is obtained; According to the overlapping characteristic value and the peak value difference degree, the gray levels of the pixels in the multimodal characteristic image sub-blocks are mapped and the kurtosis properties of the multimodal characteristic image sub-blocks are re-determined; different compression modes are used to compress the multimodal characteristic image sub-blocks and the unimodal characteristic image sub-blocks; The step of obtaining the first kurtosis characteristic value according to the pixel number difference characteristics of each gray level in the gray histogram of the image sub-blocks comprises: The peak kurtosis coefficients of the pixel numbers corresponding to all gray levels in the gray histogram of the image sub-blocks are calculated and positively correlated to obtain the first kurtosis characteristic value of the image sub-blocks; The step of obtaining the second kurtosis characteristic value according to the pixel number proportion characteristics of the gray levels in the gray histogram comprises: The ratio of the pixel number of the gray level with the largest pixel number to the pixel numbers of all gray levels in the gray histogram is calculated to obtain the second kurtosis characteristic value of the image sub-blocks; The step of obtaining the peak value difference degree according to the height difference characteristics between the peak domains comprises: The ratio of the maximum pixel number of each peak domain to the pixel number of the multimodal characteristic image sub-block is calculated to obtain the significance degree; the difference between the maximum value of the significance degree and the significance degree corresponding to any other peak domain is calculated and normalized to obtain the peak value difference degree between the peak domains; The step of mapping the gray levels of the pixels in the multimodal characteristic image sub-blocks and re-determining the kurtosis properties of the multimodal characteristic image sub-blocks according to the overlapping characteristic value and the peak value difference degree comprises: When the peak value difference degree exceeds a preset difference threshold, the pixel gray levels in the arbitrary other peak domain are mapped to the median value of the gray levels of the peak domain with the maximum significance degree; when the overlapping characteristic value of any two peak domains exceeds a preset overlapping threshold, the pixel gray levels in the any two peak domains are mapped to the mean value of the gray levels of the any two peak domains; when there is only one peak domain in the multimodal characteristic image sub-block after the mapping is completed, the kurtosis property of the multimodal characteristic image sub-block is converted to the unimodal characteristic image sub-block.

2. The method according to claim 1, wherein, The step of dividing the image sub-blocks according to the size characteristics of the gray image comprises: , wherein n represents the side length of the image sub-block, a represents a preset first adjustment parameter, b represents a preset second adjustment parameter, and s represents the geometric mean value of the gray-scale image; the gray-scale image is divided by the side length n to obtain different image sub-blocks.

3. The method of claim 1, wherein the method is characterized by, The step of obtaining the unimodal characteristic image sub-blocks and the multimodal characteristic image sub-blocks according to the first kurtosis characteristic value and the second kurtosis characteristic value comprises: When the first kurtosis characteristic value exceeds a preset first threshold value and the second kurtosis characteristic value exceeds a preset second threshold value, the image sub-block is a unimodal feature image sub-block, otherwise, the image sub-block is a multimodal feature image sub-block.

4. The method according to claim 1, wherein, The step of obtaining different peak domains in the gray level histogram according to the pixel point quantity characteristics of different gray levels of the multimodal feature image sub-block comprises: An envelope line of the gray level histogram of the multimodal feature image sub-block is constructed, and a peak point in the envelope line is obtained; a product of the peak point and a preset descending multiple is calculated and is rounded down to obtain a boundary corresponding to the peak point; and a gray level interval corresponding to the boundary is taken as a peak domain.

5. The method of claim 1, wherein the method is characterized by, The step of obtaining an overlap characteristic value according to the peak interval characteristics and distribution characteristics between the peak domains comprises: wherein represents the overlap characteristic value of the peak area x and the peak area y, represents an exponential function with a natural constant as a base, represents the average of the gray scale of the peak area x, represents the average of the gray scale of the peak area y, represents the difference degree value, represents the interval length between the left boundary gray scale and the right boundary gray scale of the peak area x and y, represents the width of the peak area x, represents the width of the peak area y, represents the distribution interval degree.

6. The method of claim 1, wherein, The step of compressing the multimodal feature image sub-block and the unimodal feature image sub-block using different compression modes comprises: The unimodal feature image sub-block is compressed using a lossy compression mode, and the multimodal feature image sub-block is compressed using a lossless compression mode.

Citation Information

Patent Citations

  • Grayscale image compression method and device based on approximate difference calculation and decompression method

    CN116866603A

  • Audio and video media transmission method and system

    CN119767009A