Summary of the invention
According to problems of the prior art, the standard white point region namely pre-set is accurate not, and the algorithm that white point judges is too complicated, now provides a kind of technical scheme about white point region representation and decision method, specifically comprises:
A kind of white point region representation and decision method, be applicable to, in white balance calibration technology, wherein, specifically comprise:
Step 1, sets up a white point region;
Step 2, adopts multiple default polygon to divide described white point region, to form a default standard white point region;
Step 3, the line segment adopting many to be parallel to each other represents described standard white point region;
Step 4, mates the point to be determined in captured image with many described line segments in described standard white point region; Judge whether described point to be determined is white point according to matching result subsequently;
Step 5, judges whether all to judge the point all described to be determined in captured image;
If all do not judge all described points to be determined, then return described step 4;
If all judge all described points to be determined, then go to step 6;
Step 6, calculates corresponding white balance calibration parameter according to the dot information of the described decision-point being judged as white point, and with the image captured by described white balance calibration parametric calibration.
Preferably, this white point region representation and decision method, wherein, described point to be determined is the arbitrfary point in captured image.
Preferably, this white point region representation and decision method, wherein, in described step 2, when setting up described white point region, absorb the photo of multiple white objects under different-colour environment, corresponding region of often opening the described white object in described photo, extracts a corresponding standard point subsequently;
Multiple described standard point is converted to the standard white point of the multiple correspondences being arranged in an XOY coordinate system with x=R/G, y=B/G; To the region of multiple described standard white point be included as described white point region; Described R is the R value component in RGB system; Described G is the G value component in RGB system; Described B is the B value component in RGB system.
Preferably, this white point region representation and decision method, wherein, described step 2 specifically comprises:
Step 21, judges any two default described polygonal regions:
If two described polygons comprise lap, then reject the region at described lap place;
If two described polygons mutually disjoint, then retain the region at two described polygon places;
Step 22, is defined as described standard white point region by the region at the multiple described polygon place formed according to the judged result of described step 21; Go to described step 3 subsequently.
Preferably, this white point region representation and decision method, wherein, described step 3 specifically comprises:
Step 31a, arranges the described line segment that many are parallel to X-axis in described XOY coordinate system;
Step 32a, retains the line segment being positioned at described standard white point region;
Step 33a, is shown in line segment form described in every bar in described XOY coordinate system.
Preferably, this white point region representation and decision method, wherein, in described step 32a, with coordinate figure (y, x
0, x
1) represent line segment described in every bar;
Described y represents the Y-axis coordinate figure that described line segment is corresponding; Described x
0represent that described line segment is from the X-axis coordinate figure corresponding to an end points close to the initial point of described XOY axle; Described x
1represent that described line segment is from the X-axis coordinate figure corresponding to an end points away from the initial point of described XOY axle.
Preferably, this white point region representation and decision method, wherein, described step 3 specifically comprises:
Step 31b, arranges the described line segment that many are parallel to Y-axis in described XOY coordinate system;
Step 32b, retains the line segment being positioned at described standard white point region;
Step 33b, is shown in line segment form described in every bar in described XOY coordinate system.
Preferably, this white point region representation and decision method, wherein, in described step 33b, with coordinate figure (x, y
0, y
1) represent line segment described in every bar;
Described x represents the X-axis coordinate figure that described line segment is corresponding; Described y
0represent that described line segment is from the Y-axis coordinate figure corresponding to an end points close to the initial point of described XOY axle; Described y
1represent that described line segment is from the Y-axis coordinate figure corresponding to an end points away from the initial point of described XOY axle.
Preferably, this white point region representation and decision method, wherein, described step 4 specifically comprises:
Step 41a, sets the X-axis coordinate of described point to be determined in described XOY coordinate system;
Step 42a, mates the described Y-axis coordinate figure of point to be determined with the Y-axis coordinate figure of described line segment with the first method preset, and is mated with the X-axis coordinate figure of described line segment by the described X-axis coordinate figure of point to be determined; According to matching result, described point to be determined is judged.
Preferably, the X-axis setting coordinate of described point to be determined in described XOY coordinate system, wherein, in described step 41a, is x by this white point region representation and decision method
l=R
l/ G
l, Y-axis setting coordinate is y
l=B
l/ G
l;
Described R
lrepresent the R value component of the rgb pixel value of described point to be determined; Described G
lrepresent the G value component of the rgb pixel value of described point to be determined; Described B
lrepresent the B value component of the rgb pixel value of described point to be determined.
Preferably, this white point region representation and decision method, wherein, in described step 42a, described the first default method specifically comprises:
By described y
lvalue is mated with the Y-axis coordinate figure in line segment described in every bar;
If described y
lvalue does not meet y
min≤ y
l≤ y
max, then think that described point to be determined is non-white point;
If described y
lmeet y
min≤ y
l≤ y
max; Y-axis coordinate figure is then found to mate described y
lthe line segment of value is to mate line segment, subsequently to described x as first
lvalue is mated; By described x
lbe worth the corresponding described x mating line segment to described first
0and corresponding described x
1mate:
If described x
lmeet x
0≤ x
l≤ x
1, then judge that described point to be determined is as white point; ;
If described x
ldo not meet x
0≤ x
l≤ x
1, then judge that described point to be determined is as non-white point; ;
Described y
minrepresent the minimum value in the Y-axis coordinate figure of described line segment; Described y
maxrepresent the maximum in the Y-axis coordinate figure of described line segment.
Preferably, this white point region representation and decision method, wherein, described step 4 specifically comprises:
Step 41b, sets the Y-axis coordinate of described point to be determined in described XOY coordinate system;
Step 42b, mates the described X-axis coordinate figure of point to be determined with the X-axis coordinate figure of described line segment with the second method preset, and is mated with the Y-axis coordinate figure of described line segment by the described Y-axis coordinate figure of point to be determined; According to matching result, described point to be determined is judged.
Preferably, this white point region representation and decision method, wherein,
In described step 41b, be x by the X-axis setting coordinate of described point to be determined in described XOY coordinate system
l=R
l/ G
l, Y-axis setting coordinate is y
l=B
l/ G
l;
Described R
lrepresent the R value component of the rgb pixel value of described point to be determined; Described G
lrepresent the G value component of the rgb pixel value of described point to be determined; Described B
lrepresent the B value component of the rgb pixel value of described point to be determined.
Preferably, this white point region representation and decision method, wherein, in described step 42b, described the first default method specifically comprises:
By described x
lvalue is mated with the X-axis coordinate figure in line segment described in every bar;
If described x
lvalue does not meet x
min≤ x
l≤ x
max, then think that described point to be determined is non-white point; ;
If described x
lmeet x
min≤ x
l≤ x
max; X-axis coordinate figure is then found to mate described x
lthe line segment of value is to mate line segment, subsequently to described y as first
lvalue is mated; By described y
lbe worth the corresponding described y mating line segment to described first
0and corresponding described y
1mate:
If described y
lmeet y
0≤ y
l≤ y
1, then think that described point to be determined is white point; ;
If described y
ldo not meet y
0≤ y
l≤ y
1, then think that described point to be determined is non-white point;
Described x
minrepresent the minimum value in the X-axis coordinate figure of described line segment; Described x
maxrepresent the maximum in the X-axis coordinate figure of described line segment.
The beneficial effect of technique scheme is:
1) adopt the method that multiple polygon splits merging to divide white point region, and represent with line segment, the region that can white point found more accurately to distribute;
2) polygonal choosing can be determined by user, is supplied to the function that user chooses white point region according to actual needs, improves the experience of user;
3) simplify white point decision algorithm, alleviate the operation burden of calculating device in camera, improve the operational efficiency of camera.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
When camera is taken, often need to do white balance process to the subject under varying environment.Before doing white balance process, first need that one is done to the standard point under different-colour environment and select.Selecting for standard point, first adopts and needs the camera carrying out calibrating to take the white object be under different-colour environment.Due to the image taken under same light source, the color value that wherein white object of real world is corresponding is at coordinate XOY coordinate system, wherein x=R/G, y=B/G, finally can trend towards converging to a bit, therefore gather the above-mentioned point of the correspondence under different-colour environment to form the multiple standard white points under XOY coordinate system.Under a concrete example, the distribution situation of standard white point as shown in Figure 1.
Suppose to include the standard white point 11 under colour temperature environment as much as possible in white point distributed areas as shown in Figure 1, then adopt default several points to indicate the border in standard white point region 12.As shown in Figure 1, what adopt 20 points 13 to delimit in the 12(Fig. 1 of standard white point region only to mark in 20 points is several), above-mentioned 20 points are followed successively by: (x
0, y
t0), (x
0, y
b0) ..., (x
n, y
tn), (x
n, y
bn), wherein 0≤n≤9, and y
bn≤ y
tn.Connect above-mentioned multiple point, finally delimit a standard white point region 13.
When behind generation standard white point region, when actual photographed photo, just can carry out the judgement of white point according to this standard white point region, and then carry out white balance calibration.For the judgement of white point usually at ISP(Image Signal Processor, image-signal processor) in carry out.The diagram be illustrated in figure 2 for the judgement of white point describes, and its idiographic flow as shown in Figure 3, can comprise:
Step a, for the arbitrfary point K in image, supposes that the rgb pixel value of this K is for (R
k, G
k, B
k) obtain the coordinate figure (x of this K in above-mentioned XOY axis coordinate system
k=R
k/ G
k, y
k=B
k/ G
k);
Step b, compares above-mentioned coordinate figure and standard white point region;
Step c, is back to step a, until all white points be all judged complete till.
In above-mentioned steps b, concrete comparative approach is:
The coordinate of first comparison X-axis; If x
k∈ [x
0, x
9], then Y-axis coordinate is compared; Otherwise this point is not white point;
The coordinate of comparison Y-axis, thus white point is judged:
Find x
kaffiliated minimum sets of line segments x
nx
n+1;
Find corresponding to x
ny
tnand y
bn, and correspond to x
n+1y
t (n+1)and y
b (n+1);
Obtain straight line x=x respectively
kwith line segment y
tny
t (n+1)intersection point K
t, and straight line x=x
kwith line segment y
bny
b (n+1)intersection point K
b; If K
ty-axis coordinate be y
tk, K
by-axis coordinate be y
bk;
If y
k∈ [y
tk, y
bk], then judge that this point is white point; Otherwise, judge that this point is not as white point.
Subsequently, utilize the dot information being judged as white point, calculate white balance calibration parameter, to calibrate colour cast phenomenon.
For white balance calibration, above-mentioned three processes (namely pre-set standard white point region-filter out according to this standard white point region the dot information that the white point-basis in image obtains to calculate white balance calibration value) be must through step.Therefore and unstable but the delimitation for standard white point region in prior art is comparatively loaded down with trivial details, and the accuracy of its defined area is along with getting the change of a quantity and corresponding change.Meanwhile, the algorithm that white point judges is too loaded down with trivial details, thus decrease in efficiency when causing camera to carry out white point determination processing.Below provide a kind of easier delimitation standard white point region and the method that white point is judged.
As shown in Figure 4, in preferred embodiment of the present invention, before white balance process, the method that white point judges is comprised:
Step 1, sets up a white point region;
Step 2, adopts multiple default polygon to divide white point region, to form a default standard white point region;
Step 3, the accurate white point region of the line segment form indicating adopting many to be parallel to each other;
Step 4, mates the point to be determined in captured image with many line segments in standard white point region; Judge whether point to be determined is white point according to matching result subsequently;
Step 5, judges whether all to judge the point all to be determined in captured image;
If all do not judge all points to be determined, then return step 4;
If all judge all points to be determined, then go to step 6;
Step 6, calculates corresponding white balance calibration parameter according to the dot information of the decision-point being judged as white point, and is judged as the decision-point of non-white point with white balance calibration parametric calibration.
Specifically, above-mentioned steps can further describe into:
As described above, in preferred embodiment of the present invention, form a white point region in above-mentioned steps 1 and specifically comprise:
First the white object under different-colour environment is taken, and using a corresponding white point in the image of white object taken under different-colour environment as the standard white point under this colour temperature environment.In preferred embodiment of the present invention, above-mentioned white point is the point that the image of the white object of picked-up tends to converge in XOY coordinate system (x=R/G, y=B/G).
Subsequently, the standard white point under above-mentioned different-colour environment is shown in XOY coordinate system (x=R/G, y=B/G) in the mode of Coordinate Conversion.Wherein R, G and B are respectively the RGB component of the image pixel of standard white point.
In other embodiments of the present invention, the above-mentioned coordinate system being applicable to confirmed standard white point region is not limited to (x=R/G, y=B/G) coordinate system, and can be used in arbitrarily for other coordinate system determining above-mentioned standard white point region, the such as XOY coordinate system etc. of x=R/ (R+G+B), y=B/ (R+G+B).
After the standard point under different-colour environment is all represented as the standard white point being arranged in XOY axis coordinate system, the region that one includes above-mentioned multiple standard white point can be formed, include the standard white point be shown in above-mentioned XOY axis coordinate system corresponding to different-colour environment in this region as much as possible.In preferred embodiment of the present invention, the above-mentioned region including multiple standard white point is a white point region.
As shown in Figure 5, in preferred embodiment of the present invention, above-mentioned steps 2 specifically comprises:
Step 21, judges any two default polygonal regions:
If two polygons comprise lap, then reject the region at lap place;
If two polygons mutually disjoint, then retain the region at two polygon places;
Step 22, is defined as standard white point region by the region at the multiple polygon places formed according to the judged result of step 21; Go to step 3 subsequently.
Specifically, as shown in Figure 6, in preferred embodiment of the present invention, include in the white point region of multiple standard white point above-mentioned, construct multiple default polygon.In preferred embodiment of the present invention, multiple not of uniform size and polygon that containment region is different can be formed.Meanwhile, in preferred embodiment of the present invention, above-mentioned polygonal shape, size and the region of containing all can be set according to actual conditions by user, with the white balance process under adapting to current environment or under particular/special requirement.
1., when two polygons 61 and 62 are by mutual containment relationship (namely little polygon is contained by large polygon), little polygonal region will be comprised and reject from large polygon in (see 1. number region in Fig. 6);
2. when two polygons 61 and 63 for mutually disjoint relation time, then retain mutually disjoint two polygon regions (see 2. number region in Fig. 6);
3., when two polygons 61 and 64 exist intersecting area, this intersecting area (see 3. number region in Fig. 6) is rejected.
Above-mentioned polygon both comprised convex polygon, also can comprise concave polygon, and namely user can preset polygon arbitrarily, to delimit a standard white point region.
According to the standard white point region integral part as shown in Figure 6 finally formed with above-mentioned rule.
After defining standard white point region, conveniently white point is judged, this standard white point region is represented with line segment.As shown in Figure 7, in preferred embodiment of the present invention, above-mentioned steps 3 specifically comprises:
Step 31a, arranges the line segment that many are parallel to X-axis in XOY coordinate system;
Step 32a, retains the line segment being positioned at standard white point region;
Step 33a, is shown in every bar line segment form in XOY coordinate system.
In preferred embodiment of the present invention, in above-mentioned steps 33a, adopt coordinate figure (y, x
0, x
1) represent that one for representing the line segment in standard white point region.
In preferred embodiment of the present invention, in above-mentioned coordinate expressions, y represents the Y-axis coordinate figure that line segment is corresponding; x
0represent that line segment is from the X-axis coordinate figure corresponding to an end points close to the initial point of XOY axle; x
1represent that line segment is from the X-axis coordinate figure corresponding to an end points away from the initial point of XOY axle.
Further, in preferred embodiment of the present invention, Fig. 8 is the schematic diagram representing above-mentioned standard white point region with line segment.Adopt many and be parallel to X-axis, and the line segment 81 in Y-axis with equal coordinate interval is to represent above-mentioned standard white point region.In preferred embodiment of the present invention, (y, x can be adopted
0, x
1) representing a wherein line segment, y represents the y-axis coordinate of this line segment, x
0represent the X-axis coordinate of this line segment closer to one end of the initial point in XOY axis coordinate system, x
1represent that this line segment is located farther from the X-axis coordinate of one end of the initial point of XOY axis coordinate system.Due in an embodiment of the present invention, relative to same Y-axis coordinate, the line segment that many different may be had, therefore, relative to same y value, different (y, x can be adopted
0, x
1), represent different line segments.
In preferred embodiment of the present invention, owing to introducing Y-axis coordinate when representing line segment, therefore above-mentioned line segment not necessarily has equal coordinate interval in Y-axis.As long as ensure that the line segment in expression standard white point region is enough intensive, to such an extent as to equivalence can be considered as this sets of line segments covers the standard white point region that user chooses.
Subsequently, as described in Figure 9, after representing standard white point region with many parallel segments, the real-time white point decision process being positioned at camera and carrying out, according to above-mentioned standard white point region, can be realized by following steps, and namely above-mentioned steps 4 is concrete as shown in Figure 9:
Step 41a, sets the X-axis coordinate of point to be determined in XOY coordinate system;
Step 42a, mates the Y-axis coordinate figure of point to be determined with the Y-axis coordinate figure of line segment with the first method preset, and is mated with the X-axis coordinate figure of line segment by the X-axis coordinate figure of point to be determined; Treat decision-point according to matching result to judge.
In preferred embodiment of the present invention, in above-mentioned steps 41a, be x by the X-axis setting coordinate of point to be determined in XOY coordinate system
l=R
l/ G
l, Y-axis setting coordinate is y
l=B
l/ G
l;
In preferred embodiment of the present invention, above-mentioned R
lrepresent the R value component of the rgb pixel value of point to be determined; G
lrepresent the G value component of the rgb pixel value of point to be determined; B
lrepresent the B value component of the rgb pixel value of point to be determined.
In preferred embodiment of the present invention, in above-mentioned steps 42a, the first method preset specifically comprises:
By y
lvalue is mated with the Y-axis coordinate figure in every bar line segment;
If y
lvalue does not meet y
min≤ y
l≤ y
max, then think that point to be determined is non-white point;
If y
lmeet y
min≤ y
l≤ y
max; Y-axis coordinate figure is then found to mate y
lthe line segment of value is to mate line segment, subsequently to x as first
lvalue is mated; By x
lbe worth the corresponding x mating line segment to first
0and corresponding x
1mate:
If x
lmeet x
0≤ x
l≤ x
1, then judge that point to be determined is as white point;
If x
ldo not meet x
0≤ x
l≤ x
1, then judge that point to be determined is as non-white point;
In preferred embodiment of the present invention, above-mentioned y
minrepresent the minimum value in the Y-axis coordinate figure of line segment; y
maxrepresent the maximum in the Y-axis coordinate figure of line segment.
In preferred embodiment of the present invention, further, above-mentioned steps is intended to many line segments of point to be determined with expression standard white point region to mate.Therefore, when judging, whether the Y-axis coordinate figure first mating point to be determined meets formula y
min≤ y
l≤ y
max, namely meet y ∈ [y
min, y
max].After point to be determined meets above-mentioned condition, the x-axis coordinate figure treating decision-point judges, namely judges x
lwhether meet x
0≤ x
l≤ x
1.If the result of above-mentioned twice judgement is satisfied, then can judge that this point to be determined is in and be combined in the standard white point region of expression by many line segments, be white point.
In preferred embodiment of the present invention, many line segments being parallel to X-axis can also be adopted to represent standard white point region.In this embodiment, as shown in Figure 10, adopt many to be parallel to Y-axis, and the line segment 101 in X-axis with equal coordinate interval is to represent above-mentioned standard white point region.In preferred embodiment of the present invention, (x, y can be adopted
0, y
1) representing a wherein line segment, x represents the X-axis coordinate of this line segment, y
0represent the Y-axis coordinate of this line segment closer to one end of the initial point in XOY axis coordinate system, y
1represent that this line segment is located farther from the Y-axis coordinate of one end of the initial point of XOY axis coordinate system.Due in an embodiment of the present invention, relative to same x-axis coordinate, the line segment that many different may be had, therefore, relative to same x value, different (x, y can be adopted
0, y
1), represent different line segments.
In preferred embodiment of the present invention, owing to introducing X-axis coordinate when representing line segment, therefore above-mentioned line segment not necessarily has equal coordinate interval in X-axis.As long as ensure that the line segment in expression standard white point region is enough intensive, to such an extent as to equivalence can be considered as this sets of line segments covers the standard white point region that user chooses.
Said process as shown in figure 11, for:
Step 31b, arranges the line segment that many are parallel to Y-axis in XOY coordinate system;
Step 32b, retains the line segment being positioned at standard white point region;
Step 33b, is shown in every bar line segment form in XOY coordinate system.
Above-mentionedly choose line segment and similar for the method for expressing in the mode that represents standard white point region and Fig. 7, it is different that difference is that the line segment adopted points to.
In preferred embodiment of the present invention, subsequently, as shown in figure 12, in the standard white point region represented by the above-mentioned line segment being parallel to Y-axis with many, treat decision-point to judge:
Step 41b, sets the Y-axis coordinate of point to be determined in XOY coordinate system;
Step 42b, mates the X-axis coordinate figure of point to be determined with the X-axis coordinate figure of line segment with the second method preset, and is mated with the Y-axis coordinate figure of line segment by the Y-axis coordinate figure of point to be determined; Treat decision-point according to matching result to judge.
In preferred embodiment of the present invention, in above-mentioned steps 41b, be x by the X-axis setting coordinate of point to be determined in XOY coordinate system
l=R
l/ G
l, Y-axis setting coordinate is y
l=B
l/ G
l;
In preferred embodiment of the present invention, above-mentioned R
lrepresent the R value component of the rgb pixel value of point to be determined; G
lrepresent the G value component of the rgb pixel value of point to be determined; B
lrepresent the B value component of the rgb pixel value of point to be determined.
In preferred embodiment of the present invention, in above-mentioned steps 42b, the second method preset can specifically comprise:
By x
lvalue is mated with the X-axis coordinate figure in every bar line segment;
If x
lvalue does not meet x
min≤ x
l≤ x
max, then think that point to be determined is non-white point;
If x
lmeet x
min≤ x
l≤ x
max; X-axis coordinate figure is then found to mate x
lthe line segment of value is to mate line segment, subsequently to y as first
lvalue is mated; By y
lbe worth the corresponding y mating line segment to first
0and corresponding y
1mate:
If y
lmeet y
0≤ y
l≤ y
1, then judge that point to be determined is as white point;
If y
ldo not meet y
0≤ y
l≤ y
1, then judge that point to be determined is as non-white point;
X
minrepresent the minimum value in the X-axis coordinate figure of line segment; x
maxrepresent the maximum in the X-axis coordinate figure of line segment.
Adopt white point decision process when many line segment form indicating accurate white point regions being parallel to X-axis similar in above-mentioned white point decision process and preferred embodiment of the present invention, do not repeat them here.
Owing to being limited to the data storage method of camera internal; in preferred embodiment of the present invention; the method that usual needs employing is parallel to the accurate white point region of many line segment form indicatings of X-axis is treated decision-point and is judged, but this is not as the restriction of protection scope of the present invention.Any change done on basis of the present invention, such as, change the direction of line segment combination, and increase or reduce the closeness etc. of line segment, includes within protection scope of the present invention.
On the basis of technique scheme, can overcome in prior art to choose the point of finite number to delimit the limitation in standard white point region.Meanwhile, usually adopt when to get in prior art and correspondingly up and down get point mode, namely correspond to same X-axis coordinate figure and get two points.Like this when changing the delimitation in standard white point region, needing to move upper and lower two corresponding points simultaneously, the accuracy chosen in white point region can be affected like this.Technical scheme in preferred embodiment of the present invention have employed arbitrary polygon and divides standard white point region, solves the above-mentioned problems in the prior art.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection range is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations specification of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.