CN106921828B - A kind of calculation method and device of auto-focusing statistical information - Google Patents
A kind of calculation method and device of auto-focusing statistical information Download PDFInfo
- Publication number
- CN106921828B CN106921828B CN201510996962.1A CN201510996962A CN106921828B CN 106921828 B CN106921828 B CN 106921828B CN 201510996962 A CN201510996962 A CN 201510996962A CN 106921828 B CN106921828 B CN 106921828B
- Authority
- CN
- China
- Prior art keywords
- auto
- statistical information
- image block
- value
- focusing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/81—Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation
Abstract
A kind of calculation method and device of auto-focusing statistical information, the described method includes: obtaining the image block of pixel centered on pixel to be processed, as the first image block, the first image block is image block choose from image shot, auto-focusing statistical information to be extracted;According to the color of the center pixel of the first image block, by with the center pixel with the pixel of channel and the subimage block that may make up default size in the range of the first image block centered on, choose the subimage block of predetermined number, constitute the second image block;According to the value differences information between the second image block neutron image block, the strong edge that the first image block is included is judged;The auto-focusing statistical information of the first image block is calculated using corresponding operator matrix according to the strong edge that the first image block is included, the accuracy of the auto-focusing statistical information of subject can be improved using the above scheme.
Description
Technical field
The present invention relates to field of image processing more particularly to a kind of calculation methods and device of auto-focusing statistical information.
Background technique
Picture pick-up device, such as the mobile phone of camera and integral photographic function, usually can realize auto-focusing.
The principle of subject light reflection is utilized in auto-focusing (Auto Focus), and the light of subject reflection is by camera
The imaging sensor (such as CCD/CMOS sensor) of equal picture pick-up devices receives, and by computer disposal, object is calculated
The auto-focusing statistical information of body drives electromotive focusing device to focus according to the auto-focusing statistical information.Therefore, certainly
The accuracy of dynamic focusing statistical information directly affects the focusing speed of picture pick-up device and the accuracy of focusing.
Currently, the auto-focusing statistics letter of subject is calculated by the way that subject is multiplied with Scharr operator
Breath.
But the auto-focusing statistical information inaccuracy of the subject obtained using the above method, to cause to image
The focusing speed of equipment and the accuracy of focusing be not high.
Summary of the invention
Problems solved by the invention is if improving the accuracy of the auto-focusing statistical information of subject.
To solve the above problems, the embodiment of the invention provides a kind of calculation method of auto-focusing statistical information, it is described
Method includes:
It obtains the image block of pixel centered on pixel to be processed, as the first image block, the first image block is
The image block of auto-focusing statistical information choosing from image shot, to be extracted, size are that M × N, M and N are odd number;
According to the color of the center pixel, with the center pixel with channel and in the range of the first image block
Centered on the pixel that inside may make up the subimage block of default size, the subimage block of predetermined number is chosen, by each subgraph
As block is as an element, the second image block is constituted, in which: the coordinate of the center pixel is (Px, Py), Px=(M-1)/2,
Py=(N-1)/2, the element value of second image block are the center pixel value of each subimage block;
According to the value differences information between the second image block neutron image block, the first image block institute is judged
The strong edge for including;
The center is calculated using corresponding operator matrix according to the strong edge that the first image block is included
The auto-focusing statistical information of pixel.
Optionally, the value differences information according between the second image block neutron image block, described in judgement
The strong edge that first image block is included, comprising:
The value differences for calculating separately each subimage block subimage block corresponding with the center pixel, as
Sub-block value differences;
According to the sub-block value differences, the strong edge that the first image block is included is judged.
Optionally, the number of the subimage block of the selection is 9.
Optionally, when the center pixel be green, and the default size of the subimage block be Sm × Sn when, it is described with
The center pixel may make up the pixel of the subimage block of default size with channel and in the range of the first image block
Coordinate is respectively as follows: (Px-distx1, Py-disty1), (Px-2, Py), (Px-distx1, Py+disty1), (Px, Py-
Disty1), (Px, Py), (Px, Py+disty1), (Px+dist, Py-disty1), (Px+2, Py) and (Px+distx1, Py+
Disty1), in which: distx1, disty1 are respectively subimage block described in every two in margin of image element both horizontally and vertically
It is different, and distx1, disty1 are even number, and meet following relationship: Px+distx1+ (Sm-1)/2≤M and Py+disty1+
(Sn-1)/2≤N.
Optionally, when the center pixel is not green, and the default size of the subimage block is Cm × Cn, it is described with
The center pixel may make up the pixel of the subimage block of default size with channel and in the range of the first image block
Coordinate is respectively as follows: (Px-distx2, Py-disty2), (Px-2, Py), (Px-distx2, Py+disty2), (Px, Py-
Disty2), (Px, Py), (Px, Py+disty2), (Px+dist, Py-disty2), (Px+2, Py) and (Px+distx2, Py+
Disty2), in which: distx2 and disty2 is respectively subimage block described in every two in distance both horizontally and vertically, and
Distx2 and disty2 is even number, and meets following relationship: Px+distx2+ (Cm-1)/2≤M and Py+disty2+ (Cn-
1)/2≤N.
Optionally, the strong edge comprises at least one of the following: the strong edge of horizontal direction, the strong edge of vertical direction ,-
The strong edge in 45 ° of directions and the strong edge in+45 ° of directions.
Optionally, using the sub-block value differences as element, according to the subimage block in the first image block
Position, correspondingly generate 3 × 3 value differences matrix;
It is described according to the sub-block value differences, judge the strong edge that the first image block is included, comprising:
When the sum of element and the tertial element of the second row of the second row first row of the value differences matrix are less than
When preset threshold, determine that the first image block includes the strong edge of horizontal direction;
When the sum of element and the element of the third line secondary series of the first row secondary series of the value differences matrix are less than
When the preset threshold, determine that the first image block includes the strong edge of vertical direction;
When the sum of element and the tertial element of the third line of the first row first row of the value differences matrix are less than
When the preset threshold, determine that the first image block includes the strong edge in -45 ° of directions;
When the sum of the tertial element of the first row and the element of the third line first row of the value differences matrix are less than
When the preset threshold, determine that the first image block includes the strong edge in+45 ° of directions.
Optionally, the strong edge for being included according to the first image block is calculated using corresponding operator matrix
To the auto-focusing statistical information of the first image block, comprising:
When the first image block includes the strong edge of horizontal direction, by the element value in second image block and in advance
If the element of the first operator matrix is successively multiplied, and the product accumulation that will be obtained, then the sum of cumulative by what is obtained, after taking absolute value
As the auto-focusing statistical information;
When the first image block includes the strong edge of vertical direction, by the element value in second image block and in advance
If the element of the second operator matrix is successively multiplied, and the product accumulation that will be obtained, then it is the sum of cumulative by what is obtained take absolute value after
As the auto-focusing statistical information;
When the first image block includes the strong edge in -45 ° of directions, by the element value in second image block and in advance
It is the sum of cumulative by what is obtained if the element of third operator matrix is successively multiplied, and adds up, as described automatic right after taking absolute value
Burnt statistical information;
When the first image block includes the strong edge in+45 ° of directions, by the element value in second image block and in advance
If the element of the 4th operator matrix is successively multiplied, and the product accumulation that will be obtained, then the sum of cumulative by what is obtained, after taking absolute value
As the auto-focusing statistical information.
Optionally, the strong edge for being included according to the first image block is calculated using corresponding operator matrix
To the auto-focusing statistical information of the first image block, further includes: when the first image block does not include the horizontal direction
Strong edge, the strong edge of vertical direction, any in the strong edge in -45 ° of directions and the strong edge in+45 ° of directions when, by institute
Element value in the second image block is stated successively to be multiplied with the element of default five, the six, the 7th and the 8th operator matrix, will with it is every
It after the product accumulation of the element of a operator matrix and takes absolute value, successively obtains first, second, third and the 4th absolutely
Value, by described first, second, third and the 4th absolute value sum, as the auto-focusing statistical information.
Optionally, the strong edge for being included according to the first image block is calculated using corresponding operator matrix
To the auto-focusing statistical information of the first image block, further includes:
When the first image block does not include the strong edge, the strong edge of vertical direction, -45 ° of directions of the horizontal direction
Strong edge and+45 ° of directions strong edge in it is any when, by the element value in second image block respectively with default the
The element of nine and the tenth operator matrix is successively multiplied, by after the product accumulation of the element with each operator matrix and take absolutely
Value, successively obtains the 5th and the 6th absolute value, by the sum of the 5th and the 6th absolute value, as described automatic after taking absolute value
Focusing statistical information.
Optionally, before judging strong edge that the first image block is included, place is modified to the second image block
Reason, further includes:
As unit of second image block, it is removed the processing of noise to the first image block, obtains removal and makes an uproar
Element value after sound constitutes third image block, the third image block is made using the element value after the removal noise as element
For revised second image block.
Optionally, the processing of the removal noise, includes any of the following:
The processing of noise is removed under single channel noise reduction process mode;
The processing of noise is removed under the noise reduction process mode of hybrid channel.
Optionally, the processing that noise is removed under single channel noise reduction process mode, includes any of the following:
To in the subimage block, it is averaged with the pixel of the center pixel same channels of the first image block,
As the element value after the removal noise;
To in the subimage block, with the pixels of the center pixel same channels of the first image block successively with it is default
It after multiplication, then is normalized, as the element value after the removal noise;
To in the subimage block, intermediate value is taken with the pixel of the center pixel same channels of the first image block, is made
For the element value after the removal noise.
Optionally, the processing that noise is removed under the noise reduction process mode of hybrid channel, comprising:
According to the adjacent pixel in the left side of the center pixel of each subimage block, upside adjacent pixel, a left side
The adjacent pixel in upside, calculates the brightness of each subimage block, as the element value after the removal noise.
Optionally, the adjacent pixel in the left side of the center pixel of each subimage block, upside are one adjacent
Pixel, the adjacent pixel in upper left side are the pixel removed after noise.
Optionally, the method also includes:
After obtaining the auto-focusing statistical information, enhancing processing is carried out to the auto-focusing statistical information, is obtained
Must enhance that treated auto-focusing statistical information, the auto-focusing statistical information as the first image block.
Optionally, described to carry out enhancing processing to the auto-focusing statistical information, it is automatic right to obtain enhancing treated
Burnt statistical information, comprising:
The auto-focusing statistical information is subjected to the obtained square value one kind of square operation, is handled as the enhancing
Auto-focusing statistical information afterwards.
Optionally, described to carry out enhancing processing to the auto-focusing statistical information, it is automatic right to obtain enhancing treated
Burnt statistical information, comprising:
According to the line direction of the first image block, every row of the auto-focusing statistical information in statistical window is taken
Maximum value;
The maximum value of acquired all rows is subjected to accumulating operation, the sum of first maximum value is obtained, by described first
The sum of maximum value is as enhancing treated the auto-focusing statistical information.
Optionally, described to carry out enhancing processing to the auto-focusing statistical information, it is automatic right to obtain enhancing treated
Burnt statistical information, comprising:
Sequence from big to small is carried out to the calculated auto-focusing statistical information of every row, preset number is as every before taking
Capable auto-focusing statistical information;
The auto-focusing statistical information of every row is subjected to accumulating operation, obtains the sum of second maximum value, by described the
The sum of two maximum values are as enhancing treated the auto-focusing statistical information.
Optionally, described to carry out enhancing processing to the auto-focusing statistical information, it is automatic right to obtain enhancing treated
Burnt statistical information, comprising:
When the auto-focusing statistical information is greater than preset focusing statistics maximum value, the preset focusing is counted
Maximum value is as enhancing treated the auto-focusing statistical information;
When the auto-focusing statistical information is less than preset focusing statistics minimum value, zero is handled as the enhancing
Auto-focusing statistical information afterwards.
The embodiment of the invention provides a kind of computing device of auto-focusing statistical information, described device includes:
Acquiring unit, it is described as the first image block suitable for obtaining the image block of pixel centered on pixel to be processed
First image block is image block choose from image shot, auto-focusing statistical information to be extracted, and size is M × N, M and N
It is odd number;
Selection unit, suitable for the color according to the center pixel, with the center pixel with channel and described
Centered on the pixel that may make up the subimage block of default size in the range of one image block, the subimage block of predetermined number is chosen,
Using each subimage block as an element, constitute the second image block, in which: the coordinate of the center pixel be (Px,
Py), Px=(M-1)/2, Py=(N-1)/2;The element value of second image block is the middle imago of each subimage block
Element value;
First judging unit, suitable for sentencing according to the value differences information between the second image block neutron image block
The strong edge that disconnected the first image block is included;
First computing unit, suitable for the strong edge for being included according to the first image block, using corresponding operator matrix,
The auto-focusing statistical information of the center pixel is calculated.
Optionally, first judging unit, comprising:
First computation subunit, suitable for calculating separately each subimage block subgraph corresponding with the center pixel
The value differences of block, as sub-block value differences;
First judgment sub-unit is suitable for judging that the first image block is included according to the sub-block value differences
Strong edge.
Optionally, the number of the subimage block of the selection is 9.
Optionally, the selection unit is suitable for working as the center pixel for green, and the default size of the subimage block
It is described to may make up default size with channel and in the range of the first image block with the center pixel when for Sm × Sn
The coordinate of the pixel of subimage block is respectively as follows: (Px-distx1, Py-disty1), (Px-2, Py), (Px-distx1, Py+
Disty1), (Px, Py-disty1), (Px, Py), (Px, Py+disty1), (Px+dist, Py-disty1), (Px+2, Py) and
(Px+distx1, Py+disty1), in which: distx1, disty1 are respectively subimage block described in every two horizontal and vertical
The value differences in direction, and distx1, disty1 are even number, and meet following relationship: Px+distx1+ (Sm-1)/2≤
M and Py+disty1+ (Sn-1)/2≤N.
Optionally, the selection unit is further adapted for when the center pixel not being green, the subimage block it is default big
It is small when being Cm × Cn, it is described to may make up default size with channel and in the range of the first image block with the center pixel
The coordinate of pixel of subimage block be respectively as follows: (Px-distx2, Py-disty2), (Px-2, Py), (Px-distx2, Py+
Disty2), (Px, Py-disty2), (Px, Py), (Px, Py+disty2), (Px+dist, Py-disty2), (Px+2, Py) and
(Px+distx2, Py+disty2), in which: distx2 and disty2 is respectively subimage block described in every two horizontal and vertical
The distance in direction, and distx2 and disty2 are even number, and meet following relationship: Px+distx2+ (Cm-1)/2≤M and Py
+ disty2+ (Cn-1)/2≤N.
Optionally, the strong edge comprises at least one of the following: the strong edge of horizontal direction, the strong edge of vertical direction ,-
The strong edge in 45 ° of directions and the strong edge in+45 ° of directions.
Optionally, first judgment sub-unit, comprising:
First matrix generation module is suitable for using the sub-block value differences as element, according to the subimage block in institute
The position in the first image block is stated, 3 × 3 value differences matrix is correspondingly generated;
First judgment module, element and the second row third suitable for the second row first row when the value differences matrix
When the sum of element of column is less than preset threshold, determine that the first image block includes the strong edge of horizontal direction, when the pixel
When being worth the sum of the element of the first row secondary series of difference matrix and the element of the third line secondary series less than the preset threshold, determine
The first image block include vertical direction strong edge, when the value differences matrix the first row first row element with
When the sum of tertial element of the third line is less than the preset threshold, determine that the first image block includes the strong side in -45 ° of directions
Edge, when the sum of the tertial element of the first row and element of the third line first row of the value differences matrix be less than it is described pre-
If when threshold value, determining that the first image block includes the strong edge in+45 ° of directions.
Optionally, first computing unit, suitable for inciting somebody to action when the first image block includes the strong edge of horizontal direction
The product accumulation that element value in second image block is successively multiplied with the element of default first operator matrix, and will obtain,
It is the sum of cumulative by what is obtained again, the auto-focusing statistical information is used as after taking absolute value, when the first image block includes to hang down
Histogram to strong edge when, the element value in second image block is successively multiplied with the element of default second operator matrix,
And the product accumulation that will be obtained, then it is the sum of cumulative by what is obtained, the auto-focusing statistical information is used as after taking absolute value;Work as institute
State the first image block include -45 ° of directions strong edge when, by second image block element value and default third Operator Moment
The product accumulation that the element of battle array is successively multiplied, and will obtain, then be used as after the sum of adding up for obtaining is taken absolute value described automatic
Focusing statistical information;When the first image block includes the strong edge in+45 ° of directions, by the element in second image block
The product accumulation that value is successively multiplied with the element of default 4th operator matrix, and will obtain, then the sum of adding up for obtaining is taken absolutely
To after value be used as the auto-focusing statistical information.
Optionally, first computing unit is further adapted for when the first image block not including the strong of the horizontal direction
When any in edge, the strong edge of vertical direction, the strong edge in -45 ° of directions and the strong edge in+45 ° of directions, by described
Element value in two image blocks is successively multiplied with the element of default five, the six, the 7th and the 8th operator matrix, will be with each institute
It states after the product accumulation of the element of operator matrix and takes absolute value, successively obtain first, second, third and the 4th absolute value, it will
Described first, second, third and the 4th absolute value sum, as the auto-focusing statistical information.
Optionally, first computing unit is further adapted for when the first image block not including the strong of the horizontal direction
When any in edge, the strong edge of vertical direction, the strong edge in -45 ° of directions and the strong edge in+45 ° of directions, by described
Element value in two image blocks is successively multiplied with the element of default 9th and the tenth operator matrix respectively, will be with each operator
It after the product accumulation of the element of matrix and takes absolute value, successively obtains the 5th and the 6th absolute value, absolutely by the described 5th and the 6th
To the sum of value, as the auto-focusing statistical information.
Optionally, described device further include: amending unit, suitable in the strong edge for judging that the first image block is included
Before, as unit of second image block, the processing of noise is removed to the first image block, after obtaining removal noise
Element value third image block is constituted, using the third image block as repairing using the element value after the removal noise as element
The second image block after just.
Optionally, the amending unit, including it is following any one:
First revise subelemen, suitable for being removed the processing of noise under single channel noise reduction process mode;
Second revise subelemen, suitable for being removed the processing of noise under the noise reduction process mode of hybrid channel.
Optionally, first revise subelemen, comprising:
First correction module is suitable for in the subimage block, identical as the center pixel of the first image block logical
The pixel in road is averaged, as the element value after the removal noise;
Second correction module is suitable for in the subimage block, identical as the center pixel of the first image block logical
It after the pixel in road is successively multiplied with predetermined coefficient, then is normalized, as the element value after the removal noise;
Third correction module is suitable for in the subimage block, identical as the center pixel of the first image block logical
The pixel in road takes intermediate value, as the element value after the removal noise.
Optionally, second revise subelemen, suitable for the left side phase according to the center pixel of each subimage block
Adjacent a pixel, the adjacent pixel in upside, the adjacent pixel in upper left side, calculate the brightness of each subimage block,
As the element value after the removal noise.
Optionally, the adjacent pixel in the left side of the center pixel of each subimage block, upside are one adjacent
Pixel, the adjacent pixel in upper left side are the pixel removed after noise.
Optionally, described device further include:
Enhance processing unit, be suitable for after obtaining the auto-focusing statistical information, the auto-focusing is counted and is believed
Breath carries out enhancing processing, obtains enhancing treated auto-focusing statistical information, the auto-focusing as the first image block
Statistical information.
Optionally, the enhancing processing unit, comprising: the first enhancing processing subelement, suitable for the auto-focusing is united
Counting information, to carry out the obtained square value of square operation a kind of, as the enhancing treated auto-focusing statistical information.
Optionally, the enhancing processing unit, comprising: the second enhancing processing subelement is suitable for according to the first image
The line direction of block is maximized every row of the auto-focusing statistical information in statistical window, by acquired all rows
The maximum value carries out accumulating operation, obtains the sum of first maximum value, by the sum of described first maximum value as at the enhancing
Auto-focusing statistical information after reason.
Optionally, the enhancing processing unit, comprising: third enhancing processing subelement, be suitable for it is calculated to every row from
Dynamic focusing statistical information carries out sequence from big to small, auto-focusing statistical information of the preset number as every row is taken, by institute
The auto-focusing statistical information for stating every row carries out accumulating operation, the sum of second maximum value is obtained, by the sum of described second maximum value
As enhancing treated the auto-focusing statistical information.
Optionally, the enhancing processing unit, comprising: the 4th enhancing processing subelement is suitable for uniting when the auto-focusing
When counting information greater than preset focusing statistics maximum value, after the preset focusing statistics maximum value is handled as the enhancing
Auto-focusing statistical information, when the auto-focusing statistical information be less than preset focusing count minimum value when, by zero conduct
Enhancing treated the auto-focusing statistical information.
Compared with prior art, technical solution of the present invention has the advantage that
By choosing the subimage block of predetermined number, using each subimage block as an element, the second figure is constituted
As block judges the first image block then according to the value differences information between the second image block neutron image block
The strong edge for being included, the strong edge for finally being included according to the first image block are calculated using corresponding operator matrix
To the auto-focusing statistical information of the center pixel, marginal information can be more targetedly extracted at strong edge position,
So as to improve the accuracy of auto-focusing statistical information, thus can be improved picture pick-up device focusing speed and focusing it is accurate
Degree.
Further, before judging strong edge that the first image block is included, by being with second image block
Unit is removed the processing of noise to the first image block, the element value after obtaining removal noise, with the removal noise
Element value afterwards is element, and constituting third image block can keep away using the third image block as revised second image block
Exempt from picture noise to impact subsequent statistical information calculating process, so as to further improve auto-focusing statistics letter
The accuracy of breath.
Further, after obtaining the auto-focusing statistical information, by being carried out to the auto-focusing statistical information
Enhancing processing obtains enhancing treated auto-focusing statistical information, and the auto-focusing as the first image block counts letter
Breath can promote the steep and significance degree of focusing peak of curve, so as to further improve auto-focusing statistics
The accuracy of information.
Detailed description of the invention
Fig. 1 is the flow diagram for the method that one of embodiment of the present invention auto-focusing information calculates;
Fig. 2 is the flow diagram for the method that another auto-focusing information in the embodiment of the present invention calculates;
Fig. 3 is the schematic diagram of the image block of one of embodiment of the present invention input;
Fig. 4 is the schematic diagram of one of embodiment of the present invention subimage block;
Fig. 5 is the schematic diagram of the image block of another input in the embodiment of the present invention;
Fig. 6 is the schematic diagram of another subimage block in the embodiment of the present invention;
Fig. 7 is the schematic diagram of image block of one of the embodiment of the present invention after denoising;
Fig. 8 is the schematic diagram of another image block after denoising in the embodiment of the present invention;
Fig. 9 be in the embodiment of the present invention another by denoising after image block schematic diagram;
Figure 10 is the structural schematic diagram of the computing device of one of embodiment of the present invention auto-focusing statistical information;
Figure 11 is the structural schematic diagram of the computing device of another auto-focusing statistical information in the embodiment of the present invention.
Specific embodiment
The principle of subject light reflection is utilized in auto-focusing (Auto Focus), and the light of subject reflection is by camera
The imaging sensor (such as CCD/CMOS sensor) of equal picture pick-up devices receives, and by computer disposal, object is calculated
The auto-focusing statistical information of body drives electromotive focusing device to focus according to the auto-focusing statistical information.Therefore, certainly
The accuracy of dynamic focusing statistical information directly affects the focusing speed of picture pick-up device and the accuracy of focusing.
Currently, the auto-focusing statistics letter of subject is calculated by the way that subject is multiplied with Scharr operator
Breath.
But the auto-focusing statistical information inaccuracy of the subject obtained using the above method, to cause to image
The focusing speed of equipment and the accuracy of focusing be not high.
To solve problems described above, the embodiment of the invention provides the calculation methods of auto-focusing statistical information, pass through
The subimage block for choosing predetermined number constitutes the second image block using each subimage block as an element, then according to
Value differences information between the second image block neutron image block judges the strong side that the first image block is included
The middle imago is calculated using corresponding operator matrix in edge, the strong edge for finally being included according to the first image block
The auto-focusing statistical information of element, can more targetedly extract marginal information at strong edge position, so as to improve
The accuracy of auto-focusing statistical information, therefore the focusing speed of picture pick-up device and the accuracy of focusing can be improved.
To make the above purposes, features and advantages of the invention more obvious and understandable, with reference to the accompanying drawing to the present invention
Specific embodiment be described in detail.
The following provide the flow diagrams for the method that one of embodiment of the present invention auto-focusing information calculates, and such as scheme
Shown in 1, describe in detail below with reference to Fig. 1 to the method:
S11: it obtains by the image block of pixel centered on pixel to be processed, as the first image block, the first image
Block is image block choose from image shot, auto-focusing statistical information to be extracted.
In specific implementation, before counting statistics information, the image of available subject, and obtaining will be to be processed
The image block of pixel centered on pixel, below according to center pixel described in the pixel extraction in described image block, that is, institute
The auto-focusing statistical information of pixel to be processed is stated, for convenience of describing, described image block can be called to the first image block, and set
Its size is that M × N, M and N are odd number.
It in specific implementation, can according to actual needs, from described due to including multiple images block in the acquisition image
The image block of auto-focusing statistical information to be extracted is chosen in image.For example, if being intended to shooting portrait, it can selection packet
The image block of face information is included as the first image block.
S12: according to the color of the center pixel, with the center pixel with channel and in the first image block
Centered on the pixel that may make up the subimage block of default size in range, the subimage block of predetermined number is chosen, it will be each described
Subimage block constitutes the second image block as an element.
In specific implementation, believed due to that can be counted to the auto-focusing of whole image block with center pixel with the pixel of color
Breath impacts, thus can according to the color of the center pixel of the first image block, with the center pixel with channel and
Centered on the pixel for the subimage block that may make up default size in the range of the first image block, the son of predetermined number is chosen
Image block constitutes the second image block using each subimage block as an element, and the coordinate of the center pixel can be
(Px, Py), Px=(M-1)/2, Py=(N-1)/2, Mei Gesuo corresponding with the size for the first image block handed over above
The center pixel value for stating subimage block can be used as the element value of second image block.
S13: according to the value differences information between the second image block neutron image block, judge the first image
The strong edge that block is included.
In specific implementation, due to the relationship between each subimage block in the second image block, image block can be reacted
Marginal information, therefore can judge described according to the value differences information between the second image block neutron image block
The strong edge that one image block is included.
In an embodiment of the present invention, the value differences information between the second image block neutron image block can be
The value differences of each subimage block subimage block corresponding with the center pixel can be referred to as convenience of describing
For that then can judge that the first image block is included according to the sub-block value differences for sub-block value differences
Strong edge.
In an embodiment of the present invention, the number of the subimage block of the selection is 9.Certainly, of the subimage block
Number can be other values, and those skilled in the art can be correspondingly arranged according to actual image algorithm.
Since perception of the human eye to different colours is different, and different colours can react the effect of image self-information not
Together, therefore for the image block on Bayer domain, the pixel of green component is different from red and blue component number of pixels.
Therefore when the center pixel is green, and the default size of the subimage block is Sm × Sn, in the present invention
It is described to may make up default size with channel and in the range of the first image block with the center pixel in one embodiment
The coordinate of the pixel of subimage block is respectively as follows:
(Px-distx1,Py-disty1)、(Px-2,Py)、(Px-distx1,Py+disty1)、(Px,Py-disty1)、
(Px, Py), (Px, Py+disty1), (Px+dist, Py-disty1), (Px+2, Py) and (Px+distx1, Py+disty1).
Wherein: distx1, disty1 are respectively subimage block described in every two in margin of image element both horizontally and vertically
It is different, and distx1, disty1 are even number, and distx1, disty1 meet following relationship: Px+distx1+ (Sm-1)/2≤M
With Py+disty1+ (Sn-1)/2≤N.
It is real in the present invention one when the center pixel is not green, and the default size of the subimage block is Cm × Cn
It applies in example, the subgraph that may make up default size with channel and in the range of the first image block with the center pixel
As the coordinate of the pixel of block is respectively as follows:
(Px-distx2,Py-disty2)、(Px-2,Py)、(Px-distx2,Py+disty2)、(Px,Py-disty2)、
(Px, Py), (Px, Py+disty2), (Px+dist, Py-disty2), (Px+2, Py) and (Px+distx2, Py+disty2).
Wherein: distx2 and disty2 is even number, and respectively subimage block described in every two is in horizontal and vertical side
To distance, meet: Px+distx2+ (Cm-1)/2≤M and Py+disty2+ (Cn-1)/2≤N.
In order to be precisely calculated the auto-focusing statistical information of image block, above-described strong edge may include a variety of.
For example, the strong edge may include the strong edge of horizontal direction, it also may include the strong edge of vertical direction, can also wrap
The strong edge in -45 ° of directions is included, also may include the strong edge in+45 ° of directions, certainly can also include above-described concentration side
To strong edge any combination.
It in specific implementation, can be by using the sub-block value differences as element, first, in accordance with the subimage block
Position in the first image block correspondingly generates 3 × 3 value differences matrix, then calculates the margin of image element
The first row of the sum of element and the tertial element of the second row of the second row first row of different matrix, the value differences matrix
The sum of element of the element of secondary series and the third line secondary series, the value differences matrix the first row first row element with
The tertial element of the first row of the sum of tertial element of the third line and the value differences matrix and the third line first row
The sum of element.
Finally when the sum of the element of the second row first row of the value differences matrix and the tertial element of the second row
When less than preset threshold, determine that the first image block includes the strong edge of horizontal direction.
If the element and the sum of the element of the third line secondary series of the first row secondary series of the value differences matrix are small
In the preset threshold, determine that the first image block includes the strong edge of vertical direction.
If the sum of the element of the first row first row of the value differences matrix and the tertial element of the third line are small
In the preset threshold, determine that the first image block includes the strong edge in -45 ° of directions.
If the tertial element of the first row and the sum of the element of the third line first row of the value differences matrix are small
In the preset threshold, determine that the first image block includes the strong edge in+45 ° of directions.
In specific implementation, the judging result for the strong edge for being included to the first image block in order to avoid picture noise
It impacts, processing can be modified to the second image block before judging strong edge that the first image block is included.
Specifically, the processing of noise is removed to the first image block as unit of second image block,
Element value after obtaining removal noise constitutes third image block using the element value after the removal noise as element, by described the
Three image blocks are as revised second image block.
In specific implementation, the processing of noise can be removed to the first image block there are many mode.Such as institute
The processing for stating removal noise can be the processing that noise is removed under single channel noise reduction process mode, or mix
It is removed the processing of noise under the noise reduction process mode of channel, can also be the combination of noise processed under various modes.
It in specific implementation, can be with when the processing that removal noise has been determined is corresponding single channel noise reduction process mode
The denoising is executed there are many mode.
For example it can be taken in the subimage block with the pixel of the center pixel same channels of the first image block
Average value can also be in the subimage block, with the first image block as the element value after the removal noise
It after the pixel of center pixel same channels is successively multiplied with predetermined coefficient, then is normalized, after the removal noise
Element value can also take with the pixel of the center pixel same channels of the first image block in the subimage block
Value, as the element value after the removal noise.
In an embodiment of the present invention, when being determined it is the place for being removed noise under the noise reduction process mode of hybrid channel
Reason, can the adjacent pixel in left side according to the center pixel of each subimage block, upside adjacent pixel, a upper left
The adjacent pixel in side, calculates the brightness of each subimage block, as the element value after the removal noise.
In an alternative embodiment of the invention, in order to avoid the brightness of calculated each subimage block is made an uproar by image
The interference of sound, the adjacent pixel in the left side of the center pixel of each subimage block, upside adjacent pixel, a left side
The adjacent pixel in upside is the pixel removed after noise.That is: can the first center pixel to each subimage block a left side
The adjacent pixel in side, the adjacent pixel of the adjacent pixel in upside and upper left side do noise reduction process respectively, obtain at noise reduction
Pixel value after reason, further according to the pixel value after the noise reduction process, to calculate the brightness of each subimage block, as institute
Element value after stating removal noise.
S14: the strong edge for being included according to the first image block is calculated described using corresponding operator matrix
The auto-focusing statistical information of first image block.
In specific implementation, when the strong edge difference for including due to image block, the acquisition methods of auto-focusing statistical information
Also can be different, therefore institute is calculated using corresponding operator matrix in the strong edge that can included according to the first image block
State the auto-focusing statistical information of the first image block.
In an embodiment of the present invention, when the first image block includes the strong edge of horizontal direction, by described second
The product accumulation that element value in image block is successively multiplied with the element of default first operator matrix, and will obtain, by what is obtained
The sum of add up, after taking absolute value, as the auto-focusing statistical information.
In an alternative embodiment of the invention, when the first image block includes the strong edge of vertical direction, by described the
Element value in two image blocks is successively multiplied with the element of default second operator matrix, and adds up, the sum of cumulative by what is obtained, takes
The auto-focusing statistical information is used as after absolute value.
In still another embodiment of the process, when the first image block includes the strong edge in -45 ° of directions, by described the
Element value in two image blocks is successively multiplied with the element of default third operator matrix, and adds up, the sum of cumulative by what is obtained, takes
The auto-focusing statistical information is used as after absolute value.
In still another embodiment of the process, when the first image block includes the strong edge in+45 ° of directions, by described the
Element value in two image blocks is successively multiplied with the element of default 4th operator matrix, and adds up, the sum of cumulative by what is obtained, takes
The auto-focusing statistical information is used as after absolute value.
It should be noted that in specific implementation, first to fourth operator matrix, can according to actual needs,
By those skilled in the art's self-setting.
In specific implementation, the first image block does not include the strong side of the strong edge of the horizontal direction, vertical direction
When any in the strong edge of edge, the strong edge in -45 ° of directions and+45 ° of directions, that is to say indicates the first image block
Frequency variation it is relatively gentle, can there are many method calculate described image block auto-focusing statistical information.
Such as it can be by the element value and default five, the six, the 7th and the 8th operator matrix in second image block
Element be successively multiplied, after the product accumulation of the element with each operator matrix and will take absolute value, successively obtain first,
Second, third and the 4th absolute value, by described first, second, third and the 4th absolute value sum, unite as the auto-focusing
Count information.
Can also by the element value in second image block respectively with the element of default 9th and the tenth operator matrix according to
Secondary multiplication after the product accumulation of the element with each operator matrix and will take absolute value, and successively obtain the 5th and the 6th absolutely
To value, by the sum of the 5th and the 6th absolute value, as the auto-focusing statistical information.
In an embodiment of the present invention, default 6th and the 7th operator matrix can be Scharr operator.
In an embodiment of the present invention, subsequent to facilitate in order to further increase the accuracy that programming count information calculates
The speed and correctness of picture pick-up device focusing, can be after obtaining the auto-focusing statistical information, to the auto-focusing
Statistical information carries out enhancing processing, obtain enhancing treated auto-focusing statistical information, as the first image block from
Dynamic focusing statistical information.
In specific implementation, enhancing processing can be carried out to the auto-focusing statistical information there are many mode.
Enhancing processing is carried out to the auto-focusing statistical information for example, square patterns can be used, it may be assumed that will to it is described from
Dynamic focusing statistical information carries out the obtained square value of square operation, as the enhancing treated auto-focusing statistics letter
Breath.
Enhancing processing also is carried out to the auto-focusing statistical information for example, row maximum value mode can be used, it may be assumed that according to
The line direction of the first image block is maximized every row of the auto-focusing statistical information in statistical window, by institute
The maximum value for obtaining all rows carries out accumulating operation, obtains the sum of first maximum value, and the sum of described first maximum value is made
For enhancing treated the auto-focusing statistical information.
Also for example, every row preset number maximum value mode, which can be used, enhances the auto-focusing statistical information
Processing, it may be assumed that sequence from big to small is carried out to the calculated auto-focusing statistical information of every row, preset number is taken to be used as every row
Auto-focusing statistical information, the auto-focusing statistical information of every row is subjected to accumulating operation, obtain the second maximum value it
With by the sum of described second maximum value as enhancing treated the auto-focusing statistical information.
In an embodiment of the present invention, the preset number can be 7, and certainly, the preset number can be other values,
Those skilled in the art may set according to actual needs.
For another example, CLIP mode can be used, enhancing processing is carried out to the auto-focusing statistical information, it may be assumed that when it is described from
When dynamic focusing statistical information is greater than preset focusing statistics maximum value, using the preset focusing statistics maximum value as the increasing
Auto-focusing statistical information that treated by force, when the auto-focusing statistical information is less than preset focusing statistics minimum value,
By zero as enhancing treated the auto-focusing statistical information.
It is understood that those skilled in the art are according to actual needs, can by it is above-described be used to it is described from
The mode that dynamic focusing statistical information carries out enhancing processing is combined use.In addition to the row maximum value mode and every row are pre-
If number maximum value mode can not be combined with each other or can not be combined simultaneously outside, other modes can be combined with each other,
It can be used to do enhancing processing to auto-focusing statistical information simultaneously.Such as it can be maximum by the square patterns and the row
Value mode is used in combination, i.e., carries out enhancing processing to the auto-focusing statistical information using the square patterns and then make
Enhancing processing is carried out to the auto-focusing statistical information with the row maximum value mode, will be obtaining as a result, just as last
Auto-focusing statistical information.Also for example, the square patterns, the row maximum value mode and CLIP mode can be tied jointly
It closes and uses.And above to the sequence of the description of the mode, simply to illustrate that, it does not limit the present invention in any way.
No matter using which kind of mode combination and when various modes are used in combination, using which kind of sequentially come to auto-focusing statistics
Information carries out enhancing processing, does not form any restrictions to the present invention, and within the scope of the present invention.
In summary it is found that passing through the subimage block for choosing predetermined number, using each subimage block as a member
Element constitutes the second image block then according to the value differences information between the second image block neutron image block and judges institute
The strong edge that the first image block is included is stated, the strong edge for finally being included according to the first image block is calculated using corresponding
The auto-focusing statistical information of the center pixel is calculated in submatrix, can be at strong edge position more targetedly
Marginal information is extracted, so as to improve the accuracy of auto-focusing statistical information, therefore the focusing speed of picture pick-up device can be improved
The accuracy of degree and focusing.
To more fully understand those skilled in the art and realizing the present invention, another auto-focusing also provided below
The calculation method of statistical information can specifically refer to Fig. 2, and the method can specifically include following steps:
S21: the image block of input is pre-processed.
Specifically, the pretreatment of the image block of described pair of input, is to carry out denoising to the image block of the input
It removes, is impacted with eliminating picture noise to the calculating of the corresponding auto-focusing statistical information of subsequent image block.
It should be noted that in this text after all pixels with coordinate, indicate image of the pixel where it
Position in block, such as G00 indicate the green pixel for the position that the zero row the 0th in its corresponding image block arranges.By
Pixel involved in text is more, and those skilled in the art can understand other pixels, therefore no longer go to live in the household of one's in-laws on getting married one by one according to this example
It states.
In an embodiment of the present invention, the image block of the input can be 9 × 9 sizes on the bayer shown in Fig. 3
Image block, it can be seen that center pixel corresponding to the central point (4,4) of the image block of 9 × 9 size is that green is logical
Road, that is to say color be green pixel, thus can choose first with the center pixel with channel coordinate be (2,
2), (2,4), (2,6), (4,2), (4,4), (4,6), (6,2), (6,4) centered on this 9 pixels of (6,6), take 3rd × 3 area
Domain constitutes a subimage block, includes 5 green component datas in each subimage block.
It should be noted that there is also other with the center pixel with logical in Fig. 3 other than the pixel of above-mentioned coordinate
The pixel in road, but since those described pixels can not be in the pixel coverage included by the image block of 9 × 9 sizes, selection is enough
Pixel constitute the subimage block, therefore those described other pixels and unselected.
For ease of understanding, Fig. 4 shows subimage block corresponding to the pixel that coordinate is (4,4), if selection is not to described
Subimage block carries out denoising, and the coordinate is that the pixel value of (4,4) can be used as the pre-processed results of the subimage block
Value.
In an alternative embodiment of the invention, the image block for 9 × 9 sizes that the image block of the input can be as shown in Figure 5,
It can be seen that center pixel corresponding to the central point (4,4) of the image block of 9 × 9 size is red channel, that is to say
Color is red pixel, thus be can choose first respectively with (2,2), (2,4), (2,6), (4,2), (4,4), (4,6),
(6,2), (6,4) centered on (6,6), take the subimage block of 5 × 5 sizes, include 5 red component numbers in each subimage block
According to.
It should be noted that there is also other with the center pixel with logical in Fig. 5 other than the pixel of above-mentioned coordinate
The pixel in road, but since those described pixels can not be in the pixel coverage included by the image block of 9 × 9 sizes, selection is enough
Pixel constitute the subimage block, therefore those described other pixels and unselected.
For ease of understanding, Fig. 6 shows subimage block corresponding to the pixel that coordinate is (4,4), if selection is not to described
Subimage block carries out denoising, and the coordinate is that the pixel value of (4,4) can be used as the pre-processed results of the subimage block
Value.
In general, then can successively be carried out to each subimage block as unit of each subimage block
Remove the processing of noise.
If selecting noise reduction process mode, it can choose three kinds of modes and noise reduction carried out to each subimage block, it is described
Three kinds of modes can be with are as follows: averaging mode seeks weighted average mode and median filtering mode.
For ease of understanding, it can be illustrated by taking the noise reduction calculating process of the subimage block in Fig. 4 as an example.
If carrying out the noise reduction process of averaging mode to the subimage block in Fig. 4, the average value of subimage block can be sought,
Shown in calculating process such as formula (1):
Value=(G00+G02+G11+G20+G22)/5 (1)
It, can will be in the subgraph if seek to the subimage block in Fig. 4 the noise reduction process of weighted average mode
In block, after being successively multiplied with predetermined coefficient with the pixel of the center pixel same channels of the first image block, then normalizing is carried out
Change, can specifically execute following calculating, shown in calculating process such as formula (2):
Value=(w0*G00+w1*G02+G11+w2*G20+w3*G22)/(z 0+z 1+z 2+z 3+z 4) (2)
It should be noted that the coefficient w0-w3 can be correspondingly arranged according to actual needs.
If carrying out the noise reduction process of median filtering mode to the subimage block in Fig. 4, following calculating can be executed, was calculated
Shown in journey such as formula (3):
Value=median (G00, G02, G11, G20, G22) (3)
Correspondingly, all the above subimage block included by Fig. 3 is carried out according to above-mentioned any noise-reduction method
Noise reduction process, available image block shown in Fig. 7, wherein Gr_f1,1=value, value can be by described above any
Kind noise reduction process mode obtains.Similarly, in the way of other all Gr_f are using any noise reduction process of the above,
And the pixel calculating for substituting into its corresponding subimage block is got.
For ease of understanding, it can also be illustrated by taking the noise reduction calculating process of the subimage block in Fig. 6 as an example.
If carrying out the noise reduction process of averaging mode to the subimage block in Fig. 6, the average value of subimage block can be sought,
Shown in calculating process such as formula (4):
Value=(R02+R20+R22+R24+R42)/5 (4)
If seek to the subimage block in image 6 noise reduction process of weighted average mode, following calculating can be executed,
Shown in calculating process such as formula (5):
Value=(z0*R02+z 1*R20+R22+z 2*R24+z 3*R42)/(z 0+z 1+z 2+z 3+z 4) (5)
It should be noted that the coefficient w0-z 4 can be correspondingly arranged according to actual needs.
If carrying out the noise reduction process of median filtering mode to the subimage block in image 6, following calculating can be executed, is calculated
Shown in process such as formula (6):
Value=median (R02, R20, R22, R24, R42) (6)
Correspondingly, according to this method, above-mentioned appoint can be executed to all the above subimage block included by Fig. 5
A kind of noise reduction process of mode, available image block shown in Fig. 8, wherein R_f1,1=value, value can by with
Upper any noise reduction process mode obtains, and similarly, all R_f are to utilize any noise reduction process side described above
Formula, and the pixel calculating for substituting into its corresponding subimage block is got.
If selecting brightness noise reduction process mode, each 3 × 3 subgraph can be taken out respectively on the basis of above calculate
A pixel on the left of the center of block, the pixel of upside one, the pixel of upper left one, the drop being had calculated that in calculating before
It makes an uproar and processing costs or takes initial value, therefore share tetra- values of Gr, R, B and Gb in 3 × 3 centers and its neighborhood, by four values according to such as
Under type calculates, and obtains 3 × 3 each position brightness value Y, shown in calculating process such as formula (7):
Y=0.299*R+ (Gr+Gb)/2*0.587+B*0.114 (7)
It is exported 9 Y values as first part, it as a result can be as shown in figure 9, wherein the calculating of Y11 can be such as formula (8)
It is shown:
Y11=0.299*R22+ (Gr21+Gb12)/2*0.587+B11*0.114 (8)
Wherein: R22, Gr21, Gb12 and B11 correspond to image block shown in Fig. 6.
S22: auto-focusing statistical information is extracted.
It in specific implementation, can be according to included by the image block of the input after completing denoising described in S11
Marginal information it is different, the image block of the input is extracted using different calculation methods.
Specifically, marginal information included by image block can be first determined whether, in an embodiment of the present invention, can adopt
With the value differences information between the subimage block, for example 3 × 3 subgraphs centered on (4,4) point can be calculated separately
As block and with (2,2), (2,4), (2,6), (4,2), (4,6), (6,2), (6,4), the pixel of the subimage block centered on (6,6)
Value difference is different, the measurement of this value differences be two blocks one by one the absolute value of corresponding points difference and.
Subimage block corresponding to the pixel of subimage block block corresponding to the pixel of citing (4,4) and (2,2)
Shown in the calculating process such as formula (9) of the value differences d00 of block:
D00=abs (block11-block33)+abs (block12-block34)+abs (block13-block35)+
abs(block21–block43)+abs(block22–block44)+abs(block23–block45)+abs(block31–
block53)+abs(block32–block54)+abs(block33–block55) (9)
Then using the value differences as element, value differences matrix is obtained, such as formula 1) shown in:
Formula 1)
The strong edge being horizontally oriented in 9 × 9block is thought if d10+d12 < d_th1;
The strong edge being vertically oriented in 9 × 9block is thought if d01+d21 < d_th1;
Think in 9 × 9block to be -45 strong edges for spending directions if d00+d22 < d_th1;
Think in 9 × 9block to be+45 strong edges for spending directions if d02+d20 < d_th1.
Then, described obvious according to the edge preextraction of acquisition as a result, to the image block that can judge limbus direction
Edge direction refers to four kinds of strong edges mentioned above: the strong edge of horizontal direction, the strong edge of vertical direction, -45 degree directions
Strong edge and the strong edge in+45 degree directions, carry out focusing statistical information using such as under type and extract:
In an embodiment of the present invention, if the strong edge of horizontal direction, then use formula 2) shown in the first operator matrix with
3 × 3 subimage blocks carry out the point-by-point simultaneously accumulation calculating that is multiplied and obtain marginal information after noise reduction, as the input after taking absolute value
The auto-focusing statistical information of image block:
Formula 2)
It for ease of understanding, can be by taking the calculation formula of the marginal information of 3 × 3 subimage blocks after the noise reduction shown in Fig. 7 as an example
It is illustrated, the calculating process can be as shown in formula (10) are as follows:
Edge1=Gr_f00* (- 1)+Gr_f01* (- 1)+Gr_f02* (- 1)+Gr_f10* (2)+Gr_f11* (2)+Gr_
f12*(2)+Gr_f20*(-1)+Gr_f21*(-1)+Gr_f22*(-1) (10)
Then the value Edge1 that calculation formula (10) can be obtained, obtains abs (Edge1), Ji Kezuo after taking absolute value
For the auto-focusing statistical information of the image block of the input
It is understood that the calculation method of other subimage blocks and operator matrix can be implemented with reference to described above,
Details are not described herein.
If the strong edge of vertical direction, then use formula 3) shown in after the second operator matrix and noise reduction 3 × 3 subimage blocks into
The point-by-point simultaneously accumulation calculating that is multiplied of row obtains marginal information, counts after taking absolute value as the auto-focusing of the image block of the input
Information:
Formula 3)
If the strong edge in -45 degree directions, then use formula 4) shown in 3 × 3 subimage blocks after third operator matrix and noise reduction
It carries out the point-by-point simultaneously accumulation calculating that is multiplied and obtains marginal information, unite after taking absolute value as the auto-focusing of the image block of the input
Count information:
Formula 4)
If the strong edge in+45 degree directions, then use formula 5) shown in 3 × 3 subimage blocks after the 4th operator matrix and noise reduction
It carries out the point-by-point simultaneously accumulation calculating that is multiplied and obtains marginal information, unite after taking absolute value as the auto-focusing of the image block of the input
Count information:
Formula 5)
In an alternative embodiment of the invention, if above four conditions are all unsatisfactory for, select one of the following two kinds mode into
Row focusing information extraction:
First: customized operator: with formula 6) the 5th operator matrix that shows, formula 7) show the 6th operator matrix, formula 8)
The 7th operator matrix and formula 9 shown) shown in the 8th operator matrix be multiplied point by point with 3 × 3 subimage blocks after noise reduction, will
The obtained product that is multiplied point by point adds up, then successively to the sum of cumulative take absolute value after, add up again, it is cumulative by what is obtained
The sum of, the auto-focusing statistical information of the image block as the input:
Formula 6)
Formula 7)
Formula 8)
Formula 9)
For ease of understanding, it can be carried out by taking the calculating of the marginal information of 3 × 3 subimage blocks after the noise reduction shown in Fig. 7 as an example
Illustrate, the calculating process is as follows:
First the subimage block shown in Fig. 7 is multiplied point by point with the 5th operator matrix, is multiplied what point-by-point multiplication obtained
Product adds up, and obtains marginal information Edge2, shown in calculating process such as formula (11):
Edge2=Gr_f00* (- 1)+Gr_f01* (- 1)+Gr_f02* (- 1)+Gr_f10* (- 1)+Gr_f11* (8)+Gr_
f12*(-1)+Gr_f20*(-1)+Gr_f21*(-1)+Gr_f22*(-1) (11)
Then the subimage block shown in Fig. 7 is multiplied point by point with the 6th operator matrix, is multiplied what point-by-point multiplication obtained
Product adds up, and obtains marginal information Edge3, shown in calculating process such as formula (12):
Edge3=Gr_f00* (- 6)+Gr_f01* (10)+Gr_f02* (6)+Gr_f10* (10)+Gr_f11* (0)+Gr_
f12*(-10)+Gr_f20*(6)+Gr_f21*(-10)+Gr_f22*(-6) (12)
Then, the subimage block shown in Fig. 7 is multiplied point by point with the 7th operator matrix, is multiplied what point-by-point multiplication obtained
Product adds up, and obtains marginal information Edge4, shown in calculating process such as formula (13):
Edge4=Gr_f00* (6)+Gr_f01* (10)+Gr_f02* (- 6)+Gr_f10* (- 10)+Gr_f11* (0)+Gr_
f12*(10)+Gr_f20*(-6)+Gr_f21*(10)+Gr_f22*(6) (13)
Then, the subimage block shown in Fig. 7 is multiplied point by point with the 8th operator matrix, is multiplied what point-by-point multiplication obtained
Product adds up, and obtains marginal information Edge5, shown in calculating process such as formula (14):
Edge5=Gr_f00* (0)+Gr_f01* (- 1)+Gr_f02* (0)+Gr_f10* (- 1)+Gr_f11* (2)+Gr_
f12*(0)+Gr_f20*(0)+Gr_f21*(0)+Gr_f22*(0) (14)
Then, it after taking absolute value to four above-mentioned marginal informations, adds up again, Edge_ the sum of cumulative by what is obtained
All, the auto-focusing statistical information of the image block as the input, as shown in formula (15):
Edge_all=abs (Edge2)+abs (Edge3)+abs (Edge4)+abs (Edge5) (15)
Second: using formula 10) the 9th operator matrix, i.e. the horizontal direction matrix and formula of Scharr operator matrix shown in
11) the tenth operator matrix shown in, i.e. the vertical direction matrix of Scharr operator matrix respectively with 3 × 3 subimage blocks after noise reduction
Be multiplied point by point, the obtained product that will be multiplied point by point adds up, then successively to the sum of cumulative take absolute value after, tire out again
Add, the sum of cumulative by what is obtained, the auto-focusing statistical information of the image block as the input:
Formula 10)
Formula 11)
It is understood that meter of the those skilled in the art according to the 5th to the 8th above-mentioned operator matrix and subimage block
Calculation method, to implement the calculating of subimage block Yu the 9th and the tenth operator matrix, details are not described herein.
It should be noted that formula 2) to formula 11) shown in operator matrix, be to be obtained by many experiments and practice summary
The operator matrix arrived.Certainly, in specific implementation, those skilled in the art can according to actual needs, and it is other suitable to be arranged
Operator matrix.The concrete form of the operator matrix, does not limit the present invention in any way.
S23: enhancing processing is carried out to auto-focusing statistical information.
In specific implementation, it in order to achieve the effect that enhancing to focusing curve, can choose a kind of in following several modes
Or it is all post-processed:
Method 1: square patterns: auto-focusing statistical information FV calculated to S22 carries out square operation;
Square_fv=FV*FV;
Method 2: row maximum value mode: auto-focusing statistical information FV calculated to S22 is pressed in monitoring window interior
FV maximum value is taken according to image row direction, every row only retains a focusing statistical value in focusing window;In each monitoring window knot
Shu Shi, the FV maximum value for each row that adds up;
Assuming that the FV value obtained in a line in monitoring window are as follows: FV1FV2 ... FVn, then at the space max model of passing through
After reason:
FV_line_max=max (FV1, FV2 ... FVn);
Method 3: 7 maximum value modes before every row: auto-focusing statistical information FV calculated to S22, in monitoring window
Inside, FV value calculated to every row sort from large to small, and take preceding 7 values as current row result;In each monitoring window
At the end of, the FV value for each row that adds up;
Assuming that the FV value obtained in a line in monitoring window are as follows: FV1, FV2 ... ..., FVn, then 7 before every row of passing through
After maximum value mode treatment:
FV_sort=sort_decrease (FV1, FV2 ... FVn);
FV_line_max7={ fv_sort (0), fv_sort (1), fv_sort (2), fv_sort (3), fv_sort
(4),fv_sort(5),fv_sort(6)};
Method 4: shear mode: setting focusing statistical value shears maximum value fv_clip_max and minimum value fv_clip_
Min, auto-focusing statistical information FV calculated to S22 carry out relevant shear operation;
(if FV > fv_clip_max)
FV_clip=fv_clip_max;
(if FV < fv_clip_min)
FV_clip=0.
Summary is described above available, and by choosing the subimage block of predetermined number, each subimage block is made
For an element, the second image block is constituted, is believed then according to the value differences between the second image block neutron image block
Breath judges that the strong edge that the first image block is included, the strong edge for finally being included according to the first image block use
The auto-focusing statistical information of the center pixel is calculated in corresponding operator matrix, can cause to avoid edge difference
Auto-focusing statistical information calculating error, so as to improve the accuracy of auto-focusing statistical information, therefore can be improved
The focusing speed of picture pick-up device and the accuracy of focusing.
To more fully understand those skilled in the art and realizing the present invention, it is also provided below can be implemented it is above-mentioned from
The device of the calculation method of dynamic focusing statistical information, as shown in Figure 10, the apparatus may include: acquiring unit 1, selection unit
2, the first judging unit 3 and the first computing unit 4, in which:
The acquiring unit 1, suitable for obtaining by the image block of pixel centered on pixel to be processed, as the first image
Block, the first image block are image block choose from image shot, auto-focusing statistical information to be extracted, size M
× N, M and N are odd number;
The selection unit 2, suitable for the color according to the center pixel, with the center pixel with channel and in institute
Centered on the pixel for stating the subimage block that may make up default size in the range of the first image block, the subgraph of predetermined number is chosen
Block constitutes the second image block using each subimage block as an element.
Wherein: the coordinate of the center pixel is (Px, Py), Px=(M-1)/2, Py=(N-1)/2;Second image
The element value of block is the center pixel value of each subimage block;
First judging unit 3, suitable for being believed according to the value differences between the second image block neutron image block
Breath, judges the strong edge that the first image block is included;
First computing unit 4, suitable for the strong edge for being included according to the first image block, using corresponding operator
The auto-focusing statistical information of the first image block is calculated in matrix.
In specific implementation, first judging unit 3, comprising:
First computation subunit 31, suitable for calculating separately each subimage block subgraph corresponding with the center pixel
As the value differences of block, as sub-block value differences;
First judgment sub-unit 32 is suitable for judging that the first image block is included according to the sub-block value differences
Strong edge.
In specific implementation, the number of the subimage block of the selection is 9.
In specific implementation, the selection unit 2 is suitable for working as the center pixel for green, and the subimage block
When default size is Sm × Sn, it is described may make up with channel and in the range of the first image block with the center pixel it is pre-
If the coordinate of the pixel of the subimage block of size is respectively as follows:
(Px-distx1,Py-disty1)、(Px-2,Py)、(Px-distx1,Py+disty1)、(Px,Py-disty1)、
(Px, Py), (Px, Py+disty1), (Px+dist, Py-disty1), (Px+2, Py) and (Px+distx1, Py+disty1).
Wherein: distx1, disty1 are respectively subimage block described in every two in distance both horizontally and vertically, and
Distx1, disty1 are even number, and distx1, disty1 meet following relationship: Px+distx1+ (Sm-1)/2≤M and Py+
Disty1+ (Sn-1)/2≤N.
In specific implementation, the selection unit 2 is further adapted for when the center pixel not being green, the subimage block
Default size be Cm × Cn when, it is described to may make up with channel and in the range of the first image block with the center pixel
The coordinate of the pixel of the subimage block of default size is respectively as follows:
(Px-distx2,Py-disty2)、(Px-2,Py)、(Px-distx2,Py+disty2)、(Px,Py-disty2)、
(Px, Py), (Px, Py+disty2), (Px+dist, Py-disty2), (Px+2, Py) and (Px+distx2, Py+disty2).
Wherein: distx2 and disty2 is even number, and respectively subimage block described in every two is in horizontal and vertical side
To distance, meet: Px+distx2+ (Cm-1)/2≤M and Py+disty2+ (Cn-1)/2≤N.
In specific implementation, the strong edge comprises at least one of the following: the strong edge of horizontal direction, vertical direction it is strong
The strong edge at edge, the strong edge in -45 ° of directions and+45 ° of directions.
In specific implementation, first judgment sub-unit 32, comprising:
First matrix generation module 321 is suitable for existing using the sub-block value differences as element according to the subimage block
Position in the first image block correspondingly generates 3 × 3 value differences matrix;
First judgment module 322, element and the second row suitable for the second row first row when the value differences matrix
When the sum of tertial element is less than preset threshold, determine that the first image block includes the strong edge of horizontal direction, when described
When the sum of element and the element of the third line secondary series of the first row secondary series of value differences matrix are less than the preset threshold,
Determine that the first image block includes the strong edge of vertical direction, when the member of the first row first row of the value differences matrix
When the sum of element and the tertial element of the third line are less than the preset threshold, determine that the first image block includes -45 ° of directions
Strong edge, when the sum of the tertial element of the first row of the value differences matrix and the element of the third line first row are less than institute
When stating preset threshold, determine that the first image block includes the strong edge in+45 ° of directions.
In specific implementation, first computing unit 4, suitable for including the strong side of horizontal direction when the first image block
When edge, the element value in second image block is successively multiplied with the element of default first operator matrix, and multiplies what is obtained
Accumulation adds, the sum that will be obtained, and the auto-focusing statistical information is used as after taking absolute value, when the first image block includes vertical
When the strong edge in direction, the element value in second image block is successively multiplied with the element of default second operator matrix, and
It is cumulative, it is the sum of cumulative by what is obtained, the auto-focusing statistical information is used as after taking absolute value, when the first image block packet
When strong edge containing -45 ° of directions, by the element of element value and default third operator matrix in second image block successively phase
Multiply, and adds up, it is the sum of cumulative by what is obtained, it is used as the auto-focusing statistical information after taking absolute value, works as the first image
When block includes the strong edge in+45 ° of directions, by the element of element value and default 4th operator matrix in second image block according to
Secondary multiplication, and add up, it is the sum of cumulative by what is obtained, the auto-focusing statistical information is used as after taking absolute value.
In specific implementation, first computing unit 4 is further adapted for when the first image block not including the level side
To strong edge, the strong edge of vertical direction, any in the strong edge in -45 ° of directions and the strong edge in+45 ° of directions when, will
Element value in second image block is successively multiplied with the element of default five, the six, the 7th and the 8th operator matrix, will be with
It after the product accumulation of the element of each operator matrix and takes absolute value, successively obtains first, second, third and the 4th absolutely
Value, by described first, second, third and the 4th absolute value sum, as the auto-focusing statistical information.
In specific implementation, first computing unit 4 is further adapted for when the first image block not including the level side
To strong edge, the strong edge of vertical direction, any in the strong edge in -45 ° of directions and the strong edge in+45 ° of directions when, will
Element value in second image block is successively multiplied with the element of default 9th and the tenth operator matrix respectively, will be with each institute
State after the product accumulation of the element of operator matrix and take absolute value, successively obtain the 5th and the 6th absolute value, by the described 5th and
The sum of 6th absolute value, as the auto-focusing statistical information.
The calculating side of the statistical information of above-mentioned auto-focusing may be implemented in another embodiment of the present invention also provided below
The device of method, as shown in figure 11, in addition to above-mentioned acquiring unit 1, selection unit 2, the first judging unit 3 and the first computing unit
Outside 4, described device can also include: amending unit 5 and enhancing processing unit 6, in which:
The amending unit 5, suitable for before judging strong edge that the first image block is included, with second figure
Picture block is unit, and the processing of noise is removed to the first image block, and the element value after obtaining removal noise is gone with described
Except the element value after noise is element, third image block is constituted, using the third image block as revised second image block.
In specific implementation, the amending unit 5, comprising:
First revise subelemen 51, suitable for being removed the processing of noise under single channel noise reduction process mode;
Second revise subelemen 52, suitable for being removed the processing of noise under the noise reduction process mode of hybrid channel.
In specific implementation, first revise subelemen 51, comprising:
First correction module 511 is suitable for in the subimage block, identical as the center pixel of the first image block
The pixel in channel is averaged, as the element value after the removal noise;
Second correction module 512 is suitable for in the subimage block, identical as the center pixel of the first image block
It after the pixel in channel is successively multiplied with predetermined coefficient, then is normalized, as the element value after the removal noise;
Third correction module 513 is suitable for in the subimage block, identical as the center pixel of the first image block
The pixel in channel takes intermediate value, as the element value after the removal noise.
In specific implementation, second revise subelemen 52, suitable for the center pixel according to each subimage block
The adjacent pixel in left side, the adjacent pixel in upside, the adjacent pixel in upper left side, calculate each subimage block
Brightness, as it is described removal noise after element value.
In an embodiment of the present invention, the adjacent pixel in the left side of the center pixel of each subimage block,
The adjacent pixel in upside, the adjacent pixel in upper left side are the pixel removed after noise.
In specific implementation, the enhancing processing unit 6 is suitable for after obtaining the auto-focusing statistical information, right
The auto-focusing statistical information carries out enhancing processing, enhancing is obtained treated auto-focusing statistical information, in described
The auto-focusing statistical information of imago element.
In specific implementation, the enhancing processing unit 6, comprising: first enhances processing subelement 61, is suitable for by described in certainly
It is a kind of that dynamic focusing statistical information carries out the obtained square value of square operation, as the enhancing treated auto-focusing statistics
Information.
In specific implementation, the enhancing processing unit 6, comprising: the second enhancing processing subelement 62 is suitable for according to described
The line direction of first image block is maximized every row of the auto-focusing statistical information in statistical window, will be acquired
The maximum value of all rows carries out accumulating operation, obtains the sum of first maximum value, regard the sum of described first maximum value as institute
State enhancing treated auto-focusing statistical information.
In specific implementation, the enhancing processing unit 6, comprising: third enhancing processing subelement 63 is suitable for every row meter
The auto-focusing statistical information of calculating carries out sequence from big to small, takes auto-focusing statistics letter of the preset number as every row
The auto-focusing statistical information of every row is carried out accumulating operation, obtains the sum of second maximum value by breath, maximum by described second
The sum of value is as enhancing treated the auto-focusing statistical information.
In specific implementation, the enhancing processing unit 6, comprising: the 4th enhances processing subelement 64, is suitable for described in certainly
When dynamic focusing statistical information is greater than preset focusing statistics maximum value, using the preset focusing statistics maximum value as the increasing
Auto-focusing statistical information that treated by force, when the auto-focusing statistical information is less than preset focusing statistics minimum value,
By zero as enhancing treated the auto-focusing statistical information.
In conclusion the subimage block of predetermined number is chosen by selection unit, using each subimage block as one
A element constitutes the second image block, and then the first judging unit is according to the pixel between the second image block neutron image block
It is worth different information, judges the strong edge that the first image block is included, last first computing unit is according to the first image
The auto-focusing statistical information of the center pixel is calculated using corresponding operator matrix in the strong edge that block is included, can
More targetedly to extract marginal information at strong edge position, so as to improve the accurate of auto-focusing statistical information
Degree, therefore the focusing speed of picture pick-up device and the accuracy of focusing can be improved.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in computer readable storage medium, storage
Medium may include: ROM, RAM, disk or CD etc..
Although present disclosure is as above, present invention is not limited to this.Anyone skilled in the art are not departing from this
It in the spirit and scope of invention, can make various changes or modifications, therefore protection scope of the present invention should be with claim institute
Subject to the range of restriction.
Claims (34)
1. a kind of calculation method of auto-focusing statistical information characterized by comprising
It obtains the image block of pixel centered on pixel to be processed, as the first image block, the first image block is from quilt
The image block of auto-focusing statistical information choosing in image, to be extracted is taken the photograph, size is that M × N, M and N are odd number;
According to the color of the center pixel, with the center pixel with channel and can in the range of the first image block
Centered on the pixel for constituting the subimage block of default size, the subimage block of predetermined number is chosen, by each subimage block
As an element, the second image block is constituted, in which: the coordinate of the center pixel is (Px, Py), Px=(M-1)/2, Py=
(N-1)/2, the element value of second image block is the center pixel value of each subimage block;
According to the value differences information between the second image block neutron image block, judge that the first image block is included
Strong edge;
The center pixel is calculated using corresponding operator matrix according to the strong edge that the first image block is included
Auto-focusing statistical information;
Wherein, the strong edge comprises at least one of the following: the strong edge of horizontal direction, the strong edge of vertical direction, -45 ° of sides
To strong edge, the strong edge in+45 ° of directions;The operator matrix is Scharr operator matrix;
The value differences information according between the second image block neutron image block, judges the first image block institute
The strong edge for including, comprising: calculate separately each subimage block and the subimage block centered on the center pixel
Value differences, as sub-block value differences;According to the sub-block value differences, judge that the first image block is included
Strong edge;
Using the sub-block value differences as element, according to position of the subimage block in the first image block, accordingly
Ground generates 3 × 3 value differences matrix;
It is described according to the sub-block value differences, judge the strong edge that the first image block is included, comprising: when the picture
When the sum of element and the tertial element of the second row of second row first row of element value difference matrix are less than preset threshold, institute is determined
State the strong edge that the first image block includes horizontal direction;When the element of the first row secondary series of the value differences matrix and
When the sum of element of three row secondary series is less than the preset threshold, determine that the first image block includes the strong side of vertical direction
Edge;When the sum of element and the tertial element of the third line of the first row first row of the value differences matrix be less than it is described pre-
If when threshold value, determining that the first image block includes the strong edge in -45 ° of directions;When the first row of the value differences matrix
When the sum of element of tertial element and the third line first row is less than the preset threshold, determine that the first image block includes
The strong edge in+45 ° of directions.
2. the calculation method of auto-focusing statistical information according to claim 1, which is characterized in that the subgraph of the selection
As the number of block is 9.
3. the calculation method of auto-focusing statistical information according to claim 2, which is characterized in that when the center pixel
For green, and when the default size of the subimage block is Sm × Sn, it is described with the center pixel with channel and described the
The coordinate that may make up the pixel of the subimage block of default size in the range of one image block is respectively as follows: (Px-distx1, Py-
disty1)、(Px-2,Py)、(Px-distx1,Py+disty1)、(Px,Py-disty1)、(Px,Py)、(Px,Py+
Disty1), (Px+distx1, Py-disty1), (Px+2, Py) and (Px+distx1, Py+disty1), in which: distx1,
Disty1 is respectively subimage block described in every two in distance both horizontally and vertically, and distx1, disty1 are even number,
And meet following relationship: Px+distx1+ (Sm-1)/2≤M and Py+disty1+ (Sn-1)/2≤N.
4. the calculation method of auto-focusing statistical information according to claim 3, which is characterized in that when the center pixel
Green, when the default size of the subimage block is Cm × Cn, it is described with the center pixel with channel and described the
The coordinate that may make up the pixel of the subimage block of default size in the range of one image block is respectively as follows: (Px-distx2, Py-
disty2)、(Px-2,Py)、(Px-distx2,Py+disty2)、(Px,Py-disty2)、(Px,Py)、(Px,Py+
Disty2), (Px+distx2, Py-disty2), (Px+2, Py) and (Px+distx2, Py+disty2), in which: distx2 and
Disty2 is even number, and respectively subimage block described in every two meets: Px+ in distance both horizontally and vertically
Distx2+ (Cm-1)/2≤M and Py+disty2+ (Cn-1)/2≤N.
5. the calculation method of auto-focusing statistical information according to claim 1, which is characterized in that described according to described
The auto-focusing statistics of the center pixel is calculated using corresponding operator matrix in the strong edge that one image block is included
Information, comprising:
When the first image block includes the strong edge of horizontal direction, by the element value and default the in second image block
The element of one operator matrix is successively multiplied, and the product accumulation that will be obtained, then the sum of cumulative by what is obtained, conduct after taking absolute value
The auto-focusing statistical information;
When the first image block includes the strong edge of vertical direction, by the element value and default the in second image block
The element of two operator matrixes is successively multiplied, and the product accumulation that will be obtained, then it is the sum of cumulative by what is obtained take absolute value after conduct
The auto-focusing statistical information;
When the first image block includes the strong edge in -45 ° of directions, by the element value and default the in second image block
The element of three operator matrixes is successively multiplied, and the product accumulation that will be obtained, then it is the sum of cumulative by what is obtained take absolute value after conduct
The auto-focusing statistical information;
When the first image block includes the strong edge in+45 ° of directions, by the element value and default the in second image block
The element of four operator matrixes is successively multiplied, and the product accumulation that will be obtained, then it is the sum of cumulative by what is obtained take absolute value after conduct
The auto-focusing statistical information;
Wherein, default first operator matrix are as follows:
Default second operator matrix are as follows:
The default third operator matrix are as follows:
Default 4th operator matrix are as follows:
6. the calculation method of auto-focusing statistical information according to claim 5, which is characterized in that described according to described
The auto-focusing statistics of the center pixel is calculated using corresponding operator matrix in the strong edge that one image block is included
Information, further includes: when the first image block does not include strong edge, the strong edge of vertical direction, -45 ° of the horizontal direction
When any in the strong edge in direction and the strong edge in+45 ° of directions, by the element value and default the in second image block
Five, the element of the six, the 7th and the 8th operator matrix is successively multiplied, by the product accumulation of the element with each operator matrix
It afterwards and takes absolute value, successively obtains first, second, third and the 4th absolute value, absolutely by described first, second, third and the 4th
To the sum of value, as the auto-focusing statistical information;
Wherein: default 5th operator matrix are as follows:
Default 6th operator matrix are as follows:
Default 7th operator matrix are as follows:
Default 8th operator matrix are as follows:
7. the calculation method of auto-focusing statistical information according to claim 5, which is characterized in that described according to described
The auto-focusing statistics of the center pixel is calculated using corresponding operator matrix in the strong edge that one image block is included
Information, further includes:
When the first image block do not include the strong edge of the horizontal direction, the strong edge of vertical direction, -45 ° of directions it is strong
When any in the strong edge in edge and+45 ° of directions, by the element value in second image block respectively with the default 9th and
The element of tenth operator matrix is successively multiplied, and after the product accumulation of the element with each operator matrix and will take absolute value,
The the 5th and the 6th absolute value is successively obtained, by the sum of the 5th and the 6th absolute value, as the auto-focusing statistical information;
Wherein, default 9th operator matrix are as follows:
Default tenth operator matrix are as follows:
8. the calculation method of auto-focusing statistical information according to claim 1, which is characterized in that judging described first
Before the strong edge that image block is included, further includes: be modified processing to selected subimage block;It is described to selected
Subimage block is modified processing
As unit of each subimage block, it is successively removed the processing of noise to each selected subimage block, obtains
Element value to after removal noise, each pixel value of selected subimage block are after removing noise in corresponding subimage block
Element value constitutes second image block using the element value after the removal noise as element.
9. the calculation method of auto-focusing statistical information according to claim 8, which is characterized in that the removal noise
Processing, includes any of the following:
The processing of noise is removed under single channel noise reduction process mode;
The processing of noise is removed under the noise reduction process mode of hybrid channel.
10. the calculation method of auto-focusing statistical information according to claim 9, which is characterized in that described in single channel
It is removed the processing of noise under noise reduction process mode, includes any of the following:
To in the subimage block, it is averaged with the pixel of the center pixel same channels of the first image block, as
Element value after the removal noise;
To in the subimage block, with the pixels of the center pixel same channels of the first image block successively with predetermined coefficient
It after multiplication, then is normalized, as the element value after the removal noise;
To in the subimage block, intermediate value is taken with the pixel of the center pixel same channels of the first image block, as institute
Element value after stating removal noise.
11. the calculation method of auto-focusing statistical information according to claim 9, which is characterized in that described logical in mixing
The processing of noise is removed under road noise reduction process mode, comprising:
It is adjacent according to the left side of the center pixel of each subimage block and the center pixel adjacent pixel, a upside
One pixel, the adjacent pixel in upper left side, calculate the brightness of each subimage block, after the removal noise
Element value.
12. the calculation method of auto-focusing statistical information according to claim 11, which is characterized in that the basis is each
The adjacent pixel in the left side of the center pixel of the subimage block, the adjacent pixel in upside, the adjacent pixel in upper left side,
Calculate the brightness of each subimage block, comprising:
First a pixel adjacent to the left side of the center pixel of each subimage block, upside adjacent pixel, a upper left side
An adjacent pixel does noise reduction process respectively, the pixel value after obtaining noise reduction process, further according to the pixel after the noise reduction process
Value, calculates the brightness of each subimage block.
13. the calculation method of auto-focusing statistical information according to claim 1 or 8, which is characterized in that further include:
After obtaining the auto-focusing statistical information, enhancing processing is carried out to the auto-focusing statistical information, is increased
Treated by force auto-focusing statistical information, the auto-focusing statistical information as the center pixel.
14. the calculation method of auto-focusing statistical information according to claim 13, which is characterized in that it is described to it is described from
Dynamic focusing statistical information carries out enhancing processing, obtains enhancing treated auto-focusing statistical information, comprising:
The auto-focusing statistical information is subjected to the obtained square value of square operation, that treated is automatic as the enhancing
Focusing statistical information.
15. the calculation method of auto-focusing statistical information according to claim 13, which is characterized in that it is described to it is described from
Dynamic focusing statistical information carries out enhancing processing, obtains enhancing treated auto-focusing statistical information, comprising:
According to the line direction of the first image block, maximum is taken to every row of the auto-focusing statistical information in statistical window
Value;
The maximum value of acquired all rows is subjected to accumulating operation, obtains the sum of first maximum value, it is maximum by described first
The sum of value is as enhancing treated the auto-focusing statistical information.
16. the calculation method of auto-focusing statistical information according to claim 13, which is characterized in that it is described to it is described from
Dynamic focusing statistical information carries out enhancing processing, obtains enhancing treated auto-focusing statistical information, comprising:
Sequence from big to small is carried out to the calculated auto-focusing statistical information of every row, take preset number as every row oneself
Dynamic focusing statistical information;
The auto-focusing statistical information of every row is subjected to accumulating operation, obtains the sum of second maximum value, most by described second
The sum of big value is as the enhancing treated auto-focusing statistical information.
17. the calculation method of auto-focusing statistical information according to claim 13, which is characterized in that it is described to it is described from
Dynamic focusing statistical information carries out enhancing processing, obtains enhancing treated auto-focusing statistical information, comprising:
When the auto-focusing statistical information is greater than preset focusing statistics maximum value, the preset focusing is counted maximum
Value is as enhancing treated the auto-focusing statistical information;
When the auto-focusing statistical information is less than preset focusing statistics minimum value, by zero, as the enhancing, treated
Auto-focusing statistical information.
18. a kind of computing device of auto-focusing statistical information characterized by comprising
Acquiring unit, suitable for obtaining the image block of pixel centered on pixel to be processed, as the first image block, described first
Image block is image block choose from image shot, auto-focusing statistical information to be extracted, and size is that M × N, M and N are
Odd number;
Selection unit, suitable for the color according to the center pixel, with the center pixel with channel and in first figure
As the subimage block that may make up default size in the range of block pixel centered on, choose the subimage block of predetermined number, will be every
A subimage block constitutes the second image block as an element, in which: the coordinate of the center pixel is (Px, Py), Px
=(M-1)/2, Py=(N-1)/2;
The element value of second image block is the center pixel value of each subimage block;
First judging unit, suitable for judging institute according to the value differences information between the second image block neutron image block
State the strong edge that the first image block is included;
First computing unit is calculated suitable for the strong edge for being included according to the first image block using corresponding operator matrix
Obtain the auto-focusing statistical information of the center pixel;
Wherein, the strong edge comprises at least one of the following: the strong edge of horizontal direction, the strong edge of vertical direction, -45 ° of sides
To strong edge, the strong edge in+45 ° of directions;The operator matrix is Scharr operator matrix;
First judging unit, comprising: the first computation subunit, suitable for calculate separately each subimage block with described
The value differences of subimage block centered on center pixel, as sub-block value differences;First judgment sub-unit is suitable for root
According to the sub-block value differences, the strong edge that the first image block is included is judged;
First judgment sub-unit, comprising: the first matrix generation module is suitable for using the sub-block value differences as element,
According to position of the subimage block in the first image block, 3 × 3 value differences matrix is correspondingly generated;First
Judgment module, suitable for the sum of the element of the second row first row when the value differences matrix and the tertial element of the second row
When less than preset threshold, determine that the first image block includes the strong edge of horizontal direction, when the value differences matrix
When the sum of element and the element of the third line secondary series of the first row secondary series are less than the preset threshold, the first image is determined
Block includes the strong edge of vertical direction, when the element and the third line third of the first row first row of the value differences matrix arrange
The sum of element when being less than the preset threshold, determine that the first image block includes the strong edge in -45 ° of directions, when the picture
When the sum of the tertial element of the first row and the element of the third line first row of element value difference matrix are less than the preset threshold, really
Determine the strong edge that the first image block includes+45 ° of directions.
19. the computing device of auto-focusing statistical information according to claim 18, which is characterized in that the son of the selection
The number of image block is 9.
20. the computing device of auto-focusing statistical information according to claim 19, which is characterized in that the selection is single
Member is suitable for when the center pixel being green, and when the default size of the subimage block is Sm × Sn, described with the center
Pixel may make up the coordinate difference of the pixel of the subimage block of default size with channel and in the range of the first image block
Are as follows: (Px-distx1, Py-disty1), (Px-2, Py), (Px-distx1, Py+disty1), (Px, Py-disty1), (Px,
Py), (Px, Py+disty1), (Px+distx1, Py-disty1), (Px+2, Py) and (Px+distx1, Py+disty1),
In: distx1, disty1 are respectively subimage block described in every two in distance both horizontally and vertically, and distx1,
Disty1 is even number, and meets following relationship: Px+distx1+ (Sm-1)/2≤M and Py+disty1+ (Sn-1)/2≤N.
21. the computing device of auto-focusing statistical information described in 9 or 20 according to claim 1, which is characterized in that the selection
Unit is further adapted for when the center pixel is not green, and the default size of the subimage block is Cm × Cn, it is described with it is described
Center pixel may make up the coordinate of the pixel of the subimage block of default size with channel and in the range of the first image block
Be respectively as follows: (Px-distx2, Py-disty2), (Px-2, Py), (Px-distx2, Py+disty2), (Px, Py-disty2),
(Px, Py), (Px, Py+disty2), (Px+distx2, Py-disty2), (Px+2, Py) and (Px+distx2, Py+
Disty2), in which: distx2 and disty2 is respectively subimage block described in every two in distance both horizontally and vertically, and
Distx2 and disty2 is even number, and meets following relationship: Px+distx2+ (Cm-1)/2≤M and Py+disty2+ (Cn-
1)/2≤N.
22. the computing device of auto-focusing statistical information according to claim 18, which is characterized in that described first calculates
Unit, suitable for when the first image block include horizontal direction strong edge when, by second image block element value with
The product accumulation that the element of default first operator matrix is successively multiplied, and will obtain, then it is the sum of cumulative by what is obtained, it takes absolute value
It is used as the auto-focusing statistical information afterwards, when the first image block includes the strong edge of vertical direction, by described second
The product accumulation that element value in image block is successively multiplied with the element of default second operator matrix, and will obtain, then will obtain
It is the sum of cumulative, the auto-focusing statistical information is used as after taking absolute value;When the first image block includes -45 ° of directions
When strong edge, the element value in second image block is successively multiplied with the element of default third operator matrix, and will obtain
Product accumulation, then it is the sum of cumulative by what is obtained, the auto-focusing statistical information is used as after taking absolute value;When first figure
When including the strong edge in+45 ° of directions as block, by the element of element value and default 4th operator matrix in second image block
The product accumulation that is successively multiplied, and will obtain, then it is the sum of cumulative by what is obtained, it is counted after taking absolute value as the auto-focusing
Information;
Wherein, default first operator matrix are as follows:
Default second operator matrix are as follows:
The default third operator matrix are as follows:
Default 4th operator matrix are as follows:
23. the computing device of auto-focusing statistical information according to claim 22, which is characterized in that described first calculates
Unit is further adapted for when the first image block not including the strong edge of the horizontal direction, the strong edge of vertical direction, -45 ° of sides
To strong edge and+45 ° of directions strong edge in it is any when, by the element value and default the in second image block
Five, the element of the six, the 7th and the 8th operator matrix is successively multiplied, by the product accumulation of the element with each operator matrix
It afterwards and takes absolute value, successively obtains first, second, third and the 4th absolute value, absolutely by described first, second, third and the 4th
To the sum of value, as the auto-focusing statistical information;
Wherein: default 5th operator matrix are as follows:
Default 6th operator matrix are as follows:
Default 7th operator matrix are as follows:
Default 8th operator matrix are as follows:
24. the computing device of auto-focusing statistical information according to claim 22, which is characterized in that described first calculates
Unit is further adapted for when the first image block not including the strong edge of the horizontal direction, the strong edge of vertical direction, -45 ° of sides
To strong edge and+45 ° of directions strong edge in it is any when, by the element value in second image block respectively with it is default
The element of 9th and the tenth operator matrix is successively multiplied, by after the product accumulation of the element with each operator matrix and take absolutely
To value, the 5th and the 6th absolute value is successively obtained, the sum of the 5th and the 6th absolute value is counted as the auto-focusing
Information;
Wherein, default 9th operator matrix are as follows:
Default tenth operator matrix are as follows:
25. the computing device of auto-focusing statistical information according to claim 18, which is characterized in that further include: amendment
Unit, suitable for before judging strong edge that the first image block is included, as unit of each subimage block, successively
The processing of noise is removed to each selected subimage block, the element value after obtaining removal noise, selected subgraph
As block each pixel value be corresponding subimage block in remove noise after element value, with it is described removal noise after element value be
Element constitutes second image block.
26. the computing device of auto-focusing statistical information according to claim 25, which is characterized in that the amendment is single
Member, including it is following any one:
First revise subelemen, suitable for being removed the processing of noise under single channel noise reduction process mode;
Second revise subelemen, suitable for being removed the processing of noise under the noise reduction process mode of hybrid channel.
27. the computing device of auto-focusing statistical information according to claim 26, which is characterized in that first amendment
Subelement, comprising:
First correction module is suitable for in the subimage block, with the center pixel same channels of the first image block
Pixel is averaged, as the element value after the removal noise;
Second correction module is suitable for in the subimage block, with the center pixel same channels of the first image block
It after pixel is successively multiplied with predetermined coefficient, then is normalized, as the element value after the removal noise;
Third correction module is suitable for in the subimage block, with the center pixel same channels of the first image block
Pixel takes intermediate value, as the element value after the removal noise.
28. the computing device of auto-focusing statistical information according to claim 26, which is characterized in that second amendment
Subelement, suitable for according to the adjacent pixel of the center pixel of each subimage block and the left side of the center pixel, on
The adjacent pixel in side, the adjacent pixel in upper left side, calculate the brightness of each subimage block, make an uproar as the removal
Element value after sound.
29. the computing device of auto-focusing statistical information according to claim 26, which is characterized in that second amendment
Subelement, the adjacent pixel in left side, the adjacent pixel in upside suitable for the center pixel first to each subimage block,
The adjacent pixel in upper left side does noise reduction process respectively, the pixel value after obtaining noise reduction process, after the noise reduction process
Pixel value, calculate the brightness of each subimage block.
30. the computing device of auto-focusing statistical information described in 8 or 25 according to claim 1, which is characterized in that further include:
Enhance processing unit, be suitable for after obtaining the auto-focusing statistical information, to the auto-focusing statistical information into
Row enhancing processing obtains enhancing treated auto-focusing statistical information, and the auto-focusing as the center pixel counts letter
Breath.
31. the computing device of auto-focusing statistical information according to claim 30, which is characterized in that the enhancing processing
Unit, comprising: the first enhancing processing subelement is suitable for carrying out the auto-focusing statistical information into square operation obtained flat
Side's value, as enhancing treated the auto-focusing statistical information.
32. the computing device of auto-focusing statistical information according to claim 30, which is characterized in that the enhancing processing
Unit, comprising: the second enhancing processing subelement, suitable for the line direction according to the first image block, to the institute in statistical window
The every row for stating auto-focusing statistical information is maximized, and the maximum value of acquired all rows is carried out accumulating operation, is obtained
The sum of first maximum value, by the sum of described first maximum value as enhancing treated the auto-focusing statistical information.
33. the computing device of auto-focusing statistical information according to claim 30, which is characterized in that the enhancing processing
Unit, comprising: third enhancing processing subelement, suitable for being carried out from big to small to the calculated auto-focusing statistical information of every row
Sequence, takes auto-focusing statistical information of the preset number as every row, and the auto-focusing statistical information of every row is carried out
Accumulating operation obtains the sum of second maximum value, by the sum of described second maximum value as enhancing treated the auto-focusing
Statistical information.
34. the computing device of auto-focusing statistical information according to claim 30, which is characterized in that the enhancing processing
Unit, comprising: the 4th enhancing processing subelement is suitable for when the auto-focusing statistical information is maximum greater than preset focusing statistics
When value, using the preset focusing statistics maximum value as the enhancing treated auto-focusing statistical information, when it is described from
When dynamic focusing statistical information is less than preset focusing statistics minimum value, by zero as the enhancing treated auto-focusing statistics
Information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510996962.1A CN106921828B (en) | 2015-12-25 | 2015-12-25 | A kind of calculation method and device of auto-focusing statistical information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510996962.1A CN106921828B (en) | 2015-12-25 | 2015-12-25 | A kind of calculation method and device of auto-focusing statistical information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106921828A CN106921828A (en) | 2017-07-04 |
CN106921828B true CN106921828B (en) | 2019-09-17 |
Family
ID=59455614
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510996962.1A Active CN106921828B (en) | 2015-12-25 | 2015-12-25 | A kind of calculation method and device of auto-focusing statistical information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106921828B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108228290B (en) * | 2017-12-19 | 2021-06-01 | 广州文石信息科技有限公司 | Method and device for displaying UI (user interface) on EINK (electronic article and Natural killer) color screen equipment |
CN114422693A (en) * | 2022-01-14 | 2022-04-29 | 山东云海国创云计算装备产业创新中心有限公司 | Focusing method, device, equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102572265A (en) * | 2010-09-01 | 2012-07-11 | 苹果公司 | Auto-focus control using image statistics data with coarse and fine auto-focus scores |
CN104102069A (en) * | 2013-04-11 | 2014-10-15 | 展讯通信(上海)有限公司 | Focusing method and device of imaging system, and imaging system |
CN104133339A (en) * | 2013-05-02 | 2014-11-05 | 聚晶半导体股份有限公司 | Automatic focusing method and automatic focusing device |
CN104717417A (en) * | 2013-12-16 | 2015-06-17 | 展讯通信(上海)有限公司 | Imaging system quick automatic focusing method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI324015B (en) * | 2006-12-22 | 2010-04-21 | Ind Tech Res Inst | Autofocus searching method |
US20130083232A1 (en) * | 2009-04-23 | 2013-04-04 | Hiok Nam Tay | Auto-focus image system |
-
2015
- 2015-12-25 CN CN201510996962.1A patent/CN106921828B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102572265A (en) * | 2010-09-01 | 2012-07-11 | 苹果公司 | Auto-focus control using image statistics data with coarse and fine auto-focus scores |
CN104102069A (en) * | 2013-04-11 | 2014-10-15 | 展讯通信(上海)有限公司 | Focusing method and device of imaging system, and imaging system |
CN104133339A (en) * | 2013-05-02 | 2014-11-05 | 聚晶半导体股份有限公司 | Automatic focusing method and automatic focusing device |
CN104717417A (en) * | 2013-12-16 | 2015-06-17 | 展讯通信(上海)有限公司 | Imaging system quick automatic focusing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106921828A (en) | 2017-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3143589B1 (en) | Identifying features | |
KR101662846B1 (en) | Apparatus and method for generating bokeh in out-of-focus shooting | |
CN104463159B (en) | A kind of image processing method and device for positioning iris | |
CN103679656B (en) | A kind of Automated sharpening of images method | |
EP3200442B1 (en) | Method and apparatus for image processing | |
CN105809630A (en) | Image noise filtering method and system | |
CN102306307B (en) | Positioning method of fixed point noise in color microscopic image sequence | |
CN106921828B (en) | A kind of calculation method and device of auto-focusing statistical information | |
CN110111711A (en) | The detection method and device of screen, computer readable storage medium | |
Coady et al. | An overview of popular digital image processing filtering operations | |
CN105654428A (en) | Method and system for image noise reduction | |
CN105430277B (en) | Autofocus control method and device | |
CN102005051B (en) | Edge detection method and related device | |
CN103997592B (en) | Vedio noise reduction method and system | |
CN105049679A (en) | Image processing device and image processing method | |
CN104702925A (en) | Method and apparatus for demosaicing of color filter array image | |
CN105590307A (en) | Transparency-based matting method and apparatus | |
CN104010114B (en) | Video denoising method and device | |
CN105976334B (en) | A kind of denoising system and method for three-dimensional filtering Denoising Algorithm | |
CN102724541B (en) | Intelligent diagnosis and recovery method for monitoring images | |
CN107437239A (en) | A kind of image enchancing method and device | |
CN104751416A (en) | Image denoising method and device and image processing system | |
CN104751417A (en) | Color noise reducing method, device and image processing system | |
CN109698946A (en) | Projection device Atomatic focusing method, projection device and computer readable storage medium | |
CN106683044B (en) | Image splicing method and device of multi-channel optical detection system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 100089 18 / F, block B, Zhizhen building, No.7, Zhichun Road, Haidian District, Beijing Patentee after: Beijing Ziguang zhanrui Communication Technology Co.,Ltd. Address before: 100084, Room 516, building A, Tsinghua Science Park, Beijing, Haidian District Patentee before: BEIJING SPREADTRUM HI-TECH COMMUNICATIONS TECHNOLOGY Co.,Ltd. |
|
CP03 | Change of name, title or address |