CN113626395A - Data compression method and device, electronic equipment and storage medium - Google Patents

Data compression method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113626395A
CN113626395A CN202110780448.XA CN202110780448A CN113626395A CN 113626395 A CN113626395 A CN 113626395A CN 202110780448 A CN202110780448 A CN 202110780448A CN 113626395 A CN113626395 A CN 113626395A
Authority
CN
China
Prior art keywords
data
compressed
color
target
continuous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110780448.XA
Other languages
Chinese (zh)
Inventor
周国富
赖树发
李伟
田丽霞
张泰原
黄永圣
汝涛涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Guohua Optoelectronics Co Ltd
Original Assignee
Shenzhen Guohua Optoelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Guohua Optoelectronics Co Ltd filed Critical Shenzhen Guohua Optoelectronics Co Ltd
Priority to CN202110780448.XA priority Critical patent/CN113626395A/en
Publication of CN113626395A publication Critical patent/CN113626395A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

The invention discloses a data compression method, a data compression device, electronic equipment and a storage medium, and relates to the technical field of picture processing, wherein the data compression method comprises the following steps: acquiring color parameters of an original picture, comprising: acquiring an original color component value of a target pixel point, and acquiring a target color component value corresponding to the selected color; converting the original picture into a target polychrome according to the original color component values and the target color component values; splitting the target multicolor image into pixel arrays to be processed; extracting continuous data to be compressed and non-compressed data from the pixel array to be processed; compressing continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number; and combining the compressed meta information and the compressed continuous number into compressed data to be spliced, and splicing the compressed data to be spliced and the uncompressed data to obtain new picture data. By the data compression method, the data volume can be greatly reduced, and the data compression efficiency and the transmission efficiency of the picture can be improved.

Description

Data compression method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a data compression method and apparatus, an electronic device, and a storage medium.
Background
The color that can present at present of colored electronic paper ink screen is very limited, according to the model difference, some can only show black and white red, some can only show black white yellow. Therefore, to display the picture on the three-color electronic paper ink screen, the picture needs to be preprocessed into a three-color picture. Secondly, bluetooth version three-colour electronic paper ink screen, bluetooth transmission speed is slower, and single transmission data volume is less. However, since the size of the picture data is often several M or several tens of M, it takes a long time to transfer such a picture.
At present, a common solution is to traverse the color values corresponding to the pixels of the generated picture, calculate RGB components of the pixels, sum the squares of the difference values corresponding to the RGB components of each target color in the selected color list, compare the deviation with each target color, select the target color with the smallest deviation value as the target color of the pixel point, and generate a target picture containing only three colors. But for bluetooth 4.0, only 20 bytes of data can be transmitted at a time, and a common converted tristimulus map takes several minutes, which is much longer than expected by consumers.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the embodiment of the invention provides a data compression method, which can greatly reduce the data volume and improve the data compression efficiency and transmission efficiency of pictures.
The embodiment of the invention also provides a data compression device.
The embodiment of the invention also provides the electronic equipment.
The embodiment of the invention also provides a computer readable storage medium.
The data compression method according to the embodiment of the first aspect of the invention comprises the following steps:
acquiring color parameters of an original picture, wherein the color parameters comprise: acquiring an original color component value of a target pixel point, and acquiring a target color component value corresponding to the selected color;
converting the original picture into a target polychromat in accordance with the original color component values and the target color component values;
splitting the target polychrome graph into pixel arrays to be processed;
extracting continuous data to be compressed from the pixel array to be processed, and extracting non-compressed data from the pixel array to be processed;
compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number;
and combining the compression meta information and the compression continuous number into to-be-spliced compressed data, and splicing the to-be-spliced compressed data and the non-compressed data to obtain new picture data.
The data compression method according to the embodiment of the first aspect of the invention has at least the following beneficial effects: the method comprises the steps of firstly obtaining color parameters of original color component values of target pixel points in an original picture, obtaining target color component values corresponding to selected colors, then converting the original picture into a target multicolor picture according to the original color component values and the target color component values, splitting the target multicolor picture into pixel arrays to be processed, extracting continuous data to be compressed from the pixel arrays to be processed, extracting non-compressed data from the pixel arrays to be processed, further compressing the continuous data to be compressed according to a preset compression format to obtain compressed meta information and compressed continuous numbers, finally combining the compressed meta information and the compressed continuous numbers into compressed data to be spliced, and splicing the compressed data to be spliced with the non-compressed data to obtain new picture data.
According to some embodiments of the present invention, after the splicing the compressed data to be spliced and the uncompressed data to obtain new picture data, the method further includes: and executing the step of extracting continuous data to be compressed from the pixel array to be processed until the pixel array to be processed is traversed.
According to some embodiments of the invention, the selected colors comprise: a first color, a second color, and a third color; the object color component values include: a first component value, a second component value, and a third component value;
said converting said original picture into a target polychrome according to said original color component values and said target color component values comprising: calculating a first difference of the original color component value and the first component value, a second difference of the original color component value and the second component value, and a third difference of the original color component and the third component value, respectively; selecting a target color corresponding to the target pixel point from the first color, the second color and the third color according to the first difference, the second difference and the third difference; and converting the original picture into a target multicolor picture according to the target color.
According to some embodiments of the present invention, the extracting continuous data to be compressed from the pixel array to be processed includes: acquiring the continuous times of continuous appearance of the same pixel data in the pixel array to be processed; comparing the size relation between the continuous times and preset times; and if the continuous times are more than or equal to the preset times, extracting the same pixel data as the continuous data to be compressed.
According to some embodiments of the invention, the extracting the non-compressed data from the pixel array to be processed includes: and if the continuous times are less than the preset times, extracting the same pixel data as the non-compressed data.
According to some embodiments of the invention, the uncompressed data comprises: non-compressed meta information and actual data values; the splicing according to the compressed data to be spliced and the uncompressed data to obtain new picture data comprises the following steps: composing the uncompressed meta information and the actual data value into uncompressed data to be spliced; and splicing the compressed data to be spliced and the uncompressed data to be spliced to obtain the new picture data.
According to some embodiments of the invention, the method further comprises: and storing the new picture data in an array to be transmitted.
A data compression apparatus according to an embodiment of a second aspect of the present invention includes:
the acquiring module is used for acquiring color parameters of an original picture, wherein the color parameters comprise: acquiring an original color component value of a target pixel point, and acquiring a target color component value corresponding to the selected color;
a conversion module for converting the original picture into a target polychrome according to the original color component values and the target color component values;
the splitting module is used for splitting the target polychrome graph into pixel arrays to be processed;
the extraction module is used for extracting continuous data to be compressed from the pixel array to be processed and extracting non-compressed data from the pixel array to be processed;
the compression module is used for compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number;
and the splicing module is used for forming compressed data to be spliced by the compressed meta information and the compressed continuous number, and splicing the compressed data to be spliced and the uncompressed data to obtain new picture data.
The data compression device according to the embodiment of the second aspect of the invention has at least the following advantages: by implementing the data compression method of the embodiment of the first aspect of the invention, the data volume can be greatly reduced, and the data compression efficiency and the transmission efficiency of the picture can be improved.
An electronic device according to an embodiment of the third aspect of the invention includes: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions for execution by the at least one processor to cause the at least one processor, when executing the instructions, to implement the data compression method of the first aspect.
According to the electronic device of the embodiment of the third aspect of the invention, at least the following beneficial effects are achieved: by implementing the data compression method of the embodiment of the first aspect of the invention, the data volume can be greatly reduced, and the data compression efficiency and the transmission efficiency of the picture can be improved.
A computer-readable storage medium according to an embodiment of the fourth aspect of the present invention, the storage medium storing computer-executable instructions for causing a computer to perform the data compression method of the first aspect.
The computer-readable storage medium according to the fourth aspect of the present invention has at least the following advantages: by implementing the data compression method of the embodiment of the first aspect of the invention, the data volume can be greatly reduced, and the data compression efficiency and the transmission efficiency of the picture can be improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a data compression method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a default compression format according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a structure of continuous data to be compressed according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data compression apparatus according to an embodiment of the present invention;
fig. 5 is a functional block diagram of an electronic device according to an embodiment of the invention.
Reference numerals:
the system comprises an acquisition module 400, a conversion module 410, a splitting module 420, an extraction module 430, a compression module 440, a splicing module 450, a processor 500, a memory 510, a data transmission module 520, a camera 530 and a display screen 540.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
Referring to fig. 1, a data compression method according to an embodiment of the first aspect of the present invention includes:
step S100, obtaining color parameters of an original picture, wherein the color parameters comprise: original color component values of the target pixel points; an object color component value corresponding to the selected color is obtained.
Wherein, the original picture can be a picture to be displayed on a color electronic paper ink screen (such as a three-color electronic paper ink screen); the target pixel point can be a certain pixel point on the original picture; the original color component value may be an RGB value corresponding to a target pixel point in the original picture; the selected color can be a black-white red color disc (the color disc comprises three groups of black, white and red), or other multi-color discs, such as a two-color disc and a four-color disc; the object color component values may be RGB values of black and white red in a color wheel. Optionally, the embodiment of the present invention takes a three-color electronic paper ink screen as an example, because the color that can be presented by the color electronic paper ink screen is very limited, some electronic paper ink screens can only display black and white red, and some electronic paper ink screens can only display black, white and yellow according to different models, an original picture needs to be preprocessed into a three-color picture, so that the picture can be displayed on the three-color electronic paper ink screen. Therefore, the RGB components of each pixel in the original picture can be respectively and sequentially calculated to obtain the original color component value of the target pixel point, and then each RGB component of each color in the selected color list is obtained to obtain the target color component value, and the target color component value is used for converting the original picture in the RGB format into a black-white-red three-color picture in a certain mode.
Step S110, convert the original picture into the target multicolor map according to the original color component values and the target color component values.
The target multicolor image can be a two-color image, a three-color image or a four-color image, and taking the three-color image as an example, the target multicolor image can be a black-white-red three-color image. Optionally, after the RGB components of the original picture are obtained, the original picture may be preprocessed by the cyan pixel, for example: for a person picture with a background, if the main effect of a person is to be highlighted, the blue-green color of the original image needs to be reduced (i.e., the cool tone needs to be reduced), if the original image blue B is 250 and the green G is 250, the blue-green pixel needs to be preprocessed, and if the blue-green color is reduced by 5% and 8%, respectively, the blue-green color B is 237 and the green G is 230, the blue-green pixel value preprocessing of the original picture is completed. After the blue-green pixel value is preprocessed, the original image in the RGB format can be converted into a black-white-red three-color picture in a certain manner according to the color component value and the target color component value of the preprocessed target pixel point, for example, the color component value and the target color component value of the preprocessed target pixel point can be calculated, and whether the color of the target pixel point is biased to the black and white of the color palette is judged, if the color of the target pixel point is biased to the black, the black color value can be set as the value of the target pixel point, that is, the target pixel point is processed to the black; if the color of another target pixel point is biased to red, the color value of the red can be set as the value of the target pixel point, that is, the target pixel point is processed to red; by analogy, each pixel point in the original picture can be converted, so that the original picture can be converted into the target multicolor picture.
And step S120, splitting the target polychrome into pixel arrays to be processed.
Taking the target multicolor image as a black-white-red three-color image as an example, the pixel array to be processed may be a pixel array including black-white or red-white data formats. Optionally, after the original picture is converted into the target multi-color picture, the target multi-color picture may be split into an array that only stores black and white or red and white pixel values, that is, a pixel array to be processed is obtained, and a black or red pixel point position is represented by 1 and a white pixel point position is represented by 0 in the pixel array to be processed. For example, assuming that the pixel array a to be processed is a pixel array including two data formats, namely black and white, a black pixel point position may be represented by 1, and a white pixel point position may be represented by 0; if the pixel array B to be processed is a pixel array including two data formats, i.e., red and white, the position of the red pixel point can be represented by 1, and the position of the white pixel point can be represented by 0.
Step S130, extracting continuous data to be compressed from the pixel array to be processed, and extracting non-compressed data from the pixel array to be processed.
The continuous data to be compressed can be data of a pixel array to be processed which needs to be compressed; the non-compressed data may be data of a group of pixels to be processed that does not need to be compressed. Optionally, assuming that the split pixel array a to be processed is a pixel array including two data formats, namely black and white, the black pixel point position may be represented by 1, and the white pixel point position may be represented by 0; as shown in fig. 2 and 3, the number of the black pixels (represented by 1) that appear continuously is n, compression is required when the same pixel continuously exceeds a threshold m, and if n is greater than or equal to m, the continuous n black pixels can be extracted as continuous data to be compressed; if n is less than m, the n black pixel points do not need to be compressed, and the n black pixel points can be extracted as uncompressed data.
And step S140, compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number.
The preset compression format can be a preset compression data format; the compression meta-information may be meta-information obtained by compressing consecutive data to be compressed and a total number of occurrences of the same data, and the meta-information may include whether to compress bits and data format bits (0 or 1, not shown in fig. 2). Optionally, as shown in fig. 2, the data format of the compressed data and the data format of the uncompressed data, the uncompressed data includes the meta information and the actual data value, and the compressed continuous data to be compressed includes the meta information and the continuous number. Continuous data to be compressed, which needs to be compressed, can be compressed according to a preset compression format shown in fig. 2, and continuous same data in the continuous data to be compressed are compressed to form new data only containing meta information and continuous numbers, that is, the compressed meta information and the compressed continuous numbers are obtained.
And S150, forming compressed data to be spliced by the compressed meta information and the compressed continuous number, and splicing the compressed data to be spliced and the uncompressed data to obtain new picture data.
Optionally, the continuous data to be compressed may be compressed, and then the compressed meta information and the compressed continuous number are combined into new data, that is, the compressed data to be spliced; for the uncompressed data, the meta information and the actual data value in the uncompressed data may be combined into new data, for example, to obtain the uncompressed data to be spliced. And finally, splicing the compressed data to be spliced and the uncompressed data to be spliced to obtain new picture data, storing the new picture data in an array until all pixel points of the target multicolor chart are traversed, and obtaining a compressed picture array. In some specific embodiments, the data amount can be reduced to several Kb to several tens of Kb for a simple picture (a large number of consecutive same pixel values exist in a picture) by the above data compression method, which greatly reduces the data amount. In some specific embodiments, when the compressed new picture array is transmitted through the bluetooth module, the required time is shortened to be within several seconds to tens of seconds, the time is reduced by tens of times or even hundreds of times, and the transmission time can be greatly reduced.
The data compression method comprises acquiring color parameters of original color component values of target pixel points in an original picture, acquiring target color component values corresponding to selected colors, then the original picture is converted into an object multicolor picture according to the original color component values and the object color component values, the object multicolor picture is split into pixel arrays to be processed, extracting continuous data to be compressed from the pixel array to be processed, extracting non-compressed data from the pixel array to be processed, further compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number, finally forming the compression meta-information and the compression continuous number into the compressed data to be spliced, and new picture data are obtained by splicing the compressed data to be spliced and the uncompressed data, so that the data volume can be greatly reduced, and the data compression efficiency and the transmission efficiency of the picture are improved.
In some embodiments of the present invention, after obtaining new picture data according to the splicing of the compressed data to be spliced and the uncompressed data, the method further includes:
and executing the step of extracting continuous data to be compressed from the pixel array to be processed until the pixel array to be processed is traversed. Optionally, when the data α in the pixel group to be processed is to be processed1After compression processing into new picture data, the data α in the pixel group to be processed may continue2And compressing the image data into new image data, sequentially traversing the pixel arrays to be processed, namely, completing the compression processing of the target multi-color image to obtain the new image array, thus realizing the compression processing of the original image and solving the problem of slow transmission of the display data of the three-color electronic paper.
In some embodiments of the invention, the selected colors include: a first color, a second color, and a third color; the object color component values include: a first component value, a second component value, and a third component value. Taking the selected color as a three-color disc of black, white and red as an example, the first color may be black, the second color may be white, and the third color may be red; the first component value may be an RGB value of the selected color black, the second component value may be an RGB value of the selected color red, and the third component value may be an RGB value of the selected color white.
Converting the original picture into the target polychromat in accordance with the original color component values and the target color component values, comprising:
a first difference between the original color component value and the first component value, a second difference between the original color component value and the second component value, and a third difference between the original color component and the third component value are calculated, respectively. Wherein the first difference value may be a difference value between the original color component value and the first component value(ii) a The second difference value may be a difference value between the original color component value and the second component value; the third difference value may be a difference value between the original color component value and the third component value. Optionally, the sum of squares of differences between the RGB values of the target pixel point preprocessed by the cyan pixel and the RGB values of the black and white in the color wheel may be taken to obtain a first difference, a second difference, and a third difference, for example: setting the original color component value after the blue-green pixel preprocessing as x1(x1Comprising R, G, B three components), the first component value being y1(y1Comprising R1、G1And B1Three components), a second component value of y2(y2Comprising R2、G2And B2Three components), a third component value of y3(y3Comprising R3、G3And B3Three components), the first difference z1=(R-R1)2+(G-G1)2+(B-B1)2Second difference z2=(R-R2)2+(G-G2)2+(B-B2)2The third difference z3=(R-R3)2+(G-G3)2+(B-B3)2
And selecting a target color corresponding to the target pixel point from the first color, the second color and the third color according to the first difference, the second difference and the third difference. Alternatively, the first difference z may be1The second difference z2And a third difference z3Making a comparison and selecting the smallest set of differences, e.g. assuming z2<z1<z3Then z can be determined2The minimum indicates that the color of the target pixel point is biased to white in black and white and red of the color wheel, so that a second color (white) can be selected as the target color of the target pixel point, and the value of the second color can be set as the value of the target pixel point; let z1<z3<z2Then z can be determined1At the minimum, the color of the target pixel point is biased to black in black and white and red of the color wheel, so that the first color (black) can be selected as the target of the target pixel pointColor, the value of the first color can be set as the value of the target pixel point; let z3<z1<z2Then z can be determined3At minimum, it indicates that the color of the target pixel is biased to the red of the black and white of the color wheel, so the third color (red) can be selected as the target color of the target pixel, and the value of the third color can be set as the value of the target pixel. And sequentially determining the target color of each pixel point of the original picture.
And converting the original picture into a target multicolor picture according to the target color. Optionally, after determining the target color and the corresponding value corresponding to each target pixel point, the original color component value of the target pixel point may be converted into a value of the target color, and each pixel point is sequentially converted, so that the original picture may be converted into a target multicolor picture, and if the target multicolor picture is a tristimulus picture, the target multicolor picture is a tristimulus picture containing three colors of black, white and red. The color deviation of the target pixel point is determined through calculation, the target pixel point is converted according to the value of the target color, and after the pixel points are sequentially converted, the original picture can be converted into the target multicolor picture, so that the processing efficiency is improved.
In some embodiments of the present invention, extracting continuous data to be compressed from a pixel array to be processed includes:
and acquiring the continuous times of continuous appearance of the same pixel data in the pixel array to be processed. The continuous times may be times of continuous appearance of the same pixel data in the pixel array to be processed. Optionally, as shown in fig. 3, if the number of continuous white pixels (represented by 0) is p, the number of continuous white pixels is p.
And comparing the magnitude relation of the continuous times and the preset times. The preset number of times may be a preset critical value corresponding to the consecutive number of times. Optionally, the preset times may be set according to requirements. Comparing the relationship between the continuous times and the preset times to obtain: the relationship of the continuous times being less than the preset times, the relationship of the continuous times being equal to the preset times, and the relationship of the continuous times being greater than the preset times.
And if the continuous times are more than or equal to the preset times, extracting the same pixel data as the continuous data to be compressed. Optionally, if the number of consecutive times is greater than or equal to the preset number of times, for example, if the number of consecutive white pixels (represented by 0) is p, the number of consecutive white pixels is p; let the number of consecutive appearance of red pixels (denoted by 1) be q. When the same pixel point continuously exceeds the threshold m (the preset number of times is m), the data volume needs to be compressed, that is: if p is larger than or equal to m, the continuous p white pixel points need to be compressed, so that the continuous p white pixel points can be extracted to serve as continuous data to be compressed; if q is larger than or equal to m, the continuous q red pixel points need to be compressed, so that the q continuous red pixel points can be extracted to serve as continuous data to be compressed. In some specific embodiments, the compression of the continuous data to be compressed may be binary compression. By comparing the size relationship between the continuous times and the preset times, the pixel data with large data volume is determined, and the data with large data volume is compressed, so that the data volume can be greatly reduced, the storage space is effectively saved, and the compression efficiency is improved.
In some embodiments of the present invention, extracting uncompressed data from the pixel array to be processed comprises:
and if the continuous times are less than the preset times, extracting the same pixel data as the non-compressed data. Optionally, in the pixel array to be processed, the number of the black pixels (represented by 1) appearing continuously is n, the preset number of times is m, and if n is smaller than m, the data size does not need to be compressed, so that the n black pixels can be extracted as uncompressed data. By comparing the size relationship between the continuous times and the preset times, the pixel data with small data volume is determined, and the pixel data with small data volume is directly extracted as non-compressed data, so that the data volume can be greatly reduced, the storage space is effectively saved, and the compression efficiency is improved.
In some embodiments of the invention, the uncompressed data comprises: uncompressed meta information and actual data values. Alternatively, referring to fig. 2, the structure of the uncompressed meta information and the actual data value is as shown in fig. 2.
Splicing according to compressed data to be spliced and uncompressed data to obtain new picture data, and the method comprises the following steps:
and composing the uncompressed meta-information and the actual data value into uncompressed data to be spliced. Optionally, the uncompressed meta information and the actual data value may be recombined into new data, that is, the uncompressed data to be spliced is used for being spliced with the compressed data to be spliced to obtain complete new picture data.
And splicing the compressed data to be spliced and the uncompressed data to be spliced to obtain new picture data. Optionally, after compressing the pixel data that needs to be compressed and reconstructing the pixel data that does not need to be compressed, the obtained compressed data to be spliced and the uncompressed data to be spliced may be spliced to obtain complete new picture data. The uncompressed meta information and the actual data value in the uncompressed data are recombined to obtain uncompressed data to be spliced, and then the compressed data to be spliced and the uncompressed data to be spliced are spliced to obtain new picture data with small data size and integrity.
In some embodiments of the present invention, the method for obtaining new picture data by splicing compressed data to be spliced and uncompressed data to be spliced further includes:
and storing the new picture data in an array to be transmitted. The array to be transmitted may be a data sequence of pictures for bluetooth transmission. Optionally, the target pixel point α may be set1Stores the new picture data in the array to be transmitted, and transmits the target pixel point alpha2Stores the new picture data in the array to be transmitted, and the target pixel point alpha3The new picture data of each pixel point is stored in the array to be transmitted … …, so that the new picture data of the whole picture can be stored. In some specific embodiments, the array to be transmitted can be transmitted through Bluetooth, the required time is shortened to be within several seconds to tens of seconds, the problem that the display data of the three-color electronic paper is slow to transmit is solved, and the transmission time is greatly reduced.
Referring to fig. 4, a data compression apparatus according to an embodiment of the second aspect of the present invention includes:
the acquisition module is used for acquiring color parameters of the original picture, and the color parameters comprise: acquiring an original color component value of a target pixel point, and acquiring a target color component value corresponding to the selected color;
the conversion module is used for converting the original picture into a target multicolor picture according to the original color component values and the target color component values;
the splitting module is used for splitting the target multicolor image into pixel arrays to be processed;
the extraction module is used for extracting continuous data to be compressed from the pixel array to be processed and extracting non-compressed data from the pixel array to be processed;
the compression module is used for compressing continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number;
and the splicing module is used for forming compressed data to be spliced by the compressed meta information and the compressed continuous number, and splicing the compressed data to be spliced and the uncompressed data to obtain new picture data.
By implementing the data compression method of the first aspect of the present invention, the data compression apparatus can greatly reduce the data size and improve the data compression efficiency and transmission efficiency of the picture.
Referring to fig. 5, an embodiment of the third aspect of the present invention further provides a functional module diagram of an electronic device, including: at least one processor 500, and a memory 510 communicatively coupled to the at least one processor 500; and the system also comprises a data transmission module 520, a camera 530 and a display screen 540.
Wherein the processor 500 is adapted to perform the data compression method of the first embodiment by calling a computer program stored in the memory 510.
The data transmission module 520 is connected to the processor 500, and is used for implementing data interaction between the data transmission module 520 and the processor 500.
The cameras 530 may include front cameras and rear cameras. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera 530 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The display 540 may be used to display information entered by the user or provided to the user. The Display screen 540 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel may cover the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 500 to determine the type of the touch event, and then the processor 500 provides a corresponding visual output on the display panel according to the type of the touch event. In some embodiments, the touch panel may be integrated with the display panel to implement input and output functions.
The memory, as a non-transitory storage medium, may be used to store non-transitory software programs as well as non-transitory computer-executable programs, such as the data compression method in the embodiment of the first aspect of the present invention. The processor implements the data compression method in the above-described first embodiment by executing the non-transitory software program and the instructions stored in the memory.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the stored data area may store data compression methods performed in the embodiments of the first aspect described above. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the data compression method in the first aspect embodiment described above are stored in a memory and, when executed by one or more processors, perform the data compression method in the first aspect embodiment described above.
Embodiments of the fourth aspect of the present invention also provide a computer-readable storage medium storing computer-executable instructions for: the data compression method in the embodiment of the first aspect is performed.
In some embodiments, the storage medium stores computer-executable instructions, which are executed by one or more control processors, for example, by one of the processors in the electronic device of the third aspect, and may cause the one or more processors to execute the data compression method in the first aspect.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A data compression method, comprising:
acquiring color parameters of an original picture, wherein the color parameters comprise: original color component values of the target pixel points; acquiring a target color component value corresponding to the selected color;
converting the original picture into a target polychromat in accordance with the original color component values and the target color component values;
splitting the target polychrome graph into pixel arrays to be processed;
extracting continuous data to be compressed from the pixel array to be processed, and extracting non-compressed data from the pixel array to be processed;
compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number;
and combining the compression meta information and the compression continuous number into to-be-spliced compressed data, and splicing the to-be-spliced compressed data and the non-compressed data to obtain new picture data.
2. The method according to claim 1, further comprising, after the splicing of the compressed data to be spliced and the uncompressed data to obtain new picture data:
and executing the step of extracting continuous data to be compressed from the pixel array to be processed until the pixel array to be processed is traversed.
3. The method of claim 1, wherein the selected color comprises: a first color, a second color, and a third color; the object color component values include: a first component value, a second component value, and a third component value;
said converting said original picture into a target polychrome according to said original color component values and said target color component values comprising:
calculating a first difference of the original color component value and the first component value, a second difference of the original color component value and the second component value, and a third difference of the original color component value and the third component value, respectively;
selecting a target color corresponding to the target pixel point from the first color, the second color and the third color according to the magnitude relation of the first difference, the second difference and the third difference;
and converting the original picture into a target multicolor picture according to the target color.
4. The method according to claim 1, wherein the extracting continuous data to be compressed from the pixel array to be processed comprises:
acquiring the continuous times of continuous appearance of the same pixel data in the pixel array to be processed;
comparing the size relation between the continuous times and preset times;
and if the continuous times are more than or equal to the preset times, extracting the same pixel data as the continuous data to be compressed.
5. The method of claim 4, wherein extracting the uncompressed data from the array of pixels to be processed comprises:
and if the continuous times are less than the preset times, extracting the same pixel data as the non-compressed data.
6. The method of claim 5, wherein the uncompressed data comprises: non-compressed meta information and actual data values;
the splicing according to the compressed data to be spliced and the uncompressed data to obtain new picture data comprises the following steps:
composing the uncompressed meta information and the actual data value into uncompressed data to be spliced;
and splicing the compressed data to be spliced and the uncompressed data to be spliced to obtain the new picture data.
7. The method of claim 6, further comprising:
and storing the new picture data in an array to be transmitted.
8. A data compression apparatus, comprising:
the acquiring module is used for acquiring color parameters of an original picture, wherein the color parameters comprise: acquiring an original color component value of a target pixel point, and acquiring a target color component value corresponding to the selected color;
a conversion module for converting the original picture into a target polychrome according to the original color component values and the target color component values;
the splitting module is used for splitting the target polychrome graph into pixel arrays to be processed;
the extraction module is used for extracting continuous data to be compressed from the pixel array to be processed and extracting non-compressed data from the pixel array to be processed;
the compression module is used for compressing the continuous data to be compressed according to a preset compression format to obtain compression meta-information and compression continuous number;
and the splicing module is used for forming compressed data to be spliced by the compressed meta information and the compressed continuous number, and splicing the compressed data to be spliced and the uncompressed data to obtain new picture data.
9. An electronic device, comprising:
at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions for execution by the at least one processor to cause the at least one processor, when executing the instructions, to implement a method of data compression as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium stores computer-executable instructions for causing a computer to perform the data compression method of any one of claims 1 to 7.
CN202110780448.XA 2021-07-09 2021-07-09 Data compression method and device, electronic equipment and storage medium Pending CN113626395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110780448.XA CN113626395A (en) 2021-07-09 2021-07-09 Data compression method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110780448.XA CN113626395A (en) 2021-07-09 2021-07-09 Data compression method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113626395A true CN113626395A (en) 2021-11-09

Family

ID=78379451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110780448.XA Pending CN113626395A (en) 2021-07-09 2021-07-09 Data compression method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113626395A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116996698A (en) * 2023-08-16 2023-11-03 武汉精臣智慧标识科技有限公司 Image lattice data compression method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301726A (en) * 2014-09-15 2015-01-21 成都智明达数字设备有限公司 Method for image lossless compression and uncompress
US20150287217A1 (en) * 2012-11-19 2015-10-08 Tencent Technology (Shenzhen) Company Limited Method and apparatus for lossless image compression
CN108900843A (en) * 2018-07-31 2018-11-27 京东方科技集团股份有限公司 Monochrome image compression method, device, medium and electronic equipment
CN112565772A (en) * 2020-11-27 2021-03-26 雅量商业智能技术(广州)有限公司 Picture compression method and decompression method based on electronic price tags

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150287217A1 (en) * 2012-11-19 2015-10-08 Tencent Technology (Shenzhen) Company Limited Method and apparatus for lossless image compression
CN104301726A (en) * 2014-09-15 2015-01-21 成都智明达数字设备有限公司 Method for image lossless compression and uncompress
CN108900843A (en) * 2018-07-31 2018-11-27 京东方科技集团股份有限公司 Monochrome image compression method, device, medium and electronic equipment
CN112565772A (en) * 2020-11-27 2021-03-26 雅量商业智能技术(广州)有限公司 Picture compression method and decompression method based on electronic price tags

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116996698A (en) * 2023-08-16 2023-11-03 武汉精臣智慧标识科技有限公司 Image lattice data compression method and device

Similar Documents

Publication Publication Date Title
David Stump Digital cinematography: fundamentals, tools, techniques, and workflows
CN113314079B (en) Picture display method and device, electronic equipment and storage medium
WO2022227308A1 (en) Image processing method and apparatus, device, and medium
US10728510B2 (en) Dynamic chroma key for video background replacement
CN101083773B (en) Apparatus and method of gamma correction in digital image processing device
US7864234B2 (en) Digital camera having a display menu used to select either color photographing operation or a black/white photographing operation
JP4794911B2 (en) Image processing device
US10600170B2 (en) Method and device for producing a digital image
JP2005210495A (en) Image processing apparatus, method, and program
CN114331916B (en) Image processing method and electronic device
CN101686321A (en) Method and system for reducing noise in image data
CN113626395A (en) Data compression method and device, electronic equipment and storage medium
CN107852456A (en) Image processing apparatus, camera device, image processing method and program
US8471925B2 (en) Digital image processing apparatus and file managing method performed therein
US8472517B2 (en) Systems and methods for reducing the total number of bits required to be transferred over a communications link for an image
CN113949855A (en) Image data transmission method and device and nonvolatile storage medium
US20120105678A1 (en) Image capturing systems and methods utilizing customizable look management
CN113034412A (en) Video processing method and device
CN110557532B (en) Imaging apparatus, client apparatus, and control method
EP2672712A1 (en) Scene-dependent color gamut mapping
JP2007097032A (en) Image display apparatus, image display method and digital camera
CN115706870B (en) Video processing method, device, electronic equipment and storage medium
CN113409196B (en) High-speed global chromatic aberration correction method for real-time video splicing
CN112165631B (en) Media resource processing method and device, storage medium and electronic equipment
CN101287057A (en) Buffer saving image decompressing storing method and module thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination