Image compression storage method and device based on color channel

By blocking and channel fitting the image, obtaining transformation parameters, color space transformation and image block merging, the problem of low compression efficiency of traditional fixed color space models is solved, and efficient image compression and storage is achieved.

CN120075450APending Publication Date: 2025-05-30SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510051919.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The traditional fixed color space model cannot adaptively adjust according to the unique features and content of each image, resulting in low image compression efficiency and affecting storage quality and compression rate.

Method used

By blocking and channel fitting the original image, obtaining transformation parameters, color space transformation and image block merging, reducing redundant information and improving compression ratio.

Benefits of technology

The image compression ratio is significantly improved, the storage efficiency is improved, and the storage quality and compression rate of the image are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075450A_ABST
    Figure CN120075450A_ABST
Patent Text Reader

Abstract

The invention provides an image compression storage method and device based on a color channel, and relates to the technical field of image processing, and the method comprises the steps: carrying out the blocking of an original image, obtaining basic blocks, carrying out the channel fitting of each basic block, and obtaining a transformation parameter; grouping all the basic blocks to obtain a plurality of groups of image blocks, and performing similarity judgment on each group of image blocks to obtain an image block merging scheme; combining each group of image blocks based on the image block combination scheme to obtain a new image block, and performing channel fitting on the new image block to obtain a new image block transformation parameter; performing color space transformation according to the new image block transformation parameters to obtain a color component image; and carrying out compression coding on the color component image to obtain image compression data, and storing the transformation parameters and the image compression data through a compression storage method. According to the method, the problem of low compression ratio caused by insufficient image adaptability of a traditional fixed color space model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an image compression and storage method and device based on color channels. Background Art

[0002] In the technical field of image processing, due to the immutability of its representation method and range, the traditional fixed color space model cannot be adaptively adjusted according to the unique features and content of each image. When processing images with different characteristics and types, the color space transformation with fixed parameter values cannot effectively utilize the inherent redundant information in the image data, thereby resulting in relatively low image compression efficiency and affecting the final effect of image compression. A lower compression ratio not only means that more bandwidth or storage space resources are required during image storage. Therefore, the deficiency of the traditional fixed color space model in terms of image adaptability leads to the problems of low compression ratio affecting the storage quality of images and low compression rate.

[0003] There is an urgent need for an image compression and storage method and device based on color channels to solve the problems of low compression ratio affecting the storage quality of images and low compression rate caused by the deficiency of the traditional fixed color space model in terms of image adaptability. Summary of the Invention

[0004] The purpose of the present invention is to provide an image compression and storage method and device based on color channels to improve the above problems. To achieve the above purpose, the technical solutions adopted by the present invention are as follows:

[0005] In a first aspect, the present application provides an image compression and storage method based on color channels, including:

[0006] Obtain an original image;

[0007] Divide the original image into blocks to obtain at least two basic blocks, and obtain transformation parameters by performing channel fitting on each basic block;

[0008] Group all the basic blocks to obtain at least one group of image blocks, and obtain an image block merging scheme by judging the similarity of transformation parameters between adjacent image blocks in the same row and / or the same column of each group;

[0009] Merge each group of image blocks based on the image block merging scheme to obtain new image blocks, and obtain new image block transformation parameters by performing channel fitting on the new image blocks;

[0010] Perform color space transformation according to the new image block space transformation parameters to obtain a color component image;

[0011] Perform compression encoding on the color component image to obtain image compression data, and store the transformation parameters and the image compression data through a preset compression storage method.

[0012] In a second aspect, the present application also provides an image compression storage device based on color channels, including:

[0013] An acquisition module for acquiring an original image;

[0014] A transformation module for dividing the original image into blocks to obtain at least two basic blocks, and obtaining transformation parameters by performing channel fitting on each of the basic blocks;

[0015] A judgment model for grouping all the basic blocks to obtain at least one group of image blocks, and obtaining an image block merging scheme by judging the similarity of transformation parameters between adjacent image blocks in the same row and / or the same column of each group;

[0016] A first calculation module for merging each group of image blocks based on the image block merging scheme to obtain new image blocks, and obtaining new image block transformation parameters by performing channel fitting on the new image blocks;

[0017] A second calculation module for performing color space transformation according to the new image block spatial transformation parameters to obtain a color component image;

[0018] A third calculation module for performing compression encoding on the color component image to obtain image compression data, and storing the transformation parameters and the image compression data through a preset compression storage method.

[0019] In a third aspect, the present application also provides an image compression storage device based on color channels, including:

[0020] A memory for storing a computer program;

[0021] A processor for implementing the steps of the image compression storage method based on color channels when executing the computer program.

[0022] In a fourth aspect, the present application also provides a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above-mentioned image compression storage method based on color channels.

[0023] The beneficial effects of the present invention are:

[0024] The present invention divides the original image into blocks and precisely preserves the features of the image itself. Specifically, color space transformation technology is used to calculate transformation parameters, which effectively extract the color features of the image and accurately reflect the distribution characteristics of the image blocks in the color space. Through similarity judgment and merging operations, redundant information in the color space of the image is further reduced, while key visual features are retained, thereby significantly improving the compression ratio of the image. On this basis, adaptive color space transformation can dynamically adjust the conversion strategy according to the actual content of the image, so as to obtain a more accurate and useful color component image. Compression processing is performed on the color component image, and optimization is carried out according to different image characteristics, thereby greatly reducing the storage space required for image data. In summary, the present invention effectively solves the deficiencies in the adaptability of images in the traditional fixed color space model, resulting in a low compression ratio, which affects the storage quality of images and the low compression rate.

[0025] Other features and advantages of the present invention will be described in the following specification, and, in part, will become apparent from the specification, or can be understood by implementing the embodiments of the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0027] Figure 1 It is a schematic flowchart of the image compression and storage method based on color channels described in the embodiments of the present invention;

[0028] Figure 2 It is a schematic structural diagram of the image compression and storage device based on color channels described in the embodiments of the present invention.

[0029] Reference numerals in the figure: 800, image compression and storage device based on color channels; 801, processor; 802, memory; 803, multimedia component; 804, I / O interface; 805, communication component. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0031] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.

[0032] Embodiment 1:

[0033] This embodiment provides an image compression and storage method based on color channels.

[0034] See Figure 1 , the figure shows that this method includes steps S1 to S6, including:

[0035] S1: Obtain the original image;

[0036] S2: Divide the original image into blocks to obtain at least two basic blocks, and obtain transformation parameters by performing channel fitting on each basic block;

[0037] To clarify the specific method of obtaining the transformation parameters, steps S21 to S25 are included in step S2, specifically:

[0038] S21: Judge the condition of uniform block division of the original image. When the original image does not meet the condition of uniform block division, expand the pixels of the rows and columns of the original image to obtain an expanded image;

[0039] In this step, when the columns of the original image are insufficient for uniform block division, expand after the last column, and the pixel values of the expanded columns are all the pixel values of the last column until it is sufficient for uniform block division; when the rows of the original image are insufficient for uniform block division, expand below the last row, and the pixel values of the expanded rows are the pixel values of the last row, and expand until it can be uniformly divided;

[0040] The pixel values of the expanded image are:

[0041]

[0042] In the above formula (1): P' m,n represents the pixel value at the m-th row and n-th column after expansion; m represents the row where the pixel is located; n represents the column where the pixel is located; P m,n represents the pixel value at the m-th row and n-th column; P m,N represents the pixel value of the last pixel in the m-th row and the pixel value of the N-th column in the original image; P M,n represents the pixel value of the m-th row and the pixel value of the n-th column in the original image; P M,N represents the pixel value at the M-th row and N-th column in the original image; M represents the number of rows in the original image; N represents the number of columns in the original image; M' represents the number of rows in the expanded image; N' represents the number of columns in the expanded image.

[0043] S22: Uniformly divide the expanded image according to a preset image size to obtain no less than two basic blocks;

[0044] In this step, the preset image size is K×K. By uniformly dividing the expanded image, the image processing process can be simplified and the features of the image itself can be accurately retained.

[0045] S23: Construct the three-channel components of the pixels in each basic block and the three-channel means of each basic block to obtain the slope of the basic block channel relationship;

[0046] In this step, the slope of the basic block channel relationship includes the first slope of the basic block channel relationship and the second slope of the basic block channel relationship;

[0047] The first slope of the basic block channel relationship is:

[0048]

[0049] In the above formula (2): represents the slope parameter in the linear regression model for fitting the R component; represents the R-channel component of the j-th pixel in the image block at the r-th row and c-th column; represents the R-channel mean of the current image block; represents the G-channel component of the j-th pixel in the image block at the r-th row and c-th column; represents the G-channel mean of the current image block; j represents the pixel count; i represents the total number of pixels in the image block;

[0050] The second slope of the basic block channel relationship is:

[0051]

[0052] In the above formula (3): represents the slope parameter in the linear regression model for fitting the B component; represents the B-channel component of the j-th pixel in the image block located in the r-th row and c-th column; represents the mean value of the B channel of the current image block; represents the G-channel component of the j-th pixel in the image block located in the r-th row and c-th column; represents the mean value of the G channel of the current image block; j represents the pixel count; i represents the total number of pixels in the image block;

[0053] Among them, the R-channel component, the G-channel component, and the B-channel component represent three channel components; the R-channel mean value, the G-channel mean value, and the B-channel mean value represent the three channel mean values of the base block.

[0054] S24: Construct the three channel mean values of each base block to obtain the base block channel intercept;

[0055] In this step, the base block channel intercept includes the first base block channel intercept and the second base block channel intercept;

[0056] The first base block channel intercept is:

[0057]

[0058] In the above formula (4): represents the intercept parameter of the linear regression model for fitting the R component; represents the mean value of the R channel of the current image block; a 0 represents the coefficient; represents the mean value of the G channel of the current image block;

[0059] The second base block channel intercept is:

[0060]

[0061] In the above formula (5): represents the intercept parameter of the linear regression model for fitting the B component; represents the mean value of the B channel of the current image block; a 1 represents the coefficient; represents the mean value of the G channel of the current image block;

[0062] Among them, the R-channel mean value, the G-channel mean value, and the B-channel mean value represent the three channel mean values of the base block.

[0063] S25: Construct according to the base block channel relationship slope and the base block channel intercept to obtain the transformation parameter.

[0064] In this step, the transformation parameters effectively extract the color features of the image and accurately reflect the distribution characteristics of the image blocks in the color space.

[0065] S3: Group all the base blocks to obtain no less than one group of image blocks. By judging the similarity of the transformation parameters between adjacent image blocks in the same row and / or the same column of each group, an image block merging scheme is obtained.

[0066] To clarify the specific acquisition method of the image block merging scheme, S3 in step S3 includes S31 to S37, specifically:

[0067] S31: Group all the base blocks to obtain no less than one group of image blocks.

[0068] S32: Based on a preset block division method, perform data normalization processing on each group of the image blocks to obtain standard image blocks.

[0069] In this step, based on a preset block division method, perform data normalization processing on each group of the image blocks to obtain T image groups with a size of L×W. Each group has standard image blocks with a size of K×K.

[0070] Preferably, L = 8, W = 8, K = 4. Each group has 2×2 standard image blocks with a size of 4×4.

[0071] S33: Based on a preset fitting algorithm, perform coefficient fitting processing on two adjacent standard image blocks in the same row of each group to obtain two row fitting parameters. By performing difference analysis calculation on the two row fitting parameters, the fitting coefficient difference between adjacent rows is obtained.

[0072] In this step, the two row fitting parameters are the first row fitting parameter and the second row fitting parameter;

[0073] The first row fitting parameter is:

[0074]

[0075] In the above formula (6): represents the row merging slope difference of the image block at the (2p - 1 + l)-th row and the q-th column; represents the fitting slope parameter a of the image block at the (2p - 1 + l)-th row and the (2q - 1)-th column in the image group k ; represents the fitting slope parameter a of the image block at the (2p - 1 + l)-th row and the 2q-th column in the image block k; k represents the serial number of the fitting coefficient; l represents the number of rows in the image group in terms of image blocks; H represents the threshold condition for adjacent rows; p represents the row index; q represents the column index.

[0076] The second row fitting parameter is:

[0077]

[0078] In the above formula (7): represents the row merging intercept difference of the image block in the (2 - 1 + l)-th row and the q-th column; represents the fitting intercept parameter b of the image block located in the (2p - 1 + l)-th row and the (2q - 1)-th column in terms of image blocks k ; represents the fitting intercept parameter b of the image block located in the (2p - 1 + l)-th row and the 2q-th column in terms of image blocks k ; k represents the serial number of the fitting coefficient; l represents the number of rows in the image group in terms of image blocks; H represents the threshold condition for adjacent rows; p represents the row index; q represents the column index.

[0079] S34: Judge the similarity of transformation parameters for two adjacent standard image blocks in the same row of each group. When the difference between the fitting coefficients of adjacent rows meets the preset threshold condition, obtain a row merging flag;

[0080] In this step, the row merging flag is:

[0081]

[0082] In the above formula (8): H represents the row merging flag; △a Hk represents the row merging slope difference; ε 1 is the threshold of the slope difference of the linear fitting function; △b Hk represents the row merging intercept difference; ε 2 is the threshold of the intercept difference of the fitting function;

[0083] Among them, when the calculated row merging slope difference and row merging intercept difference meet the threshold conditions, use one fitting function to fit the two adjacent standard image blocks on the left and right, that is, merge the two adjacent standard image blocks on the left and right, and the row merging flag meets the conditions, otherwise it does not meet the conditions.

[0084] S35: Based on the preset fitting algorithm, perform coefficient fitting processing on two adjacent standard image blocks in the same column of each group to obtain two column fitting parameters, and calculate the difference between the fitting coefficients of adjacent columns by analyzing the differences between the two column fitting parameters;

[0085] In this step, the two column fitting parameters include the first column fitting parameter and the second column fitting parameter;

[0086] The first column fitting parameter is as follows:

[0087]

[0088] In the above formula (9): represents the column merging slope difference of the image block in the p-th row and the (2q - 1 + l)-th column; represents the fitting coefficient a of the image block located in the (2p - 1 + l)-th row and the (2q - 1 + l)-th column, with the image block as the unit k ; represents the fitting coefficient a of the image block located in the 2p-th row and the (2q - 1 + l)-th column, with the image block as the unit k ; k represents the serial number of the fitting coefficient; l represents the number of rows with the image block as the unit within the image group; V represents the threshold condition for adjacent columns; p represents the row index; q represents the column index;

[0089] The second column fitting parameter is as follows:

[0090]

[0091] In the above formula (10): represents the column merging intercept difference of the image block in the p-th row and the (2q - 1 + l)-th column; represents the fitting coefficient b of the image block located in the (2p - 1)-th row and the (2q - 1 + l)-th column, with the image block as the unit k ; represents the fitting coefficient b of the image block located in the 2p-th row and the (2q - 1 + l)-th column, with the image block as the unit k ; k represents the serial number of the fitting coefficient; l represents the number of rows with the image block as the unit within the image group; V represents the threshold condition for adjacent columns; p represents the row index; q represents the column index.

[0092] S36: Judge the similarity of transformation parameters for two adjacent standard image blocks in the same column of each group. When the difference between the fitting coefficients of adjacent columns meets the preset threshold condition, obtain the column merging flag;

[0093] In this step, the column merging flag is as follows:

[0094]

[0095] In the above formula (11): V represents the column merging flag; △a Vk represents the column merging slope difference; ε 1 is the threshold of the slope difference of the linear fitting function; △b Vk represents the column merging intercept difference; ε 2 is the threshold of the intercept difference of the fitting function;

[0096] Among them, when the calculated column merging slope difference and column merging intercept difference meet the threshold conditions, a fitting function is used to fit two adjacent standard image blocks above and below, that is, two adjacent standard image blocks above and below are merged, and the column merging flag meets the conditions, otherwise it does not meet the conditions.

[0097] S37: Based on the row merging flag and the column merging flag, an image block merging scheme is constructed.

[0098] In this step, the image block merging scheme is shown in the following table, where V represents the column merging flag and H represents the row merging flag.

[0099] When the row merging flag and column merging flag of the image block are (no, no), the non-merging mode M0 is obtained, and the segmentation in the image block to be merged is not changed. In this embodiment, it is still 4 K×K image blocks.

[0100] When the row merging flag and column merging flag of the image block are (yes, no), the vertical merging mode M2 is obtained, and the upper and lower adjacent image blocks in the image block to be merged are merged into a new image block; in this embodiment, two upper and lower adjacent image blocks among the 4 image blocks are merged together to form two 2K×K image blocks.

[0101] When the row merging flag and column merging flag of the image block are (no, yes), the horizontal merging mode M1 is obtained, and the left and right adjacent image blocks in the image block to be merged are merged into a new image block. In this embodiment, two left and right adjacent image blocks among the 4 image blocks are merged together to form two K×2K image blocks.

[0102] When the row merging flag and column merging flag of the image block are (yes, yes), the full merging mode is obtained, and all the image blocks in the image block to be merged are merged into one image block. In this embodiment, the 4 image blocks are merged into one 2K×2K image block.

[0103] Table 1 Image block merging method

[0104]

[0105] In this step, through similarity judgment and merging operations, redundant information in the color space of the image is further reduced, and at the same time, key visual features are retained, thereby significantly improving the compression ratio of the image.

[0106] S4: Based on the image block merging scheme, each group of the image blocks is merged to obtain new image blocks, and new image block transformation parameters are obtained by performing channel fitting on the new image blocks.

[0107] To clarify the specific acquisition method of the new image block transformation parameters, steps S41 to S45 are included in step S4, specifically:

[0108] S41: Obtain the image sub - block counter;

[0109] S42: Merge each group of the image blocks based on the image block merging scheme to obtain new image blocks;

[0110] S43: Construct the three - channel components of the pixels in each new image block, the three - channel means of each new image block, and the image sub - block counter to obtain the new image channel relationship slope;

[0111] In this step, the new image channel relationship slope includes the first new image channel relationship slope and the second new image channel relationship slope;

[0112] The first new image channel relationship slope is:

[0113]

[0114] In the above formula (12): represents the fitting slope parameter of the first new image block; represents the G - channel component of the j - th pixel in the new image block located in the p - th row and q - th column; count represents the image sub - block counter; represents the G - channel mean of the new image block; represents the R - channel component of the j - th pixel in the new image block located in the p - th row and q - th column; represents the R - channel mean of the new image block; p represents the row number where the new image block is located; q represents the column number where the new image block is located; j represents the pixel point count; i represents the total number of pixels in the new image block;

[0115] The second new image channel relationship slope is:

[0116]

[0117] In the above formula (13): represents the fitting slope parameter of the second new image block; represents the G - channel component of the j - th pixel in the new image block located in the p - th row and q - th column; count represents the image sub - block counter; represents the G - channel mean of the new image block; represents the B - channel component of the j - th pixel in the new image block located in the p - th row and q - th column; represents the B - channel mean of the new image block; p represents the row number where the new image block is located; q represents the column number where the new image block is located; j represents the pixel point count; i represents the total number of pixels in the new image block.

[0118] S44: Based on the slope of the new image channel relationship and the three-channel means of each new image block, construct to obtain the new image channel intercepts;

[0119] In this step, the new image channel intercepts are the first new image channel intercept and the second new image channel intercept;

[0120] The first new image channel intercept is:

[0121]

[0122] In the above formula (14): represents the first new image channel fitting intercept parameter; count represents the new image sub-block counter; represents the mean value of the R channel of the new image block; represents the fitting slope parameter of the first new image block; represents the mean value of the G channel of the new image block;

[0123] The second new image channel intercept is:

[0124]

[0125] In the above formula (15): represents the second new image channel fitting intercept parameter; count represents the new image sub-block counter; represents the mean value of the B channel of the new image block; represents the fitting slope parameter of the second new image block; represents the mean value of the G channel of the new image block.

[0126] S45: Based on the slope of the new image channel relationship and the new image channel intercepts, construct to obtain the new image block transformation parameters.

[0127] In this step, when not in the merging mode M0, after the merging is completed, there are still 4 image blocks in the image group. Calculate the slope of the new image channel relationship and the new image channel intercepts for the 4 image blocks respectively. Here, count represents the image sub-block counter, and its value range is from 1 to 4, representing the fitting parameters of the current image block respectively. The value order of the counter is from left to right and from top to bottom.

[0128] When in the horizontal merging mode M1, after the merging is completed, there are 2 image blocks in the image group block. Calculate the slope of the new image channel relationship and the new image channel intercepts for the 2 image blocks respectively. Here, count represents the image sub-block counter, and its value range is 1 or 2. The value order of the counter is from top to bottom.

[0129] When in the vertical merging mode M2, after the merging is completed, there are two image blocks in the image group. The slope of the new image channel relationship and the intercept of the new image channel are calculated for the two image blocks respectively. Here, count represents the image sub-block counter, and its value range is 1 or 2. The value of the counter is taken in the order from left to right.

[0130] When in the full merging mode M3, after the merging is completed, all the image blocks in the group are merged into a large image block. The slope of the new image channel relationship and the intercept of the new image channel are calculated for the large image block. Here, count represents the image sub-block counter, and at this time count = 1.

[0131] With the new color space transformation parameters As the new image block transformation parameters in the final color space transformation matrix.

[0132] S5: Perform color space transformation according to the new image block transformation parameters to obtain a color component image;

[0133] To clarify the specific acquisition method of the color component image, steps S51 to S53 are included in step S5, specifically:

[0134] S51: Obtain the color space conversion matrix of the current image block;

[0135] S52: Perform adaptive color space transformation according to the new image block transformation parameters, the three channel components of each pixel in the new image block, and the color space conversion matrix of the current image block to obtain a luminance component and a chrominance component. The chrominance component includes a first chrominance component and a second chrominance component;

[0136] In this step, the formula for the adaptive color space transformation is:

[0137]

[0138] In the above formula (16): Represents the fitting slope parameter of the first new image block; Represents the fitting slope parameter of the second new image block; Represents the fitting intercept parameter of the first new image channel; Represents the fitting intercept parameter of the second new image channel; R p,q,count Represents the R channel component of the RGB color space; G p,q,count Is the G channel component of the RGB color space; B p,q,count Is the B channel component of the RGB color space; X represents the color space conversion matrix of the current image block; Y p,q,count Is the luminance component; Represents the first chrominance component; Represents the second chrominance component.

[0139] Among them, the fitting slope parameter of the first new image block, the fitting slope parameter of the second new image block, the fitting intercept parameter of the first new image channel, and the fitting slope parameter of the second new image block are represented as new image block transformation parameters;

[0140] The R channel component of the RGB color space, the G channel component of the RGB color space, and the B channel component of the RGB color space are represented as the three channel components of the pixels in the new image block.

[0141] S53: Based on the luminance component, the first chrominance component, and the second chrominance component, construct to obtain a color component image.

[0142] In this step, the conversion strategy can be dynamically adjusted according to the actual content of the image, so as to obtain a more accurate and useful color component image.

[0143] S6: Compress and encode the color component image to obtain image compression data, and store the transformation parameters and the image compression data through a preset compression storage method.

[0144] To clarify the specific acquisition method of the storage method, steps S6 includes S61 to S63, specifically:

[0145] S61: Compress and encode the color component image to obtain image compression data;

[0146] Preferably, the luminance component in the color component image uses but is not limited to JPEG-LS compression encoding, and the first chrominance component and the second chrominance component in the color component image use but are not limited to Huffman compression encoding.

[0147] S62: Sort the image compression data, the row merging flag, the column merging flag, the difference in fitting coefficients between adjacent rows, and the difference in fitting coefficients between adjacent columns according to a preset parameter transfer protocol to obtain image sorting data;

[0148] In this step, compress the row merging flag, the column merging flag, and the new image block transformation parameters to obtain the compressed row merging flag, the compressed column merging flag, and the compressed new image block transformation parameters;

[0149] Among them, arrange the preset file header information, the compressed row merging flag, the compressed column merging flag, the compressed new image block transformation parameters, and the image compression data in sequence from left to right. The file header information represents the area in the image for storing the basic information of the image and the compression parameters.

[0150] S63: Store the image sorting data and the transformation parameters according to a preset compression storage method.

[0151] To clarify the specific acquisition method of how to perform the storage, steps S63 includes S631 to S633, specifically:

[0152] S631: Perform a raster scan reading operation on the image sorting data to obtain parameter values;

[0153] S632: Arrange the parameter values sequentially based on the row merging flag and the column merging flag to obtain an estimated parameter transfer arrangement method;

[0154] In this step, the estimated parameter transfer arrangement method is:

[0155] When the row merging flag and the column merging flag of the image block are (no, no), obtain the non-merging mode M0. There are four groups of estimated parameter values in the image block to be merged, and they are arranged in the raster reading order from left to right and then from top to bottom;

[0156] When the row merging flag and the column merging flag of the image block are (no, yes), obtain the horizontal merging mode M1. There are two groups of estimated parameter values in the image block to be merged, and they are arranged in the up and down reading method;

[0157] When the row merging flag and the column merging flag of the image block are (yes, no), obtain the vertical merging mode M2. There are two groups of estimated parameter values in the image block to be merged, and they are arranged in the left and right reading method;

[0158] When the row merging flag and the column merging flag of the image block are (yes, yes), obtain the full merging mode M3. There is only one group of estimated parameter values in the block to be merged, and they are arranged according to Arrange. S633: Arrange the transformation parameters and the parameter values based on the estimated parameter transfer arrangement method, and store the arranged transformation parameters and parameter values through a preset compression storage method.

[0159] In this step, the compression method is optimized for different image characteristics, thereby greatly reducing the storage space required for image data.

[0160] Embodiment 2:

[0161] This embodiment provides an image compression storage device based on color channels, and the device includes:

[0162] An acquisition module, configured to acquire an original image;

[0163] A transformation module for partitioning the original image into at least two basic blocks, and obtaining transformation parameters by performing channel fitting on each of the basic blocks;

[0164] To clarify the specific way of obtaining the transformation parameters, specifically:

[0165] A first transformation unit for judging the condition of uniform partitioning of the original image. When the original image does not meet the condition of uniform partitioning, an extended image is obtained by performing pixel extension on the rows and columns of the original image;

[0166] A second transformation unit for uniformly partitioning the extended image according to a preset image size to obtain at least two basic blocks;

[0167] A third transformation unit for constructing the three-channel components of the pixels in each of the basic blocks and the three-channel means of each of the basic blocks to obtain the slope of the channel relationship of the basic block;

[0168] A fourth transformation unit for constructing the three-channel means of each of the basic blocks to obtain the channel intercept of the basic block;

[0169] A fifth transformation unit for constructing based on the slope of the channel relationship of the basic block and the channel intercept of the basic block to obtain transformation parameters.

[0170] A judgment model for grouping all the basic blocks to obtain at least one group of image blocks, and obtaining an image block merging scheme by judging the similarity of the transformation parameters between adjacent image blocks in the same row and / or the same column of each group;

[0171] A first calculation module for merging each group of image blocks based on the image block merging scheme to obtain new image blocks, and obtaining new image block transformation parameters by performing channel fitting on the new image blocks;

[0172] To clarify the specific way of obtaining the new image block transformation parameters, specifically:

[0173] A first obtaining unit for obtaining an image sub-block counter;

[0174] A first constructing unit for merging each group of image blocks based on the image block merging scheme to obtain new image blocks;

[0175] A second constructing unit for constructing the three-channel components of the pixels in each of the new image blocks, the three-channel means of each of the new image blocks, and the image sub-block counter to obtain the slope of the new image channel relationship;

[0176] A third construction unit for constructing a new image channel intercept based on the new image channel relationship slope and the three-channel means of each of the new image blocks;

[0177] A fourth construction unit for constructing new image block transformation parameters based on the new image channel relationship slope and the new image channel intercept.

[0178] A second calculation module for performing a color space transformation based on the new image block transformation parameters to obtain a color component image;

[0179] To clarify the specific acquisition method of the second calculation module, specifically:

[0180] A second acquisition unit for acquiring the color space conversion matrix of the current image block;

[0181] A first processing unit for performing an adaptive color space transformation based on the new image block transformation parameters, the three-channel components of each pixel in the new image block, and the color space conversion matrix of the current image block to obtain a luminance component and a chrominance component, where the chrominance component includes a first chrominance component and a second chrominance component;

[0182] A second processing unit for constructing a color component image based on the luminance component, the first chrominance component, and the second chrominance component.

[0183] A third calculation module for performing compression encoding on the color component image to obtain image compression data, and storing the transformation parameters and the image compression data through a preset compression storage method.

[0184] It should be noted that regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0185] Embodiment 3:

[0186] Corresponding to the above method embodiment, in this embodiment, an image compression storage device based on color channels is also provided. The image compression storage device based on color channels described below can be correspondingly referred to the image compression storage method based on color channels described above.

[0187] Figure 2 is a block diagram of an image compression storage device 800 based on color channels shown according to an exemplary embodiment. As Figure 2As shown, the color-channel-based image compression and storage device 800 may include: a processor 801 and a memory 802. The color-channel-based image compression and storage device 800 may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.

[0188] Among them, the processor 801 is used to control the overall operation of the color-channel-based image compression and storage device 800 to complete all or part of the steps in the above-mentioned color-channel-based image compression and storage method. The memory 802 is used to store various types of data to support the operation of the color-channel-based image compression and storage device 800. These data may include, for example, instructions for any application or method operating on the color-channel-based image compression and storage device 800, as well as application-related data, such as contact data, sent and received messages, pictures, audio, video, and so on. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals can be further stored in the memory 802 or sent through the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be a keyboard, a mouse, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the color-channel-based image compression and storage device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them. Accordingly, the communication component 805 may include: a Wi-Fi module, a Bluetooth module, and an NFC module.

[0189] In an exemplary embodiment, the color-channel-based image compression and storage device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, and is used to execute the above-described color-channel-based image compression and storage method.

[0190] Embodiment 4:

[0191] Corresponding to the above method embodiment, in this embodiment, a readable storage medium is further provided. A readable storage medium described below can be correspondingly referred to and cross-referenced with a color-channel-based image compression and storage method described above.

[0192] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the color-channel-based image compression and storage method in the above method embodiment are implemented.

[0193] The readable storage medium can specifically be various readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0194] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0195] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present invention, and all of them should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A color channel based image compression storage method, characterized in that: include: Get the original image; Divide the original image into blocks to obtain no less than two basic blocks, and obtain transformation parameters by performing channel fitting on each of the basic blocks; Grouping all the basic blocks to obtain at least one group of image blocks, and obtaining an image block merging scheme by judging the similarity of transformation parameters between adjacent image blocks in the same row and / or the same column of each group; Merging each group of the image blocks based on the image block merging scheme to obtain a new image block, and obtaining a new image block transformation parameter by performing channel fitting on the new image block; Performing color space transformation according to the new image block transformation parameters to obtain a color component image; The color component image is compressed and encoded to obtain image compression data, and the transformation parameters and the image compression data are stored by a preset compression storage method.

2. The image compression storage method based on color channels according to claim 1 is characterized in that: The original image is divided into blocks to obtain no less than two basic blocks, and the transformation parameters are obtained by performing channel fitting on each of the basic blocks, including: Performing uniform block division condition judgment on the original image, and when the original image does not meet the uniform block division condition, performing pixel expansion on rows and columns of the original image to obtain an expanded image; Evenly dividing the extended image into blocks according to a preset image size to obtain no less than two basic blocks; Constructing the three channel components of the pixels in each of the basic blocks and the three channel means of each of the basic blocks to obtain the basic block channel relationship slope; Constructing the three channel means of each of the basic blocks to obtain the basic block channel intercept; The transformation parameters are obtained by constructing the relationship slope of the basic block channel and the intercept of the basic block channel.

3. The image compression storage method based on color channels according to claim 1 is characterized in that: Grouping all the basic blocks to obtain at least one group of image blocks, and obtaining an image block merging scheme by judging the similarity of transformation parameters between adjacent image blocks in the same row and / or the same column of each group, including: Grouping all the basic blocks to obtain no less than one group of image blocks; Performing data standardization processing on each group of image blocks based on a preset block division method to obtain standard image blocks; Performing coefficient fitting processing on two adjacent standard image blocks in the same row of each group based on a preset fitting algorithm to obtain two row fitting parameters, and obtaining the fitting coefficient difference between adjacent rows by performing difference analysis and calculation on the two row fitting parameters; Performing transformation parameter similarity judgment on two adjacent standard image blocks in the same row of each group, and obtaining a row merging mark when the fitting coefficient difference between the adjacent rows meets a preset threshold condition; Performing coefficient fitting processing on two adjacent standard image blocks in the same column of each group based on a preset fitting algorithm to obtain two column fitting parameters, and obtaining fitting coefficient differences between adjacent columns by performing difference analysis and calculation on the two column fitting parameters; Performing transformation parameter similarity judgment on two adjacent standard image blocks in the same column of each group, and obtaining a column merging mark when the fitting coefficient difference between the adjacent columns meets a preset threshold condition; An image block merging solution is obtained by constructing based on the row merging flag and the column merging flag.

4. The image compression storage method based on color channels according to claim 1 is characterized in that: Merging each group of the image blocks based on the image block merging scheme to obtain a new image block, and obtaining a new image block transformation parameter by performing channel fitting on the new image block, including: Get the image sub-block counter; Merging each group of the image blocks based on the image block merging scheme to obtain a new image block; Constructing three channel components of pixels in each of the new image blocks, three channel means of each of the new image blocks and the image sub-block counter to obtain a new image channel relationship slope; Constructing based on the new image channel relationship slope and the three channel means of each of the new image blocks to obtain a new image channel intercept; The new image block transformation parameters are obtained by constructing the new image block transformation parameters according to the new image channel relationship slope and the new image channel intercept.

5. The image compression storage method based on color channels according to claim 1, characterized in that: Performing color space transformation according to the new image block transformation parameters to obtain a color component image includes: Get the color space conversion matrix of the current image block; Performing adaptive color space transformation according to the new image block transformation parameters, three channel components of pixels in each of the new image blocks, and the color space transformation matrix of the current image block to obtain a brightness component and a chroma component, wherein the chroma component includes a first chroma component and a second chroma component; A color component image is obtained by constructing based on the brightness component, the first chrominance component and the second chrominance component.

6. The image compression storage method based on color channels according to claim 3 is characterized in that: The color component image is compressed and encoded to obtain image compression data, and the transformation parameters and the image compression data are stored by a preset compression storage method, including: compressing and encoding the color component images to obtain image compression data; The image compression data, the row merging flag, the column merging flag, the fitting coefficient difference between adjacent rows, and the fitting coefficient difference between adjacent columns are sorted according to a preset parameter transfer protocol to obtain image sorting data; The image sorting data and the transformation parameters are stored according to a preset compression storage method.

7. An image compression storage device based on color channels, characterized in that: include: An acquisition module, used for acquiring the original image; A transformation module, used for dividing the original image into blocks to obtain at least two basic blocks, and obtaining transformation parameters by performing channel fitting on each of the basic blocks; A judgment model is used to group all the basic blocks to obtain at least one group of image blocks, and obtain an image block merging scheme by judging the similarity of transformation parameters between adjacent image blocks in the same row and / or the same column of each group; A first calculation module is used to merge each group of the image blocks based on the image block merging scheme to obtain a new image block, and obtain a new image block transformation parameter by performing channel fitting on the new image block; A second calculation module, used for performing color space transformation according to the new image block transformation parameters to obtain a color component image; The third calculation module is used to compress and encode the color component image to obtain image compression data, and store the transformation parameters and the image compression data using a preset compression storage method.

8. The image compression storage device based on color channels according to claim 7, characterized in that: Transformation module, including: A first transformation unit is used to perform uniform block determination on the original image, and when the original image does not meet the uniform block determination condition, obtain an extended image by performing pixel expansion on rows and columns of the original image; A second transform unit, configured to uniformly divide the extended image into blocks according to a preset image size to obtain no less than two basic blocks; A third transform unit, configured to construct three channel components of pixels in each of the basic blocks and three channel means of each of the basic blocks to obtain a basic block channel relationship slope; A fourth transformation unit, configured to construct the three channel means of each of the basic blocks to obtain a basic block channel intercept; The fifth transformation unit is used to construct according to the basic block channel relationship slope and the basic block channel intercept to obtain transformation parameters.

9. The image compression storage device based on color channels according to claim 7, characterized in that: The first computing module includes: A first acquisition unit, used for acquiring an image sub-block counter; A first construction unit is configured to merge each group of the image blocks based on the image block merging scheme to obtain a new image block; A second construction unit is used to construct three channel components of pixels in each of the new image blocks, three channel means of each of the new image blocks and the image sub-block counter to obtain a new image channel relationship slope; A third construction unit is used to construct based on the new image channel relationship slope and the three channel means of each of the new image blocks to obtain a new image channel intercept; The fourth construction unit is used to construct according to the new image channel relationship slope and the new image channel intercept to obtain new image block transformation parameters.

10. The image compression storage device based on color channels according to claim 7, characterized in that: The second computing module includes: A second acquisition unit, used to acquire a color space conversion matrix of a current image block; A first processing unit, configured to perform adaptive color space transformation according to the transformation parameters of the new image block, three channel components of pixels in each of the new image blocks, and a color space transformation matrix of the current image block to obtain a luminance component and a chrominance component, wherein the chrominance component includes a first chrominance component and a second chrominance component; The second processing unit is used to construct based on the brightness component, the first chrominance component and the second chrominance component to obtain a color component image.

Citation Information

Cited By

  • Image splicing imaging method suitable for super-resolution reconstruction of large-size high-throughput image

    CN122023115A