A Blocking Method, System and Electronic Device Based on Image Compression
By marking the compressed area and the uncompressed area in the image block, and encoding it using the feature value and the decoded value of neighboring pixel points, the problem of unsmooth compression of the image block boundary area is solved, and the effect of image compression is improved.
Patent Information
- Application Number
- CN202310984230.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2043-08-07
AI Technical Summary
In the prior art, in the process of image compression, the compression effect is not smooth due to the lack of neighboring pixel points in the boundary area of the image block, which affects the compression effect of the image block.
By detecting the boundary position of the image block, marking the compressed area and the uncompressed area, and replacing the decoded value of the uncompressed area with a preset feature value, encoding the compressed area based on the decoded value of the neighboring pixel points, and directly replacing the coded value of the uncompressed area with the original pixel value.
The compression effect of the image block is improved, and the encoding efficiency and decoding smoothness of the image block are improved.
Smart Images

Figure CN117014618B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image compression technology, and in particular, to a block division method, system, and electronic device based on image compression. Background Art
[0002] Image compression refers to representing a pixel matrix with fewer bits, also known as image coding. The encoded data generated by image compression can reduce redundant information in the image data, such as spatial redundancy, temporal redundancy, and spectral redundancy, etc., thereby improving the storage and transmission efficiency of the image.
[0003] In order to reduce the data volume of the encoded data, when compressing an image, the image to be processed is also divided into multiple image blocks, and then the pixel points of each image block are predicted by default sample values, and the predicted values obtained by prediction are quantized and differenced from the original values of the pixel points to generate an encoding result according to the difference value between the two. For example, in the compression based on the MIPI (Mobile Industry Process or Interface) method, the decoding result of the neighboring pixel points is used to predict the pixel points, and the difference between the predicted value and the original value is directly used as the encoding result.
[0004] However, since there are boundary regions in the divided image blocks, and there are not enough neighboring pixel points for the pixel points in the boundary regions, the corresponding predicted values cannot be obtained when compressing the image, resulting in an uneven problem in the compressed image and affecting the compression effect of the image blocks. Summary of the Invention
[0005] The present application provides a block division method, system, and electronic device based on image compression to solve the problem of poor image compression effect.
[0006] In a first aspect, some embodiments of the present application provide a block division method based on image compression, including:
[0007] Dividing the image to be processed into image blocks according to the block information;
[0008] Detecting the boundary positions of the image blocks;
[0009] Marking a compression region and a non-compression region according to the boundary positions, where the non-compression region is the region in the image to be processed whose distance from the boundary position is less than or equal to a distance threshold, and the compression region is the region in the image to be processed whose distance from the boundary position is greater than the distance threshold;
[0010] Replacing the decoding values of the non-compression region with preset feature values;
[0011] Perform encoding on the compressed region based on the decoded values of neighboring pixel points, and replace the encoded values of the uncompressed region with the original pixel values.
[0012] In combination with the first aspect, in an implementable manner, the image to be processed is segmented into image blocks according to the chunking information, including: reading the chunking information and the original file information of the image to be processed, where the chunking information includes the number of chunk rows and the number of chunk columns; determining the original pixel width and the original pixel height of the image to be processed through the original file information; calculating a first segmentation size according to the number of chunk rows and the original pixel height, and calculating a second segmentation size according to the number of chunk columns and the original pixel width; segmenting the image to be processed based on the first segmentation size and the second segmentation size.
[0013] In combination with the first aspect, in an implementable manner, detecting the boundary positions of the image blocks includes: generating a boundary function through the first segmentation size and the second segmentation size; solving the set of pixel point coordinates of the boundary function in the image block; storing the set of pixel point coordinates as boundary coordinates.
[0014] In combination with the first aspect, in an implementable manner, marking the compressed region and the uncompressed region according to the boundary positions includes: traversing the pixel points of the image block to obtain the coordinates of the pixel points; calculating the target distance between the pixel points and the boundary coordinates through the coordinates; if the target distance is less than or equal to the distance threshold, marking the pixel points as the uncompressed region; if the target distance is greater than the distance threshold, marking the pixel points as the compressed region.
[0015] In combination with the first aspect, in an implementable manner, performing encoding on the compressed region based on the decoded values of neighboring pixel points further includes: obtaining the original pixel value of the target pixel point in the compressed region; querying the neighboring pixel points of the target pixel point and detecting the decoded values of the neighboring pixel values; calculating the predicted value of the pixel point with the decoded value as the reference point; calculating the difference value between the predicted value and the original pixel value, and outputting the difference value as the decoded value of the target pixel point.
[0016] In combination with the first aspect, in an implementable manner, calculating the difference value between the predicted value and the original pixel value further includes: performing quantization on the predicted value and the decoded value; solving the difference between the predicted value and the decoded value.
[0017] In combination with the first aspect, in an implementable manner, the method further includes: detecting the header information of a pixel; if the header information is an encoded character, identifying the pixel as a compressed region, and performing encoding on the pixel based on the decoded values of neighboring pixels; if the header information is not an encoded character, identifying the pixel as an uncompressed region, and replacing the encoded value of the pixel with the original pixel value.
[0018] In combination with the first aspect, in an implementable manner, the method further includes: packing the encoded values of the image blocks to generate a compressed bitstream of the image blocks; writing the compressed bitstream into a random access memory; and storing the compressed bitstream of the image blocks in partitions.
[0019] In a second aspect, some embodiments of the present application further provide a block-based system for image compression, including a segmentation module, a processing module, and an encoding module, where:
[0020] The segmentation module is configured to segment the image to be processed into image blocks according to the block information;
[0021] The processing module is configured to detect the boundary positions of the image blocks; mark the compressed regions and uncompressed regions according to the boundary positions, where the uncompressed region is the region in the image to be processed that is less than or equal to a distance threshold from the boundary position, and the compressed region is the region in the image to be processed that is greater than the distance threshold from the boundary position;
[0022] The encoding module is configured to replace the decoded values of the uncompressed regions with preset feature values; perform encoding on the compressed regions based on the decoded values of neighboring pixels, and replace the encoded values of the uncompressed regions with the original pixel values.
[0023] In a third aspect, some embodiments of the present application further provide an electronic device, including: a processor, a memory, and a bus;
[0024] The processor and the memory communicate with each other through the bus;
[0025] The memory stores computer program instructions executable by the processor, and the processor is configured to:
[0026] Segment the image to be processed into image blocks according to the block information;
[0027] Detect the boundary positions of the image blocks;
[0028] Mark the compressed regions and uncompressed regions according to the boundary positions, where the uncompressed region is the region in the image to be processed that is less than or equal to a distance threshold from the boundary position, and the compressed region is the region in the image to be processed that is greater than the distance threshold from the boundary position;
[0029] Replace the decoded value of the non-compressed region with a preset eigenvalue;
[0030] Perform encoding on the compressed region based on the decoded values of neighboring pixel points, and replace the encoded value of the non-compressed region with the original pixel value.
[0031] As can be seen from the above technical solutions, for the block division method, system, and electronic device based on image compression provided by some embodiments of the present application, the method can divide the image to be processed into image blocks according to the block information, and detect the boundary positions of the image blocks. Mark the compressed region and the non-compressed region according to the boundary positions. Among them, the non-compressed region is the region in the image to be processed where the distance from the boundary position is less than or equal to the distance threshold, and the compressed region is the region in the image to be processed where the distance from the boundary position is greater than the distance threshold. Then, replace the decoded value of the non-compressed region with a preset eigenvalue, perform encoding on the compressed region based on the decoded values of neighboring pixel points, and replace the encoded value of the non-compressed region with the original pixel value. The method divides the compressed region and the non-compressed region through the boundary positions of the image blocks, then performs encoding on the compressed region based on the decoded values of neighboring pixel points, and directly uses the original pixel values of the non-compressed region as the encoded values, which can improve the compression effect of the image blocks. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0033] Figure 1 It is a schematic flowchart of image encoding provided by some embodiments of the present application;
[0034] Figure 2 It is a schematic diagram of the state change of a block division method based on image compression provided by some embodiments of the present application;
[0035] Figure 3 It is a schematic diagram of the effect of dividing image blocks provided by some embodiments of the present application;
[0036] Figure 4 It is a schematic diagram of the effect of the compressed region and the non-compressed region provided by some embodiments of the present application;
[0037] Figure 5 It is a schematic diagram of the reference information of compressed pixel points provided by some embodiments of the present application;
[0038] Figure 6Schematic diagram of the storage structure of each image block provided by some embodiments of the present application;
[0039] Figure 7 Schematic diagram of the processing flow of a block-based system for image compression provided by some embodiments of the present application;
[0040] Figure 8 Schematic diagram of the structure of an electronic device provided by some embodiments of the present application. Detailed implementation manners
[0041] To make the objectives, technical solutions, and advantages of the exemplary embodiments of the present application clearer, the technical solutions in the exemplary embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the exemplary embodiments of the present application. Apparently, the described exemplary embodiments are only a part rather than all of the embodiments of the present application.
[0042] Image compression refers to representing a pixel matrix with fewer bits, also known as image coding. The encoded data generated by image compression can reduce redundant information in the image data, such as spatial redundancy, temporal redundancy, and spectral redundancy, etc., thereby improving the storage and transmission efficiency of the image.
[0043] As Figure 1 shown, in some embodiments, compressing a to-be-processed image includes: obtaining the to-be-processed image and extracting pixel points of the to-be-processed image. Detecting neighboring pixel points around the pixel points, using the decoded values of the neighboring pixel points as reference values to predict the current pixel point to generate a predicted value. Performing quantization, subtraction on the original pixel value and the predicted value of the pixel point, and using the difference value obtained by the subtraction as the coding result of the current pixel point.
[0044] Since the image size of the to-be-processed image is large, in order to reduce the data volume in the line buffer during the image processing, in some embodiments, the to-be-processed image is subjected to a block processing to generate a plurality of image blocks. Encoding the image blocks respectively and packing the encoding results to form a compressed bitstream of the image blocks. Writing the compressed bitstream into a DDR (Double Data Rate, double data rate synchronous dynamic random access memory) to implement the storage of the encoded data.
[0045] However, since there are boundary regions in the segmented image blocks and there are not enough neighboring pixel points for the pixel points in the boundary regions, the corresponding predicted values cannot be obtained when compressing the boundary regions of the image blocks. In this way, the boundary regions of the image blocks cannot be encoded. And if the boundary regions are processed by the encoding method of the image edge, it will cause the problem of unevenness in the decoded image, affecting the effect of image block compression.
[0046] Based on the above application scenarios, in order to improve the compression effect of image blocks, some embodiments of the present application provide a block-based method for image compression, as Figure 2 shown, the method includes the following program steps:
[0047] S1: Segment the image to be processed into image blocks according to the block information.
[0048] When compressing the image to be processed, first segment the image to be processed according to the block information to generate a plurality of image blocks smaller than the size of the image to be processed. By dividing the image to be processed into blocks, the amount of data cached in the line buffer during image processing can be reduced.
[0049] In some embodiments, the step of segmenting the image to be processed into image blocks according to the block information includes: reading the block information and the original file information of the image to be processed. Among them, the block information includes the number of block rows and the number of block columns. Determine the original pixel width and the original pixel height of the image to be processed through the original file information, then calculate the first segmentation size according to the number of block rows and the original pixel height, and calculate the second segmentation size according to the number of block columns and the original pixel width. Segment the image to be processed based on the first segmentation size and the second segmentation size.
[0050] For example: The size of the image to be processed is 4k, its pixel width is 4096 pixels, and its height is 2048 pixels. The block information includes 1 block row and 4 block columns. As Figure 3 shown, segment the image to be processed through the block information. The number of block rows is 1 row, and the first segmentation size remains the original pixel height of 2048 pixels, that is, there is no need to horizontally segment the image to be processed; the number of block columns is 4 columns, and the second segmentation size is 1024 pixels, that is, the image to be processed is vertically segmented into four pieces, and the pixel sizes of each image block are equal.
[0051] It should be noted that the above-described image segmentation method is only an exemplary illustration, and the block-based method for image compression provided by the present application can also use other image block technologies or image segmentation algorithms. In this regard, the present application makes no restrictions.
[0052] S2: Detect the boundary positions of the image blocks.
[0053] Since segmenting the image to be processed into a plurality of image blocks will increase the boundary area of the image to be processed, and the pixel points in the boundary area cannot query the corresponding neighboring pixel points, so the predicted value of the pixel points cannot be predicted when encoding the boundary area. Therefore, after segmenting the image to be processed into image blocks, also detect the boundary positions of each image block to determine the image areas that cannot be predicted in the image blocks.
[0054] To facilitate the detection of the boundary position of an image block, in some embodiments, a boundary function is generated based on a first segmentation size and a second segmentation size, and the pixel point coordinate set of the boundary function is solved in the image block. Then, the pixel point coordinate set is stored as boundary coordinates to represent the position of the image block through the boundary coordinates.
[0055] For example, the first segmentation size m and the second segmentation size n are obtained from the block information. The number of segmented image blocks is 8, the number of block rows is 2 rows, and the number of block columns is 4 columns. And the coordinates of the image to be processed are established in a two-dimensional coordinate system with the lower left pixel point as the origin. According to m and n, the boundary functions y = m, x = n, x = 2n, and x = 3n are generated. Then, all pixel points in the image block that satisfy y = m, x = n, x = 2n, and x = 3n are solved as the pixel point coordinate set for representing the boundary position, and the pixel point coordinate set is used as the boundary coordinates of the image block.
[0056] S3: Mark the compressed area and the non-compressed area according to the boundary position.
[0057] Among them, the non-compressed area is the area in the image to be processed where the distance from the boundary position is less than or equal to the distance threshold, and the compressed area is the area in the image to be processed where the distance from the boundary position is greater than the distance threshold. The distance threshold is a preset distance value, such as 4pixel, 6pixel, etc. Since the pixel points near the boundary position cannot query the neighborhood pixel points as reference points, the image area close to the boundary position is marked as the non-compressed area, and the non-compressed area is not predicted and encoded through the reference value of the neighborhood pixel points.
[0058] In some embodiments, when marking the compressed area and the non-compressed area according to the boundary position, the pixel points of the image block are traversed to obtain the coordinates of the pixel points. The target distance between the pixel point and the boundary coordinates is calculated through the coordinates. If the target distance is less than or equal to the distance threshold, the pixel point is marked as the non-compressed area; if the target distance is greater than the distance threshold, the pixel point is marked as the compressed area.
[0059] For example: The size of the image to be processed is 4k, its pixel width is 4096pixel, and its height is 2048pixel. The block information includes 1 row of block rows and 4 columns of block columns, and the distance threshold is 4pixel. Then, the compressed area and the non-compressed area of the image block are as Figure 4 shown, Figure 4 where the blank area is the compressed area and the shaded area is the non-compressed area.
[0060] S4: Replace the decoded value of the non-compressed area with a preset eigenvalue.
[0061] Since the uncompressed region is the boundary region of the image block, the decoded values of the uncompressed region are directly replaced by preset eigenvalue for the pixel points in the compressed region to refer to. The eigenvalue can be set based on the actual application scenario of image compression, but the eigenvalue for replacing the decoded value of each uncompressed region should be consistent. That is to say, the eigenvalue for processing a to-be-processed image is fixed.
[0062] S5: Perform encoding on the compressed region based on the decoded values of the neighboring pixel points, and replace the encoded values of the uncompressed region with the original pixel values.
[0063] After replacing the decoded values of the uncompressed region with the eigenvalue, encoding can be performed on the pixel points in the compressed region based on the neighboring pixel points. At this time, the pixel points in the compressed region close to the uncompressed region can use the replaced eigenvalue as a reference point to obtain the encoding result of the pixel points in the compressed region. For example, the decoded values of the uncompressed region can be replaced with the original pixel values for other pixel points to refer to. For the pixel points in the uncompressed region, they are directly replaced with the original pixel values, thereby realizing the encoding of the compressed region and the uncompressed region of the image block.
[0064] In some embodiments, when performing encoding on the compressed region based on the decoded values of the neighboring pixel points, obtain the original pixel value of the target pixel point in the compressed region, query the neighboring pixel points of the target pixel point, and detect the decoded values of the neighboring pixel values. Calculate the predicted value of the pixel point with the decoded value as the reference point, calculate the difference value between the predicted value and the original pixel value, and output the difference value as the decoded value of the target pixel point.
[0065] To facilitate the calculation of the difference value between the predicted value and the original pixel value, quantization and subtraction can also be performed on the predicted value and the original pixel value. That is, in some embodiments, when calculating the difference value between the predicted value and the original pixel value, perform quantization on the predicted value and the decoded value, and solve the difference between the predicted value and the decoded value.
[0066] Exemplarily, when performing compression encoding on the pixel point P0 in the compressed region, the neighboring pixel point information as shown in Figure 5 is referred to. Among them, the format without filling represents the decoded neighboring pixel points in the two rows above P0 and the left group; the format with shaded filling represents the reference pixel points required for the current compressed pixel point p0; the format with dot filling represents the group of pixel points to be compressed currently.
[0067] In order not to additionally increase the space for distinguishing the compressed area from the non-compressed area, the area where the pixel points are located can also be distinguished by the header information. Therefore, in some embodiments, the header information of the pixel points is detected. If the header information is an encoded character, the pixel point is identified as a compressed area, and the pixel point is encoded based on the decoded values of the neighboring pixel points. If the header information is not an encoded character, the pixel point is identified as a non-compressed area, and the encoded value of the pixel point is replaced by the original pixel value.
[0068] For example, the encoded characters are 1-10. When encoding a pixel point, the data header information of the pixel point P0 is detected. When the header information is equal to 1-10, it can be recognized that the pixel point P0 is a pixel point in the compressed area, and the pixel point can be encoded according to the encoding method of the compressed area. When the header information is greater than 10, it can be recognized that the pixel point P0 is a pixel point in the non-compressed area, and the encoded value can be directly replaced by the original pixel point of P0.
[0069] In addition, in order to improve the decoding efficiency, in some embodiments, the encoded values of the image blocks are also packed to generate a compressed bitstream of the image blocks. Then the compressed bitstream is written into the random access memory, and the compressed bitstreams of the image blocks are stored in partitions. By storing the encoded data of each image block independently, on the one hand, the spatial efficiency of decoding can be improved, and on the other hand, the problem of address alignment during decoding can be improved, thereby improving the overall decoding efficiency.
[0070] For example, the size of the image to be processed is 4k, its pixel width is 4096 pixels, and its height is 2048 pixels. The image to be processed is divided into Figure 4 the shown image blocks to form image block 1, image block 2, image block 3, and image block 4. The encoded data of each image block, that is, the compressed bitstream, is stored separately. As Figure 6 shown, Figure 6 the unfilled part in it represents the compressed bitstream value, the shaded filled part represents the bitstream value of the non-compressed area, and line 0-line 2047 are the respective line caches of the image block encoded data.
[0071] Based on the above-mentioned block-based method for image compression, some embodiments of the present application further provide a block-based system for image compression, as Figure 7 shown, including a segmentation module 100, a processing module 200, and an encoding module 300. Among them:
[0072] The segmentation module 100 is configured to divide the image to be processed into image blocks according to the block information.
[0073] The processing module 200 is configured to detect the boundary positions of the image blocks; mark the compressed regions and the non-compressed regions according to the boundary positions, where the non-compressed regions are the regions in the image to be processed whose distances from the boundary positions are less than or equal to a distance threshold, and the compressed regions are the regions in the image to be processed whose distances from the boundary positions are greater than the distance threshold.
[0074] The encoding module 300 is configured to replace the decoded values of the non-compressed regions with preset eigenvalue; perform encoding on the compressed regions based on the decoded values of neighboring pixel points, and replace the encoded values of the non-compressed regions with the original pixel values.
[0075] Based on the above block-based system for image compression, some embodiments of the present application further provide an electronic device 400, including the block-based system for image compression described in the above embodiments.
[0076] In some embodiments, as Figure 8 shown, the electronic device 400 includes: at least one processor 401, at least one communication interface 402, at least one memory 403, and at least one bus 404. Among them, the bus 404 is used to implement direct connection communication between these components, the communication interface 402 is used to communicate with other node devices in terms of signaling or data, and the memory 403 stores computer program instructions executable by the processor 401. When the electronic device 400 runs, the processor 401 communicates with the memory 403 through the bus 404. The processor 401 can call the computer program stored in the memory 403 and execute the computer program to implement the block-based method for image compression provided by the embodiments of the present application.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
[0078] For the sake of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are for better explaining the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A block-based method based on image compression, characterized in that, Comprising: Segmenting the image to be processed into image blocks according to the chunk information; Generating a boundary function by a first segmentation size and a second segmentation size; the first segmentation size and the second segmentation size are used to segment the image to be processed; Solving a set of pixel point coordinates of the boundary function in the image blocks; Storing the set of pixel point coordinates as boundary coordinates; Traversing the pixel points of the image blocks to obtain the coordinates of the pixel points; Calculating a target distance between the pixel point and the boundary coordinates through the coordinates; the boundary coordinates are coordinates obtained by solving the boundary function based on the image blocks; If the target distance is less than or equal to the distance threshold, marking the pixel point as a non-compressed region; If the target distance is greater than the distance threshold, marking the pixel point as a compressed region; Replacing the decoded value of the non-compressed region with a preset eigenvalue; Performing encoding on the compressed region based on the decoded values of neighboring pixel points, and replacing the encoded value of the non-compressed region with the original pixel value.
2. The block-based method based on image compression according to claim 1, wherein, Segmenting the image to be processed into image blocks according to the chunk information, including: Reading the chunk information and the original file information of the image to be processed, the chunk information including the number of chunk rows and the number of chunk columns; Determining the original pixel width and the original pixel height of the image to be processed through the original file information; Calculating a first segmentation size according to the number of chunk rows and the original pixel height, and calculating a second segmentation size according to the number of chunk columns and the original pixel width; Segmenting the image to be processed based on the first segmentation size and the second segmentation size.
3. The block division method based on image compression according to claim 1, wherein Performing encoding on the compressed region based on the decoded values of neighboring pixel points, further including: Obtaining the original pixel value of a target pixel point in the compressed region; Querying the neighboring pixel points of the target pixel point and detecting the decoded values of the neighboring pixel values; Calculating a predicted value of the pixel point with the decoded value as a reference point; Calculating a difference value between the predicted value and the original pixel value, and outputting the difference value as the decoded value of the target pixel point.
4. The block-based method based on image compression according to claim 3, wherein Calculating the difference value between the predicted value and the original pixel value, further including: Performing quantization on the predicted value and the decoded value; Solving the difference between the predicted value and the decoded value.
5. The block-based method based on image compression according to claim 1, wherein Further comprising: Detecting the header information of the pixel point; If the header information is an encoded character, identifying the pixel point as a compressed region and performing encoding on the pixel point based on the decoded values of neighboring pixel points; If the header information is not an encoded character, identifying the pixel point as a non-compressed region and replacing the encoded value of the pixel point with the original pixel value.
6. The block-based method based on image compression according to claim 1, wherein Further comprising: Packing the encoded values of the image blocks to generate a compressed bitstream of the image blocks; Writing the compressed bitstream into a random access memory; Storing the compressed bitstream of the image blocks in partitions.
7. A block system based on image compression, characterized in that Comprising: A segmentation module configured to segment the image to be processed into image blocks according to the chunk information; A processing module, configured to generate a boundary function through a first segmentation size and a second segmentation size; the first segmentation size and the second segmentation size are used to segment the image to be processed; solve a set of pixel point coordinates of the boundary function in the image block; store the set of pixel point coordinates as boundary coordinates; Traverse the pixel points of the image block to obtain the coordinates of the pixel points; Calculate a target distance between the pixel point and the boundary coordinates through the coordinates; the boundary coordinates are coordinates obtained by solving a boundary function based on the image block; If the target distance is less than or equal to the distance threshold, mark the pixel point as a non-compressed area; If the target distance is greater than the distance threshold, mark the pixel point as a compressed area; An encoding module, configured to replace the decoding value of the non-compressed area with a preset feature value; perform encoding on the compressed area based on the decoding values of neighboring pixel points, and replace the encoding value of the non-compressed area with the original pixel value.
8. An electronic device, characterized in that, Comprising: A processor, a memory and a bus; The processor and the memory complete communication with each other through the bus; The memory stores computer program instructions executable by the processor, and the processor is configured to: Segment the image to be processed into image blocks according to the block information; Generate a boundary function through a first segmentation size and a second segmentation size; the first segmentation size and the second segmentation size are used to segment the image to be processed; Solve a set of pixel point coordinates of the boundary function in the image block; Store the set of pixel point coordinates as boundary coordinates; Traverse the pixel points of the image block to obtain the coordinates of the pixel points; Calculate a target distance between the pixel point and the boundary coordinates through the coordinates; the boundary coordinates are coordinates obtained by solving a boundary function based on the image block; If the target distance is less than or equal to the distance threshold, mark the pixel point as a non-compressed area; If the target distance is greater than the distance threshold, mark the pixel point as a compressed area; Replace the decoding value of the non-compressed area with a preset feature value; Perform encoding on the compressed area based on the decoding values of neighboring pixel points, and replace the encoding value of the non-compressed area with the original pixel value.
Citation Information
Patent Citations
Interframe prediction method and system of video compression
CN101179734A
Semiconductor device and processing method using the semiconductor device
CN110572663A