WO2022205603A1 - 图像压缩方法及压缩装置 - Google Patents

图像压缩方法及压缩装置 Download PDF

Info

Publication number
WO2022205603A1
WO2022205603A1 PCT/CN2021/096606 CN2021096606W WO2022205603A1 WO 2022205603 A1 WO2022205603 A1 WO 2022205603A1 CN 2021096606 W CN2021096606 W CN 2021096606W WO 2022205603 A1 WO2022205603 A1 WO 2022205603A1
Authority
WO
WIPO (PCT)
Prior art keywords
gray
scale
grayscale
region
sub
Prior art date
Application number
PCT/CN2021/096606
Other languages
English (en)
French (fr)
Inventor
刘金风
Original Assignee
Tcl华星光电技术有限公司
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 Tcl华星光电技术有限公司 filed Critical Tcl华星光电技术有限公司
Priority to US17/428,302 priority Critical patent/US11997295B2/en
Publication of WO2022205603A1 publication Critical patent/WO2022205603A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of image processing, and in particular, to an image compression method and a compression device.
  • the existing display panels directly store and transmit the original data, but with the improvement of the screen resolution, the display data that needs to be transmitted also increases. If the original data is directly stored and transmitted, a huge storage space is required. and higher transmission efficiency, resulting in increased memory capacity and power consumption of the display panel.
  • the present application provides an image compression method and a compression device, aiming at solving the technical problem in the prior art that the direct storage and transmission of original data leads to an increase in the memory capacity and power consumption of a display panel.
  • an image compression method comprising:
  • gray-scale pixel information of the original image where the gray-scale pixel information includes multiple sub-gray-scale pixel information
  • the first target grayscale pixel information is divided into a plurality of first grayscale regions according to a preset first grayscale difference threshold, and first region information is generated, where the first region information includes the plurality of first grayscale regions the first minimum grayscale pixel value and the first region label of each first grayscale region in the grayscale region;
  • the sub-gray-scale pixel information of each first gray-scale region is compressed to obtain the original The first compressed data of the image.
  • the gray-scale pixel information is compressed to obtain the first compressed data of the original image including:
  • the first minimum grayscale pixel value is subtracted from the pixel information of each sub-grayscale in the current first grayscale region to obtain the first compressed data of the original image.
  • the difference between the maximum sub-grayscale pixel information and the minimum sub-grayscale pixel information is smaller than the first grayscale difference threshold.
  • the method further includes:
  • the target gray-scale pixel information is divided into a plurality of second gray-scale areas based on the second gray-scale difference threshold, and second area information is generated, where the second area information includes one of the plurality of second gray-scale areas.
  • the sub-gray-scale pixel information of each second gray-scale region is compressed to obtain the original image.
  • the second compressed data Based on the second minimum gray-scale pixel value, the second region label, and the plurality of sub-gray-scale pixel information, the sub-gray-scale pixel information of each second gray-scale region is compressed to obtain the original image. The second compressed data.
  • the sub-gray-scale pixel information, the first region label, the first minimum gray-scale pixel value and the first compressed data are all represented by binary numbers
  • the Obtaining a compression ratio according to the first compressed data and the first region information includes:
  • the compression ratio is obtained from the original pixel parameters and the compressed pixel parameters.
  • the pixel values of the first minimum gray level in each of the first gray level regions in the plurality of first gray level regions are different, and the pixel value of the first minimum gray level is different according to the first minimum gray level.
  • the number of gray-scale pixel values and the number of bits of the first minimum gray-scale pixel value to obtain the minimum gray-scale pixel parameters include:
  • the gray-scale pixel parameters are obtained according to sub-minimum gray-scale pixel parameters of each of the first gray-scale regions in the plurality of first gray-scale regions.
  • the method further includes:
  • the first grayscale difference threshold Th is set as 2B-1, where B is the number of bits of the first compressed data.
  • the first area label is a bit bit
  • the first area label is 0 or 1
  • the first area labels of two adjacent first gray-scale areas values are not the same.
  • the method further includes:
  • the second target grayscale pixel information is divided into a plurality of third grayscale regions according to a preset first grayscale difference threshold, and third region information is generated, where the third region information includes the plurality of third grayscale regions the third minimum grayscale pixel value and the third region label of each third grayscale region in the grayscale region;
  • the sub-gray-scale pixel information of each third gray-scale region is compressed to obtain the original The third compressed data of the image.
  • the present application provides an image compression device, the image compression device comprising:
  • an acquiring unit configured to acquire gray-scale pixel information of the original image, where the gray-scale pixel information includes multiple sub-gray-scale pixel information;
  • a scanning unit configured to scan the plurality of sub-gray-scale pixel information according to a preset first scanning order to obtain first target gray-scale pixel information
  • a region dividing unit configured to divide the first target grayscale pixel information into a plurality of first grayscale regions according to a preset first grayscale difference threshold, and generate first region information, where the first region information includes all the first minimum grayscale pixel value and the first region label of each first grayscale region in the plurality of first grayscale regions;
  • a compression unit configured to compress the sub-gray-scale pixel information of each first gray-scale region based on the first minimum gray-scale pixel value, the first region label and the plurality of sub-gray-scale pixel information , to obtain the first compressed data of the original image.
  • the compression unit is specifically configured to: determine the current first gray-scale area and the first minimum gray-scale pixel value of the current first gray-scale area based on the first area label ; Subtract the first minimum grayscale pixel value from the pixel information of each sub-grayscale in the current first grayscale area to obtain the first compressed data of the original image.
  • the image compression apparatus further includes a first adjustment unit, configured to obtain a compression ratio according to the first compressed data and the first area information, and determine whether the compression ratio is is less than or equal to a preset compression ratio; if the compression ratio is greater than the preset compression ratio, a second grayscale difference threshold is determined; based on the second grayscale difference threshold, the target grayscale pixel information is divided into multiple second gray-scale regions, generating second region information, where the second region information includes the second minimum gray-scale pixel value of each second gray-scale region in the plurality of second gray-scale regions and the second region label; compressing the sub-gray-scale pixel information of each second gray-scale region based on the second minimum gray-scale pixel value, the second region label and the plurality of sub-gray-scale pixel information to obtain the original The second compressed data of the image.
  • a first adjustment unit configured to obtain a compression ratio according to the first compressed data and the first area information, and determine whether the compression ratio is is less than or equal to a preset compression ratio;
  • the image compression apparatus further includes a second adjustment unit, configured to obtain a compression ratio according to the first compressed data and the first area information, and determine whether the compression ratio is is less than or equal to the preset compression ratio; if the compression ratio is greater than the preset compression ratio, a second scanning sequence is determined; the pixel information of the plurality of sub-grayscales is scanned according to the second scanning sequence to obtain a second target grayscale gray-scale pixel information; divide the second target gray-scale pixel information into a plurality of third gray-scale regions according to a preset first gray-scale difference threshold, and generate third region information, where the third region information includes the multi-level pixel information.
  • a second adjustment unit configured to obtain a compression ratio according to the first compressed data and the first area information, and determine whether the compression ratio is is less than or equal to the preset compression ratio; if the compression ratio is greater than the preset compression ratio, a second scanning sequence is determined; the pixel information of the plurality of sub-grayscales is scanned according to the second
  • the third minimum grayscale pixel value and the third region label of each third grayscale region in the third grayscale regions based on the third minimum grayscale pixel value, the third region label and the multiple sub-gray-scale pixel information, and compressing the sub-gray-scale pixel information of each third gray-scale region to obtain third compressed data of the original image.
  • the present application also provides a computer device, the computer device comprising:
  • processors one or more processors
  • One or more application programs wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the image compression method of any of the above.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in any one of the image compression methods described above.
  • the present application obtains the first target gray-scale pixel information by scanning a plurality of sub-gray-scale pixel information according to the preset first scanning sequence, and divides the first target gray-scale pixel information into multiple sub-gray-scale pixel information according to the preset first gray-scale difference threshold obtaining the first minimum grayscale pixel value and the first region label of each first grayscale region in the plurality of first grayscale regions, based on the first minimum grayscale pixel value and the first region
  • the tag compresses the sub-gray-scale pixel information of each first gray-scale area, and converts the high-gray-scale pixel information into low-gray-scale first compressed data, reducing the amount of data transmission during the image transmission process.
  • the transmission rate is improved, the power consumption is reduced, and the compressed data occupies less memory space, which reduces the storage space; further, by dividing the first target gray-scale pixel information into a plurality of first gray-scale areas , compressing each first gray-scale area to further improve the compression rate of the image compression method.
  • FIG. 1 is a schematic flowchart of an embodiment of an image compression method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the first embodiment of S102 provided by an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of an embodiment of target grayscale information provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a second embodiment of S102 provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a third embodiment of S102 provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an embodiment of S103 provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an embodiment of S104 provided by an embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of an embodiment of calculating a compression ratio provided by an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of an embodiment of S803 provided by an embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of an embodiment of adjusting the compression ratio provided by an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of an embodiment after adjusting the compression ratio provided by the embodiment of the present invention.
  • FIG. 12 is a schematic flowchart of another embodiment of adjusting the compression ratio provided by an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of an embodiment of an image compression apparatus provided by an embodiment of the present invention.
  • FIG. 14 is a schematic flowchart of an embodiment of a server provided by an embodiment of the present invention.
  • the present application provides an image compression method and a compression device, which will be described in detail below.
  • an embodiment of the present application provides an image compression method, the image compression method includes: acquiring gray-scale pixel information of an original image, where the gray-scale pixel information includes a plurality of sub-gray-scale pixel information; Scan the plurality of sub-grayscale pixel information in a scanning sequence to obtain first target grayscale pixel information; divide the first target grayscale pixel information into a plurality of first grayscales according to a preset first grayscale difference threshold region, generating first region information, the first region information including the first minimum grayscale pixel value and the first region label of each first grayscale region in the plurality of first grayscale regions; based on the The first minimum gray-scale pixel value, the first region label, and the plurality of sub-gray-scale pixel information, the sub-gray-scale pixel information of each first gray-scale region is compressed, and the first gray-scale pixel information of the original image is obtained. - Compressed data.
  • FIG. 1 a schematic flowchart of an embodiment of an image compression method provided by an embodiment of the present application, the method includes:
  • the original image includes but is not limited to red sub-pixels, green sub-pixels and blue sub-pixels.
  • gray-scale pixel information of different sub-pixels may be acquired respectively.
  • acquiring the grayscale pixel information of the original image includes: acquiring the grayscale pixel information of the red subpixel, or acquiring the grayscale pixel information of the green subpixel, or acquiring the grayscale pixel information of the blue subpixel.
  • the gray-scale pixel information of each sub-pixel includes multiple sub-gray-scale pixel information.
  • S102 Scan a plurality of sub-gray-scale pixel information according to a preset scanning order to obtain target gray-scale pixel information
  • the gray-scale pixel information of the original image is pixel information of a two-dimensional sequence
  • the target gray-scale pixel information is pixel information of a one-dimensional sequence
  • the first region label is used to represent different gray-scale regions
  • the first minimum gray-scale pixel value is used to represent the pixel value of the first minimum gray-scale pixel in each first gray-scale region.
  • a plurality of sub-gray-scale pixel information is scanned according to a preset first scanning order to obtain the first target gray-scale pixel information, and according to the preset first gray-scale difference threshold Divide the first target grayscale pixel information into multiple first grayscale regions, obtain the first minimum grayscale pixel value and the first region label of each first grayscale region in the multiple first grayscale regions, based on The first minimum grayscale pixel value and the first region label compress the sub-grayscale pixel information of each first grayscale region, and convert the high grayscale grayscale pixel information into low grayscale first compressed data, reducing
  • the data transmission volume during the image transmission process is improved, the transmission rate is increased, the power consumption is reduced, and the compressed data occupies less memory space, which reduces the storage space; further, by converting the first target grayscale
  • the pixel information is divided into a plurality of first gray-scale regions, and each first gray-scale region is compressed to further improve the compression rate of the image compression method.
  • the grayscale pixel information of the original image is an 8*8 matrix, that is, the original image includes 64 sub-grayscale pixels information.
  • the scanning sequence is the scanning sequence shown by the arrows in Figure 2, followed by rows. Taking the first three columns scanned as an example, as shown in Figure 3, the target gray-scale pixel information obtained after scanning is one-dimensional 24 sub-gray-scale pixels. information.
  • the scanning sequence is the scanning sequence of the first row and the last column indicated by the arrows in FIG. 4
  • the scanning sequence is The scanning order of the nine-square grid indicated by the arrow in 5.
  • scanning sequence is not limited to the above scanning sequence, but may also be interval scanning or other scanning sequences, which are not limited here.
  • FIG. 6 which is a schematic diagram of an embodiment of S103 provided in this embodiment of the present application, specifically: taking the target gray-scale pixel information in FIG. 3 as an example for introduction, the principle of dividing the first gray-scale area is as follows: : The difference between the largest sub-gray-scale pixel information and the smallest sub-gray-scale pixel information in each first gray-scale area is less than the first gray-scale difference threshold, where the largest sub-gray-scale pixel information refers to: the first gray-scale pixel information The sub-gray-scale pixel information with the largest gray-scale pixel value in the gray-scale region, and the minimum sub-gray-scale pixel information refers to the sub-gray-scale pixel information with the smallest gray-scale pixel value in the first gray-scale region.
  • other gray-scale areas are determined one by one.
  • the target grayscale pixel information can be finally divided into three first grayscale areas, the minimum grayscale pixel value of the first first grayscale area is 67, and the minimum grayscale pixel value of the second first grayscale area is 98 , the minimum grayscale pixel value of the third first grayscale area is 73.
  • S104 includes:
  • the high-gray-scale pixel information can be converted into low-gray-scale pixel information, and the data is reduced. transmission volume, thereby reducing power consumption and the footprint of the first compressed data.
  • the first minimum gray-scale pixel value is subtracted from each sub-pixel information in the current first gray-scale area by setting, so as to reduce the amount of data transmission to the greatest extent.
  • the original pixel parameter is the product of the number of multiple sub-gray-scale pixel information and the number of bits of the multiple sub-gray-scale pixel information
  • the compressed data parameter is the number of multiple sub-gray-scale pixel information and the bit bit of the first compressed data
  • the product of the number; the minimum grayscale pixel parameter is the product of the number of the first minimum grayscale pixel value and the number of bits of the first minimum grayscale pixel value;
  • the area label parameter is the number of the first area label and the first area label.
  • the product of the number of bits of the label; the compressed pixel parameter is the sum of the compressed data parameter, the minimum grayscale pixel parameter and the area label parameter;
  • the compression ratio is the ratio of the compressed pixel parameter to the original pixel parameter.
  • the compression ratio is:
  • P is the compression ratio
  • M is the number of sub-gray-scale pixel information
  • X is the number of the first minimum gray-scale pixel value
  • Y is the number of the first area label
  • A is the multiple sub-gray-scale pixel information
  • B is the number of bits of the first compressed data
  • C is the number of bits of the first minimum grayscale pixel value
  • D is the number of bits of the first area label.
  • the sub-gray-scale pixel information, the first region label, the first minimum gray-scale pixel value, and the first compressed data are all represented by binary numbers.
  • the value of M*A is a fixed value. Therefore, if you want to reduce the compression ratio P, you need to reduce any one of B, C, D, X and Y, and because the image compression to be transmitted It is mainly the first compressed data. Therefore, the number of bits of the first compressed data should be reduced first. When the number of bits of the first compressed data is constant, the first grayscale difference threshold and the first minimum grayscale pixel value are also determined.
  • the gray-scale difference threshold Th is 2B-1 .
  • the first grayscale difference threshold is 31, and when the number of bits of the first compressed data is 4, the first grayscale difference threshold is 15.
  • M is 24, X is 3, Y is 3, A is 8, B is 5, C is 8, and D is 1. Then the compression ratio P is 76.56%.
  • S803 includes:
  • S902 Obtain gray-scale pixel parameters according to the sub-minimum gray-scale pixel parameters of each of the first gray-scale regions in the plurality of first gray-scale regions.
  • the compression ratio is:
  • n is the number of the first gray-scale area.
  • the first minimum grayscale pixel value when the first minimum grayscale pixel value is less than 32 and greater than 16, the number of bits of the first minimum grayscale pixel value is 5, and when the first minimum grayscale pixel value is less than 64 and greater than 32, the first minimum grayscale pixel value is The number of bits of the pixel value of the first minimum gray level is 6. When the number of bits of the first minimum gray level pixel value is less than 128 and greater than 64, the number of bits of the first minimum gray level pixel value is 7. When the number of bits of the first minimum gray level pixel value is 7 When the number is less than 256 and greater than 128, the number of bits of the first minimum grayscale pixel value is 8.
  • the compression ratio can be further reduced, and the compression efficiency of the image compression method can be improved.
  • the first area label is only used to represent different first gray-scale areas, in order to further reduce the compression ratio, in some embodiments of the present application, the first area label is a bit, and the first area label is 0 or 1, the values of the first region labels of two adjacent first gray-scale regions are different. That is, different gray-scale areas are identified through the transition of the first area label. Specifically: the initialized first area label is 0, that is, the first area label of the first first grayscale area is 0, and when the second first grayscale area is determined, the first area label jumps to 1 , when the third first gray-scale area is determined, the first area label jumps again, the jump becomes 0, and so on.
  • Different first gray-scale regions can be identified through the transition of the first region label 0 or 1, which can be realized with only one bit, which can further reduce the compression ratio.
  • the image compression method further includes:
  • the second grayscale difference threshold is smaller than the first grayscale difference threshold
  • Judging the compression ratio by setting until the compression ratio is less than or equal to the preset compression ratio can improve the reliability of the image compression method.
  • the compression ratio according to the compression method shown in FIG. 6 is 76.56%, which does not meet the requirements. Therefore, reduce the gray level difference threshold to 15, that is: the first compression The data bit is 4, then at this time, M is 24, X is 5, Y is 5, A is 8, B is 4, C is 8, and D is 1. Then the compression ratio P is 73.43%, which meets the requirements.
  • the image compression method further includes:
  • Apparatus 1300 includes:
  • an obtaining unit 1301, configured to obtain gray-scale pixel information of the original image, where the gray-scale pixel information includes multiple sub-gray-scale pixel information;
  • the original image includes but is not limited to red sub-pixels, green sub-pixels and blue sub-pixels.
  • gray-scale pixel information of different sub-pixels may be acquired respectively.
  • acquiring the grayscale pixel information of the original image includes: acquiring the grayscale pixel information of the red subpixel, or acquiring the grayscale pixel information of the green subpixel, or acquiring the grayscale pixel information of the blue subpixel.
  • a scanning unit 1302 configured to scan the plurality of sub-gray-scale pixel information according to a preset first scanning order to obtain first target gray-scale pixel information;
  • the gray-scale pixel information of the original image is pixel information of a two-dimensional sequence
  • the target gray-scale pixel information is pixel information of a one-dimensional sequence
  • the area dividing unit 1303 is configured to divide the first target gray-scale pixel information into a plurality of first gray-scale areas according to a preset first gray-scale difference threshold, and generate first area information, where the first area information includes a plurality of first gray-scale areas. the first minimum grayscale pixel value and the first region label of each first grayscale region in the grayscale region;
  • the compression unit 1304 is configured to compress the sub-gray-scale pixel information of each first gray-scale region based on the first minimum gray-scale pixel value, the first region label and the plurality of sub-gray-scale pixel information to obtain the first gray-scale pixel information of the original image. Compressed data.
  • the scanning unit 1302 scans a plurality of sub-gray-scale pixel information according to a preset first scanning sequence to obtain the first target gray-scale pixel information.
  • the set first grayscale difference threshold divides the first target grayscale pixel information into multiple first grayscale regions, and obtains the first minimum grayscale pixel of each first grayscale region in the multiple first grayscale regions value and the first area label, the compression unit 1304 compresses the sub-grayscale pixel information of each first grayscale area based on the first minimum grayscale pixel value and the first area label, and converts the grayscale pixel information of the high grayscale
  • the first compressed data with low grayscale reduces the data transmission amount during the image transmission process, improves the transmission rate, reduces the power consumption, and the compressed compressed data occupies less memory space, which reduces the storage space. ; Further, by dividing the first target grayscale pixel information into a plurality of first grayscale regions, and compressing each first grayscale region,
  • the compression unit 1304 is specifically configured to: determine the current first gray-scale area and the first minimum gray-scale pixel value of the current first gray-scale area based on the first area label; The first minimum gray-scale pixel value is subtracted from the pixel information of each sub-gray-scale in the area to obtain the first compressed data of the original image.
  • the image compression apparatus 1300 further includes a first adjustment unit 1305, configured to obtain a compression ratio according to the first compressed data and the first region information, and determine the compression ratio Whether it is less than or equal to the preset compression ratio; if the compression ratio is greater than the preset compression ratio, determine the second grayscale difference threshold; divide the target grayscale pixel information into multiple second grayscale regions based on the second grayscale difference threshold, generating second area information, where the second area information includes a second minimum grayscale pixel value and a second area label of each second grayscale area in the plurality of second grayscale areas; based on the second minimum grayscale pixel value, The second area label and the plurality of sub-gray-scale pixel information are compressed to obtain the second compressed data of the original image by compressing the sub-gray-scale pixel information of each second gray-scale area.
  • a first adjustment unit 1305 configured to obtain a compression ratio according to the first compressed data and the first region information, and determine the compression ratio Whether it is less than or equal to the preset compression ratio;
  • the image compression apparatus 1300 further includes a second adjustment unit 1306, configured to obtain a compression ratio according to the first compressed data and the first region information, and determine whether the compression ratio is less than or equal to equal to the preset compression ratio; if the compression ratio is greater than the preset compression ratio, then determine the second scanning sequence; scan multiple sub-gray-scale pixel information according to the second scanning sequence to obtain the second target gray-scale pixel information; according to the preset first
  • the grayscale difference threshold divides the grayscale pixel information of the second target into multiple third grayscale regions, and generates third region information, where the third region information includes the The third minimum grayscale pixel value and the third area label; based on the third minimum grayscale pixel value, the third area label and the multiple sub-grayscale pixel information, the sub-grayscale pixel information of each third grayscale area is compressed , to obtain the third compressed data of the original image.
  • the embodiments of the present application further provide a computer device that integrates any image compression apparatus provided by the embodiments of the present application, and the computer device includes:
  • processors one or more processors
  • One or more application programs wherein the one or more application programs are stored in the memory and configured to perform, by the processor, the image compression described in any of the above image compression method embodiments steps in the method.
  • FIG. 14 it shows a schematic structural diagram of a computer device involved in an embodiment of the present application, specifically:
  • the computer device may include a processor 1401 of one or more processing cores, a memory 1402 of one or more computer-readable storage media, a power supply 1403 and an input unit 1404 and other components.
  • a processor 1401 of one or more processing cores may include a processor 1401 of one or more processing cores, a memory 1402 of one or more computer-readable storage media, a power supply 1403 and an input unit 1404 and other components.
  • FIG. 14 does not constitute a limitation on the computer device, and may include more or less components than the one shown, or combine some components, or arrange different components. in:
  • the processor 1401 is the control center of the computer equipment, uses various interfaces and lines to connect various parts of the entire computer equipment, runs or executes the software programs and/or modules stored in the memory 1402, and calls the software programs stored in the memory 1402. Data, perform various functions of computer equipment and process data, so as to conduct overall monitoring of computer equipment.
  • the processor 1401 may include one or more processing cores; preferably, the processor 1401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the operation user interface and the application program etc., the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 1401.
  • the memory 1402 can be used to store software programs and modules, and the processor 1401 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402 .
  • the memory 1402 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of computer equipment, etc.
  • memory 1402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 1402 may also include a memory controller to provide processor 1401 access to memory 1402 .
  • the computer equipment also includes a power supply 1403 for supplying power to various components.
  • the power supply 1403 can be logically connected to the processor 1401 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
  • the power source 1403 may also include one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the computer device may also include an input unit 1404 that may be used to receive input numerical or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to operating user settings and functional controls.
  • an input unit 1404 may be used to receive input numerical or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to operating user settings and functional controls.
  • the computer device may also include a display unit and the like, which will not be described herein again.
  • the processor 1401 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 1402 according to the following instructions, and the processor 1401 executes them and stores them in the memory 1402.
  • the application program in the memory 1402 thereby realizing various functions, as follows:
  • gray-scale pixel information of the original image where the gray-scale pixel information includes multiple sub-gray-scale pixel information
  • the first target grayscale pixel information is divided into a plurality of first grayscale regions according to a preset first grayscale difference threshold, and first region information is generated, where the first region information includes the plurality of first grayscale regions the first minimum grayscale pixel value and the first region label of each first grayscale region in the grayscale region;
  • the sub-gray-scale pixel information of each first gray-scale region is compressed to obtain the original The first compressed data of the image.
  • an embodiment of the present application provides a computer-readable storage medium, where the storage medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, etc. .
  • a computer program is stored thereon, and the computer program is loaded by the processor to execute the steps in any of the image compression methods provided in the embodiments of the present application.
  • the computer program being loaded by the processor may perform the following steps:
  • gray-scale pixel information of the original image where the gray-scale pixel information includes multiple sub-gray-scale pixel information
  • the first target grayscale pixel information is divided into a plurality of first grayscale regions according to a preset first grayscale difference threshold, and first region information is generated, where the first region information includes the plurality of first grayscale regions the first minimum grayscale pixel value and the first region label of each first grayscale region in the grayscale region;
  • the sub-gray-scale pixel information of each first gray-scale region is compressed to obtain the original The first compressed data of the image.
  • the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请提供一种图像压缩方法及压缩装置,方法包括获取原始图像的灰阶像素信息及第一目标灰阶像素信息;根据预设的第一灰阶差阈值将第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息;对每一第一灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第一压缩数据。本申请提高了传输速率,降低了存储空间。

Description

图像压缩方法及压缩装置 技术领域
本申请涉及图像处理技术领域,具体涉及一种图像压缩方法及压缩装置。
背景技术
现有的显示面板均是对原始数据进行直接存储和传输,但随着画面解析度的提高,需要传输的显示数据也随之增加,若原始数据直接进行存储和传输则需要极大的存储空间和更高的传输效率,导致显示面板的内存容量和功耗增加。
技术问题
急需提出一种图像压缩方法及压缩装置解决现有技术中对原始数据直接进行存储和传输导致显示面板的内存容量和功耗增加的技术问题。
技术解决方案
本申请提供一种图像压缩方法及压缩装置,旨在解决现有技术中对原始数据直接进行存储和传输导致显示面板的内存容量和功耗增加的技术问题。
一方面,本申请提供一种图像压缩方法,包括:
获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
在本申请一种可能的实现方式中,所述基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据包括:
基于所述第一区域标签确定当前第一灰阶区域和所述当前第一灰阶区域的第一最小灰阶像素值;
将所述当前第一灰阶区域内的每一子灰阶像素信息减去所述第一最小灰阶像素值,得到所述原始图像的第一压缩数据。
在本申请一种可能的实现方式中,在所述每一第一灰阶区域内,最大子灰阶像素信息与最小子灰阶像素信息的差值均小于所述第一灰阶差阈值。
在本申请一种可能的实现方式中,所述方法还包括:
根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
若所述压缩比大于所述预设压缩比,则确定第二灰阶差阈值;
基于所述第二灰阶差阈值将所述目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,所述第二区域信息包括所述多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;
基于所述第二最小灰阶像素值、所述第二区域标签和所述多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第二压缩数据。
在本申请一种可能的实现方式中,所述子灰阶像素信息、所述第一区域标签、所述第一最小灰阶像素值和所述第一压缩数据均由二进制数表示,所述根据所述第一压缩数据和所述第一区域信息获得压缩比包括:
根据所述多个子灰阶像素信息的个数和所述多个子灰阶像素信息的比特位数获得原始像素参数;
根据所述多个子灰阶像素信息的个数和所述第一压缩数据的比特位数获得压缩数据参数;
根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数;
根据所述第一区域标签的个数和所述第一区域标签的比特位数获得区域标签参数;
根据所述压缩数据参数、所述最小灰阶像素参数和所述区域标签参数获得压缩像素参数;
根据所述原始像素参数和所述压缩像素参数获得所述压缩比。
在本申请一种可能的实现方式中,所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值不相同,所述根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数包括:
获得所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数,并根据所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数获得所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数;
根据所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数获得所述灰阶像素参数。
在本申请一种可能的实现方式中,在所述按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息之后还包括:
设定所述第一灰阶差阈值,所述第一灰阶差阈值Th为2B-1,其中,B为所述第一压缩数据的比特位数。
在本申请一种可能的实现方式中,所述第一区域标签为一位比特位,所述第一区域标签为0或1,相邻两个第一灰阶区域的所述第一区域标签的取值不相同。
在本申请一种可能的实现方式中,所述方法还包括:
根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
若所述压缩比大于所述预设压缩比,则确定第二扫描顺序;
按照所述第二扫描顺序扫描所述多个子灰阶像素信息,得到第二目标灰阶像素信息;
根据预设的第一灰阶差阈值将所述第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,所述第三区域信息包括所述多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;
基于所述第三最小灰阶像素值、所述第三区域标签和所述多个子灰阶像素信息,对所述每一第三灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第三压缩数据。
另一方面,本申请提供一种图像压缩装置,所述图像压缩装置包括:
获取单元,用于获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
扫描单元,用于按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
区域划分单元,用于根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
压缩单元,用于基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
在本申请一种可能的实现方式中,所述压缩单元具体用于:基于所述第一区域标签确定当前第一灰阶区域和所述当前第一灰阶区域的第一最小灰阶像素值;将所述当前第一灰阶区域内的每一子灰阶像素信息减去所述第一最小灰阶像素值,得到所述原始图像的第一压缩数据。
在本申请一种可能的实现方式中,所述图像压缩装置还包括第一调整单元,用于根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;若所述压缩比大于所述预设压缩比,则确定第二灰阶差阈值;基于所述第二灰阶差阈值将所述目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,所述第二区域信息包括所述多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;基于所述第二最小灰阶像素值、所述第二区域标签和所述多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第二压缩数据。
在本申请一种可能的实现方式中,所述图像压缩装置还包括第二调整单元,用于根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;若所述压缩比大于所述预设压缩比,则确定第二扫描顺序;按照所述第二扫描顺序扫描所述多个子灰阶像素信息,得到第二目标灰阶像素信息;根据预设的第一灰阶差阈值将所述第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,所述第三区域信息包括所述多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;基于所述第三最小灰阶像素值、所述第三区域标签和所述多个子灰阶像素信息,对所述每一第三灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第三压缩数据。
另一方面,本申请还提供一种计算机设备,所述计算机设备包括:
一个或多个处理器;
存储器;以及
一个或多个应用程序,其中所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行以实现上述任一项所述的图像压缩方法。
另一方面,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行上述任一项所述的图像压缩方法中的步骤。
有益效果
本申请通过按照预设的第一扫描顺序扫描多个子灰阶像素信息,得到第一目标灰阶像素信息,并根据预设的第一灰阶差阈值将第一目标灰阶像素信息划分为多个第一灰阶区域,获得多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签,基于第一最小灰阶像素值和第一区域标签对每一第一灰阶区域的子灰阶像素信息进行压缩,将高灰阶的灰阶像素信息转换成低灰阶的第一压缩数据,减少了图像在传输过程中的数据传输量,提高了传输速率,降低了功耗,并且压缩后的压缩数据占用的内存空间也较小,降低了存储空间;进一步地,通过将第一目标灰阶像素信息划分为多个第一灰阶区域,对每一个第一灰阶区域进行压缩,进一步提高图像压缩方法的压缩率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的图像压缩方法的一个实施例流程示意图;
图2是本发明实施例提供的S102的第一个实施例示意图;
图3是本申请实施例提供的目标灰阶信息的一个实施例示意图;
图4是本申请实施例提供的S102的第二个实施例示意图;
图5是本申请实施例提供的S102的第三个实施例示意图;
图6是本申请实施例提供的S103的一个实施例示意图;
图7是本发明实施例提供的S104的一个实施例流程示意图;
图8是本发明实施例提供的计算压缩比的一个实施例流程示意图;
图9是本发明实施例提供的S803的一个实施例流程示意图;
图10是本发明实施例提供的调整压缩比的一个实施例流程示意图;
图11是本发明实施例提供的调整压缩比后的一个实施例示意图
图12是本发明实施例提供的调整压缩比的另一个实施例流程示意图;
图13是本发明实施例提供的图像压缩装置的一个实施例结构示意图;
图14是本发明实施例提供的服务器的一个实施例流程示意图。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在本申请的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请提供了一种图像压缩方法及压缩装置,以下分别进行详细说明。
第一方面,本申请实施例提供了一种图像压缩方法,该图像压缩方法包括:获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
如图1所示,为本申请实施例提供的图像压缩方法的一个实施例流程示意图,该方法包括:
S101、获取原始图像的灰阶像素信息,灰阶像素信息包括多个子灰阶像素信息;
其中,原始图像包括但不限于红色亚像素、绿色亚像素和蓝色亚像素,获取原始图像的灰阶像素信息时,可以是分别获取不同亚像素的灰阶像素信息。具体地:获取原始图像的灰阶像素信息包括:获取红色亚像素的灰阶像素信息,或,获取绿色亚像素的灰阶像素信息,或,获取蓝色亚像素的灰阶像素信息。
进一步地,每一亚像素的灰阶像素信息均包括多个子灰阶像素信息。
S102、按照预设的扫描顺序扫描多个子灰阶像素信息,得到目标灰阶像素信息;
需要说明的是:在本申请的一些实施例中,原始图像的灰阶像素信息为二维序列的像素信息,目标灰阶像素信息为一维序列的像素信息。
通过将二维序列的原始图像的灰阶像素信息通过扫描转换成一维序列的目标像素信息可便于后续划分灰阶区域。
S103、根据预设的第一灰阶差阈值将目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,第一区域信息包括多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
其中,第一区域标签用于表示不同的灰阶区域,第一最小灰阶像素值用于表示每一第一灰阶区域内的第一最小灰阶像素的像素值。
S104、基于第一最小灰阶像素值、第一区域标签和多个子灰阶像素信息,对每一第一灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第一压缩数据。
本申请提供的图像压缩方法,在图像压缩过程中,按照预设的第一扫描顺序扫描多个子灰阶像素信息,得到第一目标灰阶像素信息,并根据预设的第一灰阶差阈值将第一目标灰阶像素信息划分为多个第一灰阶区域,获得多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签,基于第一最小灰阶像素值和第一区域标签对每一第一灰阶区域的子灰阶像素信息进行压缩,将高灰阶的灰阶像素信息转换成低灰阶的第一压缩数据,减少了图像在传输过程中的数据传输量,提高了传输速率,降低了功耗,并且压缩后的压缩数据占用的内存空间也较小,降低了存储空间;进一步地,通过将第一目标灰阶像素信息划分为多个第一灰阶区域,对每一个第一灰阶区域进行压缩,进一步提高图像压缩方法的压缩率。
进一步地,如图2所示,为本申请实施例提供的S102的一个实施例示意图,具体地:原始图像的灰阶像素信息为8*8的矩阵,即:原始图像包括64个子灰阶像素信息。扫描顺序为图2中箭头所示的先列后行的扫描顺序,以扫描前三列为例,如图3所示,扫描后得到的目标灰阶像素信息为一维的24个子灰阶像素信息。
进一步地,如图4所示,在本申请的一些其他实施例中,扫描顺序为图4中箭头所示的先行后列的扫描顺序,在本申请的另外一些实施例中,扫描顺序为图5中箭头所示的九宫格的扫描顺序。
应当理解的是:扫描顺序并不限于上述扫描顺序,还可是间隔扫描或其他等扫描顺序,在此不作限定。
进一步地,如图6所示,为本申请实施例提供的S103的一个实施例示意图,具体地:以图3中的目标灰阶像素信息为例进行介绍,划分第一灰阶区域的原则为:每一第一灰阶区域内的最大子灰阶像素信息与最小子灰阶像素信息的差值均小于第一灰阶差阈值,其中,最大子灰阶像素信息指的是:第一灰阶区域内的灰阶像素值最大的子灰阶像素信息,最小子灰阶像素信息指的是:第一灰阶区域内的灰阶像素值最小的子灰阶像素信息。如图6所示,当压缩数据为5位比特位时,第一灰阶差阈值为31时,第一个灰阶像素值为77,第二个灰阶像素值为70,则最大子灰阶像素信息与最小子灰阶像素信息的差值为7,小于31,则区域继续扩充至第三个灰阶像素,第三个灰阶像素值为67,则对最大紫慧杰像素信息为77,最小子灰阶像素信息为67,两者的差值为10,仍小于31,则区域继续扩充,直至扩充至灰阶像素值为117的子灰阶像素信息,其为最大子灰阶像素信息,与最小子灰阶像素信息之间的差值为50,大于第一灰阶差阈值,则第一个灰阶区域的范围是第一个子灰阶像素信息与灰阶像素值为117的子灰阶像素信息的前一个子灰阶像素信息。以此类推,将其他灰阶区域一一确定。目标灰阶像素信息最后可以分为3个第一灰阶区域,第一个第一灰阶区域的最小灰阶像素值为67,第二个第一灰阶区域的最小灰阶像素值为98,第三个第一灰阶区域的最小灰阶像素值为73。
进一步地,在本申请的一些实施例中,如图7所示,S104包括:
S701、基于第一区域标签确定当前第一灰阶区域和当前第一灰阶区域的第一最小灰阶像素值;
S702、将当前第一灰阶区域内的每一子灰阶像素信息减去第一最小灰阶像素值,得到原始图像的第一压缩数据。
本申请实施例通过将当前第一灰阶区域内的每一子像素信息减去第一最小灰阶像素值,可实现将高灰阶的像素信息转换为低灰阶的像素信息,减少了数据传输量,从而降低了功耗和第一压缩数据的占用空间。并且,本申请实施例通过设置将当前第一灰阶区域内的每一子像素信息减去第一最小灰阶像素值,最大程度的减少数据传输量。
需要说明的是:为了使压缩后的第一压缩数据满足要求,在本申请的一些实施例中,通过判断压缩比来判断第一压缩数据是否满足要求,具体地:根据第一压缩数据和第一区域信息获得压缩比,如图8所示,具体包括:
S801、根据多个子灰阶像素信息的个数和多个子灰阶像素信息的比特位数获得原始像素参数;
S802、根据多个子灰阶像素信息的个数和第一压缩数据的比特位数获得压缩数据参数;
S803、根据第一最小灰阶像素值的个数和第一最小灰阶像素值的比特位数获得最小灰阶像素参数;
S804、根据第一区域标签的个数和第一区域标签的比特位数获得区域标签参数;
S805、根据压缩数据参数、最小灰阶像素参数和区域标签参数获得压缩像素参数;
S806、根据原始像素参数和压缩像素参数获得压缩比。
其中,原始像素参数为多个子灰阶像素信息的个数和多个子灰阶像素信息的比特位数的乘积;压缩数据参数为多个子灰阶像素信息的个数和第一压缩数据的比特位数的乘积;最小灰阶像素参数为第一最小灰阶像素值的个数和第一最小灰阶像素值的比特位数的乘积;区域标签参数为第一区域标签的个数和第一区域标签的比特位数的乘积;压缩像素参数为压缩数据参数、最小灰阶像素参数和区域标签参数的和;压缩比为压缩像素参数和原始像素参数的比值。
具体地,压缩比为:
P=(M*B+X*C+Y*D)/(M*A)
其中,P为压缩比,M为多个子灰阶像素信息的个数,X为第一最小灰阶像素值的个数,Y为第一区域标签的个数,A为多个子灰阶像素信息的比特位数,B为第一压缩数据的比特位数,C为第一最小灰阶像素值的比特位数,D为第一区域标签的比特位数。
需要说明的是:在本申请的一些实施例中,子灰阶像素信息、第一区域标签、第一最小灰阶像素值和第一压缩数据均由二进制数表示。
在上述公式中,M*A的值为定值,因此,想要降低压缩比P,就需要减小B、C、D、X和Y中的任意一项,且由于图像压缩后所要传输的主要是第一压缩数据,因此,首先应当减小第一压缩数据的位数,当第一压缩数据的位数一定时,第一灰阶差阈值和第一最小灰阶像素值也会确定。
这是由于,当第一压缩数据的位数一定时,为了尽量降低压缩比,应当尽量减少第一最小灰阶像素值和第一区域标签的个数,则灰阶差阈值Th为2B-1。具体地:当第一压缩数据的位数为5时,第一灰阶差阈值为31,当第一压缩数据的位数为4时,第一灰阶差阈值为15。
以图6中的压缩方式为例,M为24,X为3,Y为3,A为8,B为5,C为8,D为1。则压缩比P为76.56%。
进一步地,在本申请的一些实施中,当灰阶像素信息分布较离散,即:子灰阶像素信息之间的差值较大时,为了进一步降低第一压缩数据的压缩比,多个第一灰阶区域中的各第一灰阶区域的第一最小灰阶像素值不相同,第一最小灰阶像素值的比特位数也不相同,如图9所示,S803包括:
S901、获得多个第一灰阶区域中的各第一灰阶区域的第一最小灰阶像素值和第一最小灰阶像素值的比特位数,并根据第一最小灰阶像素值和第一最小灰阶像素值的比特位数获得多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数;
S902、根据多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数获得灰阶像素参数。
具体地,压缩比为:
P=[M*B+∑1n(X*C)+Y*D]/(M*A)
其中,n为第一灰阶区域的个数。
具体地:当第一最小灰阶像素值小于32,大于16时,第一最小灰阶像素值的位数为5,当第一最小灰阶像素值小于64,大于32时,第一最小灰阶像素值的位数为6,当第一最小灰阶像素值的位数小于128,大于64时,第一最小灰阶像素值的位数为7,当第一最小灰阶像素值的位数小于256,大于128时,第一最小灰阶像素值的位数为8。
通过上述设置,可进一步降低压缩比,提高图像压缩方法的压缩效率。
进一步地,由于第一区域标签仅用于表示不同的第一灰阶区域,为了进一步降低压缩比,在本申请的一些实施例中,第一区域标签为一位比特位,第一区域标签为0或1,相邻两个第一灰阶区域的第一区域标签的取值不相同。即:通过第一区域标签的跳变识别不同的灰阶区域。具体地:初始化的第一区域标签为0,即第一个第一灰阶区域的第一区域标签为0,当第二个第一灰阶区域确定时,第一区域标签发生跳变为1,当第三个第一灰阶区域确定时,第一区域标签再次发生跳变,跳变为0,依次类推。
通过第一区域标签0或1的跳变即可识别不同的第一灰阶区域,仅用一位比特位即可实现,可进一步降低压缩比。
进一步地,在本申请的一些实施例中,为了获得最佳的压缩比,如图10所示,图像压缩方法还包括:
S1001、根据第一压缩数据和第一区域信息获得压缩比,并判断压缩比是否小于或等于预设压缩比;
S1002、若压缩比大于预设压缩比,则确定第二灰阶差阈值;
应当理解的是:第二灰阶差阈值小于第一灰阶差阈值;
S1003、基于第二灰阶差阈值将目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,第二区域信息包括多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;
S1004、基于第二最小灰阶像素值、第二区域标签和多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第二压缩数据。
通过设置对压缩比进行判断,直至压缩比小于或等于预设压缩比,可提高图像压缩方法的可靠性。
如图11所示,当预设压缩比为74%时,按照如图6所示的压缩方式的压缩比为76.56%不符合要求,因此,降低灰阶差阈值为15,即:第一压缩数据的比特位为4,则此时,M为24,X为5,Y为5,A为8,B为4,C为8,D为1。则压缩比P为73.43%,符合要求。
进一步地,在本申请的一些实施例中,如图12所示,图像压缩方法还包括:
S1201、根据第一压缩数据和第一区域信息获得压缩比,并判断压缩比是否小于或等于预设压缩比;
S1202、若压缩比大于预设压缩比,则确定第二扫描顺序;
S1203、按照第二扫描顺序扫描多个子灰阶像素信息,得到第二目标灰阶像素信息;
S1204、根据预设的第一灰阶差阈值将第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,第三区域信息包括多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;
S1205、基于第三最小灰阶像素值、第三区域标签和多个子灰阶像素信息,对每一第三灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第三压缩数据。
通过上述设置,增加了降低压缩比的另一种方法,提高了图像压缩方法的适用性。
另一方面,为了更好实施本发明实施例中的图像压缩方法,在图像压缩方法基础之上,对应的,如图13所示,本发明实施例中还提供一种图像压缩装置,图像压缩装置1300包括:
获取单元1301,用于获取原始图像的灰阶像素信息,灰阶像素信息包括多个子灰阶像素信息;
其中,原始图像包括但不限于红色亚像素、绿色亚像素和蓝色亚像素,获取原始图像的灰阶像素信息时,可以是分别获取不同亚像素的灰阶像素信息。具体地:获取原始图像的灰阶像素信息包括:获取红色亚像素的灰阶像素信息,或,获取绿色亚像素的灰阶像素信息,或,获取蓝色亚像素的灰阶像素信息。
扫描单元1302,用于按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
需要说明的是:在本申请的一些实施例中,原始图像的灰阶像素信息为二维序列的像素信息,目标灰阶像素信息为一维序列的像素信息。
区域划分单元1303,用于根据预设的第一灰阶差阈值将第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,第一区域信息包括多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
压缩单元1304,用于基于第一最小灰阶像素值、第一区域标签和多个子灰阶像素信息,对每一第一灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第一压缩数据。
本申请提供的图像压缩装置1300,在图像压缩的过程中,扫描单元1302按照预设的第一扫描顺序扫描多个子灰阶像素信息,得到第一目标灰阶像素信息,区域划分单元1303根据预设的第一灰阶差阈值将第一目标灰阶像素信息划分为多个第一灰阶区域,获得多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签,压缩单元1304基于第一最小灰阶像素值和第一区域标签对每一第一灰阶区域的子灰阶像素信息进行压缩,将高灰阶的灰阶像素信息转换成低灰阶的第一压缩数据,减少了图像在传输过程中的数据传输量,提高了传输速率,降低了功耗,并且压缩后的压缩数据占用的内存空间也较小,降低了存储空间;进一步地,通过将第一目标灰阶像素信息划分为多个第一灰阶区域,对每一个第一灰阶区域进行压缩,进一步提高图像压缩方法的压缩率。
在本申请一些可实施例中,压缩单元1304具体用于:基于第一区域标签确定当前第一灰阶区域和当前第一灰阶区域的第一最小灰阶像素值;将当前第一灰阶区域内的每一子灰阶像素信息减去所述第一最小灰阶像素值,得到原始图像的第一压缩数据。
进一步地,在本申请的一些实施例中,如图13所示,图像压缩装置1300还包括第一调整单元1305,用于根据第一压缩数据和第一区域信息获得压缩比,并判断压缩比是否小于或等于预设压缩比;若压缩比大于预设压缩比,则确定第二灰阶差阈值;基于第二灰阶差阈值将目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,第二区域信息包括多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;基于第二最小灰阶像素值、第二区域标签和多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第二压缩数据。
在本申请的一些实施例中,如图13所示,图像压缩装置1300还包括第二调整单元1306,用于根据第一压缩数据和第一区域信息获得压缩比,并判断压缩比是否小于或等于预设压缩比;若压缩比大于预设压缩比,则确定第二扫描顺序;按照第二扫描顺序扫描多个子灰阶像素信息,得到第二目标灰阶像素信息;根据预设的第一灰阶差阈值将第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,第三区域信息包括多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;基于第三最小灰阶像素值、第三区域标签和多个子灰阶像素信息,对每一第三灰阶区域的子灰阶像素信息进行压缩,得到原始图像的第三压缩数据。
本申请实施例还提供一种计算机设备,其集成了本申请实施例所提供的任一种图像压缩装置,所述计算机设备包括:
一个或多个处理器;
存储器;以及
一个或多个应用程序,其中所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行上述图像压缩方法实施例中任一实施例中所述的图像压缩方法中的步骤。
本申请实施例提供的一种计算机设备,其集成了本申请实施例所提供的任一种图像压缩装置。如图14所示,其示出了本申请实施例所涉及的计算机设备的结构示意图,具体来讲:
该计算机设备可以包括一个或者一个以上处理核心的处理器1401、一个或一个以上计算机可读存储介质的存储器1402、电源1403和输入单元1404等部件。本领域技术人员可以理解,图14中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
处理器1401是该计算机设备的控制中心,利用各种接口和线路连接整个计算机设备的各个部分,通过运行或执行存储在存储器1402内的软件程序和/或模块,以及调用存储在存储器1402内的数据,执行计算机设备的各种功能和处理数据,从而对计算机设备进行整体监控。可选的,处理器1401可包括一个或多个处理核心;优选的,处理器1401可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、操作用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1401中。
存储器1402可用于存储软件程序以及模块,处理器1401通过运行存储在存储器1402的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器1402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器1402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器1402还可以包括存储器控制器,以提供处理器1401对存储器1402的访问。
计算机设备还包括给各个部件供电的电源1403,优选的,电源1403可以通过电源管理系统与处理器1401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源1403还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该计算机设备还可包括输入单元1404,该输入单元1404可用于接收输入的数字或字符信息,以及产生与操作用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
尽管未示出,计算机设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,计算机设备中的处理器1401会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器1402中,并由处理器1401来运行存储在存储器1402中的应用程序,从而实现各种功能,如下:
获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行本申请实施例所提供的任一种图像压缩方法中的步骤。例如,所述计算机程序被处理器进行加载可以执行如下步骤:
获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对其他实施例的详细描述,此处不再赘述。
具体实施时,以上各个单元或结构可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元或结构的具体实施可参见前面的方法实施例,在此不再赘述。
以上对本申请所提供的图像压缩方法及图像压缩装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (20)

  1. 一种图像压缩方法,其中,包括:
    获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
    按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
    根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
    基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
  2. 根据权利要求1所述的图像压缩方法,其中,所述基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据包括:
    基于所述第一区域标签确定当前第一灰阶区域和所述当前第一灰阶区域的第一最小灰阶像素值;
    将所述当前第一灰阶区域内的每一子灰阶像素信息减去所述第一最小灰阶像素值,得到所述原始图像的第一压缩数据。
  3. 根据权利要求1所述的图像压缩方法,其中,在所述每一第一灰阶区域内,最大子灰阶像素信息与最小子灰阶像素信息的差值均小于所述第一灰阶差阈值。
  4. 根据权利要求1所述的图像压缩方法,其中,所述方法还包括:
    根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
    若所述压缩比大于所述预设压缩比,则确定第二灰阶差阈值;
    基于所述第二灰阶差阈值将所述目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,所述第二区域信息包括所述多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;
    基于所述第二最小灰阶像素值、所述第二区域标签和所述多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第二压缩数据。
  5. 根据权利要求4所述的图像压缩方法,其中,所述子灰阶像素信息、所述第一区域标签、所述第一最小灰阶像素值和所述第一压缩数据均由二进制数表示,所述根据所述第一压缩数据和所述第一区域信息获得压缩比包括:
    根据所述多个子灰阶像素信息的个数和所述多个子灰阶像素信息的比特位数获得原始像素参数;
    根据所述多个子灰阶像素信息的个数和所述第一压缩数据的比特位数获得压缩数据参数;
    根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数;
    根据所述第一区域标签的个数和所述第一区域标签的比特位数获得区域标签参数;
    根据所述压缩数据参数、所述最小灰阶像素参数和所述区域标签参数获得压缩像素参数;
    根据所述原始像素参数和所述压缩像素参数获得所述压缩比。
  6. 根据权利要求5所述的图像压缩方法,其中,所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值不相同,所述根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数包括:
    获得所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数,并根据所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数获得所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数;
    根据所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数获得所述灰阶像素参数。
  7. 根据权利要求5所述的图像压缩方法,其中,在所述按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息之后还包括:
    设定所述第一灰阶差阈值,所述第一灰阶差阈值Th为2B-1,其中,B为所述第一压缩数据的比特位数。
  8. 根据权利要求5所述的图像压缩方法,其中,所述第一区域标签为一位比特位,所述第一区域标签为0或1,相邻两个第一灰阶区域的所述第一区域标签的取值不相同。
  9. 根据权利要求1所述的图像压缩方法,其中,所述方法还包括:
    根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
    若所述压缩比大于所述预设压缩比,则确定第二扫描顺序;
    按照所述第二扫描顺序扫描所述多个子灰阶像素信息,得到第二目标灰阶像素信息;
    根据预设的第一灰阶差阈值将所述第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,所述第三区域信息包括所述多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;
    基于所述第三最小灰阶像素值、所述第三区域标签和所述多个子灰阶像素信息,对所述每一第三灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第三压缩数据。
  10. 一种图像压缩装置,其中,所述图像压缩装置包括:
    获取单元,用于获取原始图像的灰阶像素信息,所述灰阶像素信息包括多个子灰阶像素信息;
    扫描单元,用于按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息;
    区域划分单元,用于根据预设的第一灰阶差阈值将所述第一目标灰阶像素信息划分为多个第一灰阶区域,生成第一区域信息,所述第一区域信息包括所述多个第一灰阶区域中的每一第一灰阶区域的第一最小灰阶像素值和第一区域标签;
    压缩单元,用于基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对所述每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据。
  11. 根据权利要求10所述的图像压缩装置,其中,所述基于所述第一最小灰阶像素值、所述第一区域标签和所述多个子灰阶像素信息,对每一第一灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第一压缩数据包括:
    基于所述第一区域标签确定当前第一灰阶区域和所述当前第一灰阶区域的第一最小灰阶像素值;
    将所述当前第一灰阶区域内的每一子灰阶像素信息减去所述第一最小灰阶像素值,得到所述原始图像的第一压缩数据。
  12. 根据权利要求10所述的图像压缩装置,其中,在所述每一第一灰阶区域内,最大子灰阶像素信息与最小子灰阶像素信息的差值均小于所述第一灰阶差阈值。
  13. 根据权利要求10所述的图像压缩装置,其中,所述方法还包括:
    根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
    若所述压缩比大于所述预设压缩比,则确定第二灰阶差阈值;
    基于所述第二灰阶差阈值将所述目标灰阶像素信息划分为多个第二灰阶区域,生成第二区域信息,所述第二区域信息包括所述多个第二灰阶区域中的每一第二灰阶区域的第二最小灰阶像素值和第二区域标签;
    基于所述第二最小灰阶像素值、所述第二区域标签和所述多个子灰阶像素信息,对每一第二灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第二压缩数据。
  14. 根据权利要求13所述的图像压缩装置,其中,所述子灰阶像素信息、所述第一区域标签、所述第一最小灰阶像素值和所述第一压缩数据均由二进制数表示,所述根据所述第一压缩数据和所述第一区域信息获得压缩比包括:
    根据所述多个子灰阶像素信息的个数和所述多个子灰阶像素信息的比特位数获得原始像素参数;
    根据所述多个子灰阶像素信息的个数和所述第一压缩数据的比特位数获得压缩数据参数;
    根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数;
    根据所述第一区域标签的个数和所述第一区域标签的比特位数获得区域标签参数;
    根据所述压缩数据参数、所述最小灰阶像素参数和所述区域标签参数获得压缩像素参数;
    根据所述原始像素参数和所述压缩像素参数获得所述压缩比。
  15. 根据权利要求14所述的图像压缩装置,其中,所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值不相同,所述根据所述第一最小灰阶像素值的个数和所述第一最小灰阶像素值的比特位数获得最小灰阶像素参数包括:
    获得所述多个第一灰阶区域中的各第一灰阶区域的所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数,并根据所述第一最小灰阶像素值和所述第一最小灰阶像素值的比特位数获得所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数;
    根据所述多个第一灰阶区域中的各个第一灰阶区域的子最小灰阶像素参数获得所述灰阶像素参数。
  16. 根据权利要求14所述的图像压缩装置,其中,在所述按照预设的第一扫描顺序扫描所述多个子灰阶像素信息,得到第一目标灰阶像素信息之后还包括:
    设定所述第一灰阶差阈值,所述第一灰阶差阈值Th为2B-1,其中,B为所述第一压缩数据的比特位数。
  17. 根据权利要求14所述的图像压缩装置,其中,所述第一区域标签为一位比特位,所述第一区域标签为0或1,相邻两个第一灰阶区域的所述第一区域标签的取值不相同。
  18. 根据权利要求10所述的图像压缩装置,其中,所述方法还包括:
    根据所述第一压缩数据和所述第一区域信息获得压缩比,并判断所述压缩比是否小于或等于预设压缩比;
    若所述压缩比大于所述预设压缩比,则确定第二扫描顺序;
    按照所述第二扫描顺序扫描所述多个子灰阶像素信息,得到第二目标灰阶像素信息;
    根据预设的第一灰阶差阈值将所述第二目标灰阶像素信息划分为多个第三灰阶区域,生成第三区域信息,所述第三区域信息包括所述多个第三灰阶区域中的每一第三灰阶区域的第三最小灰阶像素值和第三区域标签;
    基于所述第三最小灰阶像素值、所述第三区域标签和所述多个子灰阶像素信息,对所述每一第三灰阶区域的子灰阶像素信息进行压缩,得到所述原始图像的第三压缩数据。
  19. 一种计算机设备,其中,所述计算机设备包括:
    一个或多个处理器;
    存储器;以及
    一个或多个应用程序,其中所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行以实现权利要求1至9中任一项所述的图像压缩方法。
  20. 一种计算机可读存储介质,其中,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行权利要求1至9中任一项所述的图像压缩方法中的步骤。
PCT/CN2021/096606 2021-04-01 2021-05-28 图像压缩方法及压缩装置 WO2022205603A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/428,302 US11997295B2 (en) 2021-04-01 2021-05-28 Image compression method and compression device capable of improving compression rate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110353826.6A CN113194315B (zh) 2021-04-01 2021-04-01 图像压缩方法及压缩装置
CN202110353826.6 2021-04-01

Publications (1)

Publication Number Publication Date
WO2022205603A1 true WO2022205603A1 (zh) 2022-10-06

Family

ID=76974359

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096606 WO2022205603A1 (zh) 2021-04-01 2021-05-28 图像压缩方法及压缩装置

Country Status (3)

Country Link
US (1) US11997295B2 (zh)
CN (1) CN113194315B (zh)
WO (1) WO2022205603A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115802056A (zh) * 2023-01-31 2023-03-14 南通凯沃智能装备有限公司 用于移动终端的用户数据压缩存储方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194315B (zh) * 2021-04-01 2022-05-31 Tcl华星光电技术有限公司 图像压缩方法及压缩装置
CN114220371A (zh) * 2021-12-10 2022-03-22 西安诺瓦星云科技股份有限公司 全灰阶逐点校正方法及相关装置
CN114390287A (zh) * 2022-03-24 2022-04-22 青岛大学附属医院 一种医疗图像传输控制方法及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464744A (zh) * 2002-06-25 2003-12-31 力捷电脑股份有限公司 扫描仪扫描压缩比自动判别法
TW200941406A (en) * 2008-03-17 2009-10-01 Chunghwa Picture Tubes Ltd Image compression method
US20110216834A1 (en) * 2010-03-04 2011-09-08 Minhua Zhou Fixed Length Coding Based Image Data Compression
CN104464594A (zh) * 2014-12-16 2015-03-25 京东方科技集团股份有限公司 显示数据的传输方法及装置、显示面板的驱动方法及装置
CN105959584A (zh) * 2016-04-29 2016-09-21 京东方科技集团股份有限公司 一种图像处理方法、图像处理装置及显示装置
CN107846589A (zh) * 2016-09-19 2018-03-27 上海臻瞳电子科技有限公司 一种基于局部动态量化的图像压缩方法
CN110689846A (zh) * 2019-11-06 2020-01-14 昆山国显光电有限公司 一种像素灰阶补偿参数压缩存储方法、装置和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005004344A (ja) * 2003-06-10 2005-01-06 Casio Comput Co Ltd 画像処理装置、指紋照合装置、画像圧縮方法
JP5595151B2 (ja) * 2010-07-13 2014-09-24 キヤノン株式会社 画像処理装置、画像処理装置における圧縮方法、および、プログラム
CN108810498B (zh) * 2017-08-04 2021-04-30 成都理想境界科技有限公司 一种扫描投影方法及扫描投影设备
CN109844809B (zh) * 2017-11-30 2022-04-15 深圳配天智能技术研究院有限公司 一种图像处理方法及装置、计算机可读存储介质
CN111587576B (zh) * 2018-01-05 2023-03-31 株式会社索思未来 编码方法、解码方法、编码装置、解码装置以及记录介质
KR102152346B1 (ko) * 2019-01-30 2020-09-04 스노우 주식회사 이미지 파일의 블록 간 차이를 통한 압축율 향상 방법 및 시스템
CN113194315B (zh) * 2021-04-01 2022-05-31 Tcl华星光电技术有限公司 图像压缩方法及压缩装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464744A (zh) * 2002-06-25 2003-12-31 力捷电脑股份有限公司 扫描仪扫描压缩比自动判别法
TW200941406A (en) * 2008-03-17 2009-10-01 Chunghwa Picture Tubes Ltd Image compression method
US20110216834A1 (en) * 2010-03-04 2011-09-08 Minhua Zhou Fixed Length Coding Based Image Data Compression
CN104464594A (zh) * 2014-12-16 2015-03-25 京东方科技集团股份有限公司 显示数据的传输方法及装置、显示面板的驱动方法及装置
CN105959584A (zh) * 2016-04-29 2016-09-21 京东方科技集团股份有限公司 一种图像处理方法、图像处理装置及显示装置
CN107846589A (zh) * 2016-09-19 2018-03-27 上海臻瞳电子科技有限公司 一种基于局部动态量化的图像压缩方法
CN110689846A (zh) * 2019-11-06 2020-01-14 昆山国显光电有限公司 一种像素灰阶补偿参数压缩存储方法、装置和存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115802056A (zh) * 2023-01-31 2023-03-14 南通凯沃智能装备有限公司 用于移动终端的用户数据压缩存储方法

Also Published As

Publication number Publication date
CN113194315B (zh) 2022-05-31
CN113194315A (zh) 2021-07-30
US20230362394A1 (en) 2023-11-09
US11997295B2 (en) 2024-05-28

Similar Documents

Publication Publication Date Title
WO2022205603A1 (zh) 图像压缩方法及压缩装置
CN1093669C (zh) 运动图像对比度增强的直方图均衡装置及其方法
JP5722761B2 (ja) 動画圧縮装置、画像処理装置、動画圧縮方法、画像処理方法、および動画圧縮ファイルのデータ構造
JP4816970B2 (ja) 画像処理装置、表示装置、画像処理方法及びプログラム
US8751542B2 (en) Dynamically scalable modes
CN100508572C (zh) 图像处理装置、方法
US9639920B2 (en) Dither directed LUT output value interpolation
US9892338B2 (en) Encoding method and encoder for constructing an initial color table
CN110533117B (zh) 图像比对方法、装置、设备和存储介质
US8194092B2 (en) Device and method of processing image for power consumption reduction
US20090256852A1 (en) Character display apparatus
CN111816109A (zh) 显示方法、装置及显示设备
US11315290B2 (en) Image processing apparatus and image processing method
GB2528870A (en) Managing display data for display
US20210225306A1 (en) Display device and control method of display device
KR102521364B1 (ko) 표시 장치 및 이의 구동 방법
CN110602505A (zh) 一种基于多gpu的视频转码方法及装置
KR20160025894A (ko) Gpu의 리소스에 대한 전력 소비 제어방법 및 장치
US20120154410A1 (en) Apparatus and method for processing a frame in consideration of the processing capability and power consumption of each core in a multicore environment
KR101169994B1 (ko) 알파 평면을 이용한 영상 데이터 처리 장치 및 방법
CN115604410A (zh) 视频处理方法、装置、设备和计算机可读存储介质
US20080284785A1 (en) Dynamic data rate display
CN102103477B (zh) 一种获取显示数据的方法、系统及电子设备
US11051008B2 (en) Image processing apparatus and control method
JP2006191401A (ja) 画像処理方法、画像処理装置及びコンピュータプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21934252

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21934252

Country of ref document: EP

Kind code of ref document: A1