CN114419383A - Image illumination correction algorithm based on principal component analysis - Google Patents
Image illumination correction algorithm based on principal component analysis Download PDFInfo
- Publication number
- CN114419383A CN114419383A CN202210072968.XA CN202210072968A CN114419383A CN 114419383 A CN114419383 A CN 114419383A CN 202210072968 A CN202210072968 A CN 202210072968A CN 114419383 A CN114419383 A CN 114419383A
- Authority
- CN
- China
- Prior art keywords
- image
- vector
- principal component
- matrix
- covariance matrix
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2135—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
Abstract
The invention discloses an image illumination correction algorithm based on principal component analysis, which relates to the technical field of image restoration and comprises the following steps: mapping a plurality of images affected by the same light condition into a vector group; constructing a covariance matrix, and calculating an eigenvalue and an eigenvector of the covariance matrix; and determining and eliminating the base generating the light influence in the characteristic vector, and reconstructing the image by using the principal component. The invention adopts an unsupervised learning mode, finds and eliminates components influenced by illumination through principal component analysis, and is suitable for batch processing of a plurality of images influenced by the same illumination condition. The standard deviation and the average gradient of the image processed by the algorithm are good, which means that the contrast of the processed image is higher, the level is clearer, and the edge is clearer.
Description
Technical Field
The invention relates to the technical field of image restoration, in particular to an image illumination correction algorithm based on principal component analysis.
Background
In the image acquisition process, the whole illumination is uneven due to the influence of factors such as illumination environment or object surface reflection, and the like, so that the original appearance of the image is changed, and great difficulty is brought to subsequent processing. In the process of solving the problem of identifying the damage of the high-speed pavement, the fact that the acquired image is interfered by the same light condition is found, and subsequent characteristic extraction and identification positioning are seriously influenced.
A common image acquisition processing method includes: histogram equalization is a representative time domain transformation method, the histogram equalization enhances contrast by stretching the image gray level, and the algorithm is simple and easy to implement; homomorphic filtering is a representative frequency domain transformation method, and a proper transfer function is selected in a frequency domain to process high and low frequencies of an image. The homomorphic filtering algorithm is widely suitable for processing the image with uneven illumination, and can enhance the details of the image in the dark area without losing the details of the image in the bright area; the Retinex algorithm is a typical method for separating incident and reflected components, and the Retinex enhancement method estimates the brightness component of the original image by using a Gaussian smooth function and approximates the reflected image by using an illumination compensation method. The Retinex algorithm has good effects in the aspects of color image enhancement, image defogging and the like. And the algorithm based on deep learning and the neural network is applied to the illumination compensation of the image, so that a good effect is achieved.
However, in the above-described conventional technique, histogram equalization ignores the frequency domain change of the image. The homomorphic filtering method is easy to have the problems of unclear image contour and the like after processing, parameters need to be obtained through experimental tests, and the algorithm is relatively complex. The Retinex enhancement method is easy to generate a halo phenomenon in a strong light shadow transition area, and has a poor effect on processing a high-brightness image. Algorithms based on deep learning and neural networks are not well-adapted for the versatility of being applied to illumination compensation of images, and supervised learning needs to be performed for a specific sample set.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an image illumination correction algorithm based on principal component analysis.
In order to solve the technical problems, the invention provides the following technical scheme:
an image illumination correction algorithm based on principal component analysis comprises the following steps:
102, constructing a covariance matrix, and calculating an eigenvalue and an eigenvector of the covariance matrix;
and 103, determining and eliminating the base generating the light influence in the feature vector, and reconstructing the image by using the principal component.
As a further technical solution of the present invention, the plurality of images affected by the same light condition are mapped into a vector group; the method specifically comprises the following steps: the same size images are mapped into vector sets: each given image Ii(size m × n) expressed as vector Γi(M × n,1), where i ═ 1, 2.., M, forms a vector set Γ.
The further technical scheme of the invention is that the covariance matrix is constructed, and the eigenvalue and the eigenvector of the covariance matrix are calculated;
acquiring a difference matrix according to the mean vector of the vector group, and constructing a covariance matrix according to the difference matrix;
and calculating the eigenvalue and the eigenvector of the covariance matrix.
The further technical scheme of the invention is that a difference matrix is obtained according to the mean vector of the vector group, and a covariance matrix is constructed according to the difference matrix; the method specifically comprises the following steps:
Calculating a difference matrix A:
constructing a covariance matrix C according to formula (2):
where C is an M order matrix.
As a further technical solution of the present invention, the calculating the eigenvalue and the eigenvector of the covariance matrix specifically includes:
Then, AATThe M largest eigenvalues of (a): lambda [ alpha ]1,λ2,...,λMThe corresponding feature vector is:
the further technical scheme of the invention is that bases which generate light ray influence are determined and removed from the characteristic vector, and the image is reconstructed by using the principal components; the method specifically comprises the following steps: and removing the characteristic vector corresponding to the minimum characteristic value from the characteristic vectors, wherein the removed characteristic vector is used for reconstructing the image to perform image illumination correction.
As a further technical solution of the present invention, the eliminated feature vectors are used for reconstructing an image to perform image illumination correction, and specifically include:
is calculated according to the formula (3)On a standard orthogonal substrateProjection of the lower, i.e. coordinate (w)1,w2,...,wM-1);
Reconstructing column vector Γ 'by equation (4)'iDimension (m × n,1), and convert the column vector into image I'iDimension (i ═ 1, 2.., M);
the invention has the beneficial effects that:
aiming at the problem of image light correction affected by the same illumination condition, the principal component analysis algorithm obtains a better experimental result, can well eliminate the illumination effect, has high image contrast and enhances the main characteristics; the algorithm can be understood as an unsupervised self-learning algorithm, the components influenced by illumination are found and removed through principal component analysis, and the algorithm is suitable for batch processing of a plurality of images influenced by the same illumination condition; the image standard deviation and the average gradient after the algorithm processing are good, which means that the image contrast of the processing result is higher, the level is clearer, and the edge is clearer.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flowchart of an image illumination correction algorithm based on principal component analysis according to the present invention;
FIG. 2 is an original image according to an embodiment of the present invention;
FIG. 3 is a homomorphic filtered image provided by the present invention;
FIG. 4 is an image after histogram equalization processing provided by the present invention;
fig. 5 is an image processed by the Retinex algorithm provided by the present invention.
Fig. 6 is an image processed by an image illumination correction algorithm based on principal component analysis according to the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The invention uses the following algorithm mathematical basis:
theorem: if A is an n-order real symmetric matrix, then a real eigenvalue λ exists1,λ2,...,λnAnd orthogonal real eigenvectorsSuch that:
proposition 1: matrix ATA is true symmetric and its eigenvalue is positive.
Note that: the covariance matrix constructed in the implementation of section 2 algorithm herein is a real symmetric matrix, and therefore a set of positive eigenvalues and orthogonal eigenvectors must be obtained.
Proposition 2: matrix AATAnd ATA has the same characteristic value lambdaiIf A isTThe feature vector of A isThen AATThe feature vector of
And (3) proving that: is provided withIs a matrix ATCharacteristic value λ of Ai(λi> 0) corresponding feature vectors, then:
note that: if A is an m × n order matrix, then AATIs a matrix of m x m order, ATA is an n × n order matrix:
①AATat most m eigenvalues and eigenvectors;
②ATa has at most n eigenvalues and eigenvectors;
if m is more than n, then ATN characteristic values of A correspond exactly to AATN maximum eigenvalues.
When m is large, AA is calculatedTThe eigenvalue and eigenvector of (2) are difficult to implement, and the memory requirement is difficult to meet by a common computer. According to the conclusion of proposition 2, the AA will be solvedTThe n maximum eigenvalues and eigenvectors are converted into solution ATCharacteristic value λ of A1,λ2,...,λnAnd feature vectorsThen AATThe n largest eigenvalues of (a): lambda [ alpha ]1,λ2,...,λnThe feature vector is:
referring to fig. 1, the present invention provides an image illumination correction algorithm based on principal component analysis, comprising the following steps:
102, constructing a covariance matrix, and calculating an eigenvalue and an eigenvector of the covariance matrix;
and 103, determining and eliminating the base generating the light influence in the feature vector, and reconstructing the image by using the principal component.
In the embodiment of the invention, a plurality of images influenced by the same light condition are mapped into a vector group, and a covariance matrix is constructed; then, a group of standard orthogonal bases, namely characteristic vectors corresponding to characteristic values with the largest illumination influence, are found by utilizing a principal component analysis method, finally, bases which generate light influence are determined and eliminated in the vector space, and the principal component is utilized to reconstruct an image, so that the illumination influence is eliminated, and a good effect is obtained.
In step 101, mapping a plurality of images affected by the same light condition into a vector group; the method specifically comprises the following steps: the same size images are mapped into vector sets: each given image Ii(m × n is expressed as vector Γ)i(M × n,1), where (i ═ 1,2,. M), forms a vector set Γ.
The image processed by the method is a plurality of images under the same illumination condition, and illumination correction of a plurality of images is realized by removing the image with larger illumination influence and reconstructing other images.
In step 102, constructing a covariance matrix, and calculating an eigenvalue and an eigenvector of the covariance matrix;
acquiring a difference matrix according to the mean vector of the vector group, and constructing a covariance matrix according to the difference matrix;
and calculating the eigenvalue and the eigenvector of the covariance matrix.
Acquiring a difference matrix according to the mean vector of the vector group, and constructing a covariance matrix according to the difference matrix; the method specifically comprises the following steps:
Calculating a difference matrix A:
constructing a covariance matrix C according to formula (2):
where C is an M order matrix.
In the embodiment of the present invention, calculating the eigenvalue and the eigenvector of the covariance matrix specifically includes:
Then, AATThe M largest eigenvalues of (a): lambda [ alpha ]1,λ2,...,λMThe corresponding feature vector is:
in the examples of the present invention, AATAnd ATThe eigenvalues of a are the same for the first M largest eigenvalues,to simplify the calculation, A is calculatedTCharacteristic value λ of A1,λ2,...,λMAnd corresponding feature vectorsAA may be obtainedTThe M largest eigenvalues of (a): lambda [ alpha ]1,λ2,...,λMThe corresponding feature vector is:
in step 103, determining and eliminating the base generating the light influence in the feature vector, and reconstructing an image by using the principal component; the method specifically comprises the following steps: and removing the characteristic vector corresponding to the minimum characteristic value from the characteristic vectors, wherein the removed characteristic vector is used for reconstructing the image to perform image illumination correction.
In the embodiment of the present invention, the eliminated feature vectors are used for image illumination correction of a reconstructed image, and specifically include:
is calculated according to the formula (3)On a standard orthogonal substrateProjection of the lower, i.e. coordinate (w)1,w2,...,wM-1);
Reconstructing column vector Γ 'by equation (4)'iDimension (m × n,1), and convert the column vector into image I'iDimension (i ═ 1, 2.., M);
the method is used for correcting the images of a plurality of images under the same illumination, and calculates the characteristic value and the characteristic vector for the covariance matrix of the vector group by converting the plurality of images into the vector group, wherein the characteristic value is smaller, the characteristic vector with the larger characteristic value represents the main component of the image, and the characteristic vector with the smaller characteristic value represents the illumination influence component of the image. And deleting the characteristic vector corresponding to the smaller characteristic value, and reserving the characteristic vector corresponding to the larger characteristic value to reconstruct the image to obtain a corrected image.
In the embodiment of the invention, the characteristic vector corresponding to the minimum characteristic value is removed, and the image is reconstructed by using other characteristic vectors, so that the correction of the received light image is ensured, more image characteristic values are reserved, and the image is better presented.
The experimental images are selected from actual shot pictures in projects, the size is 2048 × 3072, and fig. 2 is 3 original images, so that the images are seriously interfered by strip-shaped light, and illumination is uneven. Our goals are: the light interference is inhibited, the main characteristics of the image are kept, and the road surface damage condition is highlighted. In this experiment, 24 images were selected for principal component analysis, limited by the layout, and only 3 images (fig. 2) were given for effect comparison. To verify the validity of the algorithm, we chose three classical algorithms: homomorphic filtering (fig. 3), histogram equalization (fig. 4), and Retinex algorithm (fig. 5) are compared with the algorithm of the present invention (fig. 6). The experimental result shows that the algorithm provided by the invention is obviously superior to three classical algorithms in terms of the effect of inhibiting the light influence; the inventive algorithm and histogram equalization algorithm perform better in terms of contrast.
In order to more objectively balance the treatment effect, the information entropy, the standard deviation and the average gradient are used as indexes to carry out quantitative evaluation.
Information entropy H:
in the formula (5), H represents information entropy, p (m) represents distribution density of image gray level m, and L is the highest gray level of the image. The larger the general information entropy, the more information the image contains.
Standard deviation σ:
in the formula (6), M and N respectively represent the number of rows and the number of columns of the image; f (i, j) represents a pixel value of the (i, j) point; μ denotes the pixel mean. The image contrast is usually measured using a standard deviation. The larger the standard deviation, the higher the image contrast.
Average gradient G:
in the formula (7): m and N respectively represent the number of rows and columns of the image; f (i, j) represents a pixel value of the (i, j) point. The larger the average gradient, the clearer the image gradation and the clearer the details of the edges of the objects in the image.
Table 1 shows the comparison of the processing results of different algorithms;
TABLE 1
As can be seen from table 1: the four algorithms improve the original image to different degrees. The algorithm standard deviation and the average gradient of the invention have the best indexes, which means that the image contrast of the processing result is higher, the hierarchy is clearer, the edge is clearer, and the comparison of the effect image also proves the point. The algorithm provided by the invention has poor information entropy index, is obviously inferior to three classical algorithms, and is even inferior to an original image. This is due to the fact that the major components are retained and the minor components are discarded during the reconstruction of the image. It should be noted that the detail information lost here does not affect the subsequent road surface damage identification.
In conclusion, aiming at the problem of image light correction affected by the same illumination condition, the principal component analysis-based algorithm provided by the invention obtains a better experimental result, can well eliminate the illumination effect, has high image contrast and enhances the main characteristics. The algorithm of the invention can be understood as an unsupervised self-learning algorithm, and the components influenced by illumination are found and removed through principal component analysis. The method is suitable for batch processing of multiple images influenced by the same illumination condition.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. An image illumination correction algorithm based on principal component analysis is characterized by comprising the following steps:
mapping a plurality of images affected by the same light condition into a vector group;
constructing a covariance matrix, and calculating an eigenvalue and an eigenvector of the covariance matrix;
and determining and eliminating the base generating the light influence in the characteristic vector, and reconstructing the image by using the principal component.
2. The principal component analysis-based image illumination correction algorithm of claim 1, wherein the plurality of images affected by the same light condition are mapped into a vector group; the method specifically comprises the following steps: the same size images are mapped into vector sets: each given image Ii(size m × n) expressed as vector Γi(M × n,1), where i ═ 1, 2.., M, forms a vector set Γ.
3. The principal component analysis-based image illumination correction algorithm of claim 1, wherein the covariance matrix is constructed, and eigenvalues and eigenvectors of the covariance matrix are calculated;
acquiring a difference matrix according to the mean vector of the vector group, and constructing a covariance matrix according to the difference matrix;
and calculating the eigenvalue and the eigenvector of the covariance matrix.
4. The image illumination correction algorithm based on principal component analysis as claimed in claim 3, wherein the difference matrix is obtained according to the mean vector of the vector group, and the covariance matrix is constructed according to the difference matrix; the method specifically comprises the following steps:
Calculating a difference matrix A:
constructing a covariance matrix C according to formula (2):
where C is an M order matrix.
5. The image illumination correction algorithm based on principal component analysis of claim 3, wherein the calculating the eigenvalues and eigenvectors of the covariance matrix specifically comprises:
6. the image illumination correction algorithm based on principal component analysis as claimed in claim 1, wherein the basis generating the light influence is determined and removed from the feature vector, and the image is reconstructed by using the principal component; the method specifically comprises the following steps: and removing the characteristic vector corresponding to the minimum characteristic value from the characteristic vectors, wherein the removed characteristic vector is used for reconstructing the image to perform image illumination correction.
7. The image illumination correction algorithm based on principal component analysis according to claim 6, wherein the feature vectors after being removed are used for reconstructing an image to perform image illumination correction, specifically comprising:
is calculated according to the formula (3)On a standard orthogonal substrateProjection of the lower, i.e. coordinate (w)1,w2,...,wM-1);
Reconstructing column vector Γ 'by equation (4)'iDimension (m × n,1), andcolumn vector is converted to image I'iDimension (i ═ 1, 2.., M);
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210072968.XA CN114419383A (en) | 2022-01-21 | 2022-01-21 | Image illumination correction algorithm based on principal component analysis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210072968.XA CN114419383A (en) | 2022-01-21 | 2022-01-21 | Image illumination correction algorithm based on principal component analysis |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114419383A true CN114419383A (en) | 2022-04-29 |
Family
ID=81275540
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210072968.XA Pending CN114419383A (en) | 2022-01-21 | 2022-01-21 | Image illumination correction algorithm based on principal component analysis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114419383A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003208619A (en) * | 2000-12-19 | 2003-07-25 | Matsushita Electric Ind Co Ltd | Face description method by use of primary and secondary inherent features and not affected by illumination and visual angle |
US20030165260A1 (en) * | 2002-03-04 | 2003-09-04 | Samsung Electronics Co, Ltd. | Method and apparatus of recognizing face using 2nd-order independent component analysis (ICA)/principal component analysis (PCA) |
US20050123202A1 (en) * | 2003-12-04 | 2005-06-09 | Samsung Electronics Co., Ltd. | Face recognition apparatus and method using PCA learning per subgroup |
CN104881682A (en) * | 2015-05-26 | 2015-09-02 | 东南大学 | Image classification method based on locality preserving mapping and principal component analysis |
CN110991228A (en) * | 2019-10-24 | 2020-04-10 | 青岛中科智保科技有限公司 | Improved PCA face recognition algorithm resistant to illumination influence |
-
2022
- 2022-01-21 CN CN202210072968.XA patent/CN114419383A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003208619A (en) * | 2000-12-19 | 2003-07-25 | Matsushita Electric Ind Co Ltd | Face description method by use of primary and secondary inherent features and not affected by illumination and visual angle |
US20030165260A1 (en) * | 2002-03-04 | 2003-09-04 | Samsung Electronics Co, Ltd. | Method and apparatus of recognizing face using 2nd-order independent component analysis (ICA)/principal component analysis (PCA) |
US20050123202A1 (en) * | 2003-12-04 | 2005-06-09 | Samsung Electronics Co., Ltd. | Face recognition apparatus and method using PCA learning per subgroup |
CN104881682A (en) * | 2015-05-26 | 2015-09-02 | 东南大学 | Image classification method based on locality preserving mapping and principal component analysis |
CN110991228A (en) * | 2019-10-24 | 2020-04-10 | 青岛中科智保科技有限公司 | Improved PCA face recognition algorithm resistant to illumination influence |
Non-Patent Citations (2)
Title |
---|
刘俊等: "基于图像子空间的改进商图像方法", 《计算机科学》 * |
龚赟: "光照影响下的人脸识别研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109522908B (en) | Image significance detection method based on region label fusion | |
Wang et al. | Enhanced ridge structure for improving fingerprint image quality based on a wavelet domain | |
CN106991661B (en) | Non-local mean denoising method fusing KL (karhunen-Loeve) transformation and grey correlation degree | |
CN110503617B (en) | Underwater image enhancement method based on high-frequency and low-frequency information fusion | |
CN106204502B (en) | Based on mixing rank L0Regularization fuzzy core estimation method | |
CN112233046B (en) | Image restoration method under Cauchy noise and application thereof | |
CN111968065A (en) | Self-adaptive enhancement method for image with uneven brightness | |
CN111179333B (en) | Defocus blur kernel estimation method based on binocular stereo vision | |
Tan et al. | Image haze removal based on superpixels and Markov random field | |
Gu et al. | A novel Retinex image enhancement approach via brightness channel prior and change of detail prior | |
CN114419383A (en) | Image illumination correction algorithm based on principal component analysis | |
CN108961322B (en) | Mismatching elimination method suitable for landing sequence images | |
CN110610525B (en) | Image processing method and device and computer readable storage medium | |
Vavilin et al. | Fast HDR image generation from multi-exposed multiple-view LDR images | |
Ma et al. | Solid waste surface feature enhancement method based on gamma correction and wavelet transform | |
Xie et al. | DHD-Net: A novel deep-learning-based dehazing network | |
Naoum et al. | Color image enhancement using steady state genetic algorithm | |
Ye | Quantitative comparisons of edge based and region based feature detection in digital aerial imagery analysis | |
Kaur et al. | A comparative review of various illumination estimation based color constancy techniques | |
Wang et al. | New insights into multi-focus image fusion: A fusion method based on multi-dictionary linear sparse representation and region fusion model | |
Azimian et al. | Preventing Over-Enhancement Using Modified ICSO Algorithm | |
Xie et al. | Color image diffusion using adaptive bilateral filter | |
Zhu et al. | Cultural relic image enhancement based on the Laplacian of the Gaussian and retinex model | |
Meligy | Modified fast gray level grouping approach for enhancing image contrast | |
Wang et al. | A Novel Approach for Image Dehazing via Spatial and Channel Feature Fusion |
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 |