Disclosure of Invention
The technical problem to be solved by the invention is to assist in judging the detail degree of the current scene based on an FV value (focus value) in an AF focusing process, apply a proper edge detection filter to the current scene, extract details and increase the contrast.
In view of this, the present application provides an AF focusing method using a mobile phone, so as to help solve the problem of denoising of a camera in the prior art, and greatly improve details of a shot picture.
The technical scheme adopted by the invention for solving the technical problems is as follows:
A method for sharpening an auxiliary picture by AF focusing comprises the following steps: s1, continuously searching from the initial position; s2, calculating an FV value for each position; s3, if the FV value is increased all the time, the forward search is continued, if the FV value is decreased, the reverse search is continued; s4, when FV value increases to a value and begins to decrease, the corresponding FV value is considered to be the clearest point at which the lens stays.
preferably, the FV value is calculated by dividing the picture into several areas, calculating the FV values of RGB for each area, and then adding the FV values of all the areas to synthesize one FV value.
Preferably, the more details of the picture are rich, the larger FV value of the picture is, and the less details of the picture are, the smaller FV value is.
Preferably, a threshold value is set in each picture area of the picture, and if the calculated FV value is greater than the threshold value, the interpolation result of two adjacent areas is used.
Preferably, the filter of region 1 is used to enhance the details of the entire scene when the calculated FV value is much greater than the threshold value.
Preferably, the FV value calculation method adopts a bayer array calculation method, and the calculation formula is as follows:
R Sharpness=λ(R0,4+R0,6+R2,4+R2,6);
Gr Sharpness=λ(R0,5+R0,7+R2,5+R2,7);
Gb Sharpness=λ(R1,4+R1,6+R3,4+R3,6);
Sharpness=λ(R1,5+R1,7+R3,5+R3,7)。
preferably, each channel for which FV values are calculated has an empirical coefficient, then:
R Sharpness=λ(a11*R0,4+a12*R0,6+a21*R2,4+a22*R2,6);
Gr Sharpness=λ(a11*R0,5+a12*R0,7+a21*R2,5+a22*R2,7);
Gb Sharpness=λ(a11*R1,4+a12*R1,6+a21*R3,4+a22*R3,6);
B Sharpness=λ(a11*R1,5+a12*R1,7+a21*R3,5+a22*R3,7)。
preferably, the method can be applied to a camera of an electronic device.
The device for clearing the auxiliary picture by utilizing AF focusing comprises an imaging module and a focusing processing module, wherein the focusing processing module is used for assisting the picture to be clear by adopting an AF focusing principle.
Preferably, the device can be applied to a camera or a mobile phone.
The invention has the beneficial effects that: the method has the advantages that the proper edge detection filter is applied to extract the details of the current scene, the contrast is increased, the problem of camera de-noising in the prior art is solved in an auxiliary mode, and the details of the shot picture are greatly improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The image is an important information source, and people can be helped to know the content of the information through image processing. However, the image is often degraded by interference and influence of various noises during the generation and transmission processes, which will adversely affect the processing (such as segmentation, compression, image understanding, etc.) of the subsequent images. Therefore, in order to suppress noise, improve image quality and facilitate higher-level processing, the image needs to be subjected to denoising preprocessing.
The invention provides a method for clearing an auxiliary picture by utilizing AF focusing.
AF (automatic focusing) focusing principle of the invention
The process of AF focusing is to search forward from the initial position continuously, each position calculates an FV value, if FV is increased all the time, the focusing is proved to be in this direction, and the search is continued forward, if FV is decreased, the search direction is reversed, and the search in the reverse direction is needed.
FV is increased upward and if after increasing to a value, FV begins to drop to some extent, we consider that this clearest point is found. After which the lens stays in this position.
Therefore, the method for clearing the auxiliary picture by utilizing AF focusing comprises the following steps:
S1, continuously searching from the initial position;
S2, calculating an FV value for each position;
s3, if the FV value is increased all the time, the forward search is continued, if the FV value is decreased, the reverse search is continued;
S4, when FV value increases to a value and begins to decrease, the corresponding FV value is considered to be the clearest point at which the lens stays.
The sharpness improving method which is currently universal: that is, one filter is used to extract edge information of a picture, different filter shapes are set according to different regions (according to a gain value currently used by a sensor), a gain value smaller than a region 1 uses a filter of the region 1 to extract edge information, a gain larger than a region 2 uses a filter of the region 2 to extract edge information, and between the region 1 and the region 2, edge information is extracted using interpolation results of the filters of the region 1 and the region 2. This has the disadvantage that the lower the area is, the worse the edge detection information is, especially for some indoor scenes, the details are rich, but because of the consideration of the whole information of the area, it is impossible to use an extreme filter to detect the information of the area, so that the details of part of the object are lost, and the amount of edge information is not rich.
In this regard, we can assist FV information of AF to determine whether the current scene contains information rich in details. Thus, in the preferred embodiment of the present invention, the FV value is calculated by dividing the picture into regions, each of which calculates the FV values of RGB, and then adding the FV values of all the regions to synthesize one FV value.
Preferably, the more details of the picture are rich, the larger FV value of the picture is, and the less details of the picture are, the smaller FV value is.
Preferably, a threshold value is set in each picture area of the picture, and if the calculated FV value is greater than the threshold value, the interpolation result of two adjacent areas is used.
preferably, the filter of region 1 is used to enhance the details of the entire scene when the calculated FV value is much greater than the threshold value.
For example, according to the current exposure information, the gain of the sensor is in area 2, but for the shot scene, FV value is high, if the filter in area 2 cannot fully show the whole details of the picture, we can set an FV threshold for each area, and when the FV threshold is greater than this threshold, we can use the interpolation results of the filters in area 1 and area 2, and if FV is large enough, we can also use the filter in area 1 to improve the details of the whole scene, so as to present better picture effect to the client.
Preferably, the FV value calculation method adopts a bayer array calculation method, and the calculation formula is as follows:
R Sharpness=λ(R0,4+R0,6+R2,4+R2,6);
Gr Sharpness=λ(R0,5+R0,7+R2,5+R2,7);
Gb Sharpness=λ(R1,4+R1,6+R3,4+R3,6);
Sharpness=λ(R1,5+R1,7+R3,5+R3,7)。
Preferably, each channel for which FV values are calculated has an empirical coefficient, then:
R Sharpness=λ(a11*R0,4+a12*R0,6+a21*R2,4+a22*R2,6);
Gr Sharpness=λ(a11*R0,5+a12*R0,7+a21*R2,5+a22*R2,7);
Gb Sharpness=λ(a11*R1,4+a12*R1,6+a21*R3,4+a22*R3,6);
B Sharpness=λ(a11*R1,5+a12*R1,7+a21*R3,5+a22*R3,7)。
in a preferred embodiment of the invention, FV is calculated by dividing the picture as a whole into several regions, each region calculating FV values of RGB, and then adding the FV values of all the regions to synthesize one FV. I.e. a picture has only one FV value. And we can also set different thresholds to filter out FV calculated due to noise interference, increasing the accuracy of the picture. If a picture is more detailed, the FV value of the picture is larger, and if the picture is less detailed, the FV is small, the FV grows slowly, the FV _ nex/FV _ pre has a smooth value, and the FV rises less steeply.
Preferably, the method for assisting in picture sharpening by AF focusing provided by the invention can be applied to a camera of an electronic device.
The device for clearing the auxiliary picture by utilizing AF focusing comprises an imaging module and a focusing processing module, wherein the focusing processing module is used for assisting the picture to be clear by adopting an AF focusing principle.
Preferably, the device for assisting in picture sharpening by AF focusing can be applied to a camera or a mobile phone.
although the illustrative embodiments of the present invention have been described above to enable those skilled in the art to understand the present invention, the present invention is not limited to the scope of the embodiments, and it is apparent to those skilled in the art that all the inventive concepts using the present invention are protected as long as they can be changed within the spirit and scope of the present invention as defined and defined by the appended claims.