Research on multi focus image algorithm based on W

2022-08-24
  • Detail

Research on multi focus image algorithm based on wavelet transform

in recent years, image fusion has become an important and valuable new technology in the field of image understanding and computer vision. The research purpose of image fusion technology is to integrate the image information obtained by different types of sensors, and improve the reliability and observability of images through the processing of redundant data between multiple images, The effect of image is improved by processing the complementary information between multiple images. The fusion algorithm of multi focus image based on wavelet spatial frequency uses the coefficients of wavelet transform to define the sharpness measurement index in the image to be fused on the basis of wavelet multi-resolution analysis. For obvious clear and fuzzy regions, the clear region is directly selected as the corresponding block region after fusion. For the clear and fuzzy boundary areas, the pixel based window spatial frequency method is used for fusion processing. So that each clear area in multiple images can be displayed on a fused image at the same time, so as to solve the problem that it is difficult for people to obtain an image with clear focus of all scenes when photographing because of the limited depth of field of the optical lens. This topic plans to adopt the following methods: the fusion algorithm of multi focus image based on pixel definition, calculate the definition of pixels in images according to the coefficients of each image after multi-scale decomposition, then combine the coefficients from each clear area, and carry out the consistency test, and finally inverse transform the combined coefficients to get the fused image

1 overview

multi focus image: multi focus image refers to multiple images formed by focusing on each target respectively when the camera is shooting two or more targets in a scene. For the visible light imaging system, an object with good focus can present a clear image. Due to the limited focus range of the imaging system, in an image of different depths, except for the object with good focus, all targets outside a certain distance from the front and back of the object will show varying degrees of blur. In order to get a clear image of all objects in the scene, the imaging system can focus on one part of the object to get a clear image, then focus on another part of the object to get another clear image, and finally fuse the two images to get a clear image of all objects

multiresolution analysis: multiresolution analysis, also known as multiscale analysis, is used to decompose signals into parts in different spaces. In addition, it also provides a unified framework for constructing wavelets and a fast algorithm for digital signal decomposition and reconstruction. In the step-by-step decomposition of space, each level decomposition is not arbitrary, but has special properties, so that there is an orthogonal relationship between the decomposed subspaces. In the decomposition process, it is assumed that a subspace has been decomposed. When the subspace is re decomposed, the high-frequency detail information of the signal and the low-frequency profile or smooth part of the signal should be included, and the two parts of information should be orthogonal to each other

wavelet transform: wavelet transform is a local transform of space (time) and frequency, so it can effectively extract information from signals. The function or signal can be analyzed in multi-scale detail through the functions of scaling and a-shift, which solves many difficult problems that cannot be solved by Fourier transform

2 multi focus image fusion method based on wavelet transform

the basic idea of image data fusion in this topic is to decompose the multi focus image by two-dimensional wavelet first; Then image fusion is carried out according to certain fusion rules in the wavelet transform domain to extract important wavelet coefficients; Finally, the image after data fusion is obtained by inverse wavelet transform, as shown in Figure 1

the specific steps are as follows:

(1) calculate the two-dimensional wavelet transform of the image according to formula (1), set the decomposition level as J, and take j=1, 2,..., 8 in this experiment

(2) adopt different fusion rules for different frequency components. In the high-frequency domain, after image wavelet decomposition, the high-frequency component corresponds to the edge details of the image. The absolute value of the high-frequency component in the fuzzy region is small, and the high-frequency component in the clear region is large. For the fused image, select the high-frequency component with larger absolute value, and the details of the fused image are richer and clearer than the image to be fused. Therefore, the fusion method of high-frequency coefficients used in this research is to compare the absolute values of the corresponding high-frequency coefficients of two multi focus images after wavelet decomposition, and then take the value with the larger absolute value as the corresponding high-frequency coefficients of the fused image, that is,

in the low-frequency domain, the fusion method of low-frequency coefficients is to take the average value of the corresponding low-frequency coefficients of two multi focus images after wavelet decomposition, That is,

3 image fusion program design

3.1 program development platform

in order to facilitate human visual observation and convenient operation, Windows XP system is used as the program development platform, and windows xp has strong hardware compatibility, rich support software and powerful functions

the development tools widely used at present mainly include: visualc++, visual basic, Delphi, visual studi0.net, PowerBuilder, MATLAB, etc

matlab is the abbreviation of matrix laboratory, which is second to none in numerical calculation in Mathematical Science and technology application software. Matlab can perform matrix operations,

Draw functions and data, implement algorithms, create user interfaces, and connect programs with other programming languages. It is mainly used in engineering calculation, control design, signal processing and communication, image processing, signal detection, financial modeling design and analysis

The advantages of MATLAB are friendly working platform and programming environment, simple and easy-to-use programming language, powerful scientific computer data processing ability, excellent graphics processing function, widely used module collection toolbox, practical program interface and publishing platform

because MATLAB has the above advantages over other development tools, MATLAB 7.0 is selected for this research

3.2 image fusion program design

in order to realize the method of image fusion of multi focus images using wavelet transform, the program flow chart of multi focus image fusion based on wavelet transform is designed. As shown in Figure 2. It is mainly divided into three parts: two-dimensional wavelet decomposition, fusion and wavelet reconstruction

Figure 2 program flow chart of multi focus image fusion based on wavelet transform. The main procedures of two-dimensional wavelet decomposition are as follows:

zt=3;% The number of wavelet decomposition layers is 3

wtype= 'Haar';% The wavelet type used is haar

[c0, s0]=wavedec2 (M1, ZT, wtype)

% for M1 multi-scale two-dimensional wavelet decomposition

[c1, s1]=wavedec2 (m2, ZT, wtype)

% for M2 multi-scale two-dimensional wavelet decomposition

the main procedure of fusion is as follows:

4 experiment and result analysis

4.1 experimental results

this research adopts the fusion method of taking the average of the low-frequency coefficients and the wavelet coefficients with a large absolute value for the high-frequency coefficients. The method is tested, the code is written by MATLAB 7.0, and the type of Haar wavelet is selected to separate the images. Cheng Jiacheng, associate professor of the school of industrial engineering, Purdue University, said: because this kind of new composite material has high conductivity, the wavelet decomposition of layers is carried out, and the fusion is carried out according to the algorithm given in this paper. In Figure 3 (a) and (b) are 256 respectively × Two 256 size images focused on different source images. Figure 4 shows the fused image obtained by using the fusion method in this paper under different decomposition levels

4.2 result analysis

according to the disclosure of the municipal ceramic aluminum office

write code with MATLAB 7.0, run and compare the number of results evaluated. Table 1 shows the service parameters of the eight images in Figure 4

the experimental results are analyzed as follows:

(1) the ideal h-image r used in this experiment is obtained by first performing two-dimensional median filtering on the fused h-image, then performing two-dimensional adaptive denoising filtering, and finally performing gray-scale adjustment

(2) select 'Haar' wavelet to decompose the layer during fusion. With more decomposition layers, the fused h-image can inherit more information from the two source images, which is closer to the ideal image. The distortion is reduced, the mean square error is reduced, the peak signal-to-noise ratio is increased, and the entropy is increased. More and more businesses will favor the image, and the amount of information contained in the image is increased. However, when the number of decomposition layers is 8, the mean square error of the image is increased, the peak signal-to-noise ratio is reduced, and the definition is weakened. Therefore, it is not that the more layers of decomposition, the better. Combined with the evaluation index results, it is better to choose 7 layers of decomposition

5 Conclusion

this paper studies a multi focus image fusion algorithm based on wavelet transform, and also introduces the theoretical knowledge of multi focus h-image and wavelet analysis. Wavelet analysis is. A multi-resolution analysis, which can decompose the image into a low-frequency approximation part and a high-frequency detail part with different scales and directions. The low-frequency approximation part contains the average information of the image, accounting for most of the energy of the whole image, while the detail parts with different scales and directions contain high-frequency information of different scales. The algorithm studied in this paper adopts different fusion rules for different frequency domains after image wavelet decomposition. When selecting wavelet coefficients for low-frequency components, take the average value of the two, and when selecting wavelet coefficients for high-frequency components, choose them based on the principle of absolute value maximum coefficient. Compared with other image fusion methods, this method can achieve the unity of pace in time domain and frequency domain, perform orthogonal decomposition in frequency domain, have good localization properties in time domain and frequency domain at the same time, can decompose the signal into independent parts of space and time domain, without losing the information contained in the original signal, and can find orthogonal basis to realize signal decomposition without redundancy. Finally, subjective evaluation and objective evaluation indexes such as entropy, mean square error and peak to noise ratio are used to compare different fusion results. The experimental results show that the fusion methods proposed in this paper are based on the objective evaluation criteria such as entropy, mean square error and peak to peak noise ratio, or the subjective evaluation criteria of vision, and the measurement of correct feasibility has come to an end. According to the principle of image decomposition pixel point halving, the size is n × The maximum number of image decomposition of n is log2n, but in practical application, it is impossible to take that large, otherwise there are too few sub image pixels, which will cause serious distortion; On the contrary, if the number of decomposition layers is too small, it cannot reflect the multi-scale idea. Most scholars believe that 3 ~ 4 layers are appropriate. The experiment of the fusion method studied in this paper shows that the best number of wavelet decomposition layers is 7, but it has a certain amount of fusion calculation

Copyright © 2011 JIN SHI