CN106937117A - Method for compressing image and device - Google Patents

Method for compressing image and device Download PDF

Info

Publication number
CN106937117A
CN106937117A CN201511017681.3A CN201511017681A CN106937117A CN 106937117 A CN106937117 A CN 106937117A CN 201511017681 A CN201511017681 A CN 201511017681A CN 106937117 A CN106937117 A CN 106937117A
Authority
CN
China
Prior art keywords
compression
value
image
mass parameter
visual quality
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.)
Granted
Application number
CN201511017681.3A
Other languages
Chinese (zh)
Other versions
CN106937117B (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201511017681.3A priority Critical patent/CN106937117B/en
Publication of CN106937117A publication Critical patent/CN106937117A/en
Application granted granted Critical
Publication of CN106937117B publication Critical patent/CN106937117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Landscapes

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

Abstract

The application provides a kind of method of compression of images, including:Using the test value of at least one mass parameter, with compression algorithm by original image boil down to test image;Visual quality fraction, corresponding mass parameter test value according to test image, the corresponding mass parameter desired value of the preset target value of visual quality fraction is determined based on Gaussian function;The visual quality fraction is used for weighing the visual effect of compressed images;The Gaussian function is obtained by visual quality fraction with the relation fitting of mass parameter;Using mass parameter desired value, the original image is compressed with the compression algorithm.The technical scheme of the application can be directed to the compression quality parameter that specific image selection is adapted to the image, so that the image after compression has certain visual effect, compression ratio as high as possible reached on the premise of picture quality is ensured, improve compression effectiveness.

Description

Method for compressing image and device
Technical field
The application is related to technical field of image processing, more particularly to a kind of method for compressing image and device.
Background technology
With the development of multimedia technology and the communication technology, digital picture is directly perceived with it, the performance of image is imitated Fruit is increasingly widely applied in information interchange.Because the data volume of image is often than larger, it is It is easy to the transmission and storage of image, generally reduces the big of image file using various image compression algorithms It is small.Compression algorithm also reduces the quality of image while image file scale is reduced.
In the prior art, before transmission and/or storage image, generally using the compression algorithm pair of same parameter All of image is compressed, but compressed image file size and image high fdrequency component, phase in itself The factor such as the segment of nearly color is how many is related.In terms of picture quality, the image of equal resolution is passing through After so compressing, certain, even larger difference is there may be with the picture quality of eye-observation;And For distinguishing two larger images to resolution ratio, after being compressed using the compression algorithm of same parameter, differentiate Rate image higher may be also too big, but the relatively low figure of resolution ratio may be already smudgy.To image The complex situation in source, such as image on mobile phone is probably high-resolution photo, it is also possible to he People is transmitted through the application scenarios of the low resolution picture for coming, otherwise this compress mode reduction compression ratio ensures Picture quality, otherwise sacrificing picture quality ensures compression ratio, it is difficult to the compression effectiveness for having reached.
The content of the invention
In view of this, the application provides a kind of method of compression of images, including:
Using the test value of at least one mass parameter, with compression algorithm by original image boil down to test image;
Visual quality fraction, corresponding mass parameter test value according to test image, based on Gaussian function Determine the corresponding mass parameter desired value of preset target value of visual quality fraction;The visual quality fraction For weighing the visual effect of compressed images;The Gaussian function is by visual quality fraction and mass parameter Relation fitting obtain;
Using mass parameter desired value, the original image is compressed with the compression algorithm.
Present invention also provides a kind of device of compression of images, including:
Test image unit, for the test value using at least one mass parameter, with compression algorithm by original Compression of images is test image;
Mass parameter target value cell, for the visual quality fraction according to test image, corresponding quality Parameter testing value, the corresponding mass parameter of preset target value of visual quality fraction is determined based on Gaussian function Desired value;The visual quality fraction is used for weighing the visual effect of compressed images;The Gaussian function Obtained with the relation fitting of mass parameter by visual quality fraction;
Compression unit, for using mass parameter desired value, is entered with the compression algorithm to the original image Row compression.
From above technical scheme, in embodiments herein, with Gaussian function fitting compression image The mapping relations of the mass parameter that visual effect is used with compression algorithm, are based on determining Gaussian function The mass parameter test value of parameter, the visual quality fraction of corresponding test image, obtain visual quality ginseng The corresponding mass parameter desired value of several preset target values, and original image is entered using mass parameter desired value Row compression such that it is able to be adapted to the compression quality parameter of the image for specific image selection, so that pressure Image after contracting has certain visual effect, has been reached on the premise of picture quality is ensured as high as possible Compression ratio, improve compression effectiveness.
Brief description of the drawings
Fig. 1 is the neighbouring relations schematic diagram of pixel between compression blocks in one example of the application;
Fig. 2 be actual visual quality fraction in one example of the application with the relation curve of mass parameter, With the contrast schematic diagram of the Gaussian function curve of fitting;
Fig. 3 is a kind of flow chart of method for compressing image in the embodiment of the present application;
Fig. 4 is a kind of hardware structure diagram of terminal or server;
Fig. 5 is a kind of building-block of logic of image compressing device in the embodiment of the present application.
Specific embodiment
Various image compression algorithms generally control the compression degree to image using mass parameter.With JPEG Quality in (Joint Photographic Experts Group, Joint Photographic Experts Group) compression algorithm As a example by the factor, JPEG removes redundancy in image using the mode for quantifying to be combined with lossless compression-encoding Information, by quality factor, JPEG can control quantization step, produce the pressure of different quality and size Contract drawing picture.Using same mass parameter different images are compressed when, compress image size and Quality often because in image clean mark and fuzzy, color change substantially with close to etc. factor different and There is certain difference.Therefore, if it is desired on the premise of compression image reaches certain visual effect as far as possible Raising compression ratio, it is critical only that for certain specific image, selection is adapted to the compression quality of the image Parameter.
In embodiments herein, the visual effect of compressed images is weighed using visual quality fraction. Visual quality fraction can be generated by an index to several reflection visual effects, according to practical application The need for scene, can be using the evaluation index of various picture qualities in the prior art, it would however also be possible to employ from The image quality evaluation index of definition generates visual quality fraction.For example, can select to reflect compression figure Visual quality fraction is generated as the index of visual continuity and the index of reflection compression image clearly degree. The specific algorithm for generating visual quality fraction can also determine according to application scenarios, for example, can will be several The product of individual selected index is used as visual quality fraction, it is also possible to make the exponential weighting product of selected index It is visual quality fraction.
For such as JPEG, BPG (Better Portable Graphics, more preferable portable figure), The splits' positions such as WEBP (a kind of while there is provided lossy compression method and the picture file format of Lossless Compression) Algorithm, can be according to the saltus step journey between compression intensity of variation, each compression blocks of the image relative to original image Spend with the intensity of variation inside compression blocks to determine visual quality fraction.In other words, visual quality fraction can With by reflection compression image (S is set to relative to the index of the intensity of variation of original imagePWD), reflect each pressure The index of the saltus step degree between contracting block (is set to SAAE) and reflection compression blocks inside intensity of variation finger Mark (is set to STD) generate.
Wherein, SPWDThe change of divergence of overall importance of original image and compression image is embodied, when two figures Global sex differernce it is big to a certain extent after, the visual effect of compression image can be significantly affected;Splits' positions are calculated " disconnected line " phenomenon between method is likely to result in compression blocks in compression process (belongs to different compression blocks Adjacent pixel jumping phenomenon), cause compress image visual effect be deteriorated, SAAEIt is used for embodying The change of compression blocks marginal information;When compression quality parameter is too low, mould occurs inside compression blocks The situation of paste so that compression image seems unintelligible, STDSchemed with compression using the compression blocks in original image Compression blocks as in carry out the degree that inner vein relatively embodies change.Above three index has reacted figure The global perception of picture, local edge are perceived and local a sense of texture is known, people has been reacted well to the comprehensive of image Close visually-perceptible.
Similar, these three indexs can be using the image matter of the existing same content of reflection in the prior art Figureofmerit, it is also possible to self-defining, provides a specific example of these three indexs individually below.
Index S to reflection compression image relative to the intensity of variation of original imagePWD, existing skill can be based on PSNR (Peak Signal to Noise Ratio, Y-PSNR) index in art, using setting in advance Fixed snr threshold THRPSNRAfter being normalized to PSNR, S is obtainedPWD
PSNR embodies the mean square error between original image and compression image, a kind of specific computational methods For:Corresponding each pixel obtains difference I in subtracting compression image with each pixel in original imageD, difference Can be the difference, or RGB (Red, Green, Blue, RGB) of each grey scale pixel value The difference of value.Assuming that M, N are respectively picture traverse and height in units of pixel, MAXIFor institute There is difference I in pixelDMaximum, then PSNR can be calculated by formula 1:
Formula 1
According to formula 2, using snr threshold THRPSNRPSNR is normalized, S is obtainedPWD
Formula 2
The index S of the saltus step degree reflected between each compression blocksAAEA kind of computational methods be:Belong to different Continuity ratio is no more than continuity threshold value THR between the block of the neighbor pixel of compression blocksAAEPoint it is right Number, accounts for ratio of all neighbor pixels for belonging to different compression blocks to number;Wherein, it is continuous between block Property ratio is:Belong to the difference and the point between the laterally or longitudinally neighbor pixel pair of different compression blocks To two pixels and in respective compression blocks the difference sum of adjacent pixel in the same direction ratio.
By taking JPEG splits' positions algorithms as an example, 8*8 is divided the image into when JPEG compression quantization encoding Fritter carry out.Assuming that compression blocks A, compression blocks B, compression blocks C and compression blocks D are a compressions Partial shrinkage block in image, each compression blocks include the pixel of 8*8.For example, in compression blocks A Pixel includes:A11, A12To A18;A21, A22To A28;Until A81, A82To A88Totally 64 pixels. Compression blocks A, B, C, D neighbouring relations therebetween are as shown in Figure 1.
Belong to the pixel A of compression blocks A18With the pixel B for belonging to compression blocks B11It is horizontal neighbor pixel Right, continuity ratio can be calculated by formula 3 between its block:
Formula 3
Belong to the pixel A of compression blocks A81With the pixel C for belonging to compression blocks C11It is the neighbor pixel of longitudinal direction Right, continuity ratio can be calculated by formula 4 between its block:
Formula 4
Refer to formula 3 and formula 4 calculates in the compression image all laterally adjacent pixels pair and all vertical To neighbor pixel block continuity ratio.
Assuming that the width of the compression image in units of pixel and height are respectively M, N, the compression figure As being divided into K*L compression blocks, then the compression image has that (K-1) * is N number of to belong to different compression blocks Laterally adjacent pixel pair, M longitudinally adjacent pixel pair for belonging to different compression blocks of total (L-1) *, The S of the imageAAEIndex can be calculated by formula 5:
Formula 5
Wherein, AAE is the mark value of the neighbor pixel pair for belonging to different compression blocks:Work as neighbor pixel Block continuity ratio be no more than continuity threshold value THRAAEWhen, the AAE of the neighbor pixel pair It is 1 to be worth, otherwise it is assumed that the continuity between the neighbor pixel pair is destroyed, its AAE value is 0.
The index S of the intensity of variation inside reflection compression blocksTDA kind of computational methods be:Calculate original image block Interior change average value VARIWith change average value VAR in compressed picture blocksTRatio change lower limit in block Threshold value VARTD1With change upper limit threshold VAR in blockTD2Between compression blocks, account for the ratio of all compression blocks. Wherein, change average value VAR is in block:The difference of each pixel and all pixels average in compression blocks After totalling, the ratio with number of pixels in compression blocks.
Specifically, it is assumed that the width and height of compression blocks in an image in units of pixel Respectively M, N, then the average MEAN inside the compression blocks can be drawn by formula 6:
Formula 6
Wherein, I (m, n) is the value (can be gray value or rgb value) of pixel (m, n).
Change average value VAR can be drawn by formula 7 in the block of the compression blocks:
Formula 7
Each compression blocks is calculated respectively changes average value VAR in the block in original imageIAnd each compression blocks Change average value VAR in block in image is compressedT
Assuming that having T compression blocks in the compression image, the S of the compression image can be drawn by formula 8TD
Formula 8
Wherein, when a compression blocks change average value VAR in block in original imageIAnd the compression blocks exist Change average value VAR in block in compression imageTRatio when meeting formula 9, the S of the compression blocksblockTDFor 1, the otherwise S of the compression blocksblockTDIt is 0:
Formula 9
In above three example, snr threshold THRPSNR, continuity threshold value THRAAE, change in block Lower threshold VARTD1With change upper limit threshold VAR in blockTD2Specific value, can be according to concrete application Scene is realized determining.
A kind of computational methods based on above-mentioned formula 2, formula 5 and the middle finger target visual quality fraction s of formula 8 can With such as formula 10:
S=(SPWD)α*(SAAE)β*(STD)γFormula 10
Wherein, α, β and γ are three weighting parameters of index, can be carried out according to concrete application scene Regulation, the value of regulation can be determined by realizing.In application scenes, it is convenient for the sake of, can be with Make alpha+beta+γ=1.
For a specific image, (pressed with the different same compression algorithms of mass parameter application Except mass parameter changes in compression algorithm, other specification is constant), can obtain corresponding to mass parameter Compression image, the visual quality fraction of the compression image is the visual quality point corresponding to mass parameter Number.Mass parameter is represented with Q, visual quality fraction is represented with s, foot is chosen in the span of Q Enough values are compressed, it is possible to obtain the relation curve of Q and s.
By inventor to different images, a large amount of compressed detecteds of different visual quality fraction generating modes, Statistics finds:For same original image, same compression algorithm, the mass parameter used during compression with The relation for compressing the visual quality fraction of image can be fitted to Gaussian function;The height of different image fittings This function often has different parameters.
In a kind of implementation of the embodiment of the present application, Gaussian function uses the probability density letter of normal distribution Several expression-forms, as shown in Equation 11:
Formula 11
Wherein, μ, k, σ are the parameter of the Gaussian function.
It is the process of Gaussian function by actual Q-s curve matchings, actually determines to best match to actual Q-s The parameter μ of curve, the process of k, σ.It is the fitting precision needed according to concrete application scene, can be by Undetermined parameter when these three parameters are all as fitting, it is also possible in these three variables is set to and is set Definite value, using remaining two parameters as fitting when undetermined parameter.For example, μ is set into setting value can The need for meet major applications scene.
For a determination s value, the compression of gained is compressed with corresponding Q on actual Q-s curves Image and with according to be fitted the curve Gaussian function determine Q be compressed gained compression image, Therebetween difference visually can identification very little.For example in fig. 2, the span of Q is 0 To 100, several different Q values are chosen, obtain compressing image after being compressed same original image Visual quality fraction s value, to mark be point by each Q-s value, several Q-s values are to shape Into the actual Q-s curves of point-like.Solid line in Fig. 2 is the Gaussian function curve for being fitted Q-s curves. When s values are 0.9, correspondence Q values are 80 on actual Q-s curves, and the Gaussian function curve being fitted Upper corresponding Q values are 74, are schemed with using obtained by Q=80 compressions using image obtained by Q=74 compressions As almost not seeing difference visually.
So, in embodiments herein, visual quality fraction can be selected according to concrete application scene Preset target value st, the usual preset target value can make the visual effect of compressed images meet actual The minimum requirements of application;Assuming that the Gaussian function of fitting Q-s curves has n undetermined parameter, can use The test value of n Q is compressed to original image, obtains corresponding n s values;With n known Q-s Value is to obtaining the value of n undetermined parameter of the image Gaussian function;Afterwards can be according to the Gaussian function Calculate stCorresponding mass parameter desired value Qt, using QtOriginal image is compressed, you can realize full Compression ratio as far as possible high is used on the premise of visual effect needed for foot application, to reduce the rule of image file Mould.
Embodiments herein proposes a kind of new method for compressing image, and its flow is as shown in Figure 3.The party Method can be applied in any equipment with computing capability, such as terminal or server.Wherein, terminal can Being the equipment such as mobile phone, panel computer, PC (Personal Computer, PC), notebook; Server can be physically or logically server, not limit.
Step 310, using the test value of at least one mass parameter, is compressed original image with compression algorithm It is test image.
As it was previously stated, being treated in Gaussian function of the number of mass parameter s test values according to fitting Q-s curves Determine the number of parameter to determine.Due to original image Q values and s values can as determine Gaussian function in treat A Q-s value for determining parameter is right, if the number of undetermined parameter is n in Gaussian function, as long as using (n-1) Individual test value, (n-1) second compression is carried out to original image, obtain (n-1) individual test Q-s values to. It is of course also possible to use it is more than (n-1) individual test value, to improve the levels of precision of fitting.
Step 320, visual quality fraction, corresponding mass parameter test value, base according to test image Determine the corresponding mass parameter desired value of the preset target value of visual quality fraction in Gaussian function.Wherein, Visual quality fraction is used for weighing the visual effect of compressed images, Gaussian function by visual quality fraction with The relation fitting of mass parameter is obtained.
The index of the reflection visual effect used according to visual quality fraction and according to these quota students Into the mode of visual quality fraction, the visual quality fraction of each test image is calculated, and obtain the test It is right that the mass parameter test value for being used of image forms a Q-s value.
Using Q-s values are tested to, the Gaussian function expression formula including undetermined parameter, vision matter can be obtained Measure the preset target value s of fractiontCorresponding mass parameter desired value Qt.Specific calculating process the application's Embodiment is not limited, for example, Q-s values that can first according to test image are to calculating for being fitted Q-s The undetermined parameter of the Gaussian function of relation, then by stGaussian function known to substituting into parameter, calculates Qt; Can also first derive with several Q-s values to, stTo calculate QtExpression formula, by actual test chart As Q-s values Q is can obtain to substituting into the expression formulat.It should be noted that may make in calculating process With the Q values and s values of original image.
Step 330, using mass parameter desired value, is compressed with the compression algorithm to the original image.
Mass parameter desired value Q is being obtained by Gaussian functiontAfterwards, by QtIt is applied to the pressure in step 310 Compression algorithm, is compressed to original image, you can be met the preset target value s of visual quality fractiont's Compression image.
It can be seen that, in embodiments herein, original image is compressed using the test value of mass parameter s Obtain test Q-s values it is right, using test Q-s values to can determine be fitted original image Q-s relations height This function, to calculate the preset target value s corresponding to visual quality fractiontCorresponding mass parameter mesh Scale value Qt, using QtIt is as small as possible to compress original image, you can obtain in the case where visual effect requirement is met Compression image, so as to compression image quality and compression ratio between reach good balance.
In an application example of the application, the computational methods of visual quality fraction s are the table in formula 10 Up to formula:
S=(SPWD)α*(SAAE)β*(STD)γFormula 10
Wherein, alpha+beta+γ=1.
Using the Gaussian function in formula 11 come the Q-s relations of fitting compaction image:
Formula 11
In this application example, μ is set to setting value 1.0;K and σ is undetermined parameter, its actual value and survey Visual quality fraction, the corresponding mass parameter test value for attempting picture are related.
Assuming that to an image and JPEG compression algorithm, two different quality parameter Q values correspond to two S values, obtain (s1, Q (s1)) and (s2, Q (s2)) two Q-s values are right.By the two Q-s values to substituting into Formula 11, parameter k can be removed by being divided by, such as formula 12:
Formula 12
To the preset target value s of visual quality fractiontWith corresponding mass parameter desired value QtIt is worth right, formula 13 Set up:
Formula 13
Parameter σ in subtractive 13 and formula 12, can obtain calculating Q (st) formula 14:
Formula 14
In this application example, using the Q values of original image and corresponding s values as (s1, Q (s1)) value pair, then s1=1, Q (s1)=100.When certain original image is compressed, original image Q (s are different from one1) Q (s2) As mass parameter test value, with JPEG compression algorithm by the original image boil down to test image.With formula The 10 visual quality fraction s for drawing test image2, obtain (s2, Q (s2)) value pair.By s1、Q(s1)、s2、 Q(s2) and visual quality parameter preset target value stSubstitution formula 14, obtains corresponding to stQ (st).Using With QtIt is the JPEG compression compression algorithm original image of mass parameter, you can obtain final compression image.
So, tested only by first compression, it is possible to the Q values needed for obtaining final compression, to meter Equipment (such as mobile phone) limited in one's ability and requirement of real-time application scenario high, compress the performance of image Great guarantee is obtained.
Corresponding with the realization of above-mentioned flow, embodiments herein additionally provides one kind and applies in terminal or service Image compressing device on device.The device can be realized by software, it is also possible to by hardware or soft or hard The mode that part is combined is realized.It is by terminal as the device on logical meaning as a example by implemented in software Or the CPU (Central Process Unit, central processing unit) of server is by corresponding computer program Instruction runs what is formed in reading internal memory.From for hardware view, except the CPU shown in Fig. 4, interior Deposit and nonvolatile memory outside, terminal where the device generally also includes for carrying out wireless communication Number chip etc. of transmitting-receiving other hardware, the server where the device is generally also included for realizing that network leads to Other hardware such as board of telecommunication function.
Fig. 5 show a kind of device of compression of images of the embodiment of the present application offer, including test image list Unit, mass parameter target value cell and compression unit, wherein:Test image unit is used to use at least one The test value of individual mass parameter, with compression algorithm by original image boil down to test image;Mass parameter target Value cell is used for visual quality fraction, corresponding mass parameter test value according to test image, based on height This function determines the corresponding mass parameter desired value of the preset target value of visual quality fraction;The vision matter Amount fraction is used for weighing the visual effect of compressed images;The Gaussian function is by visual quality fraction and matter The relation fitting for measuring parameter is obtained;Compression unit is used to use mass parameter desired value, is calculated with the compression Method is compressed to the original image.
In one example, the compression algorithm includes:Splits' positions algorithm;The visual quality fractional root The saltus step between index, each compression blocks of reflection according to reflection compression image relative to the intensity of variation of original image The index of degree is generated with the index for reflecting the intensity of variation inside compression blocks.
In above-mentioned example, the reflection compression image includes relative to the index of the intensity of variation of original image: The value of gained after being normalized to the Y-PSNR PSNR of test image using snr threshold.
In above-mentioned example, the index of the saltus step degree between each compression blocks of reflection includes:Belong to different Continuity ratio is accounted for no more than the point of continuity threshold value to number between the block of the neighbor pixel of compression blocks Ratio of all neighbor pixels for belonging to different compression blocks to number;Continuity ratio is between described piece: Belong to difference and the point between the laterally or longitudinally neighbor pixel pair of different compression blocks to two Pixel and in respective compression blocks the difference sum of adjacent pixel in the same direction ratio.
In above-mentioned example, the index of the intensity of variation inside the reflection compression blocks includes:In original image block Change average value changes in lower threshold and block in block with the ratio of change average value in compressed picture blocks and becomes Change the compression blocks between upper limit threshold, account for the ratio of all compression blocks;Changing average value in described piece is: After each pixel is added up with the difference of all pixels average in compression blocks, the ratio with number of pixels in compression blocks Value.
Optionally, the Gaussian function is:
Wherein, Q (s) is mass parameter;S is visual quality fraction;μ is setting value;The value of k and σ with The visual quality fraction of test image, corresponding mass parameter test value are related.
Optionally, the mass parameter target value cell specifically for:Visual quality point according to original image Number s1And corresponding to s1Mass parameter Q (s1), the visual quality fraction s of test image2And and correspondence In s2Mass parameter Q (s2), the preset target value s of visual quality parameter is obtained according to following formulatCorresponding matter Amount parameter objectives value Q (st):
The preferred embodiment of the application is the foregoing is only, is not used to limit the application, it is all at this Within the spirit and principle of application, any modification, equivalent substitution and improvements done etc. should be included in Within the scope of the application protection.
In a typical configuration, computing device includes one or more processors (CPU), input/output Interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory And/or the form, such as read-only storage (ROM) or flash memory (flash RAM) such as Nonvolatile memory (RAM). Internal memory is the example of computer-readable medium.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be by appointing What method or technique realizes information Store.Information can be computer-readable instruction, data structure, program Module or other data.The example of the storage medium of computer include, but are not limited to phase transition internal memory (PRAM), Static RAM (SRAM), dynamic random access memory (DRAM), it is other kinds of with Machine accesses memory (RAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic rigid disk are stored or it His magnetic storage apparatus or any other non-transmission medium, can be used to store the letter that can be accessed by a computing device Breath.Defined according to herein, computer-readable medium does not include temporary computer readable media (transitory Media), such as the data-signal and carrier wave of modulation.
Also, it should be noted that term " including ", "comprising" or its any other variant be intended to it is non- It is exclusive to include, so that process, method, commodity or equipment including a series of key elements are not only wrapped Include those key elements, but also other key elements including being not expressly set out, or also include for this process, Method, commodity or the intrinsic key element of equipment.In the absence of more restrictions, by sentence " including One ... " key element that limits, it is not excluded that in the process including the key element, method, commodity or set Also there is other identical element in standby.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey Sequence product.Therefore, the application can using complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.And, the application can be used and wherein include calculating at one or more Machine usable program code computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, Optical memory etc.) on implement computer program product form.

Claims (14)

1. a kind of method of compression of images, it is characterised in that including:
Using the test value of at least one mass parameter, with compression algorithm by original image boil down to test image;
Visual quality fraction, corresponding mass parameter test value according to test image, based on Gaussian function Determine the corresponding mass parameter desired value of preset target value of visual quality fraction;The visual quality fraction For weighing the visual effect of compressed images;The Gaussian function is by visual quality fraction and mass parameter Relation fitting obtain;
Using mass parameter desired value, the original image is compressed with the compression algorithm.
2. method according to claim 1, it is characterised in that the compression algorithm includes:Piecemeal Compression algorithm;
The visual quality fraction according to reflection compression image relative to the intensity of variation of original image index, The index of the intensity of variation inside the index and reflection compression blocks of the saltus step degree reflected between each compression blocks is come Generation.
3. method according to claim 2, it is characterised in that the reflection compression image relative to The index of the intensity of variation of original image includes:Using snr threshold to the Y-PSNR of test image PSNR is normalized the value of rear gained.
4. method according to claim 2, it is characterised in that between each compression blocks of reflection The index of saltus step degree includes:Continuity ratio is not between the block of the neighbor pixel for belonging to different compression blocks More than continuity threshold value point to number, account for all neighbor pixels for belonging to different compression blocks to number Ratio;Continuity ratio is between described piece:Belong to the laterally or longitudinally neighbor pixel pair of different compression blocks Between difference and the point to two pixels and in respective compression blocks adjacent pixel in the same direction difference The ratio of different sum.
5. method according to claim 2, it is characterised in that the change inside the reflection compression blocks The index of change degree includes:The ratio of change average value and the interior change average value of compressed picture blocks in original image block It is worth the compression blocks for changing in block and changing between upper limit threshold in lower threshold and block, accounts for all compression blocks Ratio;Changing average value in described piece is:Each pixel adds with the difference of all pixels average in compression blocks The ratio of number of pixels in the General Logistics Department, with compression blocks.
6. the method according to claim 1 to 5 any one, it is characterised in that the Gaussian function Number is:
Q ( s ) = k 2 π σ exp ( - ( s - μ ) 2 2 σ 2 )
Wherein, Q (s) is mass parameter;S is visual quality fraction;μ is setting value;The value of k and σ with The visual quality fraction of test image, corresponding mass parameter test value are related.
7. method according to claim 6, it is characterised in that the vision according to test image Mass fraction, corresponding mass parameter test value, the preset of visual quality fraction is determined based on Gaussian function The corresponding mass parameter desired value of desired value, including:Visual quality fraction s according to original image1And correspondence In s1Mass parameter Q (s1), the visual quality fraction s of test image2And and corresponding to s2Quality Parameter Q (s2), the preset target value s of visual quality parameter is obtained according to following formulatCorresponding mass parameter target Value Q (st):
Q ( s t ) = Q ( s 1 ) exp ( l n Q ( s 1 ) Q ( s 2 ) * ( s 1 - s t ) ( s 1 + s t - 2.0 ) ( s 2 - s 1 ) ( s 2 + s 1 - 2.0 ) )
8. a kind of device of compression of images, it is characterised in that including:
Test image unit, for the test value using at least one mass parameter, with compression algorithm by original Compression of images is test image;
Mass parameter target value cell, for the visual quality fraction according to test image, corresponding quality Parameter testing value, the corresponding mass parameter of preset target value of visual quality fraction is determined based on Gaussian function Desired value;The visual quality fraction is used for weighing the visual effect of compressed images;The Gaussian function Obtained with the relation fitting of mass parameter by visual quality fraction;
Compression unit, for using mass parameter desired value, is entered with the compression algorithm to the original image Row compression.
9. device according to claim 8, it is characterised in that the compression algorithm includes:Piecemeal Compression algorithm;
The visual quality fraction according to reflection compression image relative to the intensity of variation of original image index, The index of the intensity of variation inside the index and reflection compression blocks of the saltus step degree reflected between each compression blocks is come Generation.
10. device according to claim 9, it is characterised in that the reflection compression image is relative Include in the index of the intensity of variation of original image:Using snr threshold to the Y-PSNR of test image PSNR is normalized the value of rear gained.
11. devices according to claim 9, it is characterised in that between each compression blocks of reflection The index of saltus step degree include:Continuity ratio between the block of the neighbor pixel for belonging to different compression blocks No more than continuity threshold value point to number, account for all neighbor pixels for belonging to different compression blocks to number Ratio;Continuity ratio is between described piece:Belong to the laterally or longitudinally neighbor pixel of different compression blocks Difference and the point between to two pixels and the adjacent pixel in the same direction in respective compression blocks The ratio of difference sum.
12. devices according to claim 9, it is characterised in that inside the reflection compression blocks The index of intensity of variation includes:Change average value and change average value in compressed picture blocks in original image block The compression blocks that ratio changes in lower threshold and block between changing upper limit threshold in block, account for all compression blocks Ratio;Changing average value in described piece is:The difference of each pixel and all pixels average in compression blocks After totalling, the ratio with number of pixels in compression blocks.
13. device according to claim 8 to 12 any one, it is characterised in that the Gauss Function is:
Q ( s ) = k 2 π σ exp ( - ( s - μ ) 2 2 σ 2 )
Wherein, Q (s) is mass parameter;S is visual quality fraction;μ is setting value;The value of k and σ with The visual quality fraction of test image, corresponding mass parameter test value are related.
14. devices according to claim 13, it is characterised in that the mass parameter desired value list Unit specifically for:Visual quality fraction s according to original image1And corresponding to s1Mass parameter Q (s1), one The visual quality fraction s of individual test image2And and corresponding to s2Mass parameter Q (s2), obtained according to following formula The preset target value s of visual quality parametertCorresponding mass parameter desired value Q (st):
Q ( s t ) = Q ( s 1 ) exp ( l n Q ( s 1 ) Q ( s 2 ) * ( s 1 - s t ) ( s 1 + s t - 2.0 ) ( s 2 - s 1 ) ( s 2 + s 1 - 2.0 ) )
CN201511017681.3A 2015-12-29 2015-12-29 Image compression method and device Active CN106937117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511017681.3A CN106937117B (en) 2015-12-29 2015-12-29 Image compression method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511017681.3A CN106937117B (en) 2015-12-29 2015-12-29 Image compression method and device

Publications (2)

Publication Number Publication Date
CN106937117A true CN106937117A (en) 2017-07-07
CN106937117B CN106937117B (en) 2020-05-29

Family

ID=59442340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511017681.3A Active CN106937117B (en) 2015-12-29 2015-12-29 Image compression method and device

Country Status (1)

Country Link
CN (1) CN106937117B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930356A (en) * 2020-08-19 2020-11-13 百度(中国)有限公司 Method and device for determining picture format

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012078114A1 (en) * 2010-12-09 2012-06-14 Nanyang Technological University Method and an apparatus for determining vein patterns from a colour image
CN102917157A (en) * 2012-10-19 2013-02-06 北京快联科技有限公司 Image compression system and method based on human visual system
CN103810694A (en) * 2012-11-15 2014-05-21 腾讯科技(深圳)有限公司 Quality factor obtaining method and device in image compression

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012078114A1 (en) * 2010-12-09 2012-06-14 Nanyang Technological University Method and an apparatus for determining vein patterns from a colour image
CN102917157A (en) * 2012-10-19 2013-02-06 北京快联科技有限公司 Image compression system and method based on human visual system
CN103810694A (en) * 2012-11-15 2014-05-21 腾讯科技(深圳)有限公司 Quality factor obtaining method and device in image compression

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930356A (en) * 2020-08-19 2020-11-13 百度(中国)有限公司 Method and device for determining picture format
CN111930356B (en) * 2020-08-19 2024-03-26 百度(中国)有限公司 Method and device for determining picture format

Also Published As

Publication number Publication date
CN106937117B (en) 2020-05-29

Similar Documents

Publication Publication Date Title
Wang et al. A fast roughness-based approach to the assessment of 3D mesh visual quality
CN109118470B (en) Image quality evaluation method and device, terminal and server
Guarda et al. Point cloud coding: Adopting a deep learning-based approach
Liu et al. Model-based joint bit allocation between geometry and color for video-based 3D point cloud compression
Chen et al. Reference-free quality assessment of sonar images via contour degradation measurement
US20210166015A1 (en) Certificate image extraction method and terminal device
CN110139102B (en) Method, device, equipment and storage medium for predicting video coding complexity
CN109598299A (en) A kind of image similarity determines method, apparatus and electronic equipment
Li et al. Image coding quality assessment using fuzzy integrals with a three-component image model
CN103281537A (en) Compression method and device for dynamic range of image
Sandoub et al. A low‐light image enhancement method based on bright channel prior and maximum colour channel
CN107369138B (en) Image optimization display method based on high-order statistical model
CN106937117A (en) Method for compressing image and device
CN114049530A (en) Hybrid precision neural network quantization method, device and equipment
CN109409305A (en) A kind of facial image clarity evaluation method and device
CN115550658B (en) Data transmission method based on intelligent campus management platform
Yang et al. Subjective quality evaluation of compressed digital compound images
CN110458754B (en) Image generation method and terminal equipment
CN108765503B (en) Skin color detection method, device and terminal
CN113807330B (en) Three-dimensional sight estimation method and device for resource-constrained scene
CN114241350B (en) Video coding test sequence determining method, related device and computer program product
CN113313245B (en) Model processing method, system and device for shared learning and electronic equipment
US20170310970A1 (en) System and Method for Estimating View Synthesis Distortion
CN108776958A (en) Mix the image quality evaluating method and device of degraded image
CN108446850A (en) A kind of power supply enterprise's customer satisfaction evaluation method based on Partial Least Squares

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right