CN106921828A - The computational methods and device of a kind of auto-focusing statistical information - Google Patents

The computational methods and device of a kind of auto-focusing statistical information Download PDF

Info

Publication number
CN106921828A
CN106921828A CN201510996962.1A CN201510996962A CN106921828A CN 106921828 A CN106921828 A CN 106921828A CN 201510996962 A CN201510996962 A CN 201510996962A CN 106921828 A CN106921828 A CN 106921828A
Authority
CN
China
Prior art keywords
auto
image block
focusing
statistical information
value
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.)
Granted
Application number
CN201510996962.1A
Other languages
Chinese (zh)
Other versions
CN106921828B (en
Inventor
胡毅
蔡进
王浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ziguang Zhanrui Communication Technology Co Ltd
Original Assignee
Beijing Spreadtrum Hi Tech Communications Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Spreadtrum Hi Tech Communications Technology Co Ltd filed Critical Beijing Spreadtrum Hi Tech Communications Technology Co Ltd
Priority to CN201510996962.1A priority Critical patent/CN106921828B/en
Publication of CN106921828A publication Critical patent/CN106921828A/en
Application granted granted Critical
Publication of CN106921828B publication Critical patent/CN106921828B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation

Abstract

The computational methods and device of a kind of auto-focusing statistical information, methods described include:Obtain using pending pixel as center pixel image block, as the first image block, described first image block be chosen from image shot, the image block of auto-focusing statistical information to be extracted;The color of the center pixel according to described first image block, centered on the pixel of subimage block that may make up default size with passage and in the range of described first image block with the center pixel, chooses the subimage block of predetermined number, constitutes the second image block;According to the value differences information between the second image block neutron image block, the strong edge that described first image block is included is judged;According to the strong edge that described first image block is included, using corresponding operator matrix, the auto-focusing statistical information of described first image block is calculated, the degree of accuracy of the auto-focusing statistical information of subject can be improved using such scheme.

Description

The computational methods and device of a kind of auto-focusing statistical information
Technical field
The present invention relates to image processing field, more particularly to a kind of auto-focusing statistical information computational methods and device.
Background technology
Picture pick-up device, such as the mobile phone of camera and integral photographic function, usually can realize auto-focusing.
Auto-focusing (Auto Focus) make use of the principle that subject light reflects, and the light of subject reflection is by camera Imageing sensor (such as CCD/CMOS sensors) Deng picture pick-up device is received, and by computer disposal, is calculated object The auto-focusing statistical information of body, is focused according to the auto-focusing statistical information driving electric focusing mechanism.Therefore, certainly The accuracy of dynamic focusing statistical information directly affects focusing speed and the degree of accuracy of focusing of picture pick-up device.
At present, it is multiplied with Scharr operators by by subject, is calculated the auto-focusing statistics letter of subject Breath.
But, the auto-focusing statistical information of the subject obtained using the above method is inaccurate, so as to cause shooting The focusing speed of equipment and the degree of accuracy of focusing be not high.
The content of the invention
The problem that the present invention is solved is if improving the degree of accuracy of the auto-focusing statistical information of subject.
To solve the above problems, a kind of computational methods of auto-focusing statistical information are the embodiment of the invention provides, it is described Method includes:
Obtain using pending pixel as center pixel image block, used as the first image block, described first image block is Image block chosen from image shot, auto-focusing statistical information to be extracted, size is odd number for M × N, M and N;
According to the color of the center pixel, with the center pixel with passage and in the scope of described first image block Centered on the pixel of the subimage block that inside may make up default size, the subimage block of predetermined number is chosen, by each subgraph As block is used as an element, the second image block is constituted, wherein: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 center pixel value of each subimage block;
According to the value differences information between the second image block neutron image block, described first image block institute is judged Comprising strong edge;
According to the strong edge that described first image block is included, using corresponding operator matrix, the center is calculated The auto-focusing statistical information of pixel.
Alternatively, the value differences information according between the second image block neutron image block, judges described The strong edge that first image block is included, including:
The value differences of each described subimage block subimage block corresponding with the center pixel are calculated respectively, as Sub-block value differences;
According to the sub-block value differences, the strong edge that described first image block is included is judged.
Alternatively, the number of the subimage block of the selection is 9.
Alternatively, when the center pixel for green, and the subimage block default size be Sm × Sn when, it is described with The center pixel may make up the pixel of the subimage block of default size with passage and in the range of described first image block Coordinate is respectively:(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 each two in margin of image element both horizontally and vertically It is different, and distx1, disty1 are even number, and meet following relation:Px+distx1+(Sm-1)/2<=M and Py+disty1+ (Sn-1)/2<=N.
Alternatively, 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 passage and in the range of described first image block Coordinate is respectively:(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 are respectively subimage block described in each two in distance both horizontally and vertically, and Distx2 and disty2 are even number, and meet following relation:Px+distx2+(Cm-1)/2<=M and Py+disty2+ (Cn- 1)/2<=N.
Alternatively, the strong edge includes following at least one:The strong edge of horizontal direction, the strong edge of vertical direction ,- 45 ° of strong edges and+45 ° of strong edges in direction in direction.
Alternatively, with the sub-block value differences as element, according to the subimage block in described first image block Position, correspondingly generate 3 × 3 value differences matrix;
It is described to judge the strong edge that described first image block is included according to the sub-block value differences, including:
When the element of the second row first row of the value differences matrix is less than with the tertial element sum of the second row During predetermined threshold value, strong edge of the described first image block comprising horizontal direction is determined;
When the element of the first row secondary series of the value differences matrix is less than with the element sum of the third line secondary series During the predetermined threshold value, strong edge of the described first image block comprising vertical direction is determined;
When the element of the first row first row of the value differences matrix is less than with the tertial element sum of the third line During the predetermined threshold value, determine that described first image block includes -45 ° of strong edges in direction;
When the tertial element of the first row of the value differences matrix is less than with the element sum of the third line first row During the predetermined threshold value, determine that described first image block includes+45 ° of strong edges in direction.
Alternatively, the strong edge included according to described first image block, using corresponding operator matrix, calculates To the auto-focusing statistical information of described first image block, including:
When described first image block comprising horizontal direction strong edge when, by the element value in second image block with it is pre- If the element of the first operator matrix is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained, after taking absolute value As the auto-focusing statistical information;
When described first image block comprising vertical direction strong edge when, by the element value in second image block with it is pre- If after the element of the second operator matrix is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolute value As the auto-focusing statistical information;
When strong edge of the described first image block comprising -45 ° of directions, by the element value in second image block with it is pre- If the element of the 3rd operator matrix is multiplied successively, and adds up, the cumulative sum that will be obtained, as described automatic right after taking absolute value Burnt statistical information;
When strong edge of the described first image block comprising+45 ° of directions, by the element value in second image block with it is pre- If the element of the 4th operator matrix is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained, after taking absolute value As the auto-focusing statistical information.
Alternatively, the strong edge included according to described first image block, using corresponding operator matrix, calculates To the auto-focusing statistical information of described first image block, also include:When described first image block does not include the horizontal direction Strong edge, the strong edge of vertical direction, the strong edge and+45 ° of strong edges in direction in -45 ° of directions in any one when, by institute Element value in the second image block is stated to be multiplied successively with the element of default five, the six, the 7th and the 8th operator matrix, will with it is every After the product accumulation of the element of the individual operator matrix and take absolute value, first, second, third and the 4th absolute is obtained successively Value, by described first, second, third and the 4th absolute value sum, as the auto-focusing statistical information.
Alternatively, the strong edge included according to described first image block, using corresponding operator matrix, calculates To the auto-focusing statistical information of described first image block, also include:
When described first image block does not include strong edge, the strong edge of vertical direction, -45 ° of directions of the horizontal direction Strong edge and+45 ° of strong edges in direction in any one when, by the element value in second image block respectively with default the The element of the nine and the tenth operator matrix is multiplied successively, by with the product accumulation of the element of operator matrix each described after and take definitely Value, obtains the 5th and the 6th absolute value successively, by the sum of the 5th and the 6th absolute value, as described automatic after taking absolute value Focusing statistical information.
Alternatively, before the strong edge that described first image block is included is judged, place is modified to the second image block Reason, also includes:
In units of second image block, the treatment of noise is removed to described first image block, obtains removal and make an uproar Element value after sound, with the element value after the removal noise as element, constitutes the 3rd image block, and the 3rd image block is made It is revised second image block.
Alternatively, it is described removal noise treatment, including it is following any one:
The treatment of noise is removed under single channel noise reduction process pattern;
The treatment of noise is removed under the noise reduction process pattern of hybrid channel.
Alternatively, the treatment that noise is removed under single channel noise reduction process pattern, including it is following any one:
To in the subimage block, the pixel with the center pixel same channels of described first image block is averaged, As the element value after the removal noise;
To in the subimage block, with the pixel of the center pixel same channels of described first image block successively with it is default After multiplication, then it is normalized, as the element value after the removal noise;
To in the subimage block, the pixel with the center pixel same channels of described first image block takes intermediate value, make It is the element value after the removal noise.
Alternatively, the treatment that noise is removed under the noise reduction process pattern of hybrid channel, including:
The adjacent pixel in left side of the center pixel according to each subimage block, upside adjacent pixel, a left side The adjacent pixel in upside, calculates the brightness of each subimage block, used as the element value after the removal noise.
Alternatively, the adjacent pixel in the left side of the center pixel of each subimage block, upside are adjacent one Pixel, the adjacent pixel in upper left side are to remove the pixel after noise.
Alternatively, methods described also includes:
After the auto-focusing statistical information is obtained, enhancing treatment is carried out to the auto-focusing statistical information, obtained The auto-focusing statistical information after treatment must be strengthened, as the auto-focusing statistical information of described first image block.
Alternatively, it is described that enhancing treatment is carried out to the auto-focusing statistical information, obtain automatic right after enhancing treatment Burnt statistical information, including:
The square value auto-focusing statistical information carried out obtained by square operation is a kind of, is processed as the enhancing Auto-focusing statistical information afterwards.
Alternatively, it is described that enhancing treatment is carried out to the auto-focusing statistical information, obtain automatic right after enhancing treatment Burnt statistical information, including:
According to the line direction of described first image block, the often row to the auto-focusing statistical information in statistical window takes Maximum;
The maximum of resulting all rows is carried out into accumulating operation, the first maximum sum is obtained, by described first Maximum sum is used as the auto-focusing statistical information after enhancing treatment.
Alternatively, it is described that enhancing treatment is carried out to the auto-focusing statistical information, obtain automatic right after enhancing treatment Burnt statistical information, including:
Sequence from big to small is carried out to the auto-focusing statistical information that every row is calculated, preceding preset number is taken as every Capable auto-focusing statistical information;
The often capable auto-focusing statistical information is carried out into accumulating operation, the second maximum sum is obtained, by described the Two maximum sums are used as the auto-focusing statistical information after enhancing treatment.
Alternatively, it is described that enhancing treatment is carried out to the auto-focusing statistical information, obtain automatic right after enhancing treatment Burnt statistical information, including:
When the auto-focusing statistical information is more than default focusing statistics maximum, by the default focusing statistics Maximum is used as the auto-focusing statistical information after enhancing treatment;
When the auto-focusing statistical information is less than default focusing statistics minimum value, processed zero as the enhancing Auto-focusing statistical information afterwards.
A kind of computing device of auto-focusing statistical information is the embodiment of the invention provides, described device includes:
Acquiring unit, be suitable to obtain using pending pixel as center pixel image block, it is described as the first image block First image block is image block chosen from image shot, auto-focusing statistical information to be extracted, and size is M × N, M and N It is odd number;
Choose unit, be suitable to the color according to the center pixel, with the center pixel with passage and described the Centered on the pixel of the subimage block that default size is may make up in the range of one image block, the subimage block of predetermined number is chosen, Using each described subimage block an as element, the second image block is constituted, wherein:The coordinate of the center pixel for (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, is suitable to, according to the value differences information between the second image block neutron image block, sentence The strong edge that disconnected described first image block is included;
First computing unit, is suitable to the strong edge included according to described first image block, using corresponding operator matrix, It is calculated the auto-focusing statistical information of the center pixel.
Alternatively, first judging unit, including:
First computation subunit, is suitable to calculate each described subimage block subgraph corresponding with the center pixel respectively The value differences of block, as sub-block value differences;
First judgment sub-unit, is suitable to, according to the sub-block value differences, judge what described first image block was included Strong edge.
Alternatively, the number of the subimage block of the selection is 9.
Alternatively, the selection unit, be suitable to when the center pixel for green, and the subimage block default size It is described that default size is may make up with passage and in the range of described first image block with the center pixel during for Sm × Sn The coordinate of the pixel of subimage block is respectively:(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 each two in horizontal and vertical The value differences in direction, and distx1, disty1 are even number, and meet following relation:Px+distx1+(Sm-1)/2<= M and Py+disty1+ (Sn-1)/2<=N.
Alternatively, the selection unit, is further adapted for when the center pixel is not green, the subimage block it is default big It is small for Cm × Cn when, it is described that default size is may make up with passage and in the range of described first image block with the center pixel The coordinate of pixel of subimage block be respectively:(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 are respectively subimage block described in each two in horizontal and vertical The distance in direction, and distx2 and disty2 are even number, and meet following relation:Px+distx2+(Cm-1)/2<=M and Py +disty2+(Cn-1)/2<=N.
Alternatively, the strong edge includes following at least one:The strong edge of horizontal direction, the strong edge of vertical direction ,- 45 ° of strong edges and+45 ° of strong edges in direction in direction.
Alternatively, first judgment sub-unit, including:
First matrix generation module, is suitable to 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 judge module, is suitable to the element and the second row the 3rd of the second row first row when the value differences matrix When the element sum of row is less than predetermined threshold value, strong edge of the described first image block comprising horizontal direction is determined, when the pixel When the element of the first row secondary series for being worth difference matrix is less than the predetermined threshold value with the element sum of the third line secondary series, it is determined that Described first image block comprising vertical direction strong edge, when the value differences matrix the first row first row element with When the tertial element sum of the third line is less than the predetermined threshold value, determine that described first image block includes -45 ° of strong sides in direction Edge, when the tertial element of the first row of the value differences matrix with the element sum of the third line first row less than described pre- If during threshold value, determining that described first image block includes+45 ° of strong edges in direction.
Alternatively, first computing unit, is suitable to when strong edge of the described first image block comprising horizontal direction, will Element value in second image block is multiplied successively with the element of default first operator matrix, and the product accumulation that will be obtained, The cumulative sum that will be obtained again, as the auto-focusing statistical information after taking absolute value, when described first image block is comprising vertical Nogata to strong edge when, the element value in second image block is multiplied successively with the element of default second operator matrix, And the product accumulation that will be obtained, then the cumulative sum that will be obtained, as the auto-focusing statistical information after taking absolute value;Work as institute When stating strong edge of first image block comprising -45 ° of directions, by the element value in second image block and default 3rd Operator Moment As described automatic after the element of battle array is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolute value Focusing statistical information;When strong edge of the described first image block comprising+45 ° of directions, by the element in second image block Value is multiplied successively with the element of default 4th operator matrix, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolutely To after value as the auto-focusing statistical information.
Alternatively, first computing unit, is further adapted for when described first image block is not strong including the horizontal direction During any one in edge, the strong edge of vertical direction, the strong edge and+45 ° of strong edges in direction in -45 ° of directions, by described Element value in two image blocks is multiplied successively with the element of default five, the six, the 7th and the 8th operator matrix, will be with each institute After the product accumulation of the element for stating operator matrix and take absolute value, first, second, third and the 4th absolute value are obtained successively, will Described first, second, third and the 4th absolute value sum, as the auto-focusing statistical information.
Alternatively, first computing unit, is further adapted for when described first image block is not strong including the horizontal direction During any one in edge, the strong edge of vertical direction, the strong edge and+45 ° of strong edges in direction in -45 ° of directions, by described Element value in two image blocks is multiplied successively with the element for presetting the 9th and the tenth operator matrix respectively, will be with operator each described After the product accumulation of the element of matrix and take absolute value, the 5th and the 6th absolute value is obtained successively, it is exhausted by the described 5th and the 6th To the sum being worth, as the auto-focusing statistical information.
Alternatively, described device also includes:Amending unit, is suitable to judging the strong edge that described first image block is included Before, in units of second image block, the treatment of noise is removed to described first image block, after obtaining removal noise Element value, with the element value after the removal noise as element, the 3rd image block is constituted, using the 3rd image block as repairing The second image block after just.
Alternatively, the amending unit, including it is following any one:
First revise subelemen, is suitable to be removed under single channel noise reduction process pattern the treatment of noise;
Second revise subelemen, is suitable to be removed under the noise reduction process pattern of hybrid channel the treatment of noise.
Alternatively, first revise subelemen, including:
First correcting module, is suitable to in the subimage block, identical with the center pixel of described first image block logical The pixel in road is averaged, used as the element value after the removal noise;
Second correcting module, is suitable to in the subimage block, identical with the center pixel of described first image block logical After the pixel in road is multiplied with predetermined coefficient successively, then it is normalized, as the element value after the removal noise;
3rd correcting module, is suitable to in the subimage block, identical with the center pixel of described first image block logical The pixel in road takes intermediate value, used as the element value after the removal noise.
Alternatively, second revise subelemen, is suitable to the left side phase according to the center pixel of each subimage block Adjacent 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.
Alternatively, the adjacent pixel in the left side of the center pixel of each subimage block, upside are adjacent one Pixel, the adjacent pixel in upper left side are to remove the pixel after noise.
Alternatively, described device also includes:
Enhancing processing unit, is suitable to after the auto-focusing statistical information is obtained, and the auto-focusing is counted and is believed Breath carries out enhancing treatment, the auto-focusing statistical information after enhancing treatment is obtained, as the auto-focusing of described first image block Statistical information.
Alternatively, the enhancing processing unit, including:First enhancing treatment subelement, is suitable to unite the auto-focusing The square value that meter information is carried out obtained by square operation is a kind of, the auto-focusing statistical information after being processed as the enhancing.
Alternatively, the enhancing processing unit, including:Second enhancing treatment subelement, is suitable to according to described first image The line direction of block, the often row to the auto-focusing statistical information in statistical window takes maximum, by resulting all rows The maximum carries out accumulating operation, obtains the first maximum sum, using the first maximum sum as at the enhancing Auto-focusing statistical information after reason.
Alternatively, the enhancing processing unit, including:3rd enhancing treatment subelement, be suitable to calculate every row from Dynamic focusing statistical information carries out sequence from big to small, preset number is taken as often capable auto-focusing statistical information, by institute The auto-focusing statistical information for stating every row carries out accumulating operation, obtains the second maximum sum, by the second maximum sum Auto-focusing statistical information after being processed as the enhancing.
Alternatively, the enhancing processing unit, including:4th enhancing treatment subelement, is suitable to be united when the auto-focusing When meter information is more than default focusing statistics maximum, after the default focusing statistics maximum is processed as the enhancing Auto-focusing statistical information, when the auto-focusing statistical information less than it is default focusing statistics minimum value when, using zero as Auto-focusing statistical information after the enhancing treatment.
Compared with prior art, technical scheme has advantages below:
By choosing the subimage block of predetermined number, using each described subimage block an as element, the second figure is constituted As block, then according to the value differences information between the second image block neutron image block, described first image block is judged Comprising strong edge, finally according to the strong edge that described first image block is included, using corresponding operator matrix, calculate To the auto-focusing statistical information of the center pixel, marginal information can be more targetedly extracted at strong edge position, Such that it is able to improve the degree of accuracy of auto-focusing statistical information, thus can improve picture pick-up device focusing speed and focusing it is accurate Degree.
Further, before the strong edge that described first image block is included is judged, it is by with second image block Unit, the treatment of noise is removed to described first image block, obtains removing the element value after noise, with the removal noise Element value afterwards is element, constitutes the 3rd image block, using the 3rd image block as revised second image block, can be kept away Exempt from picture noise to impact follow-up statistical information calculating process, such that it is able to further improve auto-focusing statistics letter The degree of accuracy of breath.
Further, after the auto-focusing statistical information is obtained, carried out by the auto-focusing statistical information Enhancing is processed, and obtains the auto-focusing statistical information after enhancing treatment, and letter is counted as the auto-focusing of described first image block Breath, can lift the steep and significance degree of focusing peak of curve, such that it is able to further improve auto-focusing statistics The degree of accuracy of information.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the method that a kind of auto-focusing information in the embodiment of the present invention is calculated;
Fig. 2 is the schematic flow sheet of the method that another auto-focusing information in the embodiment of the present invention is calculated;
Fig. 3 is a kind of schematic diagram of the image block of the input in the embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of the subimage block in the embodiment of the present invention;
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 a kind of schematic diagram of the image block by after denoising in the embodiment of the present invention;
Fig. 8 is another schematic diagram by the image block after denoising in the embodiment of the present invention;
Fig. 9 be another in the embodiment of the present invention by the image block after denoising schematic diagram;
Figure 10 is a kind of structural representation of the computing device of the auto-focusing statistical information in the embodiment of the present invention;
Figure 11 is the structural representation of the computing device of another auto-focusing statistical information in the embodiment of the present invention.
Specific embodiment
Auto-focusing (Auto Focus) make use of the principle that subject light reflects, and the light of subject reflection is by camera Imageing sensor (such as CCD/CMOS sensors) Deng picture pick-up device is received, and by computer disposal, is calculated object The auto-focusing statistical information of body, is focused according to the auto-focusing statistical information driving electric focusing mechanism.Therefore, certainly The accuracy of dynamic focusing statistical information directly affects focusing speed and the degree of accuracy of focusing of picture pick-up device.
At present, it is multiplied with Scharr operators by by subject, is calculated the auto-focusing statistics letter of subject Breath.
But, the auto-focusing statistical information of the subject obtained using the above method is inaccurate, so as to cause shooting The focusing speed of equipment and the degree of accuracy of focusing be not high.
To solve problems described above, the computational methods of auto-focusing statistical information are the embodiment of the invention provides, passed through The subimage block of predetermined number is chosen, using each described subimage block an as element, the second image block is constituted, then according to Value differences information between the second image block neutron image block, judges the strong side that described first image block is included Edge, finally according to the strong edge that described first image block is included, using corresponding operator matrix, is calculated the middle imago The auto-focusing statistical information of element, can more targetedly extract marginal information, such that it is able to improve at strong edge position The degree of accuracy of auto-focusing statistical information, therefore focusing speed and the degree of accuracy of focusing of picture pick-up device can be improved.
It is understandable to enable the above objects, features and advantages of the present invention to become apparent, below in conjunction with the accompanying drawings to the present invention Specific embodiment be described in detail.
The schematic flow sheet of the method that a kind of auto-focusing information in the embodiment of the present invention is calculated is the following provided, is such as schemed Shown in 1, methods described is described in detail below with reference to Fig. 1:
S11:Obtain using pending pixel as center pixel image block, as the first image block, described first image Block is image block chosen from image shot, auto-focusing statistical information to be extracted.
In specific implementation, before counting statistics information, the image of subject can be obtained, and acquisition will be pending Pixel as center pixel image block, below according to center pixel described in the pixel extraction in described image block, that is, institute The auto-focusing statistical information of pending pixel is stated, for convenience of describing, described image block can be called the first image block, and set Its size is odd number for M × N, M and N.
In specific implementation, because the acquisition image includes multiple images block, can according to actual needs, from described The image block of auto-focusing statistical information to be extracted is chosen in image.Such as, if being intended to shoot portrait, you can to select bag 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 passage and in described first image block In the range of may make up default size subimage block pixel centered on, choose predetermined number subimage block, by described in each Subimage block constitutes the second image block as an element.
In specific implementation, due to center pixel letter can be counted to the auto-focusing of whole image block with the pixel of color Breath is impacted, thus can according to the color of the center pixel of described first image block, with the center pixel with passage and Centered on the pixel of the subimage block that default size is may make up in the range of described first image block, the son of predetermined number is chosen Image block, using each described subimage block an as element, constitutes the second image block, and the coordinate of the center pixel can be (Px, Py), the size of the described first image block handed over more than is corresponding, Px=(M-1)/2, Py=(N-1)/2, each institute The center pixel value for stating subimage block can be as the element value of second image block.
S13:According to the value differences information between the second image block neutron image block, described first image is judged The strong edge that block is included.
In specific implementation, due to the relation between each subimage block in the second image block, image block can be reacted Marginal information, therefore described can be judged 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 described subimage block subimage block corresponding with the center pixel, for convenience of describing, can be referred to as It is sub-block value differences, then can judges what described first image block was included according to the 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, the subimage block is individual Number can be other values, and those skilled in the art can correspondingly be set according to actual image algorithm.
Because human eye is different to the perception of different colours, and different colours can response diagram as self-information effect not Together, therefore for the image block on Bayer domain, the pixel of green component is different from the number of pixels of red and blue component.
Therefore when the center pixel for green, and the subimage block default size be Sm × Sn when, in the present invention It is described that default size is may make up with passage and in the range of described first image block with the center pixel in one embodiment The coordinate of the pixel of subimage block is respectively:
(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 each two in margin of image element both horizontally and vertically It is different, and distx1, disty1 are even number, and distx1, disty1 meet following relation: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 In applying example, the subgraph that may make up default size with passage and in the range of described first image block with the center pixel As the coordinate of the pixel of block is respectively:
(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 are even number, and respectively subimage block described in each two 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 can include various. Such as, the strong edge can include the strong edge of horizontal direction, it is also possible to the strong edge including vertical direction, can also wrap Include -45 ° of strong edges in direction, it is also possible to including+45 ° of strong edges in direction, above-described concentration side can also be included certainly To strong edge any combination.
In specific implementation, can be by with the sub-block value differences as element, being first according to the subimage block Position in described first image block, correspondingly generates 3 × 3 value differences matrix, then calculates the margin of image element The element and the tertial element sum of the second row, the first row of the value differences matrix of the second row first row of different matrix The element of secondary series and the element sum of the third line secondary series, the element of the first row first row of the value differences matrix with The tertial element of the first row of the tertial element sum of the third line and the value differences matrix and the third line first row Element sum.
Finally when the value differences matrix the second row first row element and the tertial element sum of the second row During less than predetermined threshold value, strong edge of the described first image block comprising horizontal direction is determined.
If the element of the first row secondary series of the value differences matrix is small with the element sum of the third line secondary series In the predetermined threshold value, strong edge of the described first image block comprising vertical direction is determined.
If the element of the first row first row of the value differences matrix is small with the tertial element sum of the third line In the predetermined threshold value, determine that described first image block includes -45 ° of strong edges in direction.
If the tertial element of the first row of the value differences matrix is small with the element sum of the third line first row In the predetermined threshold value, determine that described first image block includes+45 ° of strong edges in direction.
In specific implementation, in order to avoid the judged result of the strong edge that picture noise is included to described first image block Impact, treatment can be modified to the second image block before the strong edge that described first image block is included is judged.
Specifically, i.e., the treatment of noise is removed to described first image block in units of second image block, Obtain removing the element value after noise, with the element value after the removal noise as element, the 3rd image block is constituted, by described the Three image blocks are used as revised second image block.
In specific implementation, there can be various ways that the treatment of noise is removed to described first image block.Such as institute The treatment for stating removal noise can be the treatment that noise is removed under single channel noise reduction process pattern, or in mixing The treatment of noise is removed under passage noise reduction process pattern, can also be the combination of noise processed under various modes.
In specific implementation, when the treatment that removal noise is determined is correspondence single channel noise reduction process pattern, can be with There are various ways to perform the denoising.
Such as can be in the subimage block, the pixel with the center pixel same channels of described first image block takes Average value, as the element value after the removal noise, can also be in the subimage block, with described first image block After the pixel of center pixel same channels is multiplied with predetermined coefficient successively, then it is normalized, after the removal noise Element value, it is also possible to in the subimage block, in being taken with the pixel of the center pixel same channels of described first image block Value, as the element value after the removal noise.
In an embodiment of the present invention, it is place that noise is removed under the noise reduction process pattern of hybrid channel when determining Reason, can be according to the adjacent pixel in the left side of 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, used as the element value after the removal noise.
In an alternative embodiment of the invention, in order to avoid the brightness of each subimage block for calculating is made an uproar by image The interference of sound, the adjacent pixel in left side of the center pixel of each subimage block, upside adjacent pixel, a left side The adjacent pixel in upside is to remove the pixel after noise.I.e.:Can first to a left side for the center pixel of subimage block each described 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, the brightness of each subimage block is calculated further according to the pixel value after the noise reduction process, used as institute State the element value after removal noise.
S14:According to the strong edge that described first image block is included, using corresponding operator matrix, it is calculated described The auto-focusing statistical information of the first image block.
In specific implementation, when the strong edge included due to image block is different, the acquisition methods of auto-focusing statistical information Also can be different, therefore the strong edge that can be included according to described first image block, using corresponding operator matrix, it is calculated institute State the auto-focusing statistical information of the first image block.
In an embodiment of the present invention, when described first image block includes the strong edge of horizontal direction, by described second Element value in image block is multiplied successively with the element of default first operator matrix, and the product accumulation that will be obtained, by what is obtained Cumulative sum, after taking absolute value, as the auto-focusing statistical information.
In an alternative embodiment of the invention, when strong edge of the described first image block comprising vertical direction, by described the Element value in two image blocks is multiplied successively with the element of default second operator matrix, and adds up, and the cumulative sum that will be obtained takes As the auto-focusing statistical information after absolute value.
In still another embodiment of the process, when strong edge of the described first image block comprising -45 ° of directions, by described the Element value in two image blocks is multiplied successively with the element of default 3rd operator matrix, and adds up, and the cumulative sum that will be obtained takes As the auto-focusing statistical information after absolute value.
In still another embodiment of the process, when strong edge of the described first image block comprising+45 ° of directions, by described the Element value in two image blocks is multiplied successively with the element of default 4th operator matrix, and adds up, and the cumulative sum that will be obtained takes As the auto-focusing statistical information after absolute value.
It should be noted that in specific implementation, first to fourth operator matrix, can according to actual needs, Voluntarily set by those skilled in the art.
In specific implementation, described first image block does not include strong edge, the strong side of vertical direction of the horizontal direction During any one in edge, the strong edge and+45 ° of strong edges in direction in -45 ° of directions, that is to say and represent described first image block Frequency change is relatively gentle, can have various methods to calculate the auto-focusing statistical information of described image block.
Such as can be by the element value in second image block and default five, the six, the 7th and the 8th operator matrix Element be multiplied successively, by with the product accumulation of the element of operator matrix each described after and take absolute value, obtain first successively, Second, third and the 4th absolute value, by described first, second, third and the 4th absolute value sum, united as the auto-focusing Meter 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, by with the product accumulation of the element of operator matrix each described after and take absolute value, the 5th and the 6th is obtained successively exhausted 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 operators.
In an embodiment of the present invention, it is follow-up to facilitate in order to further improve the accuracy that programming count information is calculated The speed and correctness of picture pick-up device focusing, can be after the auto-focusing statistical information be obtained, to the auto-focusing Statistical information carries out enhancing treatment, obtains the auto-focusing statistical information after enhancing treatment, as described first image block from Dynamic focusing statistical information.
In specific implementation, there can be various ways to carry out enhancing treatment to the auto-focusing statistical information.
Such as, it is possible to use square patterns carry out enhancing treatment to the auto-focusing statistical information, i.e.,:Will to it is described from Dynamic focusing statistical information carries out the square value obtained by square operation, and the auto-focusing after being processed as the enhancing counts letter Breath.
Also such as, it is possible to use row maximum pattern carries out enhancing treatment to the auto-focusing statistical information, i.e.,:According to The line direction of described first image block, the often row to the auto-focusing statistical information in statistical window takes maximum, by institute The maximum for obtaining all rows carries out accumulating operation, obtains the first maximum sum, and the first maximum sum is made It is the auto-focusing statistical information after enhancing treatment.
Also such as, it is possible to use often row preset number maximum pattern strengthens the auto-focusing statistical information Treatment, i.e.,:Sequence from big to small is carried out to the auto-focusing statistical information that every row is calculated, preset number conduct is taken and is often gone Auto-focusing statistical information, the often capable auto-focusing statistical information is carried out into accumulating operation, obtain the second maximum it With the auto-focusing statistical information after the second maximum sum is processed as the enhancing.
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 can be configured according to actual needs.
For another example, it is possible to use CLIP patterns carry out enhancing treatment to the auto-focusing statistical information, i.e.,:When it is described from When dynamic focusing statistical information is more than default focusing statistics maximum, using the default focusing statistics maximum as the increasing Auto-focusing statistical information after the reason of strength, when the auto-focusing statistical information is less than default focusing statistics minimum value, Using zero as the auto-focusing statistical information after enhancing treatment.
It is understood that those skilled in the art are according to actual needs, can by it is above-described for it is described from The pattern that dynamic focusing statistical information carries out enhancing treatment is combined and uses.Except the row maximum pattern is pre- with the often row If number maximum pattern can not be combined with each other or can not be used outward while being combined, other patterns can be combined with each other, Can be used to do auto-focusing statistical information enhancing treatment simultaneously.Such as can be maximum with the row by the square patterns Value pattern is used in combination, i.e., after carrying out enhancing treatment to the auto-focusing statistical information using the square patterns, then make Enhancing treatment is carried out to the auto-focusing statistical information with the row maximum pattern, the result that will be obtained, just as last Auto-focusing statistical information.Also such as, the square patterns, the row maximum pattern and CLIP patterns can jointly be tied Conjunction is used.And the above is to the order of the description of the pattern, simply to illustrate that, any limitation is not constituted to the present invention. No matter using which kind of pattern combination and when various modes are used in combination, using which kind of sequentially come to auto-focusing statistics Information carries out enhancing treatment, does not constitute any limitation to the present invention, and within protection scope of the present invention.
Understand in sum, by choosing the subimage block of predetermined number, using each described subimage block an as unit Element, constitutes the second image block, then according to the value differences information between the second image block neutron image block, judges institute The strong edge that the first image block is included is stated, finally according to the strong edge that described first image block is included, using corresponding calculation Submatrix, is calculated the auto-focusing statistical information of the center pixel, can be at strong edge position more targetedly Marginal information is extracted, such that it is able to improve the degree of accuracy of auto-focusing statistical information, therefore the focusing speed of picture pick-up device can be improved Degree and the degree of accuracy of focusing.
To cause that those skilled in the art more fully understand and realize the present invention, another auto-focusing also provided below The computational methods of statistical information, specifically may be referred to Fig. 2, and methods described specifically may include steps of:
S21:Image block to being input into is pre-processed.
Specifically, the described pair of pretreatment of the image block of input, is to carry out denoising to the image block of the input Remove, impacted with eliminating calculating of the picture noise to the corresponding auto-focusing statistical information of successive image block.
It should be noted that in this text after all pixels with coordinate, represent image of the pixel where it Position in block, such as G00, represent the green pixel of the position that the zero row the 0th in its corresponding image block is arranged.By The pixel that Yu Wenzhong is related to 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 State.
In an embodiment of the present invention, 9 × 9 sizes on bayer that the image block of the input can be shown in Fig. 3 Image block, it can be seen that the center pixel corresponding to the central point (4,4) of the image block of 9 × 9 size is green logical Road, that is to say color be green pixel, thus can select first with the center pixel with passage coordinate as (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, and 5 green component datas are included in each subimage block.
It should be noted that in figure 3 in addition to the pixel of above-mentioned coordinate, also there are other with the center pixel with logical The pixel in road, but because described those pixels cannot select enough in the pixel coverage included by the image block of 9 × 9 sizes Pixel constitute the subimage block, therefore described those other pixels and not selected.
For ease of understanding, Fig. 4 shows the 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 can be as the pre-processed results of the subimage block for the pixel value of (4,4) Value.
In an alternative embodiment of the invention, the image block of 9 × 9 sizes that the image block of the input can be as shown in Figure 5, It can be seen that, the center pixel corresponding to the central point (4,4) of the image block of 9 × 9 size is red channel, be that is to say Color is red pixel, thus can select 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, and 5 red component numbers are included in each subimage block According to.
It should be noted that in Figure 5 in addition to the pixel of above-mentioned coordinate, also there are other with the center pixel with logical The pixel in road, but because described those pixels cannot select enough in the pixel coverage included by the image block of 9 × 9 sizes Pixel constitute the subimage block, therefore described those other pixels and not selected.
For ease of understanding, Fig. 6 shows the 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 can be as the pre-processed results of the subimage block for the pixel value of (4,4) Value.
In general, can then be carried out to subimage block each described successively in units of subimage block each described Remove the treatment of noise.
If selection noise reduction process pattern, can select three kinds of modes to carry out noise reduction to described each subimage block, described Three kinds of modes can be:It is averaging mode, asks for weighted average mode and medium filtering mode.
For ease of understanding, can be illustrated by taking the noise reduction calculating process of the subimage block in Fig. 4 as an example.
If to the subimage block in Fig. 4 be averaging the noise reduction process of mode, the average value of subimage block can be asked for, Shown in calculating process such as formula (1):
Value=(G00+G02+G11+G20+G22)/5 (1)
If to the subimage block in Fig. 4 ask for the noise reduction process of weighted average mode, can be by the subgraph In block, after being multiplied with predetermined coefficient successively with the pixel of the center pixel same channels of described first image block, then normalizing is carried out Change, can specifically perform and be calculated as below, 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)
Explanation is needed, the coefficient w0-w3 can correspondingly be set according to actual needs.
If carrying out the noise reduction process of medium filtering mode to the subimage block in Fig. 4, can perform and be calculated as below, calculate 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 any one above-mentioned noise-reduction method Noise reduction process, can obtain the image block shown in Fig. 7, wherein Gr_f1, and 1=value, value can be any by the above Noise reduction process mode is planted to obtain.Similarly, other all of Gr_f are to utilize the above any one noise reduction process mode, And substitute into the pixel of its corresponding subimage block and calculate.
For ease of understanding, it is also possible to illustrated by taking the noise reduction calculating process of the subimage block in Fig. 6 as an example.
If to the subimage block in Fig. 6 be averaging the noise reduction process of mode, the average value of subimage block can be asked for, Shown in calculating process such as formula (4):
Value=(R02+R20+R22+R24+R42)/5 (4)
If to the subimage block in image 6 ask for the noise reduction process of weighted average mode, can perform and be calculated as below, 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)
Explanation is needed, the coefficient w0-z 4 can correspondingly be set according to actual needs.
If carrying out the noise reduction process of medium filtering mode to the subimage block in image 6, can perform and be calculated as below, calculate Shown in process such as formula (6):
Value=median (R02, R20, R22, R24, R42) (6)
Correspondingly, according to this method, above-mentioned appointing can be performed to all the above subimage block included by Fig. 5 A kind of noise reduction process of mode, can obtain the image block shown in Fig. 8, wherein R_f1,1=value, value can by with Upper described any one noise reduction process mode is obtained, and similarly, all of R_f is using the above any one noise reduction process side Formula, and substitute into the pixel of its corresponding subimage block and calculate.
If selection brightness noise reduction process pattern, on the basis of being calculated more than, takes out each 3 × 3 subgraph respectively One pixel in center left side of block, the pixel of upside one, the pixel of upper left one, the drop being had calculated that in calculating before Make an uproar and processing costs or take initial value, therefore in 3 × 3 centers and its neighborhood tetra- values of total Gr, R, B and Gb, by four values according to such as Under type is calculated, and 3 × 3 each position brightness value Y is drawn, shown in calculating process such as formula (7):
Y=0.299*R+ (Gr+Gb)/2*0.587+B*0.114 (7)
Exported 9 Y values as Part I, as a result can be with as shown in figure 9, the wherein 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:The image block shown in R22, Gr21, Gb12 and B11 corresponding diagram 6.
S22:Extract auto-focusing statistical information.
In specific implementation, after the denoising described in S11 is completed, can be according to included by the image block of the input Marginal information it is different, the image block of the input is extracted using different computational methods.
Specifically, the marginal information included by image block can be first determined whether, in an embodiment of the present invention, can be adopted With the value differences information between the subimage block, such as can respectively calculate 3 × 3 subgraphs centered on being put with (4,4) 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 for two blocks one by one the absolute value of corresponding points difference and.
Subimage block corresponding to the pixel of the subimage block block and (2,2) that illustrate corresponding to the pixel of (4,4) 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 with the value differences as element, value differences matrix is obtained, such as formula 1) shown in:
Formula 1)
If d10+d12<D_th1 then thinks the strong edge being horizontally oriented in 9 × 9block;
If d01+d21<D_th1 then thinks the strong edge being vertically oriented in 9 × 9block;
If d00+d22<D_th1 is -45 strong edges for spending directions in then thinking 9 × 9block;
If d02+d20<D_th1 is+45 strong edges for spending directions in then thinking 9 × 9block.
Then, according to the edge preextraction result for obtaining, the image block to that can judge limbus direction is described obvious Edge direction refers to four kinds of strong edges mentioned above:Directions are spent in the strong edge of horizontal direction, the strong edge of vertical direction, -45 Strong edge and the strong edge in+45 degree directions, carry out focusing statistical information and extract using following manner:
In an embodiment of the present invention, if the strong edge of horizontal direction, then with formula 2) shown in the first operator matrix with 3 × 3 subimage blocks carry out pointwise multiplication and accumulation calculating obtains marginal information after noise reduction, as the input after taking absolute value The auto-focusing statistical information of image block:
Formula 2)
For ease of understanding, can be by taking the computing formula of the marginal information of 3 × 3 subimage blocks after the noise reduction shown in Fig. 7 as an example Illustrate, the calculating process can show such as formula (10):
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 computing formula (10) can be obtained, abs (Edge1) is obtained after taking absolute value, you can made It is the auto-focusing statistical information of the image block of the input
It is understood that other subimage blocks may be referred to the above implementation with the computational methods of operator matrix, Will not be repeated here.
If the strong edge of vertical direction, then with formula 3) shown in the second operator matrix and noise reduction after 3 × 3 subimage blocks enter Row pointwise is multiplied and accumulation calculating obtains marginal information, and the auto-focusing of the image block after taking absolute value as the input is counted Information:
Formula 3)
If the strong edge in -45 degree directions, then with formula 4) shown in the 3rd operator matrix and noise reduction after 3 × 3 subimage blocks The auto-focusing for carrying out the image block that pointwise is multiplied and accumulation calculating obtains marginal information, after taking absolute value as the input is united Meter information:
Formula 4)
If the strong edge in+45 degree directions, then with formula 5) shown in the 4th operator matrix and noise reduction after 3 × 3 subimage blocks The auto-focusing for carrying out the image block that pointwise is multiplied and accumulation calculating obtains marginal information, after taking absolute value as the input is united Meter information:
Formula 5)
In an alternative embodiment of the invention, if four conditions are all unsatisfactory for above, one of selection the following two kinds mode is entered Row focusing information extraction:
First:Self-defined operator:With formula 6) the 5th operator matrix, the formula 7 that show) the 6th operator matrix, the formula 8 that show) The 7th operator matrix and formula 9 for showing) shown in the 8th operator matrix carry out pointwise with 3 × 3 subimage blocks after noise reduction and be multiplied, will The product that pointwise multiplication is obtained is added up, and after then being taken absolute value to cumulative sum successively, is added up again, cumulative by what is obtained Sum, as the auto-focusing statistical information of the image block of the input:
Formula 6)
Formula 7)
Formula 8)
Formula 9)
For ease of understanding, 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:
The subimage block shown in Fig. 7 is multiplied with the 5th operator matrix pointwise first, by multiplying that pointwise multiplication is obtained Product is added up, and marginal information Edge2 is obtained, 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 with the 6th operator matrix pointwise, by multiplying that pointwise multiplication is obtained Product is added up, and marginal information Edge3 is obtained, 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 with the 7th operator matrix pointwise, by multiplying that pointwise multiplication is obtained Product is added up, and marginal information Edge4 is obtained, 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 with the 8th operator matrix pointwise, by multiplying that pointwise multiplication is obtained Product is added up, and marginal information Edge5 is obtained, 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, after being taken absolute value to four above-mentioned marginal informations, add up again, the cumulative sum Edge_ that will be obtained All, as the auto-focusing statistical information of the image block of the input, such as shown in formula (15):
Edge_all=abs (Edge2)+abs (Edge3)+abs (Edge4)+abs (Edge5) (15)
Second:Using formula 10) shown in the 9th operator matrix, i.e. the horizontal direction matrix and formula of Scharr operator matrixes 11) the vertical direction matrix of the tenth operator matrix shown in, i.e. Scharr operator matrixes respectively with noise reduction after 3 × 3 subimage blocks Pointwise multiplication is carried out, the product for obtaining that pointwise is multiplied is added up, and after then being taken absolute value to cumulative sum successively, is tired out again Plus, the cumulative sum that will be obtained, as the auto-focusing statistical information of the image block of the input:
Formula 10)
Formula 11)
It is understood that those skilled in the art are according to the 5th to the 8th above-mentioned operator matrix and the meter of subimage block Calculation method implements the calculating of subimage block and the 9th and the tenth operator matrix, will not be repeated here.
It should be noted that formula 2) to formula 11) shown in operator matrix, be and obtained by many experiments and practice summary The operator matrix for arriving.Certainly, in specific implementation, those skilled in the art can set other suitable according to actual needs Operator matrix.The concrete form of the operator matrix, does not constitute any limitation to the present invention.
S23:Enhancing treatment is carried out to auto-focusing statistical information.
In specific implementation, in order to reach enhanced effect to focusing curve, one kind in following several ways can be selected Or all post-processed:
Method 1:Square patterns:The auto-focusing statistical information FV calculated to S22 carries out square operation;
Square_fv=FV*FV;
Method 2:Row maximum pattern:The auto-focusing statistical information FV calculated to S22, in monitoring window interior, presses FV maximums are taken according to image row direction, often row only retains a focusing statistical value in focusing window;In each monitoring window knot Shu Shi, the FV maximums of each row that adds up;
Assuming that the FV values obtained in a line in monitoring window are:FV1FV2 ... FVn, then at the space max model of passing through After reason:
FV_line_max=max (FV1, FV2 ... FVn);
Method 3:Every preceding 7 maximum patterns of row:The auto-focusing statistical information FV calculated to S22, in monitoring window Inside, is sorted from big to small to the FV values that every row is calculated, and takes preceding 7 values as one's own profession result;In each monitoring window At the end of, the FV values of each row that adds up;
Assuming that the FV values obtained in a line in monitoring window are:FV1, FV2 ... ..., FVn, then the often row of passing through is first 7 After maximum 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 shearing maximum fv_clip_max and minimum value fv_clip_ Min, the auto-focusing statistical information FV calculated to S22 carries out relevant shear operation;
If (FV>fv_clip_max)
FV_clip=fv_clip_max;
If (FV<fv_clip_min)
FV_clip=0.
Summarizing the above can obtain, and by choosing the subimage block of predetermined number, each described subimage block be made It is an element, constitutes the second image block, then according to the value differences letter between the second image block neutron image block Breath, judges the strong edge that described first image block is included, and finally according to the strong edge that described first image block is included, uses Corresponding operator matrix, is calculated the auto-focusing statistical information of the center pixel, edge can be avoided different and caused Auto-focusing statistical information calculation error, such that it is able to improve the degree of accuracy of auto-focusing statistical information, therefore can improve The focusing speed of picture pick-up device and the degree of accuracy of focusing.
To cause that those skilled in the art more fully understand and realizes the present invention, it is also provided below can implement it is above-mentioned oneself The device of the computational methods of dynamic focusing statistical information, as shown in Figure 10, described device can include:Acquiring unit 1, selection unit 2nd, the first judging unit 3 and the first computing unit 4, wherein:
The acquiring unit 1, be suitable to obtain using pending pixel as center pixel image block, as the first image Block, described first image block is image block chosen from image shot, auto-focusing statistical information to be extracted, and size is M × N, M and N are odd number;
It is described selection unit 2, be suitable to the color according to the center pixel, with the center pixel with passage and in institute State centered on the pixel of the subimage block that default size is may make up in the range of the first image block, choose the subgraph of predetermined number Block, using each described subimage block an as element, constitutes the second image block.
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, is suitable to according to the value differences letter between the second image block neutron image block Breath, judges the strong edge that described first image block is included;
First computing unit 4, is suitable to the strong edge included according to described first image block, using corresponding operator Matrix, is calculated the auto-focusing statistical information of described first image block.
In specific implementation, first judging unit 3, including:
First computation subunit 31, is suitable to calculate each described subimage block subgraph corresponding with the center pixel respectively As the value differences of block, as sub-block value differences;
First judgment sub-unit 32, is suitable to, according to the sub-block value differences, judge that described first image block is included 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 to when the center pixel is green, and the subimage block When default size is Sm × Sn, it is described be may make up with passage and in the range of described first image block with the center pixel it is pre- If the coordinate of the pixel of the subimage block of size is respectively:
(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 each two in distance both horizontally and vertically, and Distx1, disty1 are even number, and distx1, disty1 meet following relation: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 is not green, the subimage block Default size be Cm × Cn when, it is described to be may make up with passage and in the range of described first image block with the center pixel The coordinate of the pixel of the subimage block of default size is respectively:
(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 are even number, and respectively subimage block described in each two 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 includes following at least one:The strong edge of horizontal direction, vertical direction it is strong Edge, the strong edge and+45 ° of strong edges in direction in -45 ° of directions.
In specific implementation, first judgment sub-unit 32, including:
First matrix generation module 321, is suitable to, with the sub-block value differences as element, exist according to the subimage block Position in described first image block, correspondingly generates 3 × 3 value differences matrix;
First judge module 322, is suitable to the element and the second row of the second row first row when the value differences matrix When tertial element sum is less than predetermined threshold value, strong edge of the described first image block comprising horizontal direction is determined, when described When the element of the first row secondary series of value differences matrix is less than the predetermined threshold value with the element sum of the third line secondary series, Strong edge of the described first image block comprising vertical direction is determined, when the unit of the first row first row of the value differences matrix When element is less than the predetermined threshold value with the tertial element sum of the third line, determine described first image block comprising -45 ° of directions Strong edge, when the tertial element of the first row of the value differences matrix is less than institute with the element sum of the third line first row When stating predetermined threshold value, determine that described first image block includes+45 ° of strong edges in direction.
In specific implementation, first computing unit 4 is suitable to when strong side of the described first image block comprising horizontal direction During edge, the element value in second image block is multiplied successively with the element of default first operator matrix, and by multiplying for obtaining Accumulation adds, the sum that will be obtained, as the auto-focusing statistical information after taking absolute value, when described first image block is comprising vertical During the strong edge in direction, the element value in second image block is multiplied successively with the element of default second operator matrix, and It is cumulative, the cumulative sum that will be obtained, as the auto-focusing statistical information after taking absolute value, when described first image block bag During strong edge containing -45 ° of directions, by the element of the element value in second image block and default 3rd operator matrix successively phase Multiply, and add up, the cumulative sum that will be obtained, as the auto-focusing statistical information after taking absolute value, works as described first image During strong edge of the block comprising+45 ° of directions, by the element of the element value in second image block and default 4th operator matrix according to Secondary multiplication, and add up, the cumulative sum that will be obtained, as the auto-focusing statistical information after taking absolute value.
In specific implementation, first computing unit 4 is further adapted for not including the level side when described first image block To strong edge, the strong edge of vertical direction, the strong edge and+45 ° of strong edges in direction in -45 ° of directions in any one when, will Element value in second image block is multiplied successively with the element of default five, the six, the 7th and the 8th operator matrix, will be with After the product accumulation of the element of each operator matrix and take absolute value, first, second, third and the 4th absolute is obtained successively 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 not including the level side when described first image block To strong edge, the strong edge of vertical direction, the strong edge and+45 ° of strong edges in direction in -45 ° of directions in any one when, will Element value in second image block is multiplied successively with the element for presetting the 9th and the tenth operator matrix respectively, will be with each institute After the product accumulation of the element for stating operator matrix and take absolute value, the 5th and the 6th absolute value obtained successively, by the described 5th and The sum of the 6th absolute value, as the auto-focusing statistical information.
The calculating side of the statistical information of above-mentioned auto-focusing can be realized in another embodiment of the present invention also provided below The device of method, as shown in figure 11, except above-mentioned acquiring unit 1, chooses 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, wherein:
The amending unit 5, was suitable to before the strong edge that described first image block is included is judged, with second figure As block is unit, the treatment of noise is removed to described first image block, obtains removing the element value after noise, gone with described Except the element value after noise is element, the 3rd image block is constituted, using the 3rd image block as revised second image block.
In specific implementation, the amending unit 5, including:
First revise subelemen 51, is suitable to be removed under single channel noise reduction process pattern the treatment of noise;
Second revise subelemen 52, is suitable to be removed under the noise reduction process pattern of hybrid channel the treatment of noise.
In specific implementation, first revise subelemen 51, including:
First correcting module 511, is suitable to in the subimage block, the center pixel with described first image block is identical The pixel of passage is averaged, used as the element value after the removal noise;
Second correcting module 512, is suitable to in the subimage block, the center pixel with described first image block is identical After the pixel of passage is multiplied with predetermined coefficient successively, then it is normalized, as the element value after the removal noise;
3rd correcting module 513, is suitable to in the subimage block, the center pixel with described first image block is identical The pixel of passage takes intermediate value, used as the element value after the removal noise.
In specific implementation, second revise subelemen 52 is suitable to 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 described 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 to remove the pixel after noise.
In specific implementation, the enhancing processing unit 6 is suitable to after the auto-focusing statistical information is obtained, right The auto-focusing statistical information carries out enhancing treatment, the auto-focusing statistical information after enhancing treatment is obtained, in described The auto-focusing statistical information of imago element.
In specific implementation, the enhancing processing unit 6, including:First enhancing treatment subelement 61, be suitable to by it is described from The square value that dynamic focusing statistical information is carried out obtained by square operation is a kind of, and the auto-focusing after being processed as the enhancing is counted Information.
In specific implementation, the enhancing processing unit 6, including:Second enhancing treatment subelement 62, is suitable to according to described The line direction of the first image block, the often row to the auto-focusing statistical information in statistical window takes maximum, will be resulting The maximum of all rows carries out accumulating operation, obtains the first maximum sum, using the first maximum sum as institute State the auto-focusing statistical information after enhancing treatment.
In specific implementation, the enhancing processing unit 6, including:3rd enhancing treatment subelement 63, is suitable to every row meter The auto-focusing statistical information for calculating carries out sequence from big to small, takes preset number and counts letter as often capable auto-focusing Breath, accumulating operation is carried out by the often capable auto-focusing statistical information, obtains the second maximum sum, maximum by described second Value sum is used as the auto-focusing statistical information after enhancing treatment.
In specific implementation, the enhancing processing unit 6, including:4th enhancing treatment subelement 64, is suitable to described in certainly When dynamic focusing statistical information is more than default focusing statistics maximum, using the default focusing statistics maximum as the increasing Auto-focusing statistical information after the reason of strength, when the auto-focusing statistical information is less than default focusing statistics minimum value, Using zero as the auto-focusing statistical information after enhancing treatment.
In sum, by choosing the subimage block of unit selection predetermined number, using each described subimage block as Individual 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 Value different information, judges the strong edge that described first image block is included, and last first computing unit is according to described first image The strong edge that block is included, using corresponding operator matrix, is calculated the auto-focusing statistical information of the center pixel, can Marginal information is more targetedly extracted with strong edge position, such that it is able to improve the accurate of auto-focusing statistical information Degree, therefore focusing speed and the degree of accuracy of focusing of picture pick-up device can be improved.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can Completed with instructing the hardware of correlation by program, the program can be stored in computer-readable recording medium, to store Medium can include:ROM, RAM, disk or CD etc..
Although present disclosure is as above, the present invention is not limited to this.Any those skilled in the art, are not departing from this 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 The scope of restriction is defined.

Claims (40)

1. a kind of computational methods of auto-focusing statistical information, it is characterised in that including:
Obtain using pending pixel as center pixel image block, used as the first image block, described first image block is from quilt Image block chosen in image, auto-focusing statistical information to be extracted is taken the photograph, size is odd number for M × N, M and N;
According to the color of the center pixel, with the center pixel with passage and can in the range of described first image block Centered on the pixel of the subimage block for constituting default size, the subimage block of predetermined number is chosen, by each subimage block As an element, the second image block is constituted, wherein: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 described first image block is included Strong edge;
According to the strong edge that described first image block is included, using corresponding operator matrix, the center pixel is calculated Auto-focusing statistical information.
2. computational methods of auto-focusing statistical information according to claim 1, it is characterised in that described according to described Value differences information between two image block neutron image blocks, judges the strong edge that described first image block is included, including:
The value differences of each described subimage block subimage block corresponding with the center pixel are calculated respectively, as sub-block Value differences;
According to the sub-block value differences, the strong edge that described first image block is included is judged.
3. computational methods of auto-focusing statistical information according to claim 2, it is characterised in that the subgraph of the selection As the number of block is 9.
4. computational methods of auto-focusing statistical information according to claim 3, it is characterised in that when the center pixel Be green, and the default size of the subimage block is when being Sm × Sn, it is described with the center pixel with passage and described the The coordinate that the pixel of the subimage block of default size is may make up in the range of one image block is respectively:(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 is respectively subimage block described in each two in distance both horizontally and vertically, and distx1, disty1 are even number, And meet following relation:Px+distx1+(Sm-1)/2<=M and Py+disty1+ (Sn-1)/2<=N.
5. computational methods of auto-focusing statistical information according to claim 4, it is characterised 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 passage and described the The coordinate that the pixel of the subimage block of default size is may make up in the range of one image block is respectively:(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 each two meets in distance both horizontally and vertically:Px+ distx2+(Cm-1)/2<=M and Py+disty2+ (Cn-1)/2<=N.
6. computational methods of auto-focusing statistical information according to claim 2, it is characterised in that the strong edge includes Following at least one:The strong edge of horizontal direction, the strong edge of vertical direction, the strong edge in -45 ° of directions and+45 ° of directions it is strong Edge.
7. computational methods of auto-focusing statistical information according to claim 6, it is characterised in that with the sub-block pixel It is element that value difference is different, according to position of the subimage block in described first image block, correspondingly generates 3 × 3 pixel value Difference matrix;
It is described to judge the strong edge that described first image block is included according to the sub-block value differences, including:
When the element and the tertial element sum of the second row of the second row first row of the value differences matrix are less than default During threshold value, strong edge of the described first image block comprising horizontal direction is determined;
When the element of the first row secondary series of the value differences matrix and the element sum of the third line secondary series are less than described During predetermined threshold value, strong edge of the described first image block comprising vertical direction is determined;
When the element and the tertial element sum of the third line of the first row first row of the value differences matrix are less than described During predetermined threshold value, determine that described first image block includes -45 ° of strong edges in direction;
When the tertial element of the first row of the value differences matrix with the element sum of the third line first row less than described During predetermined threshold value, determine that described first image block includes+45 ° of strong edges in direction.
8. computational methods of auto-focusing statistical information according to claim 7, it is characterised in that described according to described The strong edge that one image block is included, using corresponding operator matrix, is calculated the auto-focusing statistics of the center pixel Information, including:
When strong edge of the described first image block comprising horizontal direction, by the element value in second image block and default the The element of one operator matrix is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained, conduct after taking absolute value The auto-focusing statistical information;
When strong edge of the described first image block comprising vertical direction, by the element value in second image block and default the After the element of two operator matrixes is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolute value as The auto-focusing statistical information;
When strong edge of the described first image block comprising -45 ° of directions, by the element value in second image block and default the After the element of three operator matrixes is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolute value as The auto-focusing statistical information;
When strong edge of the described first image block comprising+45 ° of directions, by the element value in second image block and default the After the element of four operator matrixes is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained takes absolute value as The auto-focusing statistical information.
9. computational methods of auto-focusing statistical information according to claim 8, it is characterised in that described according to described The strong edge that one image block is included, using corresponding operator matrix, is calculated the auto-focusing statistics of the center pixel Information, also includes:When described first image block including the strong edge of the horizontal direction, the strong edge of vertical direction, -45 ° During any one in the strong edge in direction and+45 ° of strong edges in direction, by the element value in second image block and default the 5th, the element of the six, the 7th and the 8th operator matrix is multiplied successively, by the product accumulation with the element of operator matrix each described Afterwards and take absolute value, first, second, third and the 4th absolute value are obtained successively, described first, second, third and the 4th is exhausted To the sum being worth, as the auto-focusing statistical information.
10. computational methods of auto-focusing statistical information according to claim 9, it is characterised in that described in the basis The strong edge that first image block is included, using corresponding operator matrix, is calculated the auto-focusing system of the center pixel Meter information, also includes:
When described first image block including the strong edge of the horizontal direction, the strong edge of vertical direction, -45 ° of directions it is strong During any one in edge and+45 ° of strong edges in direction, by the element value in second image block respectively with the default 9th and The element of the tenth operator matrix is multiplied successively, by with the product accumulation of the element of operator matrix each described after and take absolute value, The the 5th and the 6th absolute value is obtained successively, by the sum of the 5th and the 6th absolute value, as the auto-focusing statistical information.
The computational methods of 11. auto-focusing statistical informations according to claim 1, it is characterised in that judging described Before the strong edge that one image block is included, treatment is modified to the second image block, also included:
In units of each the described subimage block in second image block, noise is removed to described first image block Treatment, obtains removing the element value after noise, with the element value after the removal noise as element, constitutes the 3rd image block, will 3rd image block is used as revised second image block.
The computational methods of 12. auto-focusing statistical informations according to claim 11, it is characterised in that the removal noise Treatment, including it is following any one:
The treatment of noise is removed under single channel noise reduction process pattern;
The treatment of noise is removed under the noise reduction process pattern of hybrid channel.
The computational methods of 13. auto-focusing statistical informations according to claim 12, it is characterised in that described in single channel Be removed the treatment of noise under noise reduction process pattern, including it is following any one:
To in the subimage block, the pixel with the center pixel same channels of described first image block is averaged, as Element value after the removal noise;
To in the subimage block, with the pixel of the center pixel same channels of described first image block successively with predetermined coefficient After multiplication, then it is normalized, as the element value after the removal noise;
To in the subimage block, the pixel with the center pixel same channels of described first image block takes intermediate value, used as institute State the element value after removal noise.
The computational methods of 14. auto-focusing statistical informations according to claim 12, it is characterised in that described logical in mixing The treatment of noise is removed under road noise reduction process pattern, including:
The adjacent pixel in left side of the center pixel according to each subimage block, upside adjacent pixel, a upper left side An adjacent pixel, calculates the brightness of each subimage block, used as the element value after the removal noise.
The computational methods of 15. auto-focusing statistical informations according to claim 14, it is characterised in that described described in each The adjacent pixel in left side of the center pixel of subimage block, the adjacent pixel in upside, the adjacent pixel in upper left side are to go Except the pixel after noise.
The computational methods of the 16. auto-focusing statistical information according to claim 1 or 11, it is characterised in that also include:
After the auto-focusing statistical information is obtained, enhancing treatment is carried out to the auto-focusing statistical information, increased Auto-focusing statistical information after the reason of strength, as the auto-focusing statistical information of the center pixel.
The computational methods of 17. auto-focusing statistical informations according to claim 16, it is characterised in that it is described to it is described from Dynamic focusing statistical information carries out enhancing treatment, obtains the auto-focusing statistical information after enhancing treatment, including:
The auto-focusing statistical information is carried out into the square value obtained by square operation, it is automatic after being processed as the enhancing Focusing statistical information.
The computational methods of 18. auto-focusing statistical informations according to claim 16, it is characterised in that it is described to it is described from Dynamic focusing statistical information carries out enhancing treatment, obtains the auto-focusing statistical information after enhancing treatment, including:
According to the line direction of described first image block, the often row to the auto-focusing statistical information in statistical window takes maximum Value;
The maximum of resulting all rows is carried out into accumulating operation, the first maximum sum is obtained, it is maximum by described first Value sum is used as the auto-focusing statistical information after enhancing treatment.
The computational methods of 19. auto-focusing statistical informations according to claim 16, it is characterised in that it is described to it is described from Dynamic focusing statistical information carries out enhancing treatment, obtains the auto-focusing statistical information after enhancing treatment, including:
Sequence from big to small is carried out to the auto-focusing statistical information that every row is calculated, take preset number as often row from Dynamic focusing statistical information;
The often capable auto-focusing statistical information is carried out into accumulating operation, the second maximum sum is obtained, by described second most Big value sum is used as the auto-focusing statistical information after enhancing treatment.
The computational methods of 20. auto-focusing statistical informations according to claim 16, it is characterised in that it is described to it is described from Dynamic focusing statistical information carries out enhancing treatment, obtains the auto-focusing statistical information after enhancing treatment, including:
It is when the auto-focusing statistical information is more than default focusing statistics maximum, the default focusing statistics is maximum It is worth the auto-focusing statistical information after being processed as the enhancing;
When the auto-focusing statistical information is less than default focusing statistics minimum value, after zero is processed as the enhancing Auto-focusing statistical information.
A kind of 21. computing devices of auto-focusing statistical information, it is characterised in that including:
Acquiring unit, be suitable to obtain using pending pixel as center pixel image block, as the first image block, described first Image block is image block chosen from image shot, auto-focusing statistical information to be extracted, and size is for M × N, M and N Odd number;
Choose unit, be suitable to the color according to the center pixel, with the center pixel with passage and in first figure Centered on the pixel of the subimage block that default size is may make up in the range of block, the subimage block of predetermined number is chosen, will be every The individual subimage block constitutes the second image block as an element, wherein: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, is suitable to, according to the value differences information between the second image block neutron image block, judge institute State the strong edge that the first image block is included;
First computing unit, is suitable to the strong edge included according to described first image block, using corresponding operator matrix, calculates Obtain the auto-focusing statistical information of the center pixel.
The computing device of 22. auto-focusing statistical informations according to claim 21, it is characterised in that described first judges Unit, including:
First computation subunit, is suitable to calculate each described subimage block subimage block corresponding with the center pixel respectively Value differences, as sub-block value differences;
First judgment sub-unit, is suitable to according to the sub-block value differences, judges the strong side that described first image block is included Edge.
The computing device of 23. auto-focusing statistical informations according to claim 22, it is characterised in that the son of the selection The number of image block is 9.
The computing device of 24. auto-focusing statistical informations according to claim 23, it is characterised in that the selection list Unit, is suitable to when the center pixel is green, and the default size of the subimage block is when being Sm × Sn, described with the center Pixel may make up the coordinate difference of the pixel of the subimage block of default size with passage and in the range of described first image block For:(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 each two in distance both horizontally and vertically, and distx1, disty1 are equal It is even number, and meets following relation:Px+distx1+(Sm-1)/2<=M and Py+disty1+ (Sn-1)/2<=N.
The computing device of the 25. auto-focusing statistical information according to claim 23 or 24, it is characterised 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 passage and in the range of described first image block Respectively:(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 are respectively subimage block described in each two in distance both horizontally and vertically, and distx2 and Disty2 is even number, and meets following relation:Px+distx2+(Cm-1)/2<=M and Py+disty2+ (Cn-1)/2<=N.
The computing device of 26. auto-focusing statistical informations according to claim 22, it is characterised in that the strong edge bag Include following at least one:The strong edge of horizontal direction, the strong edge of vertical direction, the strong edge in -45 ° of directions and+45 ° of directions Strong edge.
The computing device of 27. auto-focusing statistical informations according to claim 26, it is characterised in that described first judges Subelement, including:
First matrix generation module, is suitable to the sub-block value differences as element, according to the subimage block described Position in one image block, correspondingly generates 3 × 3 value differences matrix;
First judge module, is suitable to when the element of the second row first row of the value differences matrix is tertial with the second row When element sum is less than predetermined threshold value, strong edge of the described first image block comprising horizontal direction is determined, when the margin of image element When the element of the first row secondary series of different matrix is less than the predetermined threshold value with the element sum of the third line secondary series, it is determined that described Strong edge of first image block comprising vertical direction, when the element and the 3rd of the first row first row of the value differences matrix When the tertial element sum of row is less than the predetermined threshold value, determine that described first image block includes -45 ° of strong edges in direction, When the tertial element of the first row of the value differences matrix is default less than described with the element sum of the third line first row During threshold value, determine that described first image block includes+45 ° of strong edges in direction.
The computing device of 28. auto-focusing statistical informations according to claim 27, it is characterised in that described first calculates Unit, is suitable to when strong edge of the described first image block comprising horizontal direction, by the element value in second image block with The element of default first operator matrix is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained, and takes absolute value Afterwards as the auto-focusing statistical information, when described first image block includes the strong edge of vertical direction, by described second Element value in image block is multiplied successively with the element of default second operator matrix, and the product accumulation that will be obtained, then will obtain Cumulative sum, as the auto-focusing statistical information after taking absolute value;When described first image block is comprising -45 ° of directions During strong edge, the element value in second image block is multiplied successively with the element of default 3rd operator matrix, and will obtain Product accumulation, then the cumulative sum that will be obtained, as the auto-focusing statistical information after taking absolute value;When first figure During as strong edge of the block comprising+45 ° of directions, by the element value in second image block and the element of default 4th operator matrix It is multiplied successively, and the product accumulation that will be obtained, then the cumulative sum that will be obtained, counted as the auto-focusing after taking absolute value Information.
The computing device of 29. auto-focusing statistical informations according to claim 28, it is characterised in that described first calculates Unit, is further adapted for not including strong edge, the strong edge of vertical direction, -45 ° of sides of the horizontal direction when described first image block To strong edge and+45 ° of strong edges in direction in any one when, by the element value in second image block and default the 5th, the element of the six, the 7th and the 8th operator matrix is multiplied successively, by the product accumulation with the element of operator matrix each described Afterwards and take absolute value, first, second, third and the 4th absolute value are obtained successively, described first, second, third and the 4th is exhausted To the sum being worth, as the auto-focusing statistical information.
The computing device of 30. auto-focusing statistical informations according to claim 29, it is characterised in that described first calculates Unit, is further adapted for not including strong edge, the strong edge of vertical direction, -45 ° of sides of the horizontal direction when described first image block To strong edge and+45 ° of strong edges in direction in any one when, by the element value in second image block respectively with it is default The element of the 9th and the tenth operator matrix is multiplied successively, by with the product accumulation of the element of operator matrix each described after and take absolutely To value, the 5th and the 6th absolute value is obtained successively, the sum of the 5th and the 6th absolute value is counted as the auto-focusing Information.
The computing device of 31. auto-focusing statistical informations according to claim 21, it is characterised in that also include:Amendment Unit, was suitable to before the strong edge that described first image block is included is judged, in units of second image block, to described First image block is removed the treatment of noise, obtains removing the element value after noise, with the element value after the removal noise It is element, the 3rd image block is constituted, using the 3rd image block as revised second image block.
The computing device of 32. auto-focusing statistical informations according to claim 31, it is characterised in that the amendment list Unit, including it is following any one:
First revise subelemen, is suitable to be removed under single channel noise reduction process pattern the treatment of noise;
Second revise subelemen, is suitable to be removed under the noise reduction process pattern of hybrid channel the treatment of noise.
The computing device of 33. auto-focusing statistical informations according to claim 32, it is characterised in that first amendment Subelement, including:
First correcting module, is suitable to in the subimage block, with the center pixel same channels of described first image block Pixel is averaged, used as the element value after the removal noise;
Second correcting module, is suitable to in the subimage block, with the center pixel same channels of described first image block After pixel is multiplied with predetermined coefficient successively, then it is normalized, as the element value after the removal noise;
3rd correcting module, is suitable to in the subimage block, with the center pixel same channels of described first image block Pixel takes intermediate value, used as the element value after the removal noise.
The computing device of 34. auto-focusing statistical informations according to claim 32, it is characterised in that second amendment Subelement, be suitable to the adjacent pixel in left side according to the center pixel of each subimage block, the adjacent pixel in upside, The adjacent pixel in upper left side, calculates the brightness of each subimage block, used as the element value after the removal noise.
The computing device of 35. auto-focusing statistical informations according to claim 34, it is characterised in that described described in each The adjacent pixel in left side of the center pixel of subimage block, the adjacent pixel in upside, the adjacent pixel in upper left side are to go Except the pixel after noise.
The computing device of the 36. auto-focusing statistical information according to claim 21 or 31, it is characterised in that also include:
Enhancing processing unit, is suitable to after the auto-focusing statistical information is obtained, and the auto-focusing statistical information is entered Row enhancing is processed, and obtains the auto-focusing statistical information after enhancing treatment, and letter is counted as the auto-focusing of the center pixel Breath.
The computing device of 37. auto-focusing statistical informations according to claim 36, it is characterised in that the enhancing treatment Unit, including:First enhancing treatment subelement, is suitable to carry out the auto-focusing statistical information flat obtained by square operation Side's value, the auto-focusing statistical information after being processed as the enhancing.
The computing device of 38. auto-focusing statistical informations according to claim 36, it is characterised in that the enhancing treatment Unit, including:Second enhancing treatment subelement, is suitable to the line direction according to described first image block, to the institute in statistical window The often row for stating auto-focusing statistical information takes maximum, and the maximum of resulting all rows is carried out into accumulating operation, obtains First maximum sum, using the first maximum sum as the auto-focusing statistical information after enhancing treatment.
The computing device of 39. auto-focusing statistical informations according to claim 36, it is characterised in that the enhancing treatment Unit, including:3rd enhancing treatment subelement, is suitable to carry out from big to small the auto-focusing statistical information that every row is calculated Sequence, takes preset number as often capable auto-focusing statistical information, and the often capable auto-focusing statistical information is carried out Accumulating operation, obtains the second maximum sum, using the second maximum sum as the auto-focusing after enhancing treatment Statistical information.
The computing device of 40. auto-focusing statistical informations according to claim 36, it is characterised in that the enhancing treatment Unit, including:4th enhancing treatment subelement, is suitable to when the auto-focusing statistical information is maximum more than default focusing statistics During value, using it is described it is default focusing statistics maximum as the enhancing treatment after auto-focusing statistical information, when it is described from When dynamic focusing statistical information is less than default focusing statistics minimum value, using zero as the auto-focusing statistics after enhancing treatment Information.
CN201510996962.1A 2015-12-25 2015-12-25 A kind of calculation method and device of auto-focusing statistical information Active CN106921828B (en)

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 true CN106921828A (en) 2017-07-04
CN106921828B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228290A (en) * 2017-12-19 2018-06-29 广州文石信息科技有限公司 The display methods and device at UI interfaces in a kind of EINK color/graphics equipment
CN114422693A (en) * 2022-01-14 2022-04-29 山东云海国创云计算装备产业创新中心有限公司 Focusing method, device, equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080151097A1 (en) * 2006-12-22 2008-06-26 Industrial Technology Research Institute Autofocus searching method
CN102572265A (en) * 2010-09-01 2012-07-11 苹果公司 Auto-focus control using image statistics data with coarse and fine auto-focus scores
US20130083232A1 (en) * 2009-04-23 2013-04-04 Hiok Nam Tay Auto-focus image system
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080151097A1 (en) * 2006-12-22 2008-06-26 Industrial Technology Research Institute Autofocus searching method
US20130083232A1 (en) * 2009-04-23 2013-04-04 Hiok Nam Tay Auto-focus image system
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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228290A (en) * 2017-12-19 2018-06-29 广州文石信息科技有限公司 The display methods and device at UI interfaces in a kind of EINK color/graphics equipment
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

Also Published As

Publication number Publication date
CN106921828B (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN112712512A (en) Hot-rolled strip steel scab defect detection method and system based on artificial intelligence
Pertuz et al. Generation of all-in-focus images by noise-robust selective fusion of limited depth-of-field images
CN105096269B (en) The method and system of image radial distortion correction based on distortion linear structure detection
CN101996406A (en) No-reference structural sharpness image quality evaluation method
CN105046658A (en) Low-illumination image processing method and device
CN109740721B (en) Wheat ear counting method and device
CN103679656B (en) A kind of Automated sharpening of images method
CN110610150B (en) Tracking method, device, computing equipment and medium of target moving object
CN105049679A (en) Image processing device and image processing method
JP6352547B2 (en) Image processing apparatus and image processing method
Coady et al. An overview of popular digital image processing filtering operations
CN105809630A (en) Image noise filtering method and system
CN102306307B (en) Positioning method of fixed point noise in color microscopic image sequence
CN106921828A (en) The computational methods and device of a kind of auto-focusing statistical information
CN103997592B (en) Vedio noise reduction method and system
CN105976334B (en) A kind of denoising system and method for three-dimensional filtering Denoising Algorithm
CN104751416A (en) Image denoising method and device and image processing system
CN108614995A (en) Gesture data collection acquisition method, gesture identification method and device for YOLO networks
CN104881845A (en) Method And Apparatus For Processing Image
CN107437239A (en) A kind of image enchancing method and device
CN114127784A (en) Method, computer program product and computer readable medium for generating a mask for a camera stream
CN104767913A (en) Video denoising system having contrast ratio self-adapting function
CN105590307A (en) Transparency-based matting method and apparatus
CN102724541B (en) Intelligent diagnosis and recovery method for monitoring images
CN106327441B (en) The automatic correction method and system of image radial distortion

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