Summary of the invention
The object of the present invention is to provide a kind of image compression quality prediction method and system; It is the relation of utilizing between image compression quality and compression ratio and the image feature amount; Through predictor formula, prediction obtains the compression quality of image before coding, to be implemented under the situation of not carrying out encoding; The compression quality of any component of prediction reconstructed image, and be applicable to any coding standard or encoder.
A kind of image compression quality prediction method for realizing that the object of the invention provides comprises the following steps:
Step 100. is selected calculative picture content X in the image, and through calculating single order activity amount IAMD and the second order activity amount IAME of said picture content X, obtains the characteristic quantity IAMx of said picture content;
Step 200 according to input compression ratio CR and said IAMx, is calculated Y-PSNR PSNR, the predicted picture compression quality.
Said step 100 comprises the following steps:
Step 110 is selected calculative picture content X in the said image;
Step 120 is calculated the single order activity amount IAMD of said picture content X;
Step 130 is calculated the second order activity amount IAME of said picture content X;
Step 140 according to single order activity amount IAMD and the second order activity amount IAME of said picture content X, is calculated the component characteristic quantity IAMx of said picture content X, and computing formula is:
IAM
x=θ IAMD+ (1-θ) IAME, wherein θ is the ratio value of single order activity amount IAMD and second order activity amount IAME.
In the step 120, said single order activity amount IAMD is meant the weighted average of the absolute difference of each pixel among the said picture content X and 4 neighbors around it.
Said step 120 comprises the following steps:
The average absolute IAMD1 of the difference of the neighbor pixel of each pixel and its horizontal direction among the said picture content X of step 121. calculating, wherein:
(i is that component X is at (i, pixel value j) j) to x;
Step 122. is calculated the average absolute IAMD2 of the difference of the neighbor pixel of the perpendicular direction of each pixel among the said picture content X, wherein:
Step 123. is calculated the average absolute IAMD3 of the difference of each pixel neighbor pixel bottom-right with it among the said picture content X, wherein:
The average absolute IAMD4 of the difference of the neighbor pixel of each pixel and its lower left among the said picture content X of step 124. calculating, wherein:
Step 125. is calculated the weighted sum of said IAMD1, IAMD2, IAMD3 and IAMD4, obtains the single order activity amount IAMD of said picture content X, wherein:
IAMD=wd
1* IAMD1+wd
2* IAMD2+wd
3* IAMD3+wd
4* IAMD4, wd
1, wd
2, wd
3And wd
4Be weight coefficient.
In the step 125, said wd
1, wd
2, wd
3And wd
4Span between 0 to 1.
Said second order activity amount IAME is meant the weighted average of the absolute difference of each pixel among the said picture content X and 8 neighbors around it.
Said step 130 comprises the following steps:
Step 131. is calculated the average absolute IAME1 of the difference of the pixel of 1 pixel of each pixel and its horizontal direction interval among the said picture content X, wherein:
(i is that component X is at (i, pixel value j) j) to x;
Step 132. is calculated the average absolute IAME2 of the difference of the pixel of 1 pixel in each pixel perpendicular direction interval among the said picture content X, wherein:
Step 133. is calculated the average absolute IAME3 of the difference of the pixel of each pixel diagonal upper right with it among the said picture content X, wherein:
Step 134. is calculated the average absolute IAME4 of the difference of the pixel of 1 pixel of each pixel and interval, its lower right among the said picture content X, wherein:
The average absolute IAME5 of the difference of the pixel of each pixel and its diagonal direction among the said picture content X of step 135. calculating, wherein:
Step 136. is calculated each pixel and its left average absolute IAME6 of the difference of the pixel of diagonal down among the said picture content X, wherein:
Step 137. is calculated the average absolute IAME7 of the difference of the pixel of 1 pixel of each pixel and interval, its lower left among the said picture content X, wherein:
Step 138. is calculated the average absolute IAME8 of the difference of the pixel of each pixel diagonal upper left with it among the said picture content X, wherein:
Step 139. is calculated the weighted sum of said IAME1, IAME2, IAME3, IAME4, IAME5, IAME6, IAME7 and IAME8, obtains the second order activity amount IAME of said picture content X, wherein:
IAME=we
1* IAME1+we
2* IAME2+we
3* IAME3+we
4* IAME4+we
5* IAME5+we
6* IAME6+we
7* IAME7+we
8* IAME8, we
1, we
2, we
3, we
4, we
5, we
6, we
7And we
8Be weight coefficient.
In the step 139, said we
1, we
2, we
3, we
4, we
5, we
6, we
7And we
8Span between 0 to 1.
In the step 140, the span of said θ is between 0 to 1.
Said step 200 comprises the following steps:
Step 210 is according to said input compression ratio CR, the value of computing function α;
Step 220 is according to said input compression ratio CR, the value of computing function β;
Step 230, according to the value of said function alpha and the value of function β, and said IAMx, utilize formula PSNR=α ln (IAM
x)+β calculates said Y-PSNR PSNR, the predicted picture compression quality.
Said function alpha is calculated according to the input compression ratio CR, and function alpha is the piecewise function of said input compression ratio, and parameter value wherein depends on the coded system of image, and under the different coding mode, the parameter in the function alpha is different.
The form of said function alpha is:
Wherein b is the cut off value of input compression ratio CR in the function alpha, for greater than 1 real number.
Said function β calculates according to the input compression ratio CR, and function β is the piecewise function of said input compression ratio, and parameter value wherein depends on the coded system of image, and under the different coding mode, the parameter among the function β is different.
The form of said function β is:
C wherein
1And c
2Be the cut off value of input compression ratio CR among the function β, for greater than 1 real number and satisfy 1<c
1<c
2
Be to realize the object of the invention, a kind of image compression quality prediction system also is provided, said system comprises: characteristic quantity acquisition module and image compression quality prediction module, wherein:
Said characteristic quantity acquisition module is used to obtain the characteristic quantity IAMx of the picture content X of original image;
Said image compression quality prediction module is used for the characteristic quantity IAMx according to input compression ratio CR and said component, calculates Y-PSNR PSNR, the predicted picture compression quality.
Said characteristic quantity acquisition module comprises:
Picture content is selected module, is used for selecting the calculative picture content X of original image;
Single order activity amount computing module is used to calculate the single order activity amount IAMD of said picture content X;
Second order activity amount computing module is used to calculate the second order activity amount IAME of said picture content X;
The characteristic quantity computing module is used for single order activity amount IAMD and second order activity amount IAME according to said picture content X, calculates the component characteristic quantity IAMx of said picture content X.
Said image compression quality prediction module comprises:
The function alpha computing module is used for the value according to input compression ratio CR computing function α;
Function β computing module is used for the value according to input compression ratio CR computing function β;
The Y-PSNR computing module is used for according to the value of said function alpha and the value of function β, and said IAMx, utilizes formula PSNR=α ln (IAM
x)+β calculates said Y-PSNR PSNR, the predicted picture compression quality.
The invention has the beneficial effects as follows: the compression quality of any component under given compression ratio that can before coding, calculate given image; And need behind coding, not obtain compression quality, the relative image compression of amount of calculation, decompression, reconstructed image quality are calculated simple.Be applicable to any coding standard or encoder.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, a kind of image compression quality prediction method of the present invention and system are further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
A kind of image compression quality prediction method of the present invention and system are a kind of under the situation of not encoding, the application that image compression quality is predicted.It is the component characteristic quantity and input compression ratio, computed image compression quality that utilizes original image.Be applicable to any coding standard or encoder.
Introduce a kind of image compression quality prediction method of the present invention in detail below in conjunction with above-mentioned target, Fig. 1 is the flow chart of a kind of image compression quality prediction method of the present invention, and is as shown in Figure 1, and said method comprises the following steps:
Step 100. is selected calculative picture content X in the original image, and through calculating single order activity amount IAMD and the second order activity amount IAME of said picture content X, obtains the characteristic quantity IAMx of said picture content;
Fig. 2 is the flow chart of the characteristic quantity IAMx of computed image component among the present invention, and Fig. 3 a and Fig. 3 b are respectively the pixel relationship figure of single order activity amount IAMD and second order activity amount IAME among the present invention; Shown in Fig. 2, Fig. 3 a and Fig. 3 b, said step 100 comprises the following steps:
Step 110 is selected calculative picture content X in the original image;
But,, select gray value for gray-scale map as a kind of execution mode; For the RGB image, can select any in R component, G component or the B component; For the YUV image, can select any in Y, U, the V component.Though the system of selection of other many component types image is not here enumerated, it is still within this patent interest field.
Step 120 is calculated the single order activity amount IAMD of said picture content X;
Said single order activity amount IAMD is the weighted average of the absolute difference of 4 neighbors around each pixel and its among the said picture content X, and computational methods are following:
Wherein, M and N are the height and the width of original image; (i is that picture content X is at (i, pixel value j) j) to x; Wd
1, wd
2, wd
3And wd
4Be weight coefficient, its span is between 0 to 1.
Fig. 4 is the flow chart of the single order activity amount IAMD of computed image component X among the present invention, and like Fig. 3, shown in Figure 4, said step 120 comprises the following steps:
The average absolute IAMD1 of the difference of the neighbor pixel of each pixel and its horizontal direction among the said picture content X of step 121. calculating, wherein:
Step 122. is calculated the average absolute IAMD2 of the difference of the neighbor pixel of the perpendicular direction of each pixel among the said picture content X, wherein:
Step 123. is calculated the average absolute IAMD3 of the difference of each pixel neighbor pixel bottom-right with it among the said picture content X, wherein:
The average absolute IAMD4 of the difference of the neighbor pixel of each pixel and its lower left among the said picture content X of step 124. calculating, wherein:
Step 125. is calculated the weighted sum of said IAMD1, IAMD2, IAMD3 and IAMD4, obtains the single order activity amount IAMD of said picture content X, wherein:
IAMD=wd
1×IAMD1+wd
2×IAMD2+wd
3×IAMD3+wd
4×IAMD4。
Step 130 is calculated the second order activity amount IAME of said picture content X;
Said second order activity amount IAME is the weighted average of the absolute difference of 8 neighbors around each pixel and its among the said picture content X, and computational methods are following:
Wherein, M and N are the height and the width of original image; (i is that picture content X is at (i, pixel value j) j) to x; We
1, we
2, we
3, we
4, we
5, we
6, we
7And we
8Be weight coefficient, its span is between 0 to 1.
Fig. 5 is the flow chart of the second order activity amount IAME of computed image component X among the present invention, like Fig. 3, shown in Figure 5, calculates the second order activity amount IAME of said picture content X, comprises the following steps:
Step 131. is calculated the average absolute IAME1 of the difference of the pixel of 1 pixel of each pixel and its horizontal direction interval among the said picture content X, wherein:
Step 132. is calculated the average absolute IAME2 of the difference of the pixel of 1 pixel in each pixel perpendicular direction interval among the said picture content X, wherein:
Step 133. is calculated the average absolute IAME3 of the difference of the pixel of each pixel diagonal upper right with it among the said picture content X, wherein:
Step 134. is calculated the average absolute IAME4 of the difference of the pixel of 1 pixel of each pixel and interval, its lower right among the said picture content X, wherein:
The average absolute IAME5 of the difference of the pixel of each pixel and its diagonal direction among the said picture content X of step 135. calculating, wherein:
Step 136. is calculated each pixel and its left average absolute IAME6 of the difference of the pixel of diagonal down among the said picture content X, wherein:
Step 137. is calculated the average absolute IAME7 of the difference of the pixel of 1 pixel of each pixel and interval, its lower left among the said picture content X, wherein:
Step 138. is calculated the average absolute IAME8 of the difference of the pixel of each pixel diagonal upper left with it among the said picture content X, wherein:
Step 139. is calculated the weighted sum of said IAME1, IAME2, IAME3, IAME4, IAME5, IAME6, IAME7 and IAME8, obtains the second order activity amount IAME of said picture content X, wherein:
IAME=we
1×IAME1+we
2×IAME2+we
3×IAME3+we
4×IAME4+we
5×IAME5+we
6×IAME6+we
7×IAME7+we
8×IAME8。
Step 140 according to single order activity amount IAMD and the second order activity amount IAME of said picture content X, is calculated the component characteristic quantity IAMx of said picture content X;
Said component characteristic quantity IAMx is the weighted sum of single order activity amount IAMD and second order activity amount IAME:
IAM
x=θIAMD+(1-θ)IAME
Wherein, θ is the ratio value of two activity amounts, and its span is between 0 to 1.
Step 200 according to input compression ratio CR and said IAMx, is calculated Y-PSNR PSNR, the predicted picture compression quality.
Preferably, the present invention utilizes the image compression quality characteristics relevant with characteristics of image and compression ratio, sets up the image compression quality prediction formula:
PSNR=αln(IAM
x)+β
Wherein, α and β are the functions about compression ratio CR.
For image compression quality prediction formula provided by the invention is described: PSNR=α ln (IAM
xThe accuracy of)+β is enumerated the relativity instance of a predicted picture compression quality and real image compression quality below.
Fig. 6 is an enforcement illustration of test pattern among the present invention.As shown in Figure 6, from the standard testing image, choose 6 width of cloth images arbitrarily, it is carried out the image compression quality prediction of luminance component.For effect of the present invention is described better, Fig. 6 has only provided its luminance component figure, and its resolution of shown test pattern is respectively:
Lena:512×512;Goldhill:720×576;BIKE:2048×2560;
:2048×2560;Crowrun:1920×1080;oldtowncross:1920×1080。
Fig. 7 is the predicted picture compression quality of test pattern among the present invention and the relativity figure of real image compression quality; As shown in Figure 7; Provided image shown in Figure 6; Adopt 5 grade of 9/7 wavelet transformation to encode, compression ratio is when scope was interior in 10: 1 to 100: 1, the picture quality (ActualPSNR) that image compression forecast quality in the embodiment of the invention (Predicted PSNR) and the reconstruction of employing JPEG2000 encoder compresses obtain and the graph of a relation of compression ratio.Under different compression ratios, the compression quality that embodiment of the invention prediction obtains and the difference of actual compression quality are usually less than 1dB for pictures different, and difference is about 2dB under the individual cases.Explain and utilize image compression quality prediction formula of the present invention:
PSNR=α ln (IAM
xThe predicted picture compression quality that)+β obtains and the error of actual compression quality are very little, can be used for the predicted picture compression quality.
Fig. 8 is the flow chart of the method for evaluate image compression quality among the present invention, and is as shown in Figure 8, and said step 200 comprises the following steps:
Step 210 is according to the value of said input compression ratio CR computing function α;
Among the present invention, said function alpha is calculated according to the input compression ratio CR, and function alpha is the piecewise function of said input compression ratio, and its functional form can be once linear function, secondary linear function, inverse ratio function etc.
In the said function alpha, values of parameters depends on the coded system of original image, and under the different coding mode, the parameter in the function alpha is different.
Preferably, the present invention provides a kind of piecewise function form of function alpha, though other functional form is not enumerated in this manual one by one, but still is included within this patent interest field.
Wherein, a
1, a
2, a
3, a
4And a
5Function parameter when being computing function α, a
1And a
4For greater than 0 real number, a
2, a
3And a
5For less than 0 real number; B is the cut off value of input compression ratio CR in the function alpha, for greater than 1 real number.
Step 220 is according to said input compression ratio CR, the value of computing function β.
Among the present invention, said function β calculates according to the input compression ratio CR, and said function β is the piecewise function of input compression ratio, and its functional form can be once linear function, secondary linear function, inverse ratio function etc.
Among the said function β, values of parameters depends on the coded system of original image, and under the different coding mode, the parameter among the function β is different.
Preferably, the present invention provides a kind of piecewise function form of β, though other functional form is not enumerated in this manual one by one, but still is included within this patent interest field.
Wherein, d
1, d
2, d
3, d
4, d
5And d
6Function parameter when being computing function β, d
1, d
3And d
5For less than 0 real number, d
2, d
4And d
6For greater than 0 real number; c
1And c
2Be the cut off value of input compression ratio CR among the function β, for greater than 1 real number and satisfy 1<c
1<c
2
Step 230, according to the value of said function alpha and the value of function β, and said IAMx, utilize formula PSNR=α ln (IAM
x)+β calculates said Y-PSNR PSNR, the predicted picture compression quality.
Under the different coding standard, utilize formula PSNR=α ln (IAM
x)+β calculates the value of the PSNR under this coding standard, and for the PSNR value that obtain of same image under the different coding mode, the PSNR value is big more, and this coding standard hypograph compression quality is good more.
Corresponding to a kind of image compression quality prediction method of the present invention; A kind of image compression quality prediction system also is provided, and it is the relation of utilizing between image compression quality and compression ratio and the image feature amount, through predictor formula; Prediction obtains the compression quality of image before coding, does not need coding.
Fig. 9 is the structural representation of a kind of image compression quality prediction of the present invention system, and is as shown in Figure 9, and said image compression quality prediction system comprises: characteristic quantity acquisition module 1 and image compression quality prediction module 2, wherein:
Said characteristic quantity acquisition module 1 is used to obtain the characteristic quantity IAMx of the picture content X of original image;
Said characteristic quantity acquisition module 1 comprises:
Picture content is selected module 11, is used for selecting the calculative picture content X of original image;
Single order activity amount computing module 12 is used to calculate the single order activity amount IAMD of said picture content X;
Second order activity amount computing module 13 is used to calculate the second order activity amount IAME of said picture content X;
Characteristic quantity computing module 14 is used for single order activity amount IAMD and second order activity amount IAME according to said picture content X, calculates the component characteristic quantity IAMx of said picture content X.
Said image compression quality prediction module 2 is used for the characteristic quantity IAMx according to input compression ratio CR and said component, calculates Y-PSNR PSNR, the predicted picture compression quality.
Said image compression quality prediction module 2 comprises:
Function alpha computing module 21 is used for the value according to input compression ratio CR computing function α;
Function β computing module 22 is used for the value according to input compression ratio CR computing function β;
Y-PSNR computing module 23 is used for according to the value of said function alpha and the value of function β, and said IAMx, utilizes formula PSNR=α ln (IAM
x)+β calculates said Y-PSNR PSNR, the predicted picture compression quality.
But as a kind of execution mode, below with JPEG2000 as condensing encoder, illustrate a kind of image compression quality prediction method of the present invention and system.
With the Lena:512 among Fig. 6 * 512 images is example, calculates the PSNR value of the image of the coded system that adopts 5 grade of 9/7 wavelet transformation:
At first, select luminance component image Y.
Second step, the single order activity amount IAMD of calculating luminance component Y, wd
1, wd
2, wd
3And wd
4Value is respectively 1,1,0 and 0, and computational methods are following:
The 3rd step, the second order activity amount IAME of calculating luminance component Y, wherein, we
1, we
2, we
3, we
4, we
5, we
6, we
7And we
8Value be followed successively by 1,1,0,0,0,0,0 and 0.Computational methods are following:
The 4th step, the characteristic quantity IAM of calculating luminance component Y
x, IAM
xWeighted sum for single order activity amount and second order activity amount:
IAM
x=θIAMD+(1-θ)IAME
When the input compression ratio CR was 20, the value that makes θ was 1:
IAM
y=IAMD+0IAME=IAMD=9.7516
The 5th step, computing function α;
The function parameter of function alpha (CR): a
1=3.8767, a
2=-5.3574, a
3=-10.4811, a
4=0.011429 and a
5=-10.6108; The boundary value b of piecewise function is 24 in the function alpha (CR).Adopt following piecewise function form in the present embodiment:
When the input compression ratio CR is 20:
α(CR)=a
1/(CR+a
2)+a
3=3.8767/(20-5.3574)-10.4811≈-10.2163
The 6th step, computing function β, the function parameter of function β (CR):.d
1=-0.20454, d
2=64.1748, d
3=-0.016767, d
4=59.151, d
5=-0.072618 and d
6=63.3796; The boundary value of piecewise function: c among the function β (CR)
1=27, c
2=75.
Adopt following piecewise function form in the present embodiment
When the input compression ratio CR is 20,
β(CR)=d
1×CR+d
2=-0.20454×20+64.1748=60.084;
At last, utilize PSNR=α ln (IAM
x)+β, the computed image compression quality.
When the input compression ratio CR is 20,
PSNR=αln(IAM
x)+β
=-10.2163ln(9.7516)+60.084≈-10.2163×2.2774+60.084≈36.8174;
In like manner, be example with the Lena:512 among Fig. 6 * 512 images, calculate the PSNR value of the image that adopts 5 grade of 5/3 Coding with Wavelets mode:
At first, still, select luminance component image Y;
Second step, the single order activity amount IAMD of calculating luminance component Y, wd
1, wd
2, wd
3And wd
4Value is respectively 1,1,0 and 0.IAMD=9.7516;
The 3rd step, the second order activity amount IAME of calculating luminance component Y, wherein, we
1, we
2, we
3, we
4, we
5, we
6, we
7And we
8Value be followed successively by 1,1,0,0,0,0,0 and 0.IAME=15.0133;
The 4th step, the characteristic quantity IAM of calculating luminance component Y
x, when the input compression ratio CR was 20, the value of θ was 1:IAM
x=9.7516
The 5th step, computing function α;
The function parameter of function alpha (CR): a
1=5.0566, a
2=-5.0422, a
3=-10.0149, a
4=0.010445 and a
5=-10.1915; The boundary value b of piecewise function is 33 in the function alpha (CR).Adopt following piecewise function form in the present embodiment:
When the input compression ratio CR is 20:
α(CR)=a
1/(CR+a
2)+a
3=5.0566/(CR-5.0422)-10.0149≈-9.6768
The 6th step, computing function β, the function parameter of function β (CR): d
1=-0.17156, d
2=61.4318, d
3=-0.013433, d
4=57.8774, d
5=-0.072529 and d
6=61.9298; The boundary value of piecewise function: c among the function β (CR)
1=23, c
2=68.
Adopt following piecewise function form in the present embodiment
When the input compression ratio CR is 20,
β(CR)=d
1×CR+d
2=-0.17156×20+61.4318=58.0006;
At last, utilize PSNR=α ln (IAM
x)+β, the computed image compression quality.
When the input compression ratio CR is 20,
PSNR=αln(IAM
x)+β
=-9.6768ln(9.7516)+58.0006≈-9.6768×2.2774+58.0006≈35.9624;
Can know through aforementioned calculation; The PSNR value of the image of the coded system of 5 grade of 9/7 wavelet transformation of employing is greater than the PSNR value of the image that adopts 5 grade of 5/3 Coding with Wavelets mode; So, adopt the coded system of 5 grade of 9/7 wavelet transformation to carry out the better quality of image compression for Lena:512 * 512 images.
The invention has the beneficial effects as follows: the compression quality of any component under given compression ratio that can before coding, calculate given image; Avoid the required calculating of encoding and decompress; Support that better Rate Control, small echo are selected, image compression Performance Evaluation scheduling algorithm; Need behind coding, not obtain compression quality, the relative compression algorithm of amount of calculation significantly reduces.Be applicable to any coding standard, coding method or coded system.
In conjunction with the drawings to the description of the specific embodiment of the invention, others of the present invention and characteristic are conspicuous to those skilled in the art.
More than specific embodiment of the present invention is described and explains it is exemplary that these embodiment should be considered to it, and be not used in and limit the invention, the present invention should make an explanation according to appended claim.