Summary of the invention
The objective of the invention is to propose a kind of wavelet basis classification building method towards image compression.This method is at first classified to image, and the wavelet basis of concentrating at every class image configuration optimal energy in compression process, goes out the optimal wavelet base according to the categorizing selection of input picture and carries out squeeze operation.
For realizing above-mentioned goal of the invention, the present invention adopts following technical scheme:
A kind of wavelet basis classification building method towards image compression is at first set up the wavelet basis tectonic model, and is designed corresponding wavelet basis and optimize derivation algorithm, it is characterized in that also comprising the steps:
(1) image is classified: choose typical image, determine that by statistical analysis image classification criterion and image classification threshold value are to realize image classification;
(2) off-line is set up the wavelet basis storehouse: to every class image, adopt described wavelet basis tectonic model and optimize derivation algorithm, select the wavelet basis of average meaning optimum, set up the wavelet basis storehouse;
(3) selection is fit to the optimal wavelet base of image compression: according to the classification of input picture, select to be fit to the wavelet basis of such image from the wavelet basis storehouse of setting up.
Wherein, in the process of setting up the wavelet basis tectonic model, be index with the concentration of energy, the structure energy mainly concentrates on the wavelet basis of low frequency and medium and low frequency.
Described wavelet basis is optimized derivation algorithm and is had first parameter and second parameter for the processing of utilization genetic algorithm, and concentrating with the optimal energy of wavelet transformation is the bivariate optimization problem of target function.
In the described genetic algorithm, 0 and 1 gene number respectively accounts for 50% in the chromosome of generation, inserts the chromosome with the coefficient coding of DB9/7 small echo in advance in initial population, and during evolution, picks out the new individuality and the preservation that are better than current optimum individual.
In the described step (1), described sorting criterion is the average of three high-frequency sub-band coefficient amplitudes behind the first order calculation wavelet transformation, and determines the threshold value of image classification according to statistics.
In the described wavelet basis storehouse, corresponding with a wavelet basis respectively according to each class image that described image classification threshold value is determined.
In the described step (3), at first input picture is carried out the one-level wavelet transformation, calculate the average of high frequency coefficient amplitude, determine the classification of input picture then according to described image classification threshold value, from the wavelet basis storehouse of setting up, select to be fit to the wavelet basis of such image again, and carry out wavelet transformation.
The present invention constructs the wavelet basis that is fit to every class image compression on the basis of image classification by offline mode, in the line compression process according to the categorizing selection wavelet basis of input picture, can can improve the performance of wavelet transformation so on the one hand, also avoid the problem that the online structure time is long, complexity is high on the other hand.Experimental result shows, increases under the unconspicuous situation at the wavelet transformation time complexity, and the compression performance that the present invention constructs wavelet basis is better than classical DB9/7 small echo, has improved the quality of recovering image, and the compression that is particularly suitable for remote sensing images is handled.
Embodiment
With reference to shown in Figure 1, basic ideas of the present invention are: at first image is classified, and at every class images off-line structure optimal wavelet base, set up the wavelet basis storehouse.In compression process, carry out map function from the wavelet basis storehouse according to the wavelet basis that the classification of image is selected to be fit to such image.
At first introduce the method for structure optimal wavelet base below, it is the basis that the present invention is achieved.This method contains the wavelet basis tectonic model of ginseng by choosing the wavelet basis optimization structure criterion that is fit to compression, setting up, and optimizes derivation algorithm thereby design wavelet basis.
Daubechies is verified except that the Harr small echo, and any tight support orthogonal wavelet does not have symmetry, thereby can produce phase distortion, has hindered orthogonal wavelet in APPLICATION OF IMAGE COMPRESSION.If abandon the constraint of orthogonality aspect, the biorthogonal wavelet that also has a large amount of symmetries exists, and therefore in the present embodiment, selects the structure biorthogonal wavelet.In addition, for the wavelet basis of the suitable compression of structure pointedly, the present invention has considered the characteristics of compression applications demand in construction process, and the concentration of energy of research wavelet basis and the relation of compression performance adopt the energy calculation criterion of formula (1) as image:
E=∑|c
i,j|
2≈∑p
2 i,j (1)
Wherein, wherein c is a frequency coefficient, and p is the spatial domain coefficient, and the necessary and sufficient condition that frequency domain energy and spatial domain energy equate is that wavelet transformation satisfies orthogonality.
In the present embodiment, selected biorthogonal wavelet base DB9/7 and the Villa10/18 small echo used always in the image compression for use, these two kinds of wavelet basiss have linear phase, and concentration of energy is good, though they do not satisfy orthogonal property, energy remains unchanged substantially after the conversion.Fig. 2 and Fig. 3 quantitative description through behind 6 grades of wavelet transformations, character image and the regularity of energy distribution of a plurality of different remote sensing images on each frequency band.Transverse axis is represented the frequency band progression of wavelet transformation among the figure, from 6 to 1 corresponding successively frequency bands at different levels from the extremely high frequency of infra-low frequency, every grade of frequency band comprises level, vertical and to three sub-frequency bands on the angular direction, and the longitudinal axis is represented the energy shared percentage in view picture figure energy on the respective stages frequency band.Can draw from Fig. 2 and Fig. 3 as drawing a conclusion: character image most energy after conversion all concentrate on lowest frequency, and are residual considerably less at other frequency bands, and complicated remote sensing images then have the energy of larger proportion to residue in medium-high frequency.
In general, for the Bit-Plane Encoding method, if the energy of frequency coefficient is concentrated to low frequency region more, the small magnitude coefficient of high frequency is just many more, and it is just many more correspondingly to quantize the back zero coefficient, helps to improve compression ratio.Therefore, structure can effectively reduce image at medium-high frequency and frequency band energy at different levels, and the wavelet basis that makes its energy more concentrate on low frequency and medium and low frequency is the effective way that realizes the compression of image high power.The present invention in the process of structure wavelet basis concentration of energy as the important indicator of weighing the wavelet basis compression performance.
In the present embodiment, to be the biorthogonal wavelet base that the base configuration optimal energy is concentrated with the DB9/7 small echo, suppose that the length of wavelet function and antithesis wavelet function is respectively 9 and 7, consider the centre symmetry of biorthogonal wavelet, can be respectively it be represented with 5 and 4 unknown numbers note is { h respectively
n, 0≤n≤4} and { g
n, 0≤n≤3}.Complete reconstruction condition by biorthogonal wavelet can get
Complete reconstruction condition with its antithesis small echo of reason can get
Biorthogonality relation by biorthogonal wavelet and its antithesis small echo gets
First equation of simultaneous (2), (3) formula and (4) formula makes g
0, g
1Be parameter,, can get the general solution of all the other 7 unknown numbers at last, obtain 9/7 biorthogonal wavelet filter parameter model by the unit that disappears, abbreviation
The value of g0, g1 can calculate remaining filter coefficient according to (5) after determining.By adjusting g0, g1, can generate one group of wavelet filter.Can to be converted into g0, g1 serve as to optimize variable to the construction problem of wavelet basis like this, and the optimal energy of wavelet transformation is concentrated and is the bivariate optimization problem of target function.The target function of this optimization problem is a hypersurface, and fluctuations is infinite in its codomain scope, can't use analytical method solving, and the present invention adopts the genetic algorithm for solving optimal solution for this reason.
The present invention has solved following key issue in using the genetic algorithm for solving process:
1. the coding rule of chromosome coding
The essence of this problem is the coding that problem is separated, and string length and coding form are to the algorithmic statement influence greatly.Consider that this model has two variablees, in order to make coding simple, decision adopts binary coding to represent, simultaneously need consider again to select and the equality of mutation operation to the influence of two variablees, chromosome length is defined as 2n, and wherein odd number n position is corresponding to g0, and even number n position is corresponding to g1, just the value of g0 and g1 can be adjusted in the corresponding value of the DB9/7 small echo any range on every side by the normalization operation, this will help next step search again.By lot of experiment validation, find g0 and g1 are adjusted at respectively in [0.2,0.4] and [0.1,0.3] scope of DB9/7 coefficient, can obtain reasonable effect.
2. the generation of initial population
The character of initial population has considerable influence to algorithm the convergence speed and the optimal solution that finally searches out.Most of chromosome adopts random fashion to produce in this algorithm, for the coverage that makes search is more comprehensive, makes in the chromosome of generation 0 and 1 gene number respectively account for 50%.Simultaneously in order to accelerate search speed, can in initial population, insert this group known preferred chromosome in advance, promptly with the chromosome of the coefficient coding of DB9/7, and during evolution, pick out the new individuality and the preservation that are better than current optimum individual, can give full play to the advantage that has been fruitful.
3. target function determines
The target function of this algorithm is the concentration of energy of wavelet transformation.In each repeatedly band process, use each new individuality (wavelet basis) that image is carried out 6 grades of wavelet transformations and calculated its fitness (E
LL, E
i) i=1,2 ..., 6, E wherein
LLRepresent the energy of lowest frequency, E
iRepresent the energy of i frequency band.(the E wherein if new individual fitness meets the following conditions
LL' and E
i' be respectively the frequency band energies at different levels of current optimum individual correspondence):
E
LL>E
LL′ and E
i≤E
i′,i=1,2,...,6
Then keep this individuality and replace current optimum individual with it.
Aspect the mathematical property of small echo, the wavelet basis that said method is constructed satisfies tight support characteristic.The importance of tight support is that it can provide coefficient limited FIR filter, avoids producing in the filtering truncated error in the picture breakdown process.Support is short more, and the computation complexity of wavelet transformation is low more, is convenient to quick realization.Non-tight support wavelet basis must block when using, thus the error of bringing.
In order to verify the validity of above-mentioned building method, present embodiment is to the typical remote sensing images structure of several width of cloth optimal wavelet base, and use these wavelet basiss and DB9/7 wavelet basis to compare experiment, wherein table 1 has provided when 16 multiplication of voltages contract the quality of recovering image, and Fig. 4 has compared the optimal wavelet base that the present invention constructed and the concentration of energy of DB9/7 wavelet basis.As can be seen from Figure 4, the optimal wavelet base concentration of energy of structure all is significantly improved than the DB9/7 wavelet basis, and we also can learn from construction process, other each high-frequency energies all have reduction in various degree, therefore its wavelet coefficient should be more suitable for coding, the experimental result of table 1 has just in time been verified this point, compares with the DB9/7 small echo, and the optimal wavelet base of structure has been obtained better compression effectiveness.
Table 1 optimal wavelet base and DB9/7 wavelet basis are to the Remote Sensing Image Compression quality
Image | DB9/7(dB) | Structure 9/7 (dB) | Lifting values (dB) |
City | 23.93 | 24.14 | 0.21 |
Factory | 21.52 | 21.78 | 0.26 |
Hong Kong | 24.66 | 24.95 | 0.29 |
Xiamen | 25.40 | 25.71 | 0.31 |
Introduced the conventional method of structure optimal wavelet base above, following mask body is introduced the specific embodiments of this method in image compression.
Step 1: choose typical image, determine that by statistical analysis sorting criterion and classification thresholds are to realize image classification.
Need to prove that selected in the following embodiments typical image all is remote sensing images.This mainly is because existing wavelet compression method is all undesirable to the treatment effect of remote sensing images, and there is bigger individual difference in remote sensing images itself, are difficult to handle with an existing unified pattern.But obvious method provided by the present invention can also be used for the compression to other types of image, and obtained beneficial effect also is similar.
Complexity | Image | g
0 | g
1 |
Complicated | CITY | 0.843795 | 0.457413 |
FACTORY | 0.839425 | 0.433821 |
Medium | BEIJING | 0.817774 | 0.451349 |
GUANGZHOU | 0.822007 | 0.442884 |
Simply | 2IT | 0.796827 | 0.436656 |
Z3 | 0.793379 | 0.416411 |
The optimal wavelet base of table 2 remote sensing images
All construct optimal energy at every width of cloth remote sensing images and concentrate the biorthogonal wavelet base can reach best compression effectiveness, but, need to seek a kind of effective solution because construction process is very consuming time, and this way is not allowed in actual applications.Table 2 has provided the optimal wavelet base of a few width of cloth different texture complexity remote sensing images correspondences, find by analyzing, there is certain relation between the optimal wavelet base of structure and the image complexity, it is the close image of complexity, its optimal wavelet base is also similar, so the present invention proposes the method for branch class formation.
In order to determine the sorting criterion of remote sensing images, table 3 and table 4 have provided the statistics of remote sensing images in spatial domain and wavelet field respectively.Therefrom as can be seen, the statistic in spatial domain is not clearly with the different regularity of distribution of texture complexity, and the complexity of wavelet field average X and mean square deviation MSE and image relation obviously, and the optimal wavelet base of the image correspondence that promptly the texture complexity is close also is similar.Consider the complexity of classified calculating, the present invention adopts wavelet coefficient average as the image classification criterion.Its concrete computational process is: behind the image process one-level wavelet transformation, calculate the average of HL, LH and three high-frequency sub-band coefficients of HH amplitude, with this criterion as complexity.
Complexity | Image | X | MSE | MaxX | R |
Complicated | FACTORY | 103.27 | 14475.67 | 248 | 248 |
CITY | 73.34 | 11452.36 | 248 | 248 |
Medium | BEIJING | 92.77 | 6155.23 | 255 | 252 |
GUANGZHOU | 86.52 | 6192.98 | 255 | 253 |
Simply | 2IT | 112.85 | 6954.17 | 187 | 152 |
Z3 | 131.76 | 7968.2 | 229 | 177 |
Table 3 remote sensing images are in the spatial domain statistics
Complexity | Image | X | MSE | MaxX | R |
Complicated | FACTORY | 17.74 | 30.62 | 162.64 | 162.64 |
CITY | 13.03 | 22.75 | 162.54 | 162.54 |
Medium | BEIJING | 8.08 | 14 | 83.09 | 83.09 |
GUANGZHOU | 6.78 | 11.78 | 76.99 | 76.99 |
Simply | 2IT | 4.85 | 9.26 | 67.82 | 67.82 |
Z3 | 5.15 | 9.68 | 82.18 | 82.18 |
Table 4 remote sensing images are in the Wavelet domain statistical result
In order to simplify processing, in the present embodiment image is defined as three classes: simple, medium and complicated, and according to the threshold value T that the statistical experiment of a large amount of remote sensing images is determined classification
0=6 and T
1=12, concrete classification function is as follows:
Step 2: to every class image, adopt aforesaid wavelet basis tectonic model and optimize derivation algorithm, select the wavelet basis of average meaning optimum, set up the wavelet basis storehouse.
For the three class images that are divided in the
step 1, use aforesaid optimization building method to the best wavelet basis of compression performance on the average meaning of every class image configuration, thereby set up the wavelet basis storehouse that comprises three wavelet basiss.In the final wavelet basis storehouse of setting up, the corresponding wavelet basis of every class image.Its filter coefficient provides in table 5, wherein W
r, W
mAnd W
sBe respectively complicated, moderate is complicated and the wavelet basis of simple remote sensing images correspondence.
| 0 | 1 | 2 | 3 | 4 |
W
r | h
n | 0.711176 | 0.392645 | -0.080445 | -0.039092 | 0.078411 |
g
n | 0.839515 | 0.486347 | -0.066204 | -0.132794 | |
W
m | h
n | 0.777124 | 0.388957 | -0.090059 | -0.035404 | 0.055050 |
g
n | 0.822007 | 0.442884 | -0.057450 | -0.089331 | |
W
s | h
n | 0.822000 | 0.379340 | -0.105216 | -0.025787 | 0.047770 |
g
n | 0.796827 | 0.436656 | -0.044860 | -0.083103 | |
The wavelet filter coefficient of table 5 three class image correspondences
Step 3:, from the wavelet basis village, often used in village names of setting up, select to be fit to the wavelet basis of such image according to the classification of input picture.
When the optimal wavelet base of structure is applied to compressibility, at first input picture is carried out the one-level wavelet transformation, calculate the average of high frequency coefficient amplitude, according to determined sorting criterion of step 1 and classification thresholds image is classified then, the filter of selecting to be fit to such image from the wavelet basis storehouse that step 2 is set up (being the optimal wavelet base) is carried out wavelet transformation.
In the process that the present invention realizes, adopt offline mode that a large amount of typical image classifications are constructed the optimal wavelet base in advance, thereby set up the wavelet basis storehouse.When reality is carried out squeeze operation, at first image itself is classified, and the wavelet basis of selecting to be fit to is carried out map function.This mode can effectively be avoided the problem that the online structure required time of wavelet basis is long, complexity is high, has improved practicality of the present invention.
For one of ordinary skill in the art, any conspicuous change of under the prerequisite that does not deviate from connotation of the present invention it being done all will constitute to infringement of patent right of the present invention, with corresponding legal responsibilities.