1. Field of the Invention
The present invention is related to a method for reconstructing color images, and more particularly to a method that varies pixels in original digital color images according to spectra of replaceable light sources to reconstruct color images with different visual effect.
2. Description of the Related Art
Clinically, most regular light sources pertain to tungsten lamp, xenon lamp, halogen lamp, and the like. In contrast to the aforementioned light sources, light-emitting diode (LED) lamps are advantageous due to lower power consumption, high emitting efficiency, durability, environmental protection, compact size, adjustable light intensity, and abundant color gamut.
As to biological medicine, there are plenty of related researches and equipment using various multi-spectral light sources to generate different biological images. Such biological images serve as references to medical personnel for determining if a diagnostic area has any abnormal pathological change.
Given enterovirus as an example, pathological changes arising from enterovirus, such as, acute pharyngitis, herpangina, hand-foot-and-mouth disease, and so on, are typical symptoms of highly infectious disease in recent years. Above all, enterovirus is even more life-threatening to children under five. If enterovirus can be treated at an early stage, the likelihood of developing to be severe or acute is significantly reduced. Generally, one method for pediatricians to detect the disease is to diagnose throat, hand and mouth. As patients are usually children, regular doctors can only detect if the throat mucosae have any ulcer within a limited time. Therefore, if a special light source is available, using the light source intensifies the chromatic difference between an area having pathological change and neighboring normal areas, the light source can certainly assist to enhance the detection capability of doctors. Furthermore, if the operating light source system and a charge-coupled device (CCD) can be combined, doctors can carefully examine images on a computer screen or employ pattern recognition software to promptly determine if children have contracted enterovirus. In that case, the capability of medical personnel in detecting envirovirus of children can be significantly improved.
When light sources having different spectra illuminate a diagnostic area, images with different effects are obtained. However, if various lighting equipment are provided to serve as light sources with different spectra, many problems, such as expensive hardware, maintenance and services, accommodation space, inexperienced operation of personnel, arise. Given all these problems, the approach using light sources with different spectra to test turns out to be actually infeasible.
An objective of the present invention is to provide a method for reconstructing color images varying pixels of an original digital color image with a replace spectrum of light source, thereby simulating to generate different color images affected by light source replacement for diagnostic judgment.
To achieve the foregoing objective, the method for reconstructing color images has steps of:
using a spectrum-acquiring device to acquire spectral data of a plurality of sample color blocks and calculating coefficients of a basis matrix of the sample color blocks;
obtaining digital counts of the plurality of sample color blocks with a digital camera;
obtaining a conversion matrix in accordance with the coefficients of the basis matrix and the digital counts;
acquiring digital counts of an original image with the digital camera, and generating a reconstructed image in accordance with the digital counts of the original image and the conversion matrix; and
varying the conversion matrix in accordance with a new light source, and computing to generate a reconstructed image corresponding to the new light source in accordance with the digital counts of the original image and the varied conversion matrix.
Preferably, the step of obtaining a conversion matrix further comprises steps of acquiring the spectral data of the plurality of sample color blocks with the spectrum-acquiring device to acquire a set of original spectra; acquiring the spectral data of the plurality of sample color blocks with the digital camera to acquire a set of similar spectra; dividing the set of original spectra and the set of similar spectra by a spectrum of original light source to respectively acquire a set of original reflective spectra and a set of similar reflective spectra; simultaneously multiplying the set of original reflective spectra and the set of similar reflective spectra by a spectrum of new light source to generate new spectral data of the plurality of sample color blocks; and obtaining a new conversion matrix in accordance with the new spectral data of the plurality of sample color blocks.
Preferably, when calculating the coefficients of the basis matrix of the sample color blocks, the coefficients are obtained by a principal axis factor analysis method.
Preferably, when obtaining a conversion matrix in accordance with the coefficients of the basis matrix and the digital counts, the conversion matrix is obtained by a multiple linear regression analysis method.
Preferably, when acquiring the digital counts of the original image with the digital camera, the digital camera is performed by a color calibration.
Preferably, when acquiring the digital counts of the original image with the digital camera, the digital camera acquires the digital counts of the original image through color filters.
By varying the spectrum of different light source, the present invention can generate color images with different effect from images taken by a digital camera to provide desired color reconstruction effect, such as enhancement of illumination, color temperature, chromatic difference and the like of color images and desired spectrum of light source. As a result, a true light source can be easily acquired and the cost thereof is relatively reduced. When the present invention is applied to medical diagnosis or semiconductor inspection, human eyes or instrument can directly observe tissues with pathological change or defective portions of product by changing different spectrum of light source.
The present invention is a multi-spectral technique for color measurement and color reconstruction with high accuracy. Digital cameras available everywhere serve as sampling equipment of a multi-spectral image capturing system. Values sensed by digital cameras are taken as digital counts (Dc) of images. Several color filters are incorporated to capture images and augment fitness of similar spectra thereof. As a data value of each pixel in color images taken by digital cameras can be directly converted to those of the spectrum of any light source by the present invention, the spectral value of each pixel in reconstructed color images changes from one spectrum to another spectrum of light source. Let's introduce by focusing on the multi-spectral color reconstruction technique, principal axis factor analysis method and the multiple linear regression analysis method first.
A. Multi-spectral Color Reconstruction Technique
Color reconstruction technique is employed to duplicate images with respect to objects to be photographed or color manuscripts. Color matching is divided into spectral matching and metamerism matching. The requirement of the spectral matching is that spectral characteristic of original images and reconstructed images is consistent while that of the metamerism matching must have consistent color appearance under specific condition. If the specific condition is altered, color constancy might not be maintained. For example, color matching for applications of color printing, photography, television and the like pertains to the metamerism matching. The spectral matching of those applications is barely feasible unless subjected to a specific condition.
Multi-spectral acquisition method is first addressed in VASARI system of National Gallery, UK in 1993. The VASARI system employs a scanner collaborated with seven filters to construct a 7-channel sampling equipment for acquiring images of works of art. A sensor of the scanner is a monochrome camera with high resolution. After processing by appropriate signal processing, acquired images are stored and recorded.
Color rendering of spectral reconstruction method is to be explained next. Color rendering can be performed with respect to the spectrum of each acquired pixel. Since National Gallery successfully realizes digital archive of art images in libraries thereof, such method is also valued by some research centers, among which one famous organization is Munsell Color Science Laboratory (MCSL). As VASARI system needs to spend huge time in scanning images, MCSL proposes to employ a monochrome CCD as digital sampling equipment and seven independent filters to improve the sampling equipment in the VASARI system. MCSL experimented with identical signal processing to prove that a method like this can also achieve satisfactory result and lower the sampling time. Besides, MCSL proposes that monochrome digital sampling equipment is not mandatory. Sampling equipment using three primary colors can also achieve sufficient results.
The multi-spectral acquisition system is divided into two parts. One part serves to acquire images, and the other part serves to perform multi-spectral analysis and spectral reconstruction. With reference to
B. Principal Axis Factor Analysis Method
The principal axis factor analysis method is one commonly used method in multivariate statistics, and has become a critical sector applied in color technology since 1960. The method has two major objectives. The first one is to define a direction of a principal axis of a great quantity of spectral information, and the second one is to simplify data of the spectral information. The method mainly targets calculating highly correlated and mutually independent variables after reorganizing original information, analyzing to obtain major factors, and lastly obtaining variability applied to most data of the original information.
With reference to
Deduction of Principal Axis Analysis Model
Assume that there are m variables (x1, x2, . . . , xm). Find coefficients (a1, a2, . . . , am) such that the value of the following expression is the maximum thereof.
Var(a1*x1+a2*x2+ . . . +am*xm) (2-10)
where Var represents the variance of a vector.
Using such method can obtain the maximal variables of original data. The coefficients (a1, a2, . . . , am) must satisfy the following normalization condition.
(a12+a22+ . . . +am2)=1 (2-11)
The condition of Eqn. 2-11 introduces a set of (a1, a2, . . . , am) to make the expression 2-10 maximal and be a unit vector of a m-dimensional space. (a1, a2, . . . , am) not only represent a concept of space vector but also the direction of the principal axis. Hence, m-dimensional spatial principal axis analysis method can be expressed by the following equations:
PC1=a11x1+a12x2+ . . . +a1mxm
PC2=a21x1+a22x2+ . . . +a2mxm
. . .
PCm=am1x1+am2x2+ . . . +ammxm (2-12)
where PC1, PC2 to PCm respectively represent a first principal axis, a second principal axis and a mth principal axis. The coefficients of the first principal axis (a11, a12, . . . , a1m) must satisfy Eqn. 2-11 and maximize the value of Var (a11* x1+a12*x2+ . . . +a1m*xm). Likewise, the coefficients of the second principal axis to the mth principal axis follow the same rule, and all coefficient vectors must be orthogonal. Consequently, the coefficients (ai1, ai2, . . . , aim) of PC1, PC2 to PCm can be identified through this method, in which i is a random number. Furthermore, mathematically, the original data can be rewritten as n×n covariance matrix. The eigenvector of the covariance matrix is expressed by (ai1, ai2, . . . , aim), and the corresponding eigenvalues represent the variances in the expression 2-10.
The coefficients of the principal axes (ai1, ai2, . . . , aim) are chosen so that the first principal axis PC1 has the maximal variance sufficiently interpreting most variability in the original data, and the second principal axis owns the maximum interpretation capability of variability of the original data not interpreted by the first principal axis. Usually, the original data have m variables, and m principal factors can still be identified after conversion. However, the principal axes to be identified are desirably to be as less and smaller as possible yet capable of interpreting 90% of the variability of the original data. This is the main reason why the principal axis factor analysis method is intentionally used by the present invention to analyze data.
When a group of data can be expressed by a non-square matrix and a group of random vectors X is expressed by Eqn. 2-13, the covariance matrix C can be expressed by Eqn. 2-14.
X=(x1,x2, . . . , xn)T (2-13)
C=E[(X−
Assume that the covariance matrix is p-dimensional. There exists p sets of basis coordinates, and assume that the n sets of basis matrix is U, which is expressed as follows:
U=[x1,x2, . . . , xp] (2-15)
The values of a range mapped by variables x in the p-dimensional space are expressed as follows:
y =UTX (2-16)
Hence, a covariance matrix C′ of y can be calculated as follows:
New covariance matrix C′ can be expressed by characteristic equation (Aλ=λX, where A is any one square matrix, λ is an eigenvalue, and X is an eigenvector). The expression is similar to that of Eqn. 2-18. Furthermore, the bases of the principal axes are mutually orthogonal unity vectors and can be expressed by Eqn. 2-19.
By combining Eqn. 2-18 and Eqn. 2-19, the eigenvalue λi can be obtained from the characteristic equation, and the equation is expressed as follows. Therefore, the matching eigenvectors are the principal axes.
C′=UTCU=λ
|C′−λI|=0 (2-20)
C. Multiple Linear Regression Analysis Method
Multiple linear regression analysis method is a method extensively applied to statistical analysis. Such method mainly aims at understanding if “target variables” can be expressed by linear equations of certain “independent variables” to explain characteristic of the “target variables”, meaning if variables X and Y are closely related. Through the multiple linear regression analysis method, the value of Y can be obtained from the value of X.
When the present invention is applied, the spectral value of the image is obtained through computation according to the value of digital counts (Dc) of an image taken by a digital camera. Characterize the system, understand the relationship between the Dc value and the spectral value, and adopt the multiple linear regression analysis method to obtain a conversion matrix.
Prior to the multiple linear regression analysis, first need to know the relationship between the Dc of the digital camera and the spectral value of a spectrophotometer. The present invention first discusses the spectral value of the spectrophotometer. Assume that i sets of spectral data are taken, and a reflective spectrum r(λ) obtained by simplifying each set of spectral reflectance function with the principal axis factor analysis can be expressed as follows:
r1(λ)=a11x1(λ)+a12x2(λ)+ . . . +a1nxn(λ)
r2(λ)=a21x1(λ)+a22x2(λ)+ . . . +a2nxn(λ)
. . .
ri(λ)=ai1x1(λ)+ai2x2(λ)+ . . . +ainxn(λ) (2-21)
where an is a coefficient corresponding to the maximal principal factor of the first n sets of equations. The Eqn. 2-21 can be simplified and expressed as follows:
r=aX (2-22)
where
r=[r1,r2, . . . , ri]T (2-23)
a=[a1,a2, . . . , an]=ain (2-24)
X=[x1,x2, . . . , xn]T (2-25)
On the other hand, after finishing the principal axis factor analysis of the spectrophotometer, next calculate the Dc value of the images taken by the digital camera. The Dc value can be expressed by Eqn. 2-26. The Dc value taken by the digital camera through k color filters is expressed by Eqn. 2-27.
Dc=∫P(λ)r(λ)S(λ)dλ (2-26)
Dck=∫P(λ)r(λ)Fk(λ)S(λ)dλ (2-27)
where S(λ) is a sensitivity distribution matrix of the digital camera, P(λ) is a distribution matrix of a spectrum of a light source, r(λ) is a distribution matrix of a reflective spectrum of an object, and Fk(λ) is a distribution matrix of a spectrum of the color filters. Besides, to simplify Eqn. 2-27, assume D(λ) to be Eqn. 2-28, and substitute that into Eqn. 2-27 to obtain Eqn. 2-29.
Substitute Eqn. 2-22 into Eqn. 2-29 to obtain Eqn. 2-30. Further combine XD as a constant matrix mk to obtain Eqn. 2-31.
Dck=aXD (2-30)
a=mkDck (2-31)
From the aforementioned principal axis factor analysis, a is the coefficient corresponding to the maximal principal factor of the first n sets of equations in the principal axis factor analysis, and Dc is the value of the digital camera. From Eqn. 2-31, a conversion matrix mk exists between the spectrophotometer and the digital camera. The multiple linear regression analysis method can be used to obtain the conversion matrix.
With reference to
using a spectrum-acquiring device to acquire spectral data of a plurality of sample color blocks and calculating coefficients of a basis matrix of the sample color blocks (101);
obtaining digital counts of the plurality of sample color blocks with a digital camera (102);
obtaining a conversion matrix in accordance with the coefficients of the basis matrix and the digital counts (103);
acquiring Dc counts of an original image with the digital camera, and generating a reconstructed image in accordance with the Dc of the original image and the conversion matrix (104); and
varying the conversion matrix in accordance with a new light source, and computing to generate a reconstructed image corresponding to the new light source in accordance with the Dc of the original image and the varied conversion matrix (105).
With reference to
Sr(λ)=[Sr(λ1),Sr(λ2),Sr(λ3) . . . , Sr(λm)] (3-1)
where m=201.
Moreover, the measured 24-color sample color blocks can be expressed as follows:
where i=1˜24.
After obtaining the 24 sets of spectral data, next use the principal axis factor analysis method to analyze. After the principal axis factor analysis, obtain a set of principal factors as shown in Eqn. 3-3. These factors can be treated as basis functions to linearly combine all spectral data as shown in Eqn. 3-4.
X=[x1(λ1),x2(λ2), . . . , x201(λ201)]T (3-3)
Sri(λ)=α1x1(λ1)+α2x2(λ2)+ . . . +α201x201(λ201) 3-4)
where αm represents the coefficient corresponding to each basis function.
As Sri(λ) is not a square matrix, need to use a pseudo inverse to calculate. First let ATA is a covariance matrix, and use a characteristic function (BXm=δmXm) to obtain an eigenvector, where δm is an eigenvalue, Xm is an eigenvector, as shown in the following equations.
Let B=ATA, then
BXm=δmXm,m=1˜201 (3-5)
After the calculation of Eqn. 3-5, obtain 201 eigenvalues and corresponding 201 sets of eigenvectors. The principal axis factor analysis method targets at identifying few sets of maximal eigenvector to constitute the principal factors of the spectral data, and use few factors to simulate the original spectrum. After having data of the characteristic functions, start the principal axis factor analysis. Before selecting the first few maximal eigenvalues for the principal factors (eigenvectors), calculate accumulated growth ratio expressed by Eqn. 3-6.
According to Eqn. 3-6, calculate the comparison between the number of eigenvectors and the accumulated growth ratio as shown in Table 3-1.
From Table 3-1, when the number of eigenvectors is or more than 6 sets, the accumulated growth ratio can be 99.9% and up, meaning that six sets or more of eigenvectors can represent the original spectrum. Therefore, the present invention employs the first six sets of eigenvectors as the basis functions of the spectrum. From the accumulated growth ratio, when selecting the first six eigenvectors as the basis function of the reconstructed spectrum, the basis function vector is expressed as follows:
After obtaining the first six sets of eigenvectors as the basis function, linearly combine all data of the original spectral data. For example, the first set of data can be expressed by Eqn. 3-8.
where αi represents the coefficient ahead an unknown linear combination.
Further use 24 sets as an example to generate Eqn. 3-9 which can be further simplified as Eqn. 3-10.
The dimension of the original eigenvectors is 201. After the principal axis factor analysis, the dimension is reduced to 6. As Xn is not a square matrix, the corresponding coefficient α is obtained through a pseudo inverse as expressed by Eqn. 3-11. The coefficients of the 24 color blocks are summarized as follows:
α(i)n=Sri(λ)×[(Xn)T]−1 (3-11)
where α1×10−4, i=˜6
After using the principal axis factor analysis to obtain the coefficients α of the first six set of eigenvectors, perform multiple linear regression analysis to the Dc values taken by the digital camera to obtain a conversion matrix between different systems.
Obtain the Dc values of the digital camera from the foregoing description, and combine the Dc values of the digital camera with Eqn. 3-10 to form Eqn. 3-12.
αn(i)=mn(k)×Dck(i) (3-12)
where n=1˜6, I=1˜24, and k=1˜3.
Eqn. 3-12 can be expressed in a matrix form as Eqn. 3-13 to calculate the conversion matrix m.
The spectrum can be reconstructed based on the calculated conversion matrix m.
Actual Measurement Examples
The present invention employs CANON 860 is digital camera as sampling equipment. There are two tasks upon measuring. One task goes through no color filter, and the other task goes through six color filters. The selected six color filters have a transmittance of 30% for red, green, blue, cyan, magenta, and yellow light, respectively.
The Dc values acquired by using the digital camera to photograph the 24 sample color blocks are expressed by Table 2.
The coefficients of the first six sets of basis functions of the sample color blocks measured by the spectrophotometer are listed as in Table 3.
According to Eqn. 3-13, the conversion matrix of the system can be calculated as listed in Table 4.
To further provide the digital camera with better shooting effect, a color calibration step can be performed to the camera. The standard of the color calibration is to match the RGB values of the 24-color sample color blocks taken by the spectrophotometer (CS1000A) with the Dc values of the digital camera. The way of calibration mainly obtain Gamma curve diagrams of the RGB values of the six sets of gray level color blocks on the lowest row of the sample color blocks taken by the digital camera and the spectrophotometer. By respectively setting the digital camera and the spectrophotometer as the horizontal axis and the vertical axis, obtain a regression equation. Lastly map the values of the 24 color blocks taken by the camera to those measured by the spectrophotometer to obtain a new set of camera data. Given the Gamma curve diagrams of the spectrophotometer and the camera, RGB color calibration of the camera and the spectrophotometer can be performed. The calibrated Dc values of the camera are listed on Table 5, and the new conversion matrix thereof is listed in Table 6.
With reference to
With reference to
One actual application of the present invention employs a regular three RGB digital camera to shoot a biological image to be determined, and intensifies the chromatic difference and contrast between a normal area and an area with pathological change of the biological image by varying light source.
First take the spectra of the 24-color sample color blocks with the spectrophotometer and the digital camera to respectively acquire a set of original spectra and a similar spectra. The two spectra are simultaneously divided by the spectrum of the original light source taken in the same laboratory environment to acquire a set of original reflective spectra and a set of similar reflective spectra. Subsequently, the set of original reflective spectra and the set of similar reflective spectra are simultaneously multiplied by a spectrum of a new light source to be replaced to obtain a new set of spectra of the 24-color sample color blocks. A conversion matrix after the light source is replaced can be obtained. In other words, as long as the spectrum of light source varies, new conversion matrix will be available to the generation of new images corresponding to the new light source.
With reference to
(A) The light source is the yellow lighting device. As yellow lighting devices are broadband light sources, color rendering thereof is relatively higher. So, the chromatic difference between the area having pathological change and normal tissue is not significant.
(B) The light source is the bluish white LED. As signals of blue spectral band are stronger, color rendering thereof is worse than broadband light sources. So, the chromatic difference between the area having pathological change and normal tissue is not as noticeable as in 2(A).
(C) The light source is the bluish white LED collaborated with a red filter. The oral image becomes more reddish. The oral image originally appears to be red, adding that the incorporated red filter makes the color of the oral image even more saturated. So, the area having pathological change is not easy to be recognized by naked eye.
(D) The light source is the bluish white LED collaborated with the green filter. The color of the area having pathological change is clearly noticed to be dark red. As the spectral band of the area having pathological change has higher light absorption, the color thereof is somewhat dull.
(E) and (F) The light sources are the bluish white LED collaborated with the blue filter and the bluish white LED collaborated with the yellow filter respectively. Due to the addition of the blue filter, the normal portion around the area having pathological change appears to be more white. As the background color of the oral tissue pertains to be a more reddish spectral band, wavelength difference between the red spectral band and the blue spectral band due to the addition of the blue filter is greater than that between the red spectral band and the yellow spectral band. The visual distinction is generated accordingly.
Even though numerous characteristics and advantages of the present invention have been set forth in the foregoing description, together with details of the structure and function of the invention, the disclosure is illustrative only. Changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Name | Date | Kind |
---|---|---|---|
6885394 | Noguchi | Apr 2005 | B1 |
7728904 | Quan et al. | Jun 2010 | B2 |
20070242293 | Owens | Oct 2007 | A1 |
Number | Date | Country | |
---|---|---|---|
20110216971 A1 | Sep 2011 | US |