Image compression method and system based on portrait mask binary graph

By arranging, offsetting, and dynamically counting the triples of the portrait mask binary image, binary codes are generated, solving the problem that existing technologies cannot achieve high compression rates without relying on inter-frame information, and achieving lossless compression.

CN118433421BActive Publication Date: 2026-03-20YEALINK (XIAMEN) NETWORK TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies cannot achieve high compression rates when compressing binary images of human faces without relying on inter-frame information, and are prone to anomalies, especially when packet loss occurs during network transmission.

Method used

By retrieving triples from the human image region, a two-dimensional information array is generated using a preset arrangement order. The triples are then re-encoded using an offset algorithm and a dynamic counting method to finally generate binary code, achieving lossless compression.

Benefits of technology

A high compression ratio for portrait mask binary images is achieved without relying on inter-frame information, resulting in lossless compression and improved compression ratio of binary encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118433421B_ABST
    Figure CN118433421B_ABST
Patent Text Reader

Abstract

The application discloses an image compression method and system based on a portrait mask binary graph, and the method comprises the following steps: searching a portrait area of a first image in a preset direction, and recording a triple of each portrait area; obtaining a two-dimensional information array through a preset arrangement order according to the triple of all the portrait areas; obtaining a re-encoding of the triple of each portrait area through a preset offset algorithm according to the two-dimensional information array; and processing the re-encoding of the triple of each portrait area through a preset dynamic counting method to obtain a binary code of the first image, so as to complete image compression of the first image. The application can guarantee a high compression rate of the portrait mask binary graph without inter-frame dependence, and complete lossless compression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to an image compression method and system based on a portrait mask binary image. Background Technology

[0002] In recent years, with the development of video AI, video portrait detection and matting technologies have gradually matured, and portrait matting has been increasingly applied to real-world scenarios to achieve a better video interaction experience. Examples include picture-in-picture and multi-person screen sharing (background replacement) functions in live streaming and video conferencing; additionally, portrait detection technology is used in anti-subtitle occlusion functions during video playback on video websites. In these scenarios, there is often one sharing end corresponding to multiple receiving ends. To ensure consistent results across multiple receiving ends, portrait detection is performed at the sharing end, outputting a portrait mask image (which can be converted into a binary image for easy compression). The receiving ends then use the portrait mask to perform matting display or anti-subtitle occlusion functions.

[0003] Image compression can employ hybrid compression algorithms based on standards such as H.264, H.265, JPEG, and PNG, or statistical compression algorithms designed for binary images, such as RCL and WBS. Since H.264, H.265, JPEG, and PNG are all lossy compression methods, JPEG and PNG have relatively low compression ratios. H.264 and H.265 require inter-frame dependencies to guarantee higher compression ratios, but introducing inter-frame dependencies means that packet loss during network transmission can not only cause anomalies in the current binary image but also affect subsequent binary images. While RCL and WBS are statistical coding methods designed for the characteristics of binary images, their compression performance for portrait mask binary images is still unsatisfactory. Therefore, currently, there is no compression method for portrait mask binary images that can guarantee a high compression ratio without inter-frame dependencies. Summary of the Invention

[0004] This invention proposes an image compression method and system based on a portrait mask binary image, which can still ensure a high compression ratio of the portrait mask binary image without requiring inter-frame dependency, thus achieving lossless compression.

[0005] A first aspect of the present invention provides an image compression method based on a portrait mask binary image, the method comprising:

[0006] The human image region of the first image is retrieved in a preset direction, and a triplet of each human image region is recorded; wherein, the triplet includes the starting column coordinates, the starting row coordinates, and the length of the human image region; the first image is a binary image of a human image mask;

[0007] Based on the triples of all portrait regions, a two-dimensional information array is obtained through a preset arrangement order;

[0008] According to the two-dimensional information array, a re-encoding of each portrait region triplet is obtained through a preset offset algorithm; wherein the re-encoding includes an initial column coordinate offset, an initial row coordinate offset and a length offset of the triplet;

[0009] The re-encoding of each portrait region triplet is processed through a preset dynamic counting method to obtain a binary code of the first image, so as to complete the image compression of the first image.

[0010] The above scheme obtains the triplet of the portrait region in the first image through retrieval, arranges the triplet in a preset arrangement order to obtain a two-dimensional information data group, then performs offset calculation on the data in the two-dimensional information array to obtain a re-encoding, and converts the re-encoding into a binary code through dynamic counting to complete the image compression of the first image. Since there is no approximate calculation in the compression process, the lossless compression of the image can be realized, and there is no inter-frame dependence in the compression process. Moreover, the offset calculation and dynamic counting in the compression process can compress the data amount of the first image, so as to improve the compression rate of the binary code.

[0011] In a possible implementation method of the first aspect, according to the triplet of all portrait regions, a two-dimensional information array is obtained through a preset arrangement order, specifically as follows:

[0012] The triplet of the portrait region with the same starting row coordinate is arranged in ascending order of the starting column coordinate to obtain a first information array of the portrait region with the same starting row coordinate.

[0013] According to the first information array, a two-dimensional information array is obtained by arranging in ascending order of the starting row coordinate.

[0014] The above scheme sorts the triplet of all portrait regions according to the starting row coordinate and the starting column coordinate to obtain a two-dimensional array, that is, a two-dimensional information array, which completes the extraction of the portrait region of the first image and provides data support for the encoding and compression of the portrait region.

[0015] In a possible implementation method of the first aspect, the two-dimensional information array is specifically as follows:

[0016] The two-dimensional information array has a specific expression as follows:

[0017] {{A 11 ,A 12 ,A 13 …},{A 21 ,A 22 ,A 23 …}…{A m1 ,A m2 ,Am3 …A mn}}

[0018] wherein A mn is a triplet of the mth row and nth portrait region in the first image, {A m1 , A m2 , A m3 …A mn} is a first information array of the mth row portrait region in the first image.

[0019] In a possible implementation method of the first aspect, according to the two-dimensional information array, a re-encoding of each triplet of the portrait region is obtained through a preset offset algorithm, specifically as follows:

[0020] According to the triplet of the portrait region in the two-dimensional information array, an initial column coordinate offset of each triplet of the portrait region is obtained by processing an initial column coordinate of each triplet of the portrait region through a preset column coordinate offset algorithm.

[0021] According to the triplet of the portrait region in the two-dimensional information array, an initial row coordinate offset of each triplet of the portrait region is obtained by processing an initial row coordinate of each triplet of the portrait region through a preset row coordinate offset algorithm.

[0022] According to the triplet of the portrait region in the two-dimensional information array, a length offset of each triplet of the portrait region is obtained by processing a length of each triplet of the portrait region through a preset length offset algorithm.

[0023] According to the initial column coordinate offset, the initial row coordinate offset and the length offset of each triplet, a re-encoding of each triplet is obtained.

[0024] The above scheme performs offset calculation on the initial column coordinate, the initial row coordinate and the length of the triplet of the portrait region through a preset offset algorithm, re-encodes the triplet, and simplifies the subsequent binary encoding step.

[0025] In a possible implementation method of the first aspect, the initial column coordinate offset, the initial row coordinate offset and the length offset of the triplet, and the re-encoding of the triplet are specifically as follows:

[0026] The initial column coordinate offset of the triplet is ΔAx mn , and a specific formula is as follows:

[0027]

[0028] wherein Ax mn is an initial column coordinate of the triplet of the mth row and nth portrait region in the first image, NMAX m-1total number of portrait regions in the m-1th row of the first image;

[0029] initial row coordinate offset Ay of the triplet mn , and the specific formula is:

[0030]

[0031] wherein Ay mn is the initial row coordinate of the triplet of the nth portrait region in the mth row of the first image;

[0032] length offset Al of the triplet mn , and the specific formula is:

[0033]

[0034] wherein Al mn is the length of the triplet of the nth portrait region in the mth row of the first image;

[0035] re-encoding A of the triplet mn , and the specific formula is:

[0036]

[0037] In a possible implementation method of the first aspect, the re-encoding of the triplet of each portrait region is processed by a preset dynamic counting method to obtain the binary encoding of the first image, and the specific method is:

[0038] The initial column coordinate offset, the initial row coordinate offset and the length offset of the re-encoding are converted into corresponding first threshold bit dynamic encodings by the preset dynamic counting method, wherein the first bit of the dynamic encoding is the sign of the re-encoding, and the format of the dynamic encoding is binary encoding;

[0039] According to the dynamic encoding, the binary encoding of the first image is obtained.

[0040] The above scheme converts the re-encoding into binary encoding and performs dynamic counting by the preset dynamic counting method, realizes the compression of the data of the first image, and improves the compression rate of the binary encoding of the portrait region.

[0041] The second aspect of the application provides an image compression system based on a portrait mask binary graph, and the system comprises a portrait region retrieval module, a data arrangement module, a data offset calculation module and a data dynamic encoding module.

[0042] The human region searching module is configured to search human regions of the first image in a preset direction, and record a triple of each human region; the triple includes a starting column coordinate, a starting row coordinate and a length of the human region; the first image is a human mask binary image;

[0043] The data arrangement module is configured to obtain a two-dimensional information array according to the triples of all human regions through a preset arrangement order;

[0044] The data offset calculation module is configured to obtain a re-encoding of the triple of each human region according to the two-dimensional information array through a preset offset algorithm; the re-encoding includes an initial column coordinate offset, an initial row coordinate offset and a length offset of the triple;

[0045] The data dynamic encoding module is configured to process the re-encoding of the triple of each human region through a preset dynamic counting method, and obtain a binary encoding of the first image to complete image compression of the first image.

[0046] In a possible implementation of the second aspect, the data arrangement module includes a triple arrangement unit.

[0047] The triple arrangement unit is configured to arrange the triples of the human regions with the same starting row coordinate in ascending order of the starting column coordinates to obtain a first information array of the human regions with the same starting row coordinate, and arrange the first information array in ascending order of the starting row coordinates to obtain a two-dimensional information array.

[0048] In a possible implementation of the second aspect, the data offset calculation module includes a re-encoding calculation unit.

[0049] The re-encoding calculation unit is configured to process the initial column coordinates of the human regions of each triple according to the triples of the human regions in the two-dimensional information array through a preset column coordinate offset algorithm to obtain an initial column coordinate offset of each triple, process the initial row coordinates of the human regions of each triple according to the triples of the human regions in the two-dimensional information array through a preset row coordinate offset algorithm to obtain an initial row coordinate offset of each triple, process the lengths of the human regions of each triple according to the triples of the human regions in the two-dimensional information array through a preset length offset algorithm to obtain a length offset of each triple, and obtain a re-encoding of each triple according to the initial column coordinate offset, the initial row coordinate offset and the length offset of each triple.

[0050] In a possible implementation of the second aspect, the data dynamic encoding module includes a binary encoding calculation unit.

[0051] The binary encoding calculation unit is used to convert the initial column coordinate offset, initial row coordinate offset, and length offset of the re-encoded data into dynamic codes of the corresponding first threshold bits using a preset dynamic counting method; wherein, the first bit of the dynamic code is the re-encoded symbol, and the format of the dynamic code is binary encoding; and the binary code of the first image is obtained according to the dynamic encoding. Attached Figure Description

[0052] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is a schematic diagram illustrating the specific process of an image compression method based on a portrait mask binary image according to a certain embodiment of the present invention;

[0054] Figure 2 This is a structural diagram of an image compression system based on a human face mask binary image provided in a certain embodiment of the present invention. Detailed Implementation

[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.

[0057] like Figure 1 As shown, Figure 1 This invention provides a schematic flowchart of an image compression method based on a portrait mask binary image, which includes steps S1 to S4, as detailed below:

[0058] Step S1: Search for the portrait region of the first image in a preset direction and record the triplet of each portrait region;

[0059] In this step, the portrait region of the first image is first retrieved by row or column. In this embodiment, the retrieval is done by row. Since the portrait region of the first image is displayed as line segments, it is necessary to record the starting coordinates and length of the line segments representing the portrait region. The starting row coordinates of the line segments are recorded as the starting row coordinates of the portrait region, the starting column coordinates of the line segments are recorded as the starting column coordinates of the portrait region, and the length of the line segments is recorded as the length of the portrait region. The starting column coordinates, starting row coordinates, and length of the portrait region are then recorded as a triplet of the portrait region: A mn Let be the triplet representing the nth person's image region in the m-th row of the first image. mn The specific formula is:

[0060]

[0061] Among them, A mn Let Ax be the triplet of the nth portrait region in the mth row of the first image. mn For A mn The starting row coordinates, Ay mn For A mn The starting column coordinates, Al mn For A mn The length.

[0062] Step S2: Based on the triples of all portrait regions, a two-dimensional information array is obtained through a preset arrangement order;

[0063] In this step, since each row in the first image may contain multiple portrait regions, the triples of portrait regions with the same starting row coordinates are arranged in ascending order of their starting column coordinates to obtain a first information array of portrait regions in the same row. Then, all the first information arrays in the first image are arranged in ascending order of their starting row coordinates to obtain a two-dimensional information array. This two-dimensional information array, along with the added width and height of the first image, can describe the entire first image.

[0064] The specific formula for expressing the two-dimensional information array is as follows:

[0065] {{A 11 A 12 A 13 …},{A 21 A 22 A 23 …}…{A m1 A m2 A m3 …A mn}}

[0066] Among them, {A m1 Am2 A m3 …A mn}is the first information array of the portrait region of the mth row in the first image, and m and n are positive integers starting from 1.

[0067] S3, according to the two-dimensional information array, obtaining the re-encoding of each portrait region triplet by a preset offset algorithm;

[0068] In this step, the triplet in the two-dimensional information array is calculated by a preset offset algorithm, and the triplet A mn is obtained after the offset calculation, and the re-encoding of the triplet is denoted as ΔA mn . The specific formula is:

[0069]

[0070] Wherein, ΔAx mn is the initial column coordinate offset of the triplet, ΔAy mn is the initial row coordinate offset of the triplet, and ΔAl mn is the length offset of the triplet.

[0071] According to the triplet of the portrait region in the two-dimensional information array, the initial column coordinate of the portrait region of each said triplet is processed by a preset column coordinate offset algorithm to obtain the initial column coordinate offset of each said triplet; wherein the initial column coordinate offset of the triplet is the difference value compared with the starting column coordinate of the triplet of the portrait region of the previous row in the first image (the same portrait region in the previous row).

[0072] Wherein, the initial column coordinate offset ΔAx mn of the triplet, the specific formula is:

[0073]

[0074] Wherein, Ax mn is the initial column coordinate of the triplet of the nth portrait region of the mth row in the first image, and NMAX m-1 is the total number of portrait regions of the m-1th row in the first image.

[0075] According to the triplet of the portrait region in the two-dimensional information array, the initial row coordinate of the portrait region of each said triplet is processed by a preset row coordinate offset algorithm to obtain the initial row coordinate offset of each said triplet; wherein the initial row coordinate of the triplet is the difference value compared with the starting column coordinate of the previous one in the same row, or the last portrait region of the previous row in the first image.

[0076] Wherein, the initial row coordinate offset ΔAy mn, the specific formula is:

[0077]

[0078] wherein, Ay mn is the initial row coordinate of the triplet of the mth row and nth portrait area in the first image.

[0079] According to the triplet of the portrait area in the two-dimensional information array, the length of the portrait area of each triplet is processed by a preset length offset algorithm, and the length offset of each triplet is obtained; wherein the length offset of the triplet is the difference compared with the length of the triplet of the portrait area of the previous row (the same portrait area in the previous row) in the first image.

[0080] wherein, the length offset of the triplet is ΔAl mn , the specific formula is:

[0081]

[0082] wherein, Al mn is the length of the triplet of the mth row and nth portrait area in the first image.

[0083] Finally, the re-encoding of the triplet is obtained according to the initial column coordinate offset, the initial row coordinate offset and the length offset of the triplet.

[0084] Step S4, the re-encoding of the triplet of each portrait area is processed by a preset dynamic counting method, and the binary code of the first image is obtained to complete the image compression of the first image.

[0085] In this step, the initial column coordinate offset, the initial row coordinate offset and the length offset of the re-encoding of the triplet are processed respectively by a preset dynamic counting method, and the corresponding first threshold bit dynamic code is obtained. Then the dynamic code is combined with the width and height of the first image and the re-encoding of the triplet to complete the encoding of the complete binary image information, and the binary code of the first image is obtained.

[0086] The preset dynamic counting method is a set of signed dynamic length counting method, which can reduce the coding redundancy caused by the traditional fixed length counting method, and further increase the compression rate after binary coding; wherein the traditional fixed length counting method has fixed counting length, and each counting needs to meet the maximum value in the compressed data.

[0087] First, the width and height of the first image are respectively binary coded, then the re-encoding of each triplet in the two-dimensional information array is sequentially binary coded according to the order of the initial column coordinate offset, the initial row coordinate offset and the length offset, and finally the binary code containing the image information of the first image is obtained.

[0088] In the embodiment, the preset dynamic counting method is specifically:

[0089] The number is converted into the binary code corresponding to the first threshold bit; wherein the first 1 bit is a positive and negative flag bit (0 for positive number and 1 for negative number), the middle 2 bits form a quaternary count, and the last 1 bit is a carry flag (0 for no carry and 1 for carry). In the embodiment, the high bit is set to the left, but in other embodiments, the high bit can be set to the right.

[0090] Take the number -5 as an example to illustrate dynamic counting: the binary code of the number -5 obtained by the preset dynamic counting method is "0011011", and the specific explanation is as follows:

[0091] "0 01 1 01 1"

[0092] Wherein, from right to left, the 1st bit is "1", indicating a negative number, denoted as "-"; the 2nd and 3rd bits "01" are low count, indicating "1*4 0 "; the 4th bit is "1", indicating a carry; the 5th and 6th bits are "01", which are carry count, indicating "1*4 1 "; the 7th bit is "0", which is no carry, indicating the end of the current number.

[0093] According to the above description, it can be obtained that:

[0094] -(1*4 0 +1*4 1 )=-5.

[0095] The binary code of the first image can be reversely and losslessly restored into the first image according to the encoding format.

[0096] Further, in order to execute the image compression system based on the portrait mask binary graph corresponding to the above-mentioned method embodiment, to realize the corresponding functions and technical effects, Figure 2 a structural diagram of an image compression system based on a portrait mask binary graph is provided. For the sake of convenience, only the part related to the embodiment is shown, and the image compression system based on the portrait mask binary graph provided by the embodiment includes:

[0097] The portrait area retrieval module 201 is used for retrieving the portrait area of the first image in a preset direction, and recording the triplets of each portrait area; wherein the triplets include the starting column coordinate, the starting row coordinate and the length of the portrait area; the first image is a portrait mask binary graph;

[0098] The data arrangement module 202 is used for obtaining a two-dimensional information array through a preset arrangement order according to the triplets of all portrait areas.

[0099] The data offset calculation module 203 is configured to obtain a re-encoding of each portrait region triplet according to the two-dimensional information array by using a preset offset algorithm; wherein the re-encoding includes an initial column coordinate offset, an initial row coordinate offset and a length offset of the triplet.

[0100] The data dynamic encoding module 204 is configured to process the re-encoding of each portrait region triplet by using a preset dynamic counting method, to obtain a binary encoding of the first image, so as to complete the image compression of the first image.

[0101] In some embodiments, the data arrangement module 202 further includes:

[0102] The triplet arrangement unit is configured to arrange the triplets of the portrait regions with the same initial row coordinate in ascending order of the initial column coordinate, to obtain a first information array of the portrait regions with the same initial row coordinate; and arrange the triplets in ascending order of the initial row coordinate according to the first information array, to obtain a two-dimensional information array.

[0103] In some embodiments, the data offset calculation module 203 further includes:

[0104] The re-encoding calculation unit is configured to process the initial column coordinate of each portrait region triplet in the two-dimensional information array by using a preset column coordinate offset algorithm, to obtain an initial column coordinate offset of each triplet; process the initial row coordinate of each portrait region triplet in the two-dimensional information array by using a preset row coordinate offset algorithm, to obtain an initial row coordinate offset of each triplet; process the length of each portrait region triplet in the two-dimensional information array by using a preset length offset algorithm, to obtain a length offset of each triplet; and obtain a re-encoding of each triplet according to the initial column coordinate offset, the initial row coordinate offset and the length offset of each triplet.

[0105] In some embodiments, the data dynamic encoding module 204 further includes:

[0106] The binary encoding calculation unit is configured to convert the initial column coordinate offset, the initial row coordinate offset and the length offset of the re-encoding into corresponding dynamic encodings of the first threshold bit by using a preset dynamic counting method; wherein the first bit of the dynamic encoding is the sign of the re-encoding, and the format of the dynamic encoding is a binary encoding; and obtain a binary encoding of the first image according to the dynamic encoding.

[0107] The embodiment provides an image compression method and system based on a portrait mask binary graph. A portrait area of a first image is searched in a preset direction, and a triple of each portrait area is recorded. A two-dimensional information array is obtained through a preset arrangement order according to the triple of all the portrait areas. A re-encoding of the triple of each portrait area is obtained through a preset offset algorithm according to the two-dimensional information array. The re-encoding of the triple of each portrait area is processed through a preset dynamic counting method, and a binary code of the first image is obtained, so that image compression of the first image is completed. The method has the beneficial effect that a high compression rate of the portrait mask binary graph can be ensured without inter-frame dependence, and lossless compression is completed.

[0108] The above-described specific embodiments further explain the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above-described specific embodiments are merely examples of the present application and are not intended to limit the protection scope of the present application. It is particularly pointed out that any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image compression method based on a portrait mask binary image, characterized in that, include: The human figure region of the first image is retrieved in a preset direction, and a triplet of each human figure region is recorded; wherein, the triplet includes the starting column coordinates, the starting row coordinates, and the length of the human figure region; the first image is a binary image of a human figure mask; Based on the triples of all portrait regions, a two-dimensional information array is obtained through a preset arrangement order; Based on the two-dimensional information array, the recoding of each triplet of the portrait region is obtained through a preset offset algorithm. Specifically, based on the triplet of the portrait region in the two-dimensional information array, the initial column coordinates of the portrait region of each triplet are processed using a preset column coordinate offset algorithm to obtain the initial column coordinate offset of each triplet; based on the triplet of the portrait region in the two-dimensional information array, the initial row coordinates of the portrait region of each triplet are processed using a preset row coordinate offset algorithm to obtain the initial row coordinate offset of each triplet; based on the triplet of the portrait region in the two-dimensional information array, the length of the portrait region of each triplet is processed using a preset length offset algorithm to obtain the length offset of each triplet; based on the initial column coordinate offset, initial row coordinate offset, and length offset of each triplet, the recoding of each triplet is obtained; wherein, the recoding includes the initial column coordinate offset, initial row coordinate offset, and length offset of the triplet. The triplet of each portrait region is re-encoded using a preset dynamic counting method to obtain the binary code of the first image, thereby completing the image compression of the first image.

2. The image compression method based on a portrait mask binary image according to claim 1, characterized in that, The process involves generating a two-dimensional information array based on the triples of all portrait regions, arranged in a preset order. Specifically: Arrange the triplets of the portrait regions with the same starting row coordinates in ascending order of the starting column coordinates to obtain the first information array of the portrait regions with the same starting row coordinates; Based on the first information array, arrange the data in ascending order of the starting row coordinates to obtain a two-dimensional information array.

3. The image compression method based on a portrait mask binary image according to claim 2, characterized in that, The two-dimensional information array is specifically as follows: The specific expression for the two-dimensional information array is: in, A mn For the first image m Line number n The triplet of the individual portrait area, For the first image m The first information array of the portrait area in the row.

4. The image compression method based on a portrait mask binary image according to claim 1, characterized in that, The initial column coordinate offset, initial row coordinate offset, and length offset of the triple, as well as the recoding of the triple, are specifically as follows: The initial column coordinate offset of the triplet The specific formula is as follows: ; in, For the first image m Line number n The initial column coordinates of the triples in the portrait region. NMAX m-1 For the first image m -1 is the total number of portrait areas in the row; The initial row coordinate offset of the triplet The specific formula is as follows: ; in, For the first image m Line number n Initial row coordinates of the triplet in the individual portrait region; The length offset of the triplet The specific formula is as follows: ; in, For the first image m Line number n The length of the triplet in the individual portrait region; The recoding of the triple The specific formula is as follows: 。 5. The image compression method based on a portrait mask binary image according to claim 1, characterized in that, The process of recoding the triples of each portrait region using a preset dynamic counting method to obtain the binary code of the first image is as follows: The initial column coordinate offset, initial row coordinate offset, and length offset of the re-encoded data are converted into dynamic codes of the corresponding first threshold bits using a preset dynamic counting method; wherein, the first bit of the dynamic code is the re-encoded symbol, and the format of the dynamic code is binary code; The binary code of the first image is obtained based on the dynamic encoding.

6. An image compression system based on a human face mask binary image, characterized in that, include: The system includes a human face region retrieval module, a data arrangement module, a data offset calculation module, and a data dynamic encoding module. The portrait region retrieval module is used to retrieve the portrait region of the first image in a preset direction and record the triplet of each portrait region; wherein, the triplet includes the starting column coordinates, the starting row coordinates, and the length of the portrait region; the first image is a portrait mask binary image; The data arrangement module is used to obtain a two-dimensional information array based on the triples of all portrait regions through a preset arrangement order; The data offset calculation module is used to obtain the recoding of each portrait region's triples based on the two-dimensional information array using a preset offset algorithm. Specifically, it performs the following steps: First, based on the portrait region triples in the two-dimensional information array, it processes the initial column coordinates of each triple's portrait region using a preset column coordinate offset algorithm to obtain the initial column coordinate offset of each triple. Second, based on the portrait region triples in the two-dimensional information array, it processes the initial row coordinates of each triple's portrait region using a preset row coordinate offset algorithm to obtain the initial row coordinate offset of each triple. Third, based on the portrait region triples in the two-dimensional information array, it processes the length of each triple's portrait region using a preset length offset algorithm to obtain the length offset of each triple. Finally, based on the initial column coordinate offset, initial row coordinate offset, and length offset of each triple, it obtains the recoding of each triple. The recoding includes the initial column coordinate offset, initial row coordinate offset, and length offset of the triple. The data dynamic encoding module is used to process the re-encoding of the triples of each portrait region through a preset dynamic counting method to obtain the binary encoding of the first image, so as to complete the image compression of the first image.

7. The image compression system based on a portrait mask binary image according to claim 6, characterized in that, The data arrangement module includes: a triplet arrangement unit; The triplet arrangement unit is used to arrange the triplets of the portrait regions with the same starting row coordinates in ascending order of the starting column coordinates to obtain a first information array of the portrait regions with the same starting row coordinates; and to arrange the first information array in ascending order of the starting row coordinates to obtain a two-dimensional information array.

8. The image compression system based on a portrait mask binary image according to claim 6, characterized in that, The data dynamic encoding module includes: a binary encoding calculation unit; The binary encoding calculation unit is used to convert the initial column coordinate offset, initial row coordinate offset, and length offset of the re-encoded data into dynamic codes of the corresponding first threshold bits using a preset dynamic counting method; wherein, the first bit of the dynamic code is the re-encoded symbol, and the format of the dynamic code is binary encoding; and the binary code of the first image is obtained according to the dynamic encoding.

Citation Information

Patent Citations

  • Fixed-width variable-length pixel sample value string matching strengthened image compression method and device

    CN104378644A