Disclosure of Invention
The invention provides a device chromatic aberration correction method, which avoids chromatic dispersion observed by human eyes and does not need to change the hardware structure of the device.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for chromatic aberration correction of a device having a lens through which a user views a digital image, characterized by: the method comprises the following steps:
acquiring a two-dimensional index value (u, v) corresponding to each pixel of the digital image;
obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b);
According to (u 'to the digital image'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb';
Calculating the color value C' of each pixel after dispersionr'+C'gg+Cb', obtaining a digital image after dispersion;
the dispersed digital image is observed through the lens.
Further, obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) The specific calculation formula is as follows:
(u'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+...+Krn(u,v)n;
(u'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+...+Kgn(u,v)n;
(u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+...+Kbn(u,v)n(ii) a Wherein,
Kr、Kr1、Kr2、Kr3、...、Krn,Kg、Kg1、Kg2、Kg3、...、Kgn,Kb、Kb1、Kb2、Kb3、...、Kbnis a coefficient, determined by the refractive index of the lens.
Still further, the obtaining of the red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) The specific calculation formula is as follows:
(u'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+Kr4(u,v)4+Kr5(u,v)5+Kr6(u,v)6;
(u'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+Kg4(u,v)4+Kg5(u,v)5+Kg6(u,v)6;
(u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+Kb4(u,v)4+Kb5(u,v)5+Kb6(u,v)6;
wherein, Kr、Kr1、Kr2、Kr3、Kr4、Kr5、Kr6,Kg、Kg1、Kg2、Kg3、Kg4、Kg5、Kg6,Kb、Kb1、Kb2、Kb3、Kb4、Kb5、Kb6Is a coefficient, determined by the refractive index of the lens.
Further, the device is a head mounted display device.
Equipment color difference correction system and equipmentThere is lens, and the user observes digital image through lens, its characterized in that: the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring a two-dimensional index value (u, v) corresponding to each pixel of the digital image; a color index value obtaining module for obtaining a red index value (u'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) (ii) a A sampling module for sampling the digital image by (u'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'; a calculation module for calculating the color value C ═ C of each pixel after dispersionr'+Cg'+Cb', obtaining a digital image after dispersion.
Further, the color index value obtaining module includes:
a red index value obtaining unit for obtaining a red index value (u 'for each pixel subjected to lens dispersion'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+...+Krn(u,v)n;
A green index value obtaining unit for obtaining a green index value (u 'for each pixel subjected to lens dispersion'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+...+Kgn(u,v)n;
A blue index value obtaining unit for obtaining a blue index value (u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+...+Kbn(u,v)n(ii) a Wherein,
Kr、Kr1、Kr2、Kr3、...、Krn,Kg、Kg1、Kg2、Kg3、...、Kgn,Kb、Kb1、Kb2、Kb3、...、Kbnis a coefficient, determined by the refractive index of the lens.
Still further, the color index value obtaining module includes:
a red index value obtaining unit for obtaining a red index value (u 'for each pixel subjected to lens dispersion'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+Kr4(u,v)4+Kr5(u,v)5+Kr6(u,v)6;
A green index value obtaining unit for obtaining a green index value (u 'for each pixel subjected to lens dispersion'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+Kg4(u,v)4+Kg5(u,v)5+Kg6(u,v)6;
A blue index value obtaining unit for obtaining a blue index value (u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+Kb4(u,v)4+Kb5(u,v)5+Kb6(u,v)6;
Wherein, Kr、Kr1、Kr2、Kr3、Kr4、Kr5、Kr6,Kg、Kg1、Kg2、Kg3、Kg4、Kg5、Kg6,Kb、Kb1、Kb2、Kb3、Kb4、Kb5、Kb6Is a coefficient, determined by the refractive index of the lens.
Further, the device is a head mounted display device.
Compared with the prior art, the invention has the advantages and positive effects that: the equipment chromatic aberration correction method and the equipment chromatic aberration correction system acquire a two-dimensional index value (u, v) corresponding to each pixel of a digital image; obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) (ii) a According to (u 'to the digital image'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'; calculating the color value C' of each pixel after dispersionr'+Cg'+Cb', obtaining a digital image after dispersion; the dispersed digital image is observed through the lens, and because the image has the dispersion effect, when the human eyes observe the image through the lens, the dispersion effect on the image and the dispersion characteristic of the lens are mutually offset, so that the image seen by the human eyes is a normal image without dispersion, the dispersion phenomenon observed by the human eyes is avoided, the use experience of a user is improved, and the competitiveness of equipment is improved; and the hardware structure of the equipment does not need to be changed, the cost is lower, and the realization is convenient.
Other features and advantages of the present invention will become more apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and examples.
The chromatic aberration correction method of the device of the embodiment is characterized in that the device is provided with a lens, and a user observes a digital image through the lens. In this embodiment, the device is a head-mounted display device, and the user wears the device and observes the digital image through the lens to experience the user.
The chromatic aberration correction method of the present embodiment specifically includes the following steps, as shown in fig. 1.
Step S1: a two-dimensional index value (u, v) corresponding to each pixel of the digital image is obtained.
Step S2: obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b)。
Using a commonly used fitting method, an nth order polynomial, called distortion polynomial, is obtained for the lens with respect to the three colors red, green and blue (u, v). Thus, the red, green and blue of the same pixel color have their respective index values.
Specifically, (1) the index value (u'r,v'r) The calculation formula of (2) is as follows:
(u'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+...+Krn(u,v)n,
wherein, Kr、Kr1、Kr2、Kr3、...、KrnIs a coefficient ofDetermined by the refractive index of the lens and the frequency of the red light.
(2) Index value (u 'corresponding to green component in color corresponding to each pixel after passing through lens'g,v'g) The calculation formula of (2) is as follows:
(u'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+...+Kgn(u,v)n,
wherein, Kg、Kg1、Kg2、Kg3、...、KgnIs a coefficient determined by the refractive index of the lens and the frequency of the green light.
(3) Index value (u 'corresponding to blue component in color corresponding to each pixel after passing through lens'b,v'b) The calculation formula of (2) is as follows:
(u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+...+Kbn(u,v)n,
wherein, Kb、Kb1、Kb2、Kb3、...、KbnIs a factor determined by the refractive index of the lens and the frequency of the blue light.
Obtaining accurate (u 'through the three polynomials'r,v'r)、(u'g,v'g)、(u'b,v'b) And the accuracy is high, so that the accuracy of the color value of the pixel calculated subsequently is improved.
In order to obtain both (u 'with higher accuracy'r,v'r)、(u'g,v'g)、(u'b,v'b) And the calculation speed is improved, the calculation load is reduced, and all the three polynomials are sextic polynomials. Namely, it is
(u'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+Kr4(u,v)4+Kr5(u,v)5+Kr6(u,v)6,
Wherein, Kr、Kr1、Kr2、Kr3、Kr4、Kr5、Kr6Is a coefficient determined by the refractive index of the lens and the frequency of red light. For example, when a certain type of lens is selected, Kr=1.0、Kr1=0.002801、Kr2=-0.04208、Kr3=0.1972、Kr4=-0.4513、Kr5=0.4744、Kr6=-0.1907。
(u'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+Kg4(u,v)4+Kg5(u,v)5+Kg6(u,v)6,
Wherein, Kg、Kg1、Kg2、Kg3、Kg4、Kg5、Kg6Is a coefficient determined by the refractive index of the lens and the frequency of the green light. For example, when a certain type of lens is selected, Kg=1.0、Kg1=0.0、Kg2=0.0、Kg3=0.0、Kg4=0.0、Kg5=0.0、Kg6=0.0。
(u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+Kb4(u,v)4+Kb5(u,v)5+Kb6(u,v)6,
Wherein, Kb、Kb1、Kb2、Kb3、Kb4、Kb5、Kb6Is a factor determined by the refractive index of the lens and the frequency of the blue light. For example, when a certain type of lens is selected, Kb=1.0、Kb1=-0.009364、Kb2=0.1262、Kb3=-0.5844、Kb4=1.312、Kb5=-1.362、Kb6=0.5408。
Step S3: according to (u 'to the digital image'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'。
In particular, the red component value Cr'=S(u'r,v'r) Green component value C'g=S(u'g,v'g) Blue component value C'b=S(u'b,v'b) And S is a sampling function.
Step S4: calculating the color value C' of each pixel after dispersionr'+C'g+Cb', obtaining a digital image after dispersion.
Since the color of a pixel is composed of red, green, and blue, the color value of each pixel can be represented by the formula C ═ Cr'+Cg'+Cb' obtaining.
The color value of each pixel after dispersion is obtained, namely, a digital image after dispersion is obtained.
Step S5: the dispersed digital image is observed through the lens.
Will red component value Cr', Green component value C'gBlue component value CbAdding up to obtain the color value of each pixel after dispersion, thereby obtaining a new digital image after dispersion, and because the image has the dispersion effect, when the human eye observes the image through the lens, the dispersion effect on the image and the dispersion characteristic of the lens are mutually offset, so that the image seen by the human eye is a normal image without dispersion phenomenon.
The device chromatic aberration correction method of the embodiment acquires a two-dimensional index value (u, v) corresponding to each pixel of a digital image; obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) (ii) a According to (u 'to the digital image'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'; calculating the color value C' of each pixel after dispersionr'+Cg'+Cb', obtaining a digital image after dispersion; the dispersed digital image is observed through the lens, and because the image has the dispersion effect, when the human eyes observe the image through the lens, the dispersion effect on the image and the dispersion characteristic of the lens are mutually offset, so that the image seen by the human eyes is a normal image without dispersion, the dispersion phenomenon observed by the human eyes is avoided, the use experience of a user is improved, and the competitiveness of equipment is improved; and the hardware structure of the equipment does not need to be changed, the cost is lower, and the realization is convenient.
Based on the design of the above method for correcting chromatic aberration of the device, this embodiment further provides a system for correcting chromatic aberration of the device, where the device has a lens, and a user observes a digital image through the lens. In this embodiment, the device is a head-mounted display device, and the user wears the device and observes the digital image through the lens to experience the user.
The device chromatic aberration correction system of the embodiment mainly includes an obtaining module, a color index value obtaining module, a sampling module, a calculating module, and the like, as shown in fig. 2.
In particular, the present invention relates to a method for producing,
an acquisition module for acquiring a two-dimensional index value (u, v) corresponding to each pixel of the digital image.
A color index value obtaining module for obtaining a red index value (u'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b)。
A sampling module for sampling the digital image by (u'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'。
A calculation module for calculating the color value C ═ C of each pixel after dispersionr'+Cg'+Cb', obtaining a digital image after dispersion.
In this embodiment, the color index value obtaining module mainly includes a red index value obtaining unit, a green index value obtaining unit, and a blue index value obtaining unit, as shown in fig. 3.
A red index value obtaining unit for obtaining a red index value (u 'for each pixel subjected to lens dispersion'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+...+Krn(u,v)n。
A green index value obtaining unit for obtaining a green index value (u 'for each pixel subjected to lens dispersion'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+...+Kgn(u,v)n。
A blue index value obtaining unit for obtaining a blue index value (u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+...+Kbn(u,v)n. Wherein,
Kr、Kr1、Kr2、Kr3、...、Krn,Kg、Kg1、Kg2、Kg3、...、Kgn,Kb、Kb1、Kb2、Kb3、...、Kbnis a coefficient, determined by the refractive index of the lens.
As another preferred design of the present embodiment,
a red index value obtaining unit for obtaining a red index value (u 'for each pixel subjected to lens dispersion'r,v'r)=Kr+Kr1(u,v)+Kr2(u,v)2+Kr3(u,v)3+Kr4(u,v)4+Kr5(u,v)5+Kr6(u,v)6。
A green index value obtaining unit for obtaining a green index value (u 'for each pixel subjected to lens dispersion'g,v'g)=Kg+Kg1(u,v)+Kg2(u,v)2+Kg3(u,v)3+Kg4(u,v)4+Kg5(u,v)5+Kg6(u,v)6。
A blue index value obtaining unit for obtaining a blue index value (u'b,v'b)=Kb+Kb1(u,v)+Kb2(u,v)2+Kb3(u,v)3+Kb4(u,v)4+Kb5(u,v)5+Kb6(u,v)6。
Wherein, Kr、Kr1、Kr2、Kr3、Kr4、Kr5、Kr6,Kg、Kg1、Kg2、Kg3、Kg4、Kg5、Kg6,Kb、Kb1、Kb2、Kb3、Kb4、Kb5、Kb6Is a coefficient, determined by the refractive index of the lens.
The working process of the device chromatic aberration correction system has been described in detail in the device chromatic aberration correction method, and is not described herein again.
The apparatus of the present embodimentThe chromatic aberration correction system acquires a two-dimensional index value (u, v) corresponding to each pixel of the digital image; obtaining a red index value (u ') corresponding to each pixel subjected to lens dispersion'r,v'r) Green index value (u'g,v'g) Blue index value (u'b,v'b) (ii) a According to (u 'to the digital image'r,v'r)、(u'g,v'g)、(u'b,v'b) Sampling to obtain a red component value C of the color value of each dispersed pixelr', Green component value C'gBlue component value Cb'; calculating the color value C' of each pixel after dispersionr'+Cg'+Cb', obtaining a digital image after dispersion; the dispersed digital image is observed through the lens, and because the image has the dispersion effect, when the human eyes observe the image through the lens, the dispersion effect on the image and the dispersion characteristic of the lens are mutually offset, so that the image seen by the human eyes is a normal image without dispersion, the dispersion phenomenon observed by the human eyes is avoided, the use experience of a user is improved, and the competitiveness of equipment is improved; and the hardware structure of the equipment does not need to be changed, the cost is lower, and the realization is convenient.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; 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 various changes may be made and equivalents may be substituted for elements thereof; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions.