CN113163123A - Automatic focusing method and device, electronic equipment and storage medium - Google Patents

Automatic focusing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113163123A
CN113163123A CN202110558827.4A CN202110558827A CN113163123A CN 113163123 A CN113163123 A CN 113163123A CN 202110558827 A CN202110558827 A CN 202110558827A CN 113163123 A CN113163123 A CN 113163123A
Authority
CN
China
Prior art keywords
scene
light source
shot image
brightness
low
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.)
Pending
Application number
CN202110558827.4A
Other languages
Chinese (zh)
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Publication of CN113163123A publication Critical patent/CN113163123A/en
Pending legal-status Critical Current

Links

Images

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/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene

Abstract

The embodiment of the invention discloses an automatic focusing method, an automatic focusing device, electronic equipment and a storage medium. The automatic focusing method comprises the following steps: acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information; if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image; and if the scene is a low-illumination point light source scene, carrying out automatic focusing according to the image subjected to brightness suppression on the shot image. The embodiment of the invention realizes the targeted focusing according to the scene recognition result, improves the recognition accuracy of the point light source scene, and further improves the focusing accuracy of the night scene.

Description

Automatic focusing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of video surveillance technologies, and in particular, to an auto-focusing method and apparatus, an electronic device, and a storage medium.
Background
The auto-focusing algorithm in the related video monitoring field depends on determining the FV Value (Focus Value, definition evaluation Value, FV for short) of the current picture, which is generally obtained by image frequency domain analysis. According to the division of different frequency bands, the FV value of the low frequency component and the FV value of the high frequency component can be obtained. When the focus motor is moved to make the image clearer, the FV value obtained by the current picture is larger. In a conventional scenario, an FV value curve composed of focus motor positions and FV values generally satisfies unbiased, unimodal characteristics. Therefore, when the focusing is carried out automatically, the position of the focusing motor is moved to find the maximum FV value, and the focusing can be clear.
However, with the acceleration of the urbanization process, most night monitoring scenes or dark environment monitoring scenes have lamplight, the FV value of the collected picture is easily affected by a point light source, and the low-frequency component in the image is increased due to halo diffusion when the image is blurred, so that the image blur is caused to be a phenomenon that the FV value becomes larger, and the single-peak characteristic is damaged by the FV value curve, and a double-peak phenomenon appears, which shows that the FV value curve has pseudo-peak interference. Therefore, the focusing of the scene with the point light source is difficult, and is one of the main problems existing in the automatic focusing of the current night scene or dim environment scene.
In the prior art, highlight points in a picture are deleted, and a focusing position is determined according to FV values of all remaining points. However, in different scenes, the same brightness value may be a common point of a highlight point light source scene or a light source point of a low-light scene, and if a highlight point in a point light source image is set as a deletion point, an FV value curve composed of retained points has a very poor trend and cannot be used for aggregation, which seriously affects an automatic focusing effect in a night scene.
Disclosure of Invention
The embodiment of the disclosure provides an automatic focusing method, an automatic focusing device, electronic equipment and a storage medium, and improves the automatic focusing accuracy of a zoom lens by identifying different scenes.
In a first aspect, an embodiment of the present invention provides an auto-focusing method, including:
acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information;
if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image;
and if the scene is a low-illumination point light source scene, carrying out automatic focusing according to the image subjected to brightness suppression on the shot image.
In a second aspect, an embodiment of the present invention further provides an automatic focusing apparatus, including:
the low-illumination scene judging module is used for acquiring picture parameter information in a shot image and determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information;
the low-illumination point light source scene judging module is used for determining whether the scene of the shot image is a low-illumination point light source scene or not according to the distribution of the high-brightness points in the shot image if the scene is a low-illumination scene;
and the low-illumination point light source scene focusing module is used for automatically focusing the shot image according to the image subjected to brightness suppression if the shot image is a low-illumination point light source scene.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement an autofocus method as described in any embodiment of the invention.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the auto-focusing method according to any embodiment of the present invention.
The embodiment of the invention determines the light source or the illumination scene of the shot image based on the picture parameter information in the shot image, and provides different gathering schemes in a targeted manner according to different scenes, thereby improving the accuracy of automatic shooting at night. In some exemplary embodiments, a more precise scene recognition scheme is further proposed for a low-light point light source scene and/or a strong-point light source scene, so as to further improve the accuracy of automatic night shooting.
Other aspects will be apparent upon reading and understanding the attached drawings and detailed description.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a flow chart of an auto-focusing method according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of block division of a captured image;
FIG. 3 is a schematic diagram of the partitioning of highlight impact weights;
FIG. 4 is a schematic illustration of piecewise luminance suppression of an image;
FIG. 5 is a flowchart of an auto-focusing method according to a second embodiment of the present invention;
FIG. 6 is a result of displaying the luminance histogram of an image of a strong point light source scene and the luminance histograms of other scene images;
FIG. 7 is a flow chart of an auto-focusing method according to a third embodiment of the present invention;
FIG. 8 is a flow chart of another auto-focusing method according to a third embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an automatic focusing apparatus according to a fourth embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device in the fifth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that all the directional indicators (such as up, down, left, right, front, and rear … …) in the embodiment of the present invention are only used to explain the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indicator is changed accordingly.
In addition, the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "connected," "secured," and the like are to be construed broadly, and for example, "secured" may be a fixed connection, a removable connection, or an integral part; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In addition, the technical solutions in the embodiments of the present invention may be combined with each other, but it must be based on the realization of those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Fig. 1 is a flowchart of an autofocus method according to a first embodiment of the present invention, which is applicable to a case where autofocus is performed on a shot image based on a scene determination result. The method may be performed by an autofocus apparatus, which may be implemented in software and/or hardware, and may be configured in an electronic device, for example, the electronic device may be a device with communication and computing capabilities, such as a background server. As shown in fig. 1, the method specifically includes:
step 101, acquiring picture parameter information in the shot image, and determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information.
The captured image is an image captured by using the zoom lens and initially unfocused, the captured image is an image captured at night or in a dark environment, and the night scene in the captured image is identified for targeted focusing. The picture parameter information refers to a parameter characterizing an imaging effect in a captured image, and for example, the picture parameter information includes brightness information, picture gain information, and the like in the image, and the specific content of the picture parameter information is not limited herein. The classification of the scene of the image is used to distinguish between the brightness in the image and the light source effect in the image. A low-light scene means that the luminance of a picture in a captured image is low.
In some exemplary embodiments, picture parameter information, such as a luminance statistical result, capable of characterizing the picture illuminance in the captured image is obtained, and it is determined whether the picture illuminance in the current picture is too low according to the picture parameter information, for example, it is determined whether the current picture is a low-illuminance scene according to a comparison result between the luminance statistical result and a preset low-illuminance threshold, and if the luminance statistical result is greater than the preset low-illuminance threshold, it is determined that the scene of the captured image is not the low-illuminance scene; and if the brightness statistical result is less than or equal to the preset low-illumination threshold value, determining that the scene of the shot image is a low-illumination scene.
In one possible embodiment, the picture parameter information includes a luminance statistic and a picture gain parameter in the auto-exposure statistic;
correspondingly, determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information comprises the following steps:
and if the brightness statistical result is smaller than the preset low-illumination threshold value and the picture gain parameter is larger than the preset gain threshold value, determining that the scene of the shot image is a low-illumination scene.
The automatic Exposure statistical information included in the picture parameter information refers to statistical information obtained when a shot picture is under Automatic Exposure (AE), and includes a luminance statistical result Luma and a current picture gain parameter.
The real situation of the image illumination can be better reflected when the shot image is in the automatic exposure state, so when determining whether the scene of the shot image is a low-illumination scene, the judgment is carried out based on the brightness statistical result Luma and the image gain parameter in the AE statistical information. The low-illumination scene image is analyzed, and when the brightness statistical result Luma is smaller than the preset low-illumination threshold value and the picture Gain parameter Gain is larger than the preset Gain threshold value, the scene of the shot image can be determined to be a low-illumination scene. The preset low-illumination threshold value and the preset gain threshold value can be determined statistically according to low-illumination scene image materials collected in advance, so that the accuracy of determining the preset low-illumination threshold value and the preset gain threshold value is guaranteed.
And 102, if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image.
The sharpness evaluation value of the image is easily influenced by the point light source, and low-frequency components in the image are increased due to the diffusion of the halo of the point light source during focusing blurring, so that the phenomenon that the sharpness evaluation value of blurred reflection of the image is increased is caused, namely, false peak interference exists on a sharpness evaluation value curve. The presence of a point source of light in a scene can cause focusing difficulties in that scene. Therefore, after the scene of the shot image is identified as the low-illumination scene, the current scene needs to be further identified to determine whether the point light source exists, and if the point light source exists, the current scene is the low-illumination point light source scene in the low-illumination scene.
The image of the low-light point source scene shows that the image has low illumination, large gain and less details, and the scene contains sporadic light sources, for example, the common low-light point source scene is a field scene containing light sources. The sporadic light sources are high in brightness and small in quantity in the image, so that whether the scene of the shot image is a point light source scene or not can be determined according to the distribution of the high bright points in the shot image. For example, if the highlight points in the captured image are scattered and the number of the highlight points is small, it may be determined that the scene of the captured image is a low-illumination point light source scene. Otherwise a low-light conventional scene, i.e. where focusing is not disturbed by a point source.
In one possible embodiment, determining whether the scene of the captured image is a low-illumination point-light-source scene according to the distribution of the highlight dots in the captured image includes: the method comprises the steps of carrying out blocking processing on a shot image to obtain at least two blocking areas;
determining the proportion of pixel points with brightness values larger than a preset highlight threshold value in each block area to the total pixel points in the block area to obtain the highlight proportion of each block area;
determining highlight focusing influence parameters of the shot images according to the highlight proportion of each block area and the predetermined highlight influence weight; wherein the highlight point impact weight is determined according to a focus weight;
and if the focus influence parameter of the highlight point is larger than the preset focus influence parameter threshold value, determining that the scene of the shot image is a low-illumination point light source scene.
In order to improve the accuracy of determining the highlight distribution in the shot image and further improve the accuracy of determining the highlight focusing influence parameters, in the embodiment of the present invention, the shot image is subjected to blocking processing to obtain M × N blocking regions, as shown in fig. 2, a schematic diagram of blocking the shot image is obtained, the Width is divided by N, the Height is divided by M, and the M × N blocking regions are obtained, wherein M, N are integers greater than or equal to 1.
And counting the number of highlight points in each block area according to a preset highlight threshold, and counting the proportion of the number of highlight points in each block area. Illustratively, the number Cnt of pixels with brightness values larger than a preset highlight threshold in each block region is counted, and the ratio of the number Cnt of pixels larger than the preset highlight threshold in each block region to the number of all pixels in the current block region is calculated, i.e. the highlight ratio of each block region is denoted as R (x, y), wherein x is greater than or equal to 1 and less than or equal to M, and y is greater than or equal to 1 and less than or equal to N. The preset highlight threshold value can be determined statistically according to pre-collected low-illumination point light source scene image materials, so that the condition of a point light source in a low-illumination scene can be accurately reflected by the preset highlight threshold value. Illustratively, the preset high brightness threshold value is obtained by statistics according to the brightness histogram information of the low-illumination point light source scene image material collected in advance.
When the focusing is carried out automatically, due to different focuses on scenes, the image definition evaluation value is subjected to blocking processing, and different focusing weight values are assigned to the blocks. And during focusing, convolving the definition evaluation value of each block with the focusing weight of each block to obtain the definition evaluation value which finally participates in focusing. The focusing weight is set according to the shooting requirement, and belongs to the attribute information of the image, which is not limited herein. Illustratively, the focus weight includes, but is not limited to, center focus in which the focus weight of a block region located at the center position of the captured image is larger than the focus weight of a block region located at the edge position; in the edge focusing, the focusing weight of the block area located at the center position of the captured image is smaller than the focusing weight of the block area located at the edge position. The highlight influence weight is determined according to the focusing weight, namely, the highlight influence weight of the shot image is determined according to the overall condition of the focusing weight in the image.
Due to the setting of the focusing weight during automatic focusing, when a low-illumination point light source scene is focused, the influence degrees of point light sources in an image on a definition evaluation value which finally participates in focusing are different due to different preset focusing weights of different block areas, when central focusing is adopted, the influence of the point light sources closer to the central position on focusing is larger, and when edge focusing is adopted, the influence of the point light sources closer to the edge position on focusing is larger. Therefore, after the highlight point proportion of each block area is determined, the highlight point focusing influence parameter of the shot image is determined according to the highlight point proportion of each block area and the predetermined highlight point influence weight. Wherein the highlight influence weight is determined according to the focusing weight of the auto-focusing and the blocking result, for example, the focusing weight of the auto-focusing of the zoom lens can be directly adopted, or the dividing method of the highlight influence weight of the actual auto-focusing can be designed, the distribution characteristics are the same as the focusing weight of the actual auto-focusing and are matched with the distribution of the blocking result, the center position weight is lower than the high edge position weight by taking the center focusing as an example, as shown in fig. 3, the dividing schematic diagram of the highlight influence weight is shown, the region C in the image is the center position of the image, the highlight influence weight is W1, the region a in the image is the edge position of the image, the highlight influence weight is W3, the region B in the image is the middle position of the image, the highlight influence weight is W2, by taking the center focusing as an example, the position determination W1 is larger than W2, w2 is greater than W1. The expression of the highlight influence weight can be expressed as:
Figure BDA0003078320870000081
when the target blocking area is located in the area a, the highlight influence weight value of the target blocking area is W1; when the target block area is located in the B area, the highlight influence weight of the target block area is W2; when the target block area is located in the C area, the highlight influence weight of the target block area is W3. The determination of which area the target block area is located in can be determined according to the actual coordinate point position, which belongs to a common technical means of those in the art and is not described herein again.
The highlight focus influence parameter is a convolution result of R (x, y) and W (x, y), and represents the influence degree of the highlight information in each block area on the focus under the focus weight. A larger value indicates a higher highlight ratio affecting focusing; the smaller the numerical value, the smaller the highlight point ratio indicating that focus is affected, and taking center focus as an example, the larger the highlight point focus effect parameter, the more the highlight point is distributed at the center position of the image, and the smaller the highlight point focus effect parameter, the more the highlight point is distributed at the edge position of the image. If the focus influence parameter of the highlight point is larger than the preset focus influence parameter threshold, the point light source in the image can influence automatic focusing, and the scene of the image is determined to be a low-illumination point light source scene; if the focus influence parameter of the highlight point is less than or equal to the preset focus influence parameter threshold, the point light source in the image does not have large influence on automatic focusing, and the scene of the image is determined to be a low-light conventional scene. The preset focusing influence parameter threshold value can be determined in a statistical manner according to pre-collected low-illumination point light source scene image materials, so that the influence degree of a point light source on focusing in a low-illumination scene can be accurately reflected by the preset focusing influence parameter threshold value.
Exemplarily, a brightness image of the shot image is determined according to a Y component image in a YUV format of the shot image, the brightness image is subjected to blocking processing, a pixel value of each pixel point in the brightness image is a brightness value of the point, and the proportion of the pixel point with the pixel value larger than a preset highlight threshold value in each blocking area to the total pixel point in the blocking area is directly counted.
And 103, if the scene is a low-illumination point light source scene, performing automatic focusing according to the image subjected to brightness suppression on the shot image.
The sharpness evaluation value under the low-illumination point light source scene contains point light source information and scene effective focusing information at the same time, so that the point light source information needs to be weakened if focusing is carried out according to the scene effective focusing information. The point light source information in the image can be suppressed by suppressing the highlight point, that is, reducing the luminance value of the highlight point.
In one possible embodiment, performing autofocus based on the brightness-suppressed captured image includes:
determining a suppression brightness value of pixel points of which the brightness values are larger than a preset brightness suppression threshold value in a shot image according to a preset suppression proportion to obtain an image with suppressed brightness;
and carrying out automatic focusing according to the definition evaluation value of the low-frequency component in the image after brightness suppression.
The preset brightness suppression threshold value distinguishes highlight points needing to be suppressed in the image; the preset suppression proportion is used for ensuring the suppression degree of the highlight points needing to be suppressed. The process of suppressing the point light source information not only suppresses the unfavorable point light source information, but also affects other parts of the effective focusing information. Therefore, the setting of the preset brightness suppression threshold and the preset suppression ratio requires that the influence of the high-brightness point on the pseudo-peak of the definition evaluation value curve is suppressed. The preset brightness suppression threshold value can be obtained through statistics according to brightness histogram information of low-illumination point light source scene image materials collected in advance, and after the preset brightness suppression threshold value is determined, the preset suppression proportion with the minimum influence on the focusing of the definition evaluation value is determined through live-action regulation.
Fig. 4 is a schematic diagram of performing segmented luminance suppression on an image, where Luma represents a luminance value of a pixel in the image, T8 represents a first preset luminance suppression threshold, T7 represents a second preset luminance suppression threshold, RR represents a suppression ratio, and T9 represents a preset suppression ratio. The brightness of pixel values which are larger than T8 and smaller than T7 in the image is linearly suppressed according to 1 to T9, the brightness of the pixel values which are larger than T7 is directly multiplied by a preset suppression proportion T9, and the brightness of the pixel values which are smaller than T8 is kept unchanged, so that the effect of carrying out segmented suppression on the brightness in the image is achieved. The form of the specific segmented luminance suppression in the embodiment of the present invention is not limited, and is only exemplified here.
The image subjected to the brightness suppression is Img (i, j) '-Img (i, j) × RR (i, j), wherein Img (i, j) represents a brightness value of the captured image at a point (i, j), RR (i, j) represents a preset suppression ratio determined according to the brightness value at the point (i, j), and Img (i, j)' represents a brightness value of the image subjected to the brightness suppression at a point (i, j). The autofocusing is performed according to the sharpness evaluation value in Img (i, j) ', and the focusing succeeds when the position of the focusing motor is moved so that the sharpness evaluation value in Img (i, j)' is maximized.
Because the illuminance is low in a low-illumination point light source scene, a large amount of noise information caused by the improvement of the picture gain exists in the definition evaluation value of the high-frequency component, the focusing failure can be caused by using the definition evaluation value of the high-frequency component in the scene, and the interference can be avoided by using the definition evaluation value of the low-frequency component. Effective focusing information exists in low-frequency components, so that focusing interference caused by noise information can be avoided according to the definition evaluation value of the low-frequency components in the image after brightness suppression, focusing interference caused by a point light source can be avoided, and accuracy of automatic focusing is improved. Illustratively, the autofocusing is performed according to the sharpness evaluation value of the low frequency component in Img (i, j) ', and the focusing succeeds when the position of the focusing motor is moved such that the sharpness evaluation value of the low frequency component in Img (i, j)' is maximized.
The embodiment of the invention determines whether the shot image is a low-illumination scene or not based on the picture parameter information in the shot image, determines whether the shot image is a low-illumination point light source scene in the low-illumination scene or not according to the distribution of high-brightness points in the shot image when the shot image is determined to be the low-illumination scene, inhibits the high-brightness points of the shot image if the shot image is determined to be the low-illumination point light source scene, and performs automatic focusing according to the inhibited image. The method and the device realize targeted focusing according to the recognition result of the scene, improve the recognition accuracy of the low-illumination point light source scene, further improve the focusing accuracy of the low-illumination point light source scene, and solve the focusing problem in the low-illumination point light source scene.
Example two
Fig. 5 is a flowchart of an auto-focusing method according to a second embodiment of the present invention, which is further optimized based on the first embodiment. As shown in fig. 5, the method includes:
step 501, determining whether the shot image scene is a strong point light source scene according to the distribution condition of the brightness values of the pixel points in the shot image.
The brightness value of each pixel point in the image is determined according to a Y component image in an image YUV format, the Y component image represents a brightness image of the image, and the pixel value of each point in the brightness image is the brightness value of the point in the shot image. The distribution of the brightness values is determined according to the quantity distribution of each pixel value in the brightness image. Specifically, since the range of the luminance value is 0 to 255, the range of the pixel value of each point in the luminance image is also 0 to 255, the number of the pixels of each luminance value in the luminance image is counted, and a luminance histogram is generated by counting, that is, the abscissa is the luminance value, and the ordinate is the number of the pixels of each luminance value in the photographed image.
Illustratively, after a current shot image is obtained, filtering preprocessing is performed on a brightness image of the shot image, the influence of a jumping highlight point on a statistical result is eliminated, brightness normalization processing is performed on the filtered brightness image, and a normalized brightness histogram is generated through statistics.
In addition to a low-illumination point light source scene, a strong-point light source scene also exists in a shot image, the overall brightness of the image in the strong-point light source scene is high, the image is in a similar overexposure state, the bright area is large, and image information mainly comes from the edge of a point light source halo. Common strong point light source scenes include luminous billboards, large searchlights on iron towers, and the like.
And judging according to the distribution condition of the brightness values based on the characteristics of the scene image with the strong point light source, wherein the scene image with the strong point light source is in the characteristics similar to overexposure. Specifically, after the normalized luminance histogram of the photographed image is determined, if the luminance data in the normalized luminance histogram is distributed discretely and is concentrated in a bright area and a dark area, and an obvious peak value exists in a highlight area, the scene of the photographed image meets the scene characteristics of a strong point light source, and is determined to be a strong point light source scene; if any condition is not met, the scene is not a strong point light source scene, and subsequent scene judgment is needed. As shown in fig. 6, which is a display result of the luminance histogram of the high-intensity light source scene image and the luminance histograms of other scene images, it can be seen from fig. 6 that the luminance data distribution in the luminance histogram of the upper high-intensity light source scene image is discrete, and there are many pixel points in the bright area and the dark area, and there is an obvious peak in the high-intensity area.
In a feasible embodiment, the standard deviation characteristic parameter, the highlight proportion characteristic parameter and the non-highlight bias characteristic parameter are determined according to the distribution condition of the brightness values of the pixel points in the shot image, and whether the shot image scene is the strong point light source scene is determined according to whether the standard deviation characteristic parameter, the highlight proportion characteristic parameter and the non-highlight bias characteristic parameter meet the strong point light source characteristic threshold value.
The standard deviation characteristic parameter is used for representing the discrete degree of the brightness value distribution in the shot image. The brightness value distribution is discrete under the scene of the strong point light source, the standard deviation in the brightness histogram is used for representing the discrete degree of the brightness data distribution, and the standard deviation characteristic parameter sigma can be determined by using the following formula:
Figure BDA0003078320870000121
wherein the content of the first and second substances,
Figure BDA0003078320870000122
n=255,Xirepresenting the number, X, of pixels with a brightness value i in the captured imageiThe value of (d) can be obtained from a luminance histogram. When the standard deviation parameter is larger than a preset standard deviation threshold (a first standard deviation threshold), the scene of the shot image conforms to the scene characteristic of the strong point light source. The preset standard difference threshold value can be determined according to the pre-collected image materials of the strong point light source scene, so that the distribution condition of the brightness value in the strong point light source scene can be accurately reflected by the preset standard difference threshold value.
The highlight ratio characteristic parameter is used for representing whether a highlight area in a shot image has a peak value or not. Dividing the brightness value in the shot image into a highlight area and a non-highlight area according to a preset highlight threshold of the strong point light source, for example, if the preset highlight threshold of the strong point light source is set to 250, the brightness value of the highlight area is 250 to 255, and the brightness value of the non-highlight area is 0 to 249. The preset high-point light source highlight threshold value can be determined in a statistical mode according to the pre-collected high-point light source scene image materials, and therefore the fact that the preset high-point light source highlight threshold value can accurately reflect the brightness degree in the high-point light source scene is guaranteed.
Specifically, a preset highlight threshold of the strong point light source is set to be Δ i (recorded as a first brightness threshold) in the brightness histogram, and then the brightness data in the brightness histogram is divided into two parts according to Δ i: highlight region histogram data XH(XΔi,..,X255) Non-highlight histogram data XL(X0,..,XΔi-1). The highlight proportion characteristic parameter can be determined by the following formula:
Figure BDA0003078320870000123
wherein R is(Δi,255)Highlight ratio characteristic parameters representing highlight areas from delta i to 255; xiRepresenting the number of pixel points with the brightness value of i in the shot image; xH(XΔi,..,X255) Representing the number of pixel points with brightness values in a highlight area; x (X)0,X1,X2,...X255) The total number of pixel points in the shot image is represented. When the highlight proportion characteristic parameter is larger than a preset highlight proportion threshold (a first proportional threshold), the scene of the shot image accords with the scene characteristic of the highlight light source. The preset highlight ratio threshold can be determined statistically according to the pre-collected image materials of the strong point light source scene, so that the condition of the peak value of the highlight area in the strong point light source scene can be accurately reflected by the preset highlight ratio threshold.
The non-highlight skewness characteristic parameter is used for representing the sample deviation degree of a non-highlight area in the shot image. For the scene image of the strong point light source, because the brightness distribution is discrete, the overexposure phenomenon exists, and more pixel points are positioned in the dark area and the bright area, so that the non-highlight areaXL(X0,..,XΔi-1) The histogram of (a) is in a positive offset state, the non-highlight offset characteristic parameter can characterize the offset degree of the positive offset state, and the non-highlight offset characteristic parameter (also called offset) can be determined by the following formula:
Figure BDA0003078320870000131
where SK denotes a non-highlight skew characteristic parameter, also called skew,
Figure BDA0003078320870000132
is the mean value of the brightness of the image, m3Is a sample third-order central moment, m2Is the sample second order central moment. When SK is greater than 0, it represents non-highlight region XL(X0,..,XΔi-1) The histogram of (1) is in a positive skewness state, and when the SK is greater than a preset skewness threshold (also referred to as a first skewness threshold), a scene of the captured image conforms to the scene characteristics of the strong point light source. The preset off-state threshold value can be determined statistically according to pre-collected strong point light source scene image materials, so that the preset off-state threshold value can accurately reflect the deviation condition of a non-highlight area in a strong point light source scene.
And if the standard deviation characteristic parameter of the shot image is greater than a preset standard deviation threshold value, the highlight proportion characteristic parameter is greater than a preset highlight proportion threshold value and the non-highlight deviation characteristic parameter is greater than a preset deviation threshold value, determining that the scene of the shot image is a strong point light source scene. Otherwise, whether the scene is a low-illumination scene or not is determined according to the picture parameter information, and if the scene of the shot image is not a strong point light source scene and is not a low-illumination scene, the scene is a high-brightness scene.
Step 502, if the scene is a strong point light source scene, determining that the focusing is successful when the image brightness value of the shot image is minimum.
Because the strong point light source scene image is characterized in a similar overexposure state, the highlight and the dark area in the image occupy most of the area, and the dark area is too dark and has no effective focusing information, the definition evaluation value of each frequency band cannot be used for focusing. However, when the scene image with strong point light source is focused and blurred, the halo of the point light source in the image is enlarged, the image brightness is increased, and when the scene image is focused clearly, the halo of the point light source in the image is reduced, and the image brightness is reduced. Therefore, when the scene is identified as a strong point light source scene, the image brightness value is used for focusing according to the image characteristics of the strong point light source. And moving the focusing motor to find the minimum point of the image brightness value, namely the clear point of the strong point light source scene. The image brightness value refers to the sum of brightness values of all pixel points in the shot image. And moving the position of the focusing motor, and simultaneously calculating the brightness value of the image at each position, wherein when the brightness value of the image is at the lowest value, the image is successfully focused.
And 503, if the scene is not the strong point light source scene, determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information.
If the scene of the shot image is not a strong point light source scene, whether the scene is a low-illumination scene or not needs to be determined, if the characteristic of the low-illumination scene image is met, the scene is a low-illumination scene, and if not, the scene is a highlight scene.
Specifically, when determining whether or not the scene of the captured image is a low-illuminance scene, the determination is made based on the luminance statistical result Luma and the picture gain parameter in the AE statistical information. The low-illumination scene image is analyzed, and when the brightness statistical result Luma is smaller than the preset low-illumination threshold value and the picture Gain parameter Gain is larger than the preset Gain threshold value, the scene of the shot image can be determined to be a low-illumination scene.
And step 504, if the scene is not a low-illumination scene, determining that the scene of the shot image is a common high-brightness scene, and performing automatic focusing according to the definition evaluation value of high-frequency components in the shot image.
When the luminance statistical result Luma is greater than or equal to the preset low-illumination threshold value or the picture Gain parameter Gain is less than or equal to the preset Gain threshold value, the scene of the shot image can be determined to be a highlight scene.
The highlight scene comprises a highlight conventional scene and a highlight point light source scene. The two scenes have the common characteristics of high image brightness and rich details, and are mainly distinguished in that a highlight point light source scene comprises a point light source, a common scene is a long-distance urban building community scene, and a common highlight conventional scene is a street scene under night urban lighting.
Since the halo of the point light source mainly has the most influence on the low-frequency component, the filter cut-off frequency for calculating the image definition evaluation value is set, and statistical information of the high-frequency definition evaluation value which is less influenced by the point light source can be obtained by using the definition evaluation value of the high-frequency component obtained through the filter. And the highlight conventional scene has no light source influence, has high brightness and rich details, and can be focused by using a high-frequency definition evaluation value.
Specifically, for focusing of a highlight scene, a preset high-frequency threshold is used for determining a definition evaluation value of a high-frequency component, and when the definition evaluation value of the high-frequency component is the highest, focusing of a shot image is successful. The preset high-frequency threshold value can be determined by statistics according to the pre-collected highlight scene image materials, so that the high-frequency component can accurately reflect effective focusing information in the highlight scene image.
And 505, if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image.
If the scene of the shot image is determined to be a low-illumination scene, whether the scene is a low-illumination point light source scene or a low-illumination conventional scene in the low-illumination scene needs to be judged. The determination of the low-light point light source scene can be determined according to the distribution of the high-light points in the shot image. The method comprises the steps of carrying out blocking processing on a shot image to obtain at least two blocking areas; determining the proportion of pixel points with brightness values larger than a preset highlight threshold value in each block area to the total pixel points in the block area to obtain the highlight proportion of each block area; determining highlight focusing influence parameters of the shot images according to the highlight proportion of each block area and the predetermined highlight influence weight; wherein the highlight point impact weight is determined according to a focus weight; and if the focus influence parameter of the highlight point is larger than the preset focus influence parameter threshold value, determining that the scene of the shot image is a low-illumination point light source scene.
And step 506, if the scene is a low-illumination point light source scene, performing automatic focusing according to the image subjected to brightness suppression on the shot image.
If the scene is a low-illumination point light source scene, determining a suppression brightness value of a pixel point with a brightness value larger than a preset brightness suppression threshold value in a shot image according to a preset suppression proportion to obtain an image with suppressed brightness; and carrying out automatic focusing according to the definition evaluation value of the low-frequency component in the image after brightness suppression.
And 507, if the scene is not the low-illumination point light source scene, determining that the scene of the shot image is a low-illumination conventional scene, and performing automatic focusing according to the definition evaluation value of the low-frequency components in the shot image.
And if the scene of the shot image is a low-illumination scene and the scene of the shot image is determined not to be a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image, determining that the scene is a low-illumination conventional scene. The low-light conventional scene is characterized by low image illumination, large gain, less image details and no light source. The common scenes are outdoor scene without light source. The scene features are similar to a low-illumination point light source scene, and the definition evaluation value of high-frequency classification cannot be used due to noise influence, so that the definition evaluation value of low-frequency components is adopted for automatic focusing.
The division of the low frequency component is determined by setting a reasonable preset low frequency cut-off frequency. The preset low-frequency cut-off frequency can be determined statistically according to low-illumination conventional scene materials collected in advance, so that the low-frequency component can accurately reflect effective focusing information in the low-illumination conventional scene. Specifically, for focusing of a low-light conventional scene, the definition evaluation value of the low-frequency component is determined by using a preset low-frequency cut-off frequency, and when the definition evaluation value of the low-frequency component is the highest, focusing of the shot image is successful.
According to the embodiment of the invention, the image scenes shot at night or in a dim environment are divided into the scene with a strong point light source, the scene with a low conventional light source and the scene with a high brightness, and different focusing methods are implemented according to the characteristics of different scenes, so that the problem that the zoom lens is easy to focus at night or in a complex scene in a dim environment is solved, the effect of self-adaptive focusing of the scene is realized, and the focusing success rate of the zoom lens in the night scene or in the dim environment is improved.
EXAMPLE III
An embodiment of the present disclosure further provides an auto-focusing method, as shown in fig. 7, including:
step 701, acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information;
step 702, determining whether the scene is a strong point light source scene according to the distribution condition of the brightness values of the pixel points in the shot image if the scene is not a low-illumination scene;
and 703, determining that the focusing is successful when the image brightness value of the shot image is the minimum if the shot image is a strong point light source scene.
In some exemplary embodiments, the determining, in step 702, whether the captured image scene is a strong point light source scene according to the distribution of the brightness values of the pixels in the captured image includes:
determining brightness value statistical data according to the brightness value of each pixel point in the shot image; the brightness value statistical data embody the quantity of each brightness value and the pixel points included by each brightness value;
and judging that the condition of the strong point light source is met according to the statistical data of the brightness values, and determining that the shot image scene is a strong point light source scene.
In some exemplary embodiments, the determining, in step 702, luminance value statistical data according to luminance values of pixel points in the captured image includes:
before determining the luminance statistics, in step 7011, a pre-processing of the captured image is performed, including: filtering the shot image, and performing brightness value normalization processing on the filtered image;
and then determining the brightness value statistical data according to the brightness value of each pixel point in the image after normalization processing.
As can be seen, in the preprocessing of step 7011, the shot image obtained from the current scene is filtered to eliminate the influence of the jumping highlight point on the statistical result; the luminance image obtained by filtering is subjected to normalization processing of a preset luminance value range, for example, normalization processing of luminance values of 0 to 255 is performed. The luminance range subjected to the normalization processing is not limited to the disclosed example, and other numerical value ranges may be selected.
In some exemplary embodiments, as shown in fig. 8, after step 702, the method further includes:
and 704, determining that the scene is not a strong point light source scene, determining that the scene of the shot image is a common highlight scene, and performing automatic focusing according to a definition evaluation value of high-frequency components in the shot image.
In some exemplary embodiments, the luminance value statistics may be embodied in the form of a histogram as shown in fig. 6. In the histogram shown in fig. 6, the abscissa represents the luminance value, and the ordinate represents the number of pixels included (corresponding) in each luminance value.
In some exemplary embodiments, the determining that the strong point light source condition is satisfied includes:
according to the brightness value statistical data, selecting the brightness value statistical data with the brightness value smaller than a first brightness threshold value to form non-highlight area statistical data;
and judging that the statistical data of the non-highlight areas are distributed in a positive skewness mode, and determining that the skewness is greater than or equal to a first skewness threshold value, so that the strong point light source condition is met.
It can be seen that the luminance value statistical data of the captured image is divided into highlight region statistical data and non-highlight region statistical data according to the first luminance threshold (luminance value corresponding to the demarcation point Δ i that demarcates the highlight region). In some exemplary embodiments, the statistical data is embodied by histogram data, and the histogram X is divided into highlight regions correspondinglyH(xΔi,..,x255) Histogram of non-highlighted regions XL(X0,..,XΔi-1)。
In some exemplary embodiments, in the above-described strong point light source condition: the statistical data of the non-highlight areas are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold and is marked as a condition one; namely, if the statistical data of the brightness values meet the first condition, the shot image scene is determined to be a strong point light source scene.
It can be seen that, for the scene image of the strong point light source, because the brightness distribution is discrete, the overexposure phenomenon exists, and there are many pixel points in the dark area and the bright area, therefore, the non-highlight area XL(X0,..,XΔi-1) The histogram of (2) is in a positive offset state, and the offset degree of the data of the non-highlight area can represent the offset degree of the positive offset state. In some exemplary embodiments, data X is for non-highlighted regionsL(X0,..,XΔi-1) The skewness of (d) can be determined by the following formula:
Figure BDA0003078320870000181
wherein SK represents the skewness, wherein
Figure BDA0003078320870000182
Is the mean value of the brightness of the sample, m3Is a sample third-order central moment, m2Is the sample second order central moment. When SK is greater than 0, it represents non-highlight region XL(X0,..,XΔi-1) The histogram of (1) is in a positive skewness state, and when SK is larger than a preset first skewness threshold value, a scene of a shot image accords with the scene characteristics of a strong point light source. The preset first skewness threshold value can be determined statistically according to the pre-collected strong point light source scene image materials, so that the deviation condition of a non-highlight area in the strong point light source scene can be accurately reflected by the preset first skewness threshold value.
I.e. the non-highlighted areas XL(X0,..,XΔi-1) When the histogram is in a positive bias state and the bias degree is greater than or equal to a first bias state threshold value T3, judging that the histogram is an intense point light source scene; and when the deviation is smaller than the first deviation threshold T3, the scene is not a strong point light source scene. The T3 threshold may be statistically derived from strong point source scene image material.
In some exemplary embodiments, the determining that the strong point light source condition is satisfied further includes:
calculating a standard deviation of the luminance value statistical data;
and judging that the standard deviation is greater than or equal to a first standard deviation threshold value, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold value, and determining that the strong point light source condition is met.
In some exemplary embodiments, in the above-described strong point light source condition: the standard deviation is greater than or equal to a first standard deviation threshold value and is marked as a condition two; namely, the shot image scene is determined to be a strong point light source scene if the brightness value statistical data meets the first condition and the second condition.
The distribution of the brightness value statistical data of the scene of the strong point light source is discrete, and the standard deviation sigma of the brightness value statistical data is used for representing the discrete degree of the distribution of the brightness data. The larger the σ is, the more discrete the data distribution is, and the smaller the σ is, the more concentrated the data distribution is.
In some exemplary embodiments, the luminance value statistics are embodied as luminance histogram data X (X)0,x1,x2,...x255) Then, the standard deviation is calculated as follows:
Figure BDA0003078320870000191
wherein
Figure BDA0003078320870000192
When the standard deviation sigma is greater than or equal to the first standard deviation threshold T1, the scene is considered to conform to the strong point light source scene characteristics, and T1 may be derived from the statistical strong point light source image material.
In some exemplary embodiments, the determining that the strong point light source condition is satisfied further includes:
calculating the proportion of the number of pixels with the brightness values larger than or equal to a first brightness threshold value to the total pixels in the shot image according to the brightness value statistical data;
and judging that the proportion is greater than or equal to a first proportion threshold value, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold value, and determining that the strong point light source condition is met.
In some exemplary embodiments, in the above-described strong point light source condition: the ratio is greater than or equal to a first ratio threshold and is marked as a condition three; namely, the shot image scene is determined to be a strong point light source scene if the brightness value statistical data are judged to meet the first condition and the third condition.
In some exemplary embodiments, the determining that the strong point light source condition is satisfied further includes:
calculating a standard deviation of the luminance value statistical data;
calculating the proportion of the number of pixels with the brightness values larger than or equal to a first brightness threshold value to the total pixels in the shot image according to the brightness value statistical data;
and judging that the standard deviation is greater than or equal to a first standard deviation threshold, the proportion is greater than or equal to a first proportion threshold, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold, and determining that the strong point light source condition is met.
Namely, if the statistical data of the brightness values meet the first condition, the second condition and the third condition, the shot image scene is determined to be a strong point light source scene.
It can be seen that the demarcation point Δ i (first luminance threshold) of the highlight region histogram is defined, dividing the luminance histogram data into two parts: highlight region histogram XH(xΔi,..,x255) Histogram of non-highlighted regions XL(X0,..,XΔi-1) Calculating the ratio of the number of the pixel points in the highlight area:
Figure BDA0003078320870000201
the proportion of the number of the pixels in the highlight area to the total number of the pixels in the shot image is calculated, when the proportion is larger than or equal to a first proportion threshold value T2, the scene is considered to accord with the scene characteristics of the strong point light source, and the threshold value T2 can be obtained by counting the materials of the strong point light source scene image.
It can be seen that after the scene is identified as the strong point light source scene according to the first, second and third conditions, the image brightness value can be used for focusing, and the focus motor is moved to find the point where the image brightness value is the minimum, which is the clear point of the strong point light source scene.
It should be noted that in the embodiment of the present disclosure, for a scene that is not low-illuminance, an intense point light source scene and an ordinary highlight scene are further divided, and for the intense point light source scene, a focusing scheme when the image brightness value is minimum is adopted, and for the ordinary highlight scene, autofocusing is performed according to the sharpness evaluation value of the high-frequency component in the captured image.
In the case of the related technical steps provided in the first, second and third embodiments, those skilled in the art may combine and implement the related technical steps to obtain a new technical solution without conflict.
Example four
Fig. 9 is a schematic structural diagram of an autofocus apparatus according to a fourth embodiment of the present invention, which is applicable to a case where autofocus is performed on a captured image based on a result of determination of a scene. As shown in fig. 9, the apparatus includes:
a low-illumination scene determining module 910, configured to obtain picture parameter information in a captured image, and determine whether a scene of the captured image is a low-illumination scene according to the picture parameter information;
a low-illumination point light source scene determining module 920, configured to determine whether a scene of the captured image is a low-illumination point light source scene according to distribution of high light points in the captured image if the scene is a low-illumination point light source scene;
and a low-illumination point light source scene focusing module 930, configured to perform auto focusing according to the image with the brightness suppressed, if the low-illumination point light source scene is a low-illumination point light source scene.
The embodiment of the invention determines whether the shot image is a low-illumination scene or not based on the picture parameter information in the shot image, determines whether the shot image is a low-illumination point light source scene in the low-illumination scene or not according to the distribution of high-brightness points in the shot image when the shot image is determined to be the low-illumination scene, inhibits the high-brightness points of the shot image if the shot image is determined to be the low-illumination point light source scene, and performs automatic focusing according to the inhibited image. The method and the device realize targeted focusing according to the recognition result of the scene, improve the recognition accuracy of the low-illumination point light source scene, further improve the focusing accuracy of the low-illumination point light source scene, and solve the focusing problem in the low-illumination point light source scene.
Optionally, the low-illumination point light source scene determination module is specifically configured to: carrying out blocking processing on the shot image to obtain at least two blocking areas;
determining the proportion of pixel points with brightness values larger than a preset highlight threshold value in each block area to the total pixel points in the block area to obtain the highlight proportion of each block area;
determining highlight point focusing influence parameters of the shot image according to the highlight point proportion of each block area and a predetermined highlight point influence weight; wherein the highlight point impact weight is determined according to a focus weight;
and if the highlight point focusing influence parameter is larger than a preset focusing influence parameter threshold value, determining that the scene of the shot image is a low-illumination point light source scene.
Optionally, the low-illumination point light source scene focusing module is specifically configured to:
determining a suppression brightness value of the pixel points of which the brightness values are greater than a preset brightness suppression threshold value in the shot image according to a preset suppression proportion to obtain an image with suppressed brightness;
and carrying out automatic focusing according to the definition evaluation value of the low-frequency component in the image after the brightness suppression.
Optionally, the picture parameter information includes a luminance statistical result and a picture gain parameter in the automatic exposure statistical information;
correspondingly, the low-illumination scene judging module comprises:
and if the brightness statistical result is smaller than a preset low-illumination threshold value and the picture gain parameter is larger than a preset gain threshold value, determining that the scene of the shot image is a low-illumination scene.
Optionally, the picture parameter information includes a brightness value of each pixel:
correspondingly, the device further comprises a strong point light source scene judging module, which is used for determining whether the shot image scene is a strong point light source scene according to the distribution condition of the brightness values of all the pixel points in the shot image before determining whether the shot image scene is a low-illumination scene according to the picture parameter information;
and if the scene is a strong point light source scene, determining that the focusing is successful when the image brightness value of the shot image is minimum.
Optionally, the low-illumination scene determination module further includes a highlight scene focusing unit, and is specifically configured to:
and if the scene is not the low-illumination scene, determining that the scene of the shot image is a highlight scene, and automatically focusing according to the definition evaluation value of the high-frequency component in the shot image.
Optionally, the low-illumination point light source scene determining module further includes a low-illumination conventional scene focusing unit, specifically configured to:
and if the scene is not a low-illumination point light source scene, determining that the scene of the shot image is a low-illumination conventional scene, and performing automatic focusing according to the definition evaluation value of the low-frequency components in the shot image.
In some exemplary embodiments, the strong point light source scene determining module is further configured to determine whether the captured image scene is a strong point light source scene according to a distribution of luminance values of each pixel point in the captured image when it is determined that the captured image scene is not a low-illumination scene.
In some exemplary embodiments, the apparatus further includes an intense point light source scene focusing module, configured to determine that focusing succeeds when an image brightness value of the captured image is minimum when the scene is determined to be an intense point light source scene.
In some exemplary embodiments, the apparatus further includes a normal highlight scene focusing module, configured to determine that the scene of the captured image is a normal highlight scene when it is determined that the scene is not a highlight light source scene, and perform auto focusing according to a sharpness evaluation value of a high-frequency component in the captured image.
In some exemplary embodiments, the strong point light source scene determining module is further configured to determine luminance value statistical data according to luminance values of pixel points in the captured image; judging that a strong point light source condition is met according to the statistical data of the brightness values, and determining that the shot image scene is a strong point light source scene;
the brightness value statistical data represents each brightness value and the number of pixel points included in each brightness value.
In some exemplary embodiments, the strong point light source condition comprises condition one; or, condition one and condition two; or, condition one and condition three; or, condition one, condition two, and condition three. Wherein, the conditions I, II and III are described in the third embodiment.
In some exemplary embodiments, the strong point light source scene determining module is further configured to perform filtering processing on the captured image, and perform normalization processing on a brightness value of the filtered image; and determining the brightness value statistical data according to the brightness value of each pixel point in the image after normalization processing.
The automatic focusing device provided by the embodiment of the invention can execute the automatic focusing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the automatic focusing method.
EXAMPLE five
Fig. 10 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 10 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in FIG. 10, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, and a bus 18 that couples various system components including the system memory device 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system storage 28 may include computer system readable media in the form of volatile storage, such as Random Access Memory (RAM)30 and/or cache storage 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, and commonly referred to as a "hard drive"). Although not shown in FIG. 10, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Storage 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 10, the network adapter 20 communicates with the other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 10, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system storage device 28, for example, to implement the auto-focusing method provided by the embodiment of the present invention, including:
acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information;
if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image;
and if the scene is a low-illumination point light source scene, carrying out automatic focusing according to the image subjected to brightness suppression on the shot image.
EXAMPLE six
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an auto-focusing method provided in an embodiment of the present invention, where the computer program includes:
acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information;
if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image;
and if the scene is a low-illumination point light source scene, carrying out automatic focusing according to the image subjected to brightness suppression on the shot image.
It can be seen that the automatic focusing scheme provided by the embodiment of the present disclosure provides a corresponding automatic focusing scheme on the basis of accurately identifying a scene, so as to solve the defects of the automatic focusing scheme in the related video monitoring scheme in the night environment, and improve the accuracy of the automatic focusing of the zoom lens.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (15)

1. An auto-focusing method, comprising,
acquiring picture parameter information in a shot image, and determining whether a scene of the shot image is a low-illumination scene according to the picture parameter information;
if the scene is a low-illumination scene, determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image;
and if the scene is a low-illumination point light source scene, carrying out automatic focusing according to the image subjected to brightness suppression on the shot image.
2. The method of claim 1,
the determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image comprises the following steps:
carrying out blocking processing on the shot image to obtain at least two blocking areas;
determining the proportion of pixel points with brightness values larger than a preset highlight threshold value in each block area to the total pixel points in the block area to obtain the highlight proportion of each block area;
determining highlight point focusing influence parameters of the shot image according to the highlight point proportion of each block area and a predetermined highlight point influence weight; wherein the highlight point impact weight is determined according to a focus weight;
and if the highlight point focusing influence parameter is larger than a preset focusing influence parameter threshold value, determining that the scene of the shot image is a low-illumination point light source scene.
3. The method of claim 1,
the automatic focusing according to the image subjected to brightness suppression on the shot image comprises the following steps:
determining a suppression brightness value of the pixel points of which the brightness values are greater than a preset brightness suppression threshold value in the shot image according to a preset suppression proportion to obtain an image with suppressed brightness;
and carrying out automatic focusing according to the definition evaluation value of the low-frequency component in the image after the brightness suppression.
4. The method according to any one of claims 1 to 3,
the picture parameter information comprises a brightness statistical result and a picture gain parameter in the automatic exposure statistical information;
the determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information includes:
and if the brightness statistical result is smaller than a preset low-illumination threshold value and the picture gain parameter is larger than a preset gain threshold value, determining that the scene of the shot image is a low-illumination scene.
5. The method of claim 1,
the picture parameter information comprises the brightness value of each pixel point;
before determining whether the scene of the photographed image is a low-illuminance scene according to the picture parameter information, the method further includes:
determining whether the shot image scene is a strong point light source scene according to the distribution condition of the brightness values of all the pixel points in the shot image;
and if the scene is a strong point light source scene, determining that the focusing is successful when the image brightness value of the shot image is minimum.
6. The method of claim 1,
after determining whether the scene of the photographed image is a low-illumination scene according to the picture parameter information, the method further includes:
and if the scene is not the low-illumination scene, determining that the scene of the shot image is a highlight scene, and automatically focusing according to the definition evaluation value of the high-frequency component in the shot image.
7. The method of claim 1,
after determining whether the scene of the shot image is a low-illumination point light source scene according to the distribution of the high-brightness points in the shot image, the method further comprises the following steps:
and if the scene is not a low-illumination point light source scene, determining that the scene of the shot image is a low-illumination conventional scene, and performing automatic focusing according to the definition evaluation value of the low-frequency components in the shot image.
8. The method of claim 1,
the picture parameter information comprises the brightness value of each pixel point;
after determining whether the scene of the photographed image is a low-illumination scene according to the picture parameter information, the method further includes:
judging whether the scene is a low-illumination scene, and determining whether the scene is a strong-point light source scene according to the distribution condition of the brightness values of all the pixel points in the shot image;
and if the scene is judged to be a strong point light source scene, determining that the focusing is successful when the image brightness value of the shot image is minimum.
9. The method of claim 8,
after determining whether the shot image scene is a strong point light source scene according to the distribution condition of the brightness values of the pixels in the shot image, the method further comprises the following steps:
and if the scene is not the strong point light source scene, determining that the scene of the shot image is a common highlight scene, and carrying out automatic focusing according to the definition evaluation value of the high-frequency component in the shot image.
10. The method of claim 5 or 8,
determining whether the shot image scene is a strong point light source scene according to the distribution condition of the brightness values of the pixels in the shot image, including:
determining brightness value statistical data according to the brightness value of each pixel point in the shot image; the brightness value statistical data embody the quantity of each brightness value and the pixel points included by each brightness value;
judging that a strong point light source condition is met according to the statistical data of the brightness values, and determining that the shot image scene is a strong point light source scene;
wherein, the judging that the strong point light source condition is satisfied comprises:
according to the brightness value statistical data, selecting the brightness value statistical data with the brightness value smaller than a first brightness threshold value to form non-highlight area statistical data;
and judging that the statistical data of the non-highlight areas are distributed in a positive skewness mode, and determining that the skewness is greater than or equal to a first skewness threshold value, so that the strong point light source condition is met.
11. The method of claim 10,
the judging that the strong point light source condition is met further comprises:
calculating a standard deviation of the luminance value statistical data;
judging that the standard deviation is greater than or equal to a first standard deviation threshold value, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold value, and determining that the strong point light source condition is met;
alternatively, the first and second electrodes may be,
the judging that the strong point light source condition is met further comprises:
calculating the proportion of the number of pixels with the brightness values larger than or equal to a first brightness threshold value to the total pixels in the shot image according to the brightness value statistical data;
judging that the proportion is greater than or equal to a first proportion threshold value, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold value, and determining that the strong point light source condition is met;
alternatively, the first and second electrodes may be,
the judging that the strong point light source condition is met further comprises:
calculating a standard deviation of the luminance value statistical data;
calculating the proportion of the number of pixels with the brightness values larger than or equal to a first brightness threshold value to the total pixels in the shot image according to the brightness value statistical data;
and judging that the standard deviation is greater than or equal to a first standard deviation threshold, the proportion is greater than or equal to a first proportion threshold, the statistical data of the non-highlight area are distributed in a positive skewness mode, and the skewness is greater than or equal to a first skewness threshold, and determining that the strong point light source condition is met.
12. The method of claim 10,
the determining the brightness value statistical data according to the brightness value of each pixel point in the shot image comprises:
filtering the shot image, and performing brightness value normalization processing on the filtered image;
and determining the brightness value statistical data according to the brightness value of each pixel point in the image after normalization processing.
13. An auto-focusing device, comprising:
the low-illumination scene judging module is used for acquiring picture parameter information in a shot image and determining whether the scene of the shot image is a low-illumination scene according to the picture parameter information;
the low-illumination point light source scene judging module is used for determining whether the scene of the shot image is a low-illumination point light source scene or not according to the distribution of the high-brightness points in the shot image if the scene is a low-illumination scene;
and the low-illumination point light source scene focusing module is used for automatically focusing the shot image according to the image subjected to brightness suppression if the shot image is a low-illumination point light source scene.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the autofocus method of any of claims 1-12.
15. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the autofocus method of any one of claims 1 to 12.
CN202110558827.4A 2020-12-30 2021-05-21 Automatic focusing method and device, electronic equipment and storage medium Pending CN113163123A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020116132523 2020-12-30
CN202011613252 2020-12-30

Publications (1)

Publication Number Publication Date
CN113163123A true CN113163123A (en) 2021-07-23

Family

ID=76877292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110558827.4A Pending CN113163123A (en) 2020-12-30 2021-05-21 Automatic focusing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113163123A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810603A (en) * 2021-08-12 2021-12-17 荣耀终端有限公司 Point light source image detection method and electronic equipment
CN114022484A (en) * 2022-01-10 2022-02-08 深圳金三立视频科技股份有限公司 Image definition value calculation method and terminal for point light source scene
CN114363532A (en) * 2021-12-02 2022-04-15 浙江大华技术股份有限公司 Focusing method and related device
CN114615439A (en) * 2022-03-08 2022-06-10 北京有竹居网络技术有限公司 Exposure statistical method and device, electronic equipment and medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810603A (en) * 2021-08-12 2021-12-17 荣耀终端有限公司 Point light source image detection method and electronic equipment
CN114363532A (en) * 2021-12-02 2022-04-15 浙江大华技术股份有限公司 Focusing method and related device
CN114022484A (en) * 2022-01-10 2022-02-08 深圳金三立视频科技股份有限公司 Image definition value calculation method and terminal for point light source scene
CN114022484B (en) * 2022-01-10 2022-04-29 深圳金三立视频科技股份有限公司 Image definition value calculation method and terminal for point light source scene
CN114615439A (en) * 2022-03-08 2022-06-10 北京有竹居网络技术有限公司 Exposure statistical method and device, electronic equipment and medium
CN114615439B (en) * 2022-03-08 2024-03-05 北京有竹居网络技术有限公司 Exposure statistical method, device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN113163123A (en) Automatic focusing method and device, electronic equipment and storage medium
CN108322646B (en) Image processing method, image processing device, storage medium and electronic equipment
US7916173B2 (en) Method for detecting and selecting good quality image frames from video
CN110248112B (en) Exposure control method of image sensor
CN111028190A (en) Image processing method, image processing device, storage medium and electronic equipment
CN108289173B (en) Camera shooting control method and device, terminal equipment and storage medium
CN111368587B (en) Scene detection method, device, terminal equipment and computer readable storage medium
CN112601008B (en) Camera switching method, terminal, device and computer readable storage medium
US11836903B2 (en) Subject recognition method, electronic device, and computer readable storage medium
CN111369471A (en) Image processing method, device, equipment and storage medium
CN112653845B (en) Exposure control method, exposure control device, electronic equipment and readable storage medium
CN114418879A (en) Image processing method, image processing device, electronic equipment and storage medium
CN115082350A (en) Stroboscopic image processing method and device, electronic device and readable storage medium
CN114004850A (en) Sky segmentation method, image defogging method, electronic device and storage medium
CN111212238A (en) Contrast focusing method, system, equipment and storage medium under point light source scene
CN111970501A (en) Pure color scene AE color processing method and device, electronic equipment and storage medium
CN112733827B (en) License plate recognition method and device, electronic equipment and storage medium
CN112291481B (en) Exposure automatic adjusting method and device, electronic equipment and storage medium
CN112183158B (en) Cereal type identification method of cereal cooking equipment and cereal cooking equipment
CN111754410B (en) Image processing method and device, electronic equipment and readable storage medium
CN111161211A (en) Image detection method and device
CN115720296A (en) Method for acquiring shot picture, electronic equipment and storage medium
CN111833376A (en) Target tracking system and method
CN112822410B (en) Focusing method, focusing device, electronic device and storage medium
TWI792454B (en) Adaptive image shading correction method and image shading correction system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination