Summary of the invention
In view of this, the embodiment of the present invention provides a kind of new camera lens dark angle compensation method and system, solve because the size of static random access memory in chip is limited in prior art, and make compensation coefficient table constrained storage, and the problem that chip manufacturing cost increases.
Embodiments provide a kind of dark angle compensation method of camera lens, comprising:
The image penetrating camera lens generation with uniform illumination is divided into N × M region;
Obtain the end points compensation coefficient of the end points in each region, generate compensation coefficient table;
Described compensation coefficient table is stored in the memory of chip exterior;
Image to be compensated is also divided into N × M region, obtains the end points compensation coefficient of K the end points be positioned at around pixel to be compensated from the memory of described chip exterior;
The compensation coefficient of described pixel to be compensated is obtained according to the end points compensation coefficient of K the end points be positioned at around described pixel to be compensated.
The dark angle compensation system of a kind of camera lens that the embodiment of the present invention provides, comprising:
Divide module, for the image penetrating camera lens generation with uniform illumination is divided into N × M region;
Computing module, for calculating the end points compensation coefficient of the end points in each region, generates compensation coefficient table; The compensation coefficient table of generation is left in chip exterior memory simultaneously;
Control module, for image to be compensated is also divided into N × M region, obtains the end points compensation coefficient of K the end points be positioned at around pixel to be compensated from described chip exterior memory;
Compensating module, for according to the end points compensation coefficient being positioned at K end points around described pixel to be compensated, obtains the compensation coefficient of described pixel to be compensated.
The dark angle compensation method and system of the camera lens utilizing the embodiment of the present invention to provide, compensation coefficient table needed for dark angle compensation is stored in the memory outside chip, the storage of compensation coefficient table not by the restriction of chip internal memory, thus extends the capacity of compensation coefficient table.In addition when chip processes a pixel to be compensated, the compensation coefficient of the end points that only need read around this pixel to be compensated from chip exterior memory can complete rectification, only need be equipped with a less memory in such chip and can reach high-quality dark angle compensation effect, not only be conducive to reducing chip manufacturing size, also reduce the manufacturing cost of chip.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Figure 2 shows that the schematic flow sheet of the dark angle compensation method of camera lens that one embodiment of the invention provides.As shown in Figure 2, the dark angle compensation method of this camera lens comprises:
Step 201: the image penetrating camera lens generation with uniform illumination is divided into N × M region.
Wherein each region is a rectangle possessing four end points.Penetrating camera lens with uniform illumination is to make the illumination condition of each pixel on the image of generation identical, thus ensure obtain the accuracy of end points compensation coefficient.
It will be appreciated by those skilled in the art that, the numerical value of N and M can determine by reaching best size of correcting desired zone, because follow-up compensation coefficient table is stored in chip exterior memory, user can according to the numerical value of mated condition arbitrary extension N and M of camera lens and lens sensors, wherein the numerical value of N also can equal M, and the concrete numerical value of the present invention to N and M does not limit.
In an embodiment of the present invention, the numerical value of N and M is all greater than 16.
Step 202: the end points compensation coefficient obtaining the end points in each region, generates compensation coefficient table.
The end points compensation coefficient of all end points in all regions in image is stored in compensation coefficient table, to judge which region this pixel to be compensated fall into according to the division in the position of pixel to be compensated and N × M region in subsequent step, and the end points compensation coefficient extracted around respective regions is for calculating the compensation coefficient of pixel to be compensated.
In an embodiment of the present invention, setting end points compensation coefficient is directly proportional to the intensity of illumination of image center, be inversely proportional to, and the acquisition of image center and end points intensity of illumination can adopt any method of the prior art with the intensity of illumination of described end points.The present invention does not limit the calculating of end points compensation coefficient and acquisition methods.
Step 203: the memory described compensation coefficient table being stored in chip exterior.
The storage of such compensation coefficient table, no longer by the restriction of chip internal memory size, extends the capacity of compensation coefficient table.In an embodiment of the present invention, the memory of chip exterior can adopt non-volatility memorizer, like this when the reading speed of non-volatility memorizer is enough fast, directly can read compensation coefficient from this non-volatility memorizer.When non-volatility memorizer reading speed is fast not, volatile storage (as DDR) is faster to need that compensation coefficient table is dumped to reading speed from non-volatility memorizer when system initialization, then from this volatile storage, reads compensation coefficient.
Step 204: image to be compensated is also divided into N × M region, obtains the end points compensation coefficient of K the end points be positioned at around pixel to be compensated from the memory of described chip exterior.
When chip will compensate process to an image to be compensated, first image to be compensated also to be divided into N × M region.And then compensate process according to the pending pixel that order is from left to right treated in compensation image picture line by line.When processing a certain pending pixel, only need obtain the end points compensation coefficient of end points around this pending pixel from chip exterior memory according to the position of pending pixel, and do not need to store all end points compensation coefficients at chip internal memory, thus make only need to be equipped with in chip a less memory and can reach high-quality dark angle compensation effect, this is not only conducive to reducing chip manufacturing size, also reduces the manufacturing cost of chip.
It will be understood by those skilled in the art that pixel to be compensated can be positioned at the central area of this K end points, also can not be positioned at the central area of this K end points.As long as can obtain the compensation coefficient of pixel to be compensated according to the end points compensation coefficient of this K end points, the present invention does not limit this.
Step 205: the compensation coefficient obtaining described pixel to be compensated according to the end points compensation coefficient of K the end points be positioned at around pixel to be compensated.
It will be understood by those skilled in the art that the central area whether being positioned at this K end points according to pixel to be compensated, the compensation coefficient algorithm in step 205 can be different, and the specific algorithm of the present invention to the compensation coefficient obtaining pixel to be compensated does not limit.
Those skilled in the art are further appreciated that the difference according to compensation coefficient algorithm in step 205, and the required end points correction system number be positioned at around pending pixel obtained also can be different in step 204 for user, and the present invention does not limit this equally.
Such as, in an embodiment of the present invention, the end points compensation coefficient of 4 end points be positioned at around pixel to be compensated can be utilized to generate the compensation coefficient of this pixel to be compensated, for Fig. 3, the end points compensation coefficient that can be 4 end points of 1 ~ 4 according to label calculates the bucking-out system of pending pixel A.In one embodiment of the invention, the end points compensation coefficient of 16 end points around pixel to be compensated can also be utilized to generate the compensation coefficient of this pixel to be compensated, same for Fig. 3, the end points compensation coefficient that can be 16 end points of 1 ~ 16 according to label calculates the compensation coefficient of pending pixel A.To be described in detail the process how utilizing the end points compensation coefficient of 16 end points around pixel to be compensated to generate the compensation coefficient of this pixel to be compensated with the embodiment shown in Fig. 4 and Fig. 5 below.
Figure 4 shows that the compensation principle schematic diagram of the dark angle compensation method of camera lens that one embodiment of the invention provides.As shown in Figure 4, when pixel A to be compensated is positioned at the centre position of image to be compensated, when namely having 16 end points around pixel A to be compensated, the principle of this compensation method is:
First from compensation coefficient table, obtain the end points compensation coefficient of 16 end points around pixel A to be compensated.
And then calculate the compensation coefficient of pixel A to be compensated in cubic algebraic curves mode according to 16 the end points compensation coefficients obtained.It is mild that the benefit utilizing cubic algebraic curves mode to carry out compensation coefficient calculating is to make the compensation coefficient change in each region.
Detailed process can be: the value first y direction being obtained to four points (B, C, D and E) with the cubic algebraic curves that every four end points make one dimension, and then four points (B, C, D and E) remake the cubic algebraic curves of one dimension thus obtain the compensation coefficient of pixel A to be compensated in x direction.The formula that wherein cubic algebraic curves utilizes is:
X in formula is dx or dy in figure.
Figure 5 shows that the compensation principle schematic diagram of the dark angle compensation method of camera lens that one embodiment of the invention provides.As shown in Figure 5, when pixel A to be compensated is positioned at the side of image to be compensated, the number of endpoint quantity not sufficient 16 namely around pixel A to be compensated, this compensation way first need to adopt extrapolation mode obtain polishing image to be compensated the end points compensation coefficient of end points that lacks.
Such as, for Fig. 5, end points around pixel A to be compensated is less than 16 points, now can under y direction, the mode of extrapolation be first adopted to calculate the value of 4 points (B, C, D and E), 12 points that such B, C, D and E add the image upper left corner to be compensated first three rows can form 16 end points around pixel A to be compensated, and pixel A to be compensated is not in the central area of these 16 end points.Here obtaining the algorithm shown in the algorithm of the compensation coefficient of pixel A to be compensated and Fig. 3 according to these 16 end points compensation coefficients can be different.
Detailed process can be: the value this 16 end points one dimension cubic algebraic curves done on y direction being drawn 4 points (F, G, H and I).These 4 points (F, G, H and I) remake extrapolation and draw value x direction being put J.Finally, 12 somes one dimension cubic algebraic curves done on x direction adding upper left corner first three columns in image to be compensated according to a J can calculate the compensation coefficient of current to be compensated some A.
The whole process that the pixel to be compensated for regions all in a certain two field picture compensates is described in detail below with an embodiment.
Figure 6 shows that the schematic flow sheet of the dark angle compensation method of camera lens that one embodiment of the invention provides.As shown in Figure 6, and carry out the mode that the compensation process of each region pixel to be compensated compensates by from left to right, line by line, now detailed process is as follows:
Step 601: judge that whether region residing for pixel to be compensated is the frame head of current frame image, namely residing for pixel to be compensated, whether region is positioned at the upper left corner of current frame image.If not, then make flow process return idle waiting state; If so, then step 502 is performed.
Step 602: the end points compensation coefficient obtaining K the end points be positioned at around pixel to be compensated.Wherein, if when residing for pixel to be compensated, region is positioned at the side of current frame image, then with around extrapolation mode polishing pixel to be compensated the end points compensation coefficient of end points that lacks.
Step 603: the compensation coefficient obtaining pixel to be compensated according to the end points compensation coefficient of this K end points.
Step 604: judge whether the postamble (i.e. the lower right corner of current frame image) reaching current frame image; If so, then illustrate that all pixels of current frame image have compensated complete all, flow process returns idle waiting state; If not, then step 605 is performed.
Step 605: judge whether the end reaching current line; If so, then return step 602 to compensate from first pixel to be compensated obtaining next line; If not, then step 606 is performed.
Step 606: judge whether region residing for next pixel to be compensated has a common boundary with region described in current pixel to be compensated; If not, then illustrate that this next pixel to be compensated and current pixel to be compensated are positioned at the same area, now return step 603 and directly compensate; If so, then step 607 is performed.
Step 607: the end points compensation coefficient removing the end points that Far Left one arranges in K end points around current pixel to be compensated, and obtain the end points compensation coefficient of the end points of row on the right side of next pixel to be compensated, to form the end points compensation coefficient of K the end points be positioned at around this next pixel to be compensated; Then to this, next pixel to be compensated compensates according to K end points compensation coefficient of new composition to return step 603.
To calculate according to 16 end points compensation coefficients the compensation coefficient treating supplementary pixel, step 607 can be: the end points compensation coefficient retaining 12 end points of right three row in 16 end points around current pixel to be compensated, remove the end points compensation coefficient of remaining 4 end points, and obtain the end points compensation coefficient in 4 end points of row on the right side of next pixel to be compensated; And then to this, next pixel to be compensated compensates according to new 16 the end points compensation coefficients formed.Such chip internal memory at most only need store 20 end points compensation coefficients can complete rectification to next one pixel to be compensated, and this is not only conducive to the size reducing storage on chip and chip, also reduces the manufacturing cost of chip.
More than compensate flow cycles repeatedly until in this two field picture all pixels to be compensated all by rectification complete.
Figure 7 shows that the structural representation of the dark angle compensation system of camera lens that one embodiment of the invention provides.As shown in Figure 7, the dark angle compensation system of this camera lens comprises:
Divide module, for the image penetrating camera lens generation with uniform illumination is divided into N × M region.In an embodiment of the present invention, divide module and be positioned at chip exterior.
Computing module, for calculating the end points compensation coefficient of the end points in each region, generates compensation coefficient table; The compensation coefficient table of generation is left in chip exterior memory simultaneously.In an embodiment of the present invention, computing module is positioned at chip exterior.
Control module, for image to be compensated is also divided into N × M region, obtains the end points compensation coefficient of K the end points be positioned at around pixel to be compensated from described chip exterior memory.In an embodiment of the present invention, chip exterior memory is non-volatility memorizer.When the reading speed of non-volatility memorizer is enough fast, directly compensation coefficient can be read from this non-volatility memorizer.When non-volatility memorizer reading speed is fast not, volatile storage (as DDR) is faster also to need that compensation coefficient table is dumped to reading speed from non-volatility memorizer when system initialization, then from this volatile storage, reads compensation coefficient.
In an alternative embodiment of the invention, the end points compensation coefficient of K the end points be positioned at around pixel to be compensated obtained is stored in chip internal memory by control module.This chip internal memory can be static random access memory.
Compensating module, for being positioned at the end points compensation coefficient of K end points around pixel to be compensated described in basis, obtains the compensation coefficient of described pixel to be compensated.
In an alternative embodiment of the invention, control module and/or compensating module are positioned at chip internal.
These are only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement etc., all should be included within protection scope of the present invention.