Computer image compression method and system based on artificial intelligence

By performing four-way neighborhood subtraction and union image processing on the image, the redundancy and redundancy of the image are calculated, and the optimal compression method is selected, which solves the problem of poor image compression effect in the existing technology and achieves more efficient storage and transmission.

CN114463450BActive Publication Date: 2026-02-27HENAN POLYTECHNIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210118171.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2026-02-27
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

Existing image compression techniques cannot maximize the use of spatial redundancy, resulting in poor compression performance.

Method used

By acquiring the grayscale image of the image to be compressed, performing neighborhood subtraction in four directions, generating a difference image union image, calculating duplicate pixels and redundancy, and selecting the optimal compression method.

Benefits of technology

It achieves the selection of the optimal compression method based on the spatial redundancy of the image, maximizing storage space utilization or reducing transmission bandwidth loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463450B_ABST
    Figure CN114463450B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image compression, and particularly relates to a computer image compression method and system based on artificial intelligence. The method comprises the following steps: obtaining a gray image and four difference images of the gray image of a to-be-compressed image; obtaining a union image and first pixel points with a pixel value of zero and second pixel points with a pixel value of non-zero, obtaining the number of repeated pixel points in the gray image according to the number of second pixel points in the neighborhood pixel points of the first pixel points and the number of first pixel points in the neighborhood pixel points of the second pixel points; taking the number proportion of the repeated pixel points in the gray image as the spatial repetition degree of the to-be-compressed image; obtaining the spatial redundancy by obtaining the bit number required for compressing the union image and the to-be-compressed image; obtaining the compressible degree of the to-be-compressed image according to the spatial repetition degree and the spatial redundancy; and selecting the optimal compression method for each to-be-compressed image by using the compressible degree. The present application can select the optimal compression method according to the spatial redundancy of the image.
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, in particular to a computer image compression method and system based on artificial intelligence. BACKGROUND

[0002] In the information age, the amount of data increases greatly, and various data stored or transmitted in people's daily life need to be compressed under certain circumstances. Image compression refers to the technology of representing the original pixel matrix with fewer bits with loss or without loss, which is the application of data compression technology in the field of digital images.

[0003] Image compression can reduce the storage space for storing images or reduce the bandwidth requirement in the transmission process. Image compression is mostly based on spatial redundancy, but different compression methods are selected for images with different redundancy degrees, and the compression effect is different. Most of the compression methods used at present are non-selective and cannot maximize the use of space. SUMMARY

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

[0005] In a first aspect, an embodiment of the present application provides a computer image compression method based on artificial intelligence, which comprises the following steps:

[0006] Obtain a gray image of a to-be-compressed image, and perform neighborhood difference on the gray image from four directions of up, down, left and right respectively to obtain four corresponding difference images;

[0007] According to the union of the pixel values of the four difference images, a union image is obtained, the first pixel point with a pixel value of zero and the second pixel point with a pixel value other than zero in the union image are obtained, the number of repeated pixel points in the gray image is obtained according to the number of second pixel points in the neighborhood of the first pixel point and the number of first pixel points in the neighborhood of the second pixel point, and the number proportion of the repeated pixel points in the gray image is taken as the spatial redundancy of the to-be-compressed image;

[0008] Obtain the number of third pixel points with a pixel value less than a preset threshold in the union image, obtain the first bit number required for compressing the union image according to the number of third pixel points, obtain the second bit number required for directly compressing the to-be-compressed image, and obtain the spatial redundancy of the to-be-compressed image according to the first bit number and the second bit number;

[0009] The compressible degree of the to-be-compressed image is obtained according to the spatial repetition degree and the spatial redundancy degree; a plurality of to-be-compressed images with the same compressible degree are compressed by using different compression methods respectively, and corresponding compression effects are obtained; and the optimal compression method of each to-be-compressed image is selected by using the compressible degree and the compression effect.

[0010] Preferably, the difference image is obtained by:

[0011] A pixel matrix is constructed according to the gray-scale image, and a new row or column is obtained by sequentially performing difference operation on a first row or column and an adjacent row or column from four directions of the matrix, so as to form the difference image.

[0012] Preferably, the first pixel point is obtained by:

[0013] The image coordinates of the first pixel point with a pixel value of zero in the union image are obtained by traversing the union image, and the number of the first pixel points is recorded.

[0014] Preferably, the number of the repeated pixel points in the gray-scale image is obtained by:

[0015] For each first pixel point, the number of second pixel points in the neighborhood of the first pixel point is recorded, so as to obtain the preliminary number of the repeated pixel points corresponding to each first pixel point in the gray-scale image.

[0016] The number of repeated calculations of each second pixel point is obtained according to the number of first pixel points in the neighborhood of the second pixel point, and the number of the repeated pixel points is obtained according to the preliminary number and the number of repeated calculations of all second pixel points.

[0017] Preferably, the preliminary number is obtained by:

[0018] For each first pixel point, the sum of the number of second pixel points in the four neighborhood pixel points of the first pixel point and the number of the first pixel point itself is taken as the number of local repeated pixel points corresponding to the first pixel point in the gray-scale image, and the sum of the numbers of local repeated pixel points corresponding to all first pixel points is the preliminary number.

[0019] Preferably, the number of the repeated pixel points is obtained by:

[0020] For each second pixel point, the number of first pixel points in the four neighborhood pixel points of the second pixel point is obtained, and the number of repeated calculations of the second pixel point is obtained by subtracting one from the number; the number of the repeated pixel points is obtained by subtracting the sum of the numbers of repeated calculations of all second pixel points from the preliminary number.

[0021] Preferably, the first bit number is obtained by:

[0022] The product of the number of bits required for compression of the third pixel points and the number of the third pixel points is obtained, and the product of the number of bits required for the remaining pixel points other than the third pixel points and the number of the remaining pixel points is obtained, and the sum of the two products is taken as the first number of bits.

[0023] Preferably, the method for obtaining the compression effect is:

[0024] The first number of bytes required for direct storage of the image to be compressed and the second number of bytes required for storage after compression are obtained, and the ratio of the first number of bytes to the second number of bytes is taken as the compression effect.

[0025] In a second aspect, another embodiment of the present application provides an artificial intelligence-based computer image compression system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the artificial intelligence-based computer image compression method described above when executing the computer program.

[0026] The embodiments of the present application have at least the following beneficial effects:

[0027] By performing difference calculation in four directions on the image, a difference image and a union image of the difference image are obtained, the number of repeated pixel points in the original image is obtained according to the number of neighborhood pixel values of zero and the number of neighborhood pixel values of zero of each pixel value of zero in the union image, and the number of repeated pixel points is taken as the spatial repetition degree. In addition, the ratio of the number of bits required for compression of the union image to the number of bits required for direct compression is calculated to obtain the spatial redundancy. The compressibility is obtained according to the spatial repetition degree and the spatial redundancy, and then a suitable compression algorithm is selected to compress the original image. The embodiments of the present application can select the optimal compression method according to the amount of spatial redundancy of the image, so that the space utilization is maximized or the bandwidth loss is optimized when the image to be compressed is stored or transmitted. BRIEF DESCRIPTION OF DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art and the advantages thereof, a brief introduction will be given below to the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative effort.

[0029] Figure 1 A step flow chart of the artificial intelligence-based computer image compression method provided by an embodiment of the present application is shown in the following figure:

[0030] Figure 2 A gray-scale image of the image to be compressed collected by an embodiment of the present application is shown in the following figure:

[0031] Figure 3 a gray scale histogram of the image to be detected;

[0032] Figure 4 a gray scale histogram of the union image. DETAILED DESCRIPTION

[0033] In order to further clarify the technical means and effects taken by the present application to achieve the predetermined object of the application, the specific implementation, structure, features and effects of the computer image compression method and system based on artificial intelligence according to the present application are described in detail as follows in combination with the drawings and preferred embodiments. 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.

[0034] 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 this application belongs.

[0035] The specific scheme of the computer image compression method and system based on artificial intelligence provided by the present application is specifically described below in combination with the drawings.

[0036] Please refer to Figure 1 , which shows the step flowchart of the computer image compression method based on artificial intelligence provided by one embodiment of the present application. The method comprises the following steps:

[0037] Step S001, obtaining a gray scale image of the image to be compressed, and performing neighborhood difference from the top, bottom, left and right directions of the gray scale image respectively to obtain four corresponding difference images.

[0038] The specific steps include:

[0039] 1. Gray scale processing is performed on the collected image to be compressed to obtain a gray scale image of the image to be compressed, as shown in Figure 2 .

[0040] 2. Obtain a difference image.

[0041] According to the gray scale image, a pixel matrix is constructed, and the first row or column starting from the four directions of the matrix is sequentially subtracted from the adjacent row or column to obtain a new row or column, which constitutes a difference image.

[0042] For most images, there is a correlation between the current pixel and its neighborhood pixels. For most objects, it must have or approximate color or brightness within a certain range to cause human visual excitement, otherwise if the pixels are independent of each other, the gray value appears randomly, it can only be a meaningless image, such as snowflakes when the TV receiver fails. Therefore, the difference image representing the image to be compressed can be obtained by difference of neighborhood to perform compression.

[0043] According to the gray image, a pixel value matrix m*n of the image is constructed, and difference calculation in four directions is performed on the matrix respectively to obtain four corresponding difference images.

[0044] The specific process is as follows:

[0045] A first difference image is obtained by sequentially performing difference between adjacent columns from the rightmost direction:

[0046] Starting from the nth column, i.e. i=n, the pixel value of the ith column of the matrix is subtracted from the pixel value corresponding to the i-1th column, and each time the operation is performed, i is set to i-1, until i=2, wherein i∈[2,n].

[0047] A second difference image is obtained by sequentially performing difference between adjacent columns from the leftmost direction:

[0048] Starting from the first column, i.e. i=1, the pixel value of the ith column of the matrix is subtracted from the pixel value corresponding to the i+1th column, and each time the operation is performed, i is set to i+1, until i=n-1, wherein i∈[1,n-1].

[0049] A third difference image is obtained by sequentially performing difference between adjacent rows from the topmost direction:

[0050] Starting from the first row, i.e. j=1, the pixel value of the jth row of the matrix is subtracted from the pixel value corresponding to the j+1th row, and each time the operation is performed, j is set to j+1, until j=m-1, wherein j∈[1,m-1].

[0051] A fourth difference image is obtained by sequentially performing difference between adjacent rows from the bottommost direction:

[0052] Starting from the mth row, i.e. j=m, the pixel value of the jth row of the matrix is subtracted from the pixel value corresponding to the j-1th row, and each time the operation is performed, j is set to m-1, until j=2, wherein j∈[2,m].

[0053] The pixel value of 0 in the difference image indicates that the two pixel values to be subtracted in the image to be compressed are repeated, for example, when the pixel value of 0 in the first difference image, the pixel value of the corresponding pixel point and its left neighborhood pixel point in the image to be compressed is repeated, i.e. redundancy occurs.

[0054] Step S002, according to the pixel value of four difference images and set of obtaining the union image, obtain the first pixel point and the second pixel point in the union image, according to the number of the second pixel point in the neighborhood pixel point of the first pixel point, and the number of the first pixel point in the neighborhood pixel point of the second pixel point obtains the number of repeated pixel points in the gray scale image;With the number of repeated pixel points in the gray scale image as the proportion of the spatial repetition degree of the image to be compressed.

[0055] Specific steps include:

[0056] 1. According to the pixel value of four difference images and set of obtaining the union image, obtain the first pixel point and the second pixel point in the union image.

[0057] Contrast the pixel value of four difference images, the maximum pixel value at the same position as the pixel value of the union image, get the union image.

[0058] Traverse the union image, obtain the image coordinates of the first pixel point with pixel value of zero in the union image, record the number of the first pixel point s, and the rest of the pixel points are the second pixel points.

[0059] The pixel value of 0 in the union image indicates that the 4-neighbor pixel value of the corresponding coordinate point in the image to be compressed is the same as the pixel value of the coordinate point.

[0060] 2. Obtain the preliminary number of repeated pixel points in the gray scale image.

[0061] For each first pixel point, record the number of second pixel points in its neighborhood pixel points, and then obtain the preliminary number of repeated pixel points in the gray scale image corresponding to each first pixel point.

[0062] Specifically, for each first pixel point, the sum of the number of second pixel points in its four neighborhood pixel points and the number of the first pixel point itself is taken as the number of local repeated pixel points in the gray scale image corresponding to the first pixel point, and the sum of the number of local repeated pixel points corresponding to all first pixel points is the preliminary number.

[0063] When the four neighborhood pixel points of the first pixel point are all second pixel points, the pixel values of the first pixel point and the four neighborhood pixel points, i.e. 5 pixels, are the same in the image to be compressed; when there is a first pixel point in the four neighborhood pixel points of the first pixel point, the counting of the neighborhood pixel points of both first pixel points is required, at this time, each first pixel point value does not calculate other first pixel points, only calculates the number of second pixel points in the four neighborhood pixel points of each first pixel point, and then adds the number of the first pixel point itself, i.e. 1, as the number of local repeated pixel points in the gray scale image corresponding to the first pixel point, and the sum of the number of local repeated pixel points corresponding to all first pixel points is the preliminary number.

[0064] The specific calculation formula is:

[0065]

[0066] wherein K1 represents the preliminary number, k x represents the number of second pixel points in the four-neighborhood of the xth first pixel point.

[0067] 3. Obtain the number of repeated pixel points in the gray-scale image.

[0068] Obtain the repeated calculation times of each second pixel point according to the number of first pixel points in the neighborhood pixel points of the second pixel point, and obtain the number of repeated pixel points according to the preliminary number and the repeated calculation times of all second pixel points.

[0069] Specifically, for each second pixel point, obtain the number of first pixel points in its four-neighborhood pixel points, and subtract one from the number to obtain the number of times the second pixel point is repeatedly calculated. Subtract the sum of the repeated calculation times of all second pixel points from the preliminary number to obtain the number of repeated pixel points.

[0070] Two first pixel points that are not adjacent but have overlapping four-neighborhoods will repeatedly count the number of second pixel points when calculating the local repeated pixel points. According to the above counting method, the second pixel point is counted as many times as there are first pixel points in its four-neighborhood. However, the second pixel point only needs to be counted once. Therefore, obtain the number of first pixel points in the four-neighborhood of the second pixel point, and subtract one from the number to obtain the number of times the second pixel point is repeatedly calculated.

[0071] Use W y to record the number of first pixel points in the four-neighborhood of the yth second pixel point, then the number of times K2 that all second pixel points in the image to be compressed are repeatedly calculated is:

[0072]

[0073] wherein N represents the total number of pixel points in the image to be compressed.

[0074] It should be noted that the image size and the number of pixel points of the image to be compressed, the four difference images and the union image are consistent.

[0075] Subtract the number of times that all second pixel points are repeatedly calculated from the preliminary number to obtain the number of repeated pixel points:

[0076] K = K1-K2

[0077] wherein K represents the number of repeated pixel points.

[0078] 4. Take the quantity proportion of repeated pixels in the gray scale image as the spatial repetition of the image to be compressed.

[0079]

[0080] Wherein, y1 represents the spatial repetition.

[0081] In step S003, the quantity of third pixels with pixel value less than the preset threshold in the union image is obtained, the first bit number required for compressing the union image is obtained according to the quantity of third pixels, the second bit number required for directly compressing the image to be compressed is obtained, and the spatial redundancy of the image to be compressed is obtained according to the first bit number and the second bit number.

[0082] The specific steps include:

[0083] 1. The quantity of third pixels with pixel value less than the preset threshold in the union image is obtained, and then the first bit number required for compressing the union image is obtained.

[0084] The product of the bit number required for compressing the third pixels and the quantity of third pixels, and the product of the bit number required for the remaining pixels except the third pixels and the quantity of the remaining pixels are obtained, and the sum of the above two products is taken as the first bit number.

[0085] The pixel gray value of an image is between 0 and 255, which requires 8bit coding. The pixel value of 0-16 only needs 4bit to complete the coding, and the smaller the pixel value, the fewer the coding bits required. The pixel value range of the image to be compressed is wide, and the gray value of the union image is in a small interval. Through the subtraction operation, the dynamic range of the pixel value is greatly reduced, and the bit number required for coding is reduced.

[0086] The gray scale histograms of the image to be detected and the union image are obtained respectively, as shown in Figure 3 and Figure 4 It can be seen that the pixel value of the image to be compressed is between 0 and 255, which requires 8bit coding, while most of the pixels of the union image are between 0 and 50, of which the pixels with pixel value between 0 and 32 account for 96% of all pixels, and the pixels with pixel value between 0 and 16 account for 92%. The pixel value of 0-16 only needs 4bit to complete the coding.

[0087] The quantity of third pixels with pixel value less than the preset threshold in the union image is obtained, and in the embodiment of the present application, the preset threshold is 16, that is, the quantity P of pixels with pixel value between 0 and 16 in the union image is obtained, wherein the P pixels with pixel value between 0 and 16 in the union image only need 4bit to complete the coding, and the remaining pixels need 8bit coding. Therefore, the calculation method of the first bit number is:

[0088] W1=4P+8(N-P)=8N-4P

[0089] Wherein, W1 represents the first number of bits, N represents the number of all pixel points in the union image.

[0090] 2. Obtain the spatial redundancy of the image to be compressed.

[0091] Obtain the second number of bits W2 required for directly compressing the image to be compressed = 8N, and obtain the spatial redundancy of the image to be compressed according to the first number of bits and the second number of bits:

[0092]

[0093] Simplify to

[0094] Wherein, y2 represents the spatial redundancy.

[0095] Step S004, obtain the compressibility of the image to be compressed according to the spatial redundancy and the spatial redundancy; compress the plurality of images to be compressed with different compression methods respectively, and obtain the corresponding compression effect, and select the optimal compression method for each image to be compressed by using the compressibility and the compression effect.

[0096] The specific steps include:

[0097] 1. Obtain the compressibility of the image to be compressed according to the spatial redundancy and the spatial redundancy.

[0098] From the above steps, the greater the spatial redundancy y1 is, the higher the spatial redundancy degree is; similarly, the greater the spatial redundancy y2 is, the greater the spatial redundancy degree is, and since the importance of y1 and y2 is close, the weights are set to be the same, that is, 1. Then the compressibility Y is:

[0099] Y=y1×y2

[0100] The greater the compressibility Y is, the more spatial redundancy the image has, and the more compression processing is needed; the smaller the compressibility Y is, the less spatial redundancy the image has, and the less compression processing is needed.

[0101] 2. Obtain a plurality of images to be compressed with the same compressibility, and compress them by using different compression methods respectively, and obtain the corresponding compression effect.

[0102] As an example, the different compression methods in the embodiment of the application are: Huffman coding, run-length coding, arithmetic coding, DCT coding, prediction coding and run-length coding.

[0103] For each of the to-be-compressed images with the same compressibility, the first number of bytes required for direct storage of the to-be-compressed image and the second number of bytes required for storage after compression are obtained, and the compression effect is taken as the ratio of the first number of bytes to the second number of bytes.

[0104] As an example, for a plurality of to-be-compressed images with the same compressibility Y A , one of the to-be-compressed images A is taken as an example, the number of bytes N A required for storage of the current to-be-compressed image A is obtained, and the to-be-compressed image A is compressed using the six compression algorithms described above, and the number of bytes X Ak required for storage of the compressed image is obtained, and the corresponding compression effect T Ak is calculated.

[0105]

[0106] , T Ak represents the compression effect of the to-be-compressed image A compressed by the kth compression method, and X Ak represents the number of bytes required for storage of the to-be-compressed image A compressed by the kth compression method.

[0107] In the embodiment of the application, there are six compression methods, so k [1, 6].

[0108] 3. Select the optimal compression method for each to-be-compressed image using compressibility and compression effect.

[0109] For a plurality of to-be-compressed images with the same compressibility, the compression effect of each to-be-compressed image obtained by using each compression method is calculated, and for each compression method, the average value of the corresponding compression effect is obtained as the average compression effect of the to-be-compressed image using the compression method, and is obtained, and normalized processing is performed.

[0110] The compressibility of the to-be-compressed image is taken as the input, and the compression method corresponding to the maximum average compression effect of the compressibility is taken as the label, and a neural network is trained, the neural network is a convolutional neural network (DNN), the structure is an Encoder-FC structure, and the loss function used by the network is a cross-entropy loss function.

[0111] For a newly obtained to-be-compressed image, the compressibility thereof is calculated and input into the trained neural network, and the recommended optimal compression method is obtained.

[0112] To sum up, the embodiment of the application obtains a gray image of the image to be compressed, respectively carries out neighborhood difference from four directions of top, bottom, left and right of the gray image, and obtains four corresponding difference images; obtains a union image according to the pixel values of the four difference images, obtains a first pixel point with a pixel value of zero and a second pixel point with a pixel value of non-zero in the union image, obtains the number of repeated pixel points in the gray image according to the number of the second pixel points in the neighborhood pixel points of the first pixel point and the number of the first pixel points in the neighborhood pixel points of the second pixel point; takes the number proportion of the repeated pixel points in the gray image as the spatial repetition degree of the image to be compressed; obtains the number of third pixel points with a pixel value less than a preset threshold in the union image, obtains the first bit number required for compressing the union image according to the number of the third pixel points, simultaneously obtains the second bit number required for directly compressing the image to be compressed, and obtains the spatial redundancy of the image to be compressed according to the first bit number and the second bit number; obtains the compressible degree of the image to be compressed according to the spatial repetition degree and the spatial redundancy; respectively compresses a plurality of images to be compressed with the same compressible degree by using different compression methods, obtains corresponding compression effects, and selects the optimal compression method for each image to be compressed by using the compressible degree and the compression effect. The embodiment of the application can select the optimal compression method according to the spatial redundancy of the image.

[0113] The embodiment of the application also provides a computer image compression system based on artificial intelligence, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the above method when executing the computer program. Since the computer image compression method based on artificial intelligence is described in detail above, no further description is given.

[0114] It should be noted that the above-mentioned embodiment sequence is only for description, and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in an order different from that in the embodiments and still achieve the desired results. In addition, 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 possible or can be advantageous.

[0115] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments.

[0116] The above merely describes preferred embodiments of the present application and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A computer image compression method based on artificial intelligence, characterized by, The method comprises the following steps: The method comprises the following steps: Obtaining a gray image of the image to be compressed, and obtaining four difference images from the gray image in four directions respectively; According to the pixel values of the four difference images, a union image is obtained, and first pixel points with a pixel value of zero and second pixel points with a pixel value other than zero in the union image are obtained, the number of repeated pixel points in the gray image is obtained according to the number of second pixel points in the neighborhood of the first pixel points and the number of first pixel points in the neighborhood of the second pixel points, and the spatial repetition degree of the image to be compressed is obtained according to the proportion of the number of repeated pixel points in the gray image. The number of third pixel points with a pixel value less than a preset threshold in the union image is obtained, the first bit number required for compressing the union image is obtained according to the number of third pixel points, the second bit number required for directly compressing the image to be compressed is obtained, and the spatial redundancy of the image to be compressed is obtained according to the first bit number and the second bit number. According to the spatial repetition degree and the spatial redundancy, the compressibility of the image to be compressed is obtained, different compression methods are used to compress a plurality of images to be compressed with the same compressibility, and the corresponding compression effects are obtained, and the optimal compression method for each image to be compressed is selected according to the compressibility and the compression effect. The first bit number is obtained by: 2.The artificial intelligence-based computer image compression method of claim 1, wherein, The product of the number of third pixel points and the bit number required for compressing the third pixel points is obtained, and the product of the number of remaining pixel points and the bit number required for the remaining pixel points is obtained, and the sum of the two products is taken as the first bit number. The difference image is obtained by: 3.The artificial intelligence-based computer image compression method of claim 1, wherein, According to the gray image, a pixel matrix is constructed, and a new row or column is obtained by performing difference between the first row or column and the adjacent row or column in four directions, thereby obtaining the difference image. The first pixel point is obtained by: 4.The artificial intelligence-based computer image compression method of claim 1, wherein, The image coordinates of the first pixel points with a pixel value of zero in the union image are obtained by traversing the union image, and the number of first pixel points is recorded. The number of repeated pixel points in the gray image is obtained by: For each first pixel point, the number of second pixel points in its neighborhood is recorded, and the preliminary number of repeated pixel points corresponding to each first pixel point in the gray image is obtained; 5.The artificial intelligence-based computer image compression method of claim 4, wherein, The number of repeated pixel points is obtained according to the number of first pixel points in the neighborhood of each second pixel point and the number of repeated calculation times of each second pixel point. The preliminary number is obtained by: 6.The artificial intelligence-based computer image compression method of claim 4, wherein, For each first pixel point, the number of second pixel points in its four neighborhood pixel points is added to the sum of the number of the first pixel point itself, and the sum of the number of local repeated pixel points corresponding to all first pixel points is taken as the preliminary number. The number of repeated pixel points is obtained by: For each second pixel point, the number of first pixel points in its four neighboring pixel points is obtained, the number is reduced by one, which is the number of times the second pixel point is repeatedly calculated, the preliminary number is reduced by the sum of the number of times all second pixel points are repeatedly calculated, and the number of repeated pixel points is obtained. 7.The artificial intelligence-based computer image compression method of claim 1, wherein, The method for obtaining the compression effect is: The first number of bytes required for directly storing the to-be-compressed image and the second number of bytes required for storing the compressed image are obtained, and the compression effect is obtained by taking the ratio of the first number of bytes to the second number of bytes.

8. An artificial intelligence-based computer image compression system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the steps of the method according to any one of claims 1-7 when executing the computer program.

Citation Information

Patent Citations

  • High-resolution remote sensing image variation detection method based on self-adaptive threshold division

    CN101976437A

  • Remote video monitoring method and device

    CN108200402A