CN108668086B - Automatic focusing method and device, storage medium and terminal - Google Patents

Automatic focusing method and device, storage medium and terminal Download PDF

Info

Publication number
CN108668086B
CN108668086B CN201810935373.6A CN201810935373A CN108668086B CN 108668086 B CN108668086 B CN 108668086B CN 201810935373 A CN201810935373 A CN 201810935373A CN 108668086 B CN108668086 B CN 108668086B
Authority
CN
China
Prior art keywords
focusing
area
shooting
shooting target
focusing area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810935373.6A
Other languages
Chinese (zh)
Other versions
CN108668086A (en
Inventor
张弓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810935373.6A priority Critical patent/CN108668086B/en
Publication of CN108668086A publication Critical patent/CN108668086A/en
Application granted granted Critical
Publication of CN108668086B publication Critical patent/CN108668086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Studio Devices (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

The embodiment of the application discloses an automatic focusing method, an automatic focusing device, a storage medium and a terminal, wherein the method comprises the following steps: carrying out focusing area division on a shooting visual field, and determining a preset grading range of each focusing area; determining a focusing area where a shooting target is located in the obtained shooting image; carrying out quality scoring on a focusing area where the shooting target is located; and if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again. The efficiency and accuracy of automatic focusing can be improved.

Description

Automatic focusing method and device, storage medium and terminal
Technical Field
The embodiment of the application relates to the technical field of mobile terminals, in particular to an automatic focusing method, an automatic focusing device, a storage medium and a terminal.
Background
At present, the photographing function becomes a standard configuration of most terminal devices, and a terminal user can easily and quickly realize photographing operation through a portable mobile terminal.
The development of terminal equipment is more and more intelligent, and in order to improve the definition of shooting images, common terminal equipment can focus to the shooting target automatically. However, the real-time performance of the automatic focusing of the terminal device is poor, the inaccuracy of the current focusing result cannot be found in time, and the original focusing parameters are still used for image acquisition, so that the problem of out-of-focus of the shot image is caused, and improvement is urgently needed.
Disclosure of Invention
An object of the embodiments of the present application is to provide an auto-focusing method, an auto-focusing device, a storage medium, and a terminal, which can improve the efficiency and accuracy of auto-focusing.
In a first aspect, an embodiment of the present application provides an auto-focusing method, including:
carrying out focusing area division on a shooting visual field, and determining a preset grading range of each focusing area;
determining a focusing area where a shooting target is located in the obtained shooting image;
carrying out quality scoring on a focusing area where the shooting target is located;
and if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
In a second aspect, an embodiment of the present application provides an automatic focusing apparatus, including:
the area division module is used for carrying out focusing area division on the shooting visual field;
the scoring range determining module is used for determining the preset scoring range of each focusing region divided by the region dividing module;
the area determining module is used for determining a focusing area where a shooting target is located in the obtained shooting image;
the quality scoring module is used for performing quality scoring on the focusing area where the shooting target is located, which is determined by the area determining module;
and the focusing module is used for carrying out focusing operation on the shooting target again if the quality score of the quality scoring module does not meet the preset scoring range of the focusing area where the shooting target is located.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the program, when executed by a processor, implements an auto-focusing method as shown in the first aspect.
In a fourth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the auto-focusing method according to the first aspect when executing the computer program.
According to the automatic focusing scheme provided by the embodiment of the application, firstly, focusing areas of a shooting view are divided, and a preset grading range of each focusing area is determined; secondly, determining a focusing area where a shooting target is located in the obtained shooting image; thirdly, performing quality scoring on the focusing area where the shooting target is located; and finally, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, the shooting target is focused again, and the automatic focusing efficiency and accuracy can be improved.
Drawings
Fig. 1 is a schematic flowchart of an auto-focusing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another auto-focusing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another auto-focusing method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another auto-focusing method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another auto-focusing method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another auto-focusing method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an automatic focusing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
At present, the photographing function becomes a standard configuration of most mobile terminals, and a terminal user can easily and quickly realize photographing operation through a portable terminal device. The development of terminal equipment is more and more intelligent, and in order to improve the definition of shooting the image, common terminal equipment can focus to shooting the image automatically. However, the real-time performance of the terminal device for automatic focusing is poor, for example, if the position of the shooting target changes, the focusing result at this time is not accurate, but the terminal device cannot find the inaccuracy of the current focusing result in time, and still uses the original focusing parameters to collect the image, so that the problem of out-of-focus of the shot image is caused, and improvement is urgently needed.
The embodiment of the application provides an automatic focusing method, which can divide a shooting field into a plurality of focusing areas before shooting, determine a preset grading range of each focusing area, determine a focusing area where a shooting target is located during shooting, judge whether the quality grading of the focusing area meets the preset grading range corresponding to the focusing area, and refocus the shooting target if the quality grading of the focusing area does not meet the preset grading range corresponding to the focusing area, so that the focusing operation is simplified, and the focusing efficiency and accuracy are improved. The specific scheme is as follows:
fig. 1 is a schematic flow diagram of an auto-focusing method provided in an embodiment of the present application, where the method is used for a situation that a terminal device performs auto-focusing on a shooting target in a process of starting a camera to shoot, and the method may be executed by a terminal device with an image shooting function or a mobile terminal installed with an image shooting application program, where the mobile terminal may be a smart phone, a tablet computer, a wearable device, a notebook computer, and the method specifically includes the following steps:
and 110, dividing focusing areas of the shooting visual field, and determining a preset grading range of each focusing area.
The shooting field of view may be the maximum range that can be shot by a camera on the terminal device, and the size of the shooting field of view is determined by the characteristics of the camera, for example, the shooting field of view of a wide-angle camera is larger than that of a telephoto camera. The preset scoring range is determined according to the shooting results of the focused different areas after synchronously focusing and shooting the different areas of the shooting visual field by at least two cameras in advance, and is used for measuring whether the quality of a shooting target in an image meets the requirement or not, namely whether focusing operation needs to be carried out again or not.
In the embodiment of the present application, the focusing area of the shooting visual field may be divided according to a certain division rule, and the specific division rule is not limited in the present application, and the shooting visual field may be divided into at least two focusing areas with the same shape and size, for example, the shooting visual field may be divided into four grid areas with the same size and the same size in a shape of Chinese character 'tian'; the focus area may be divided into at least two focus areas according to the importance degree of the area in the shooting field, for example, when the end user shoots, the shooting target is customarily placed in the central area of the shooting field, so the focus areas may be divided into a plurality of focus areas in the form of concentric circles from the center to the edge. Optionally, the shapes and sizes of the divided focusing areas may be the same or different, and this application is not limited thereto.
After the shooting field of view is divided, a preset scoring range needs to be determined for each divided focusing area. For example, when a preset scoring range corresponding to each focusing area is determined, the camera may be controlled to perform focusing shooting on the focusing area; then, the focusing shooting result (such as definition, contrast, white balance, brightness value and the like) of the focusing area is analyzed, and a preset grading range is set for the shooting quality of the focusing area. According to the embodiment of the application, the operation of focusing shooting and determining the preset scoring range is performed on each divided focusing area, and compared with the operation of fixing one preset scoring range, the shooting quality of each focusing area can be accurately shown, so that the accuracy of judging whether the shooting target is focused successfully is improved.
And step 120, determining a focusing area where the shooting target is located in the obtained shooting image.
For example, in the photographing mode, the acquiring of the photographed image may be, in the image preview stage, after the camera completes automatic focusing, acquiring the photographed image according to the focusing parameter determined after the current automatic focusing. In the shooting mode, a shot image can be acquired every preset image frame number according to the focusing parameter used when the previous frame image is acquired. Alternatively, the preset image frame number may be 0, that is, a shot image is acquired once for each frame image, or may be a value greater than 0, for example, a shot image is acquired once every 3 frames. After the captured image is acquired, a focusing area where the capture target is located is determined, wherein the focusing area refers to one or more areas obtained by dividing the focusing area of the capture field of view in step S110.
Optionally, when the focusing area where the shooting target is located is determined, the area where the shooting target is located may be determined first, and then the focusing area where the shooting target is located may be determined according to the area where the shooting target is located. Wherein, the area where the shooting target is located is contained in one or more focusing areas. Specifically, the determination of the region where the photographic target is located may be a position range where the photographic target is located in the acquired photographic image. In the embodiment of the application, there are many methods for determining the area where the shooting target is located, which may be to extract the edge profile of the shooting target, and take the area surrounded by the edge profile as the area where the shooting target is located; it may be determined which of a plurality of focus regions into which the photographing field of view is divided in advance is the photographing target. When the area where the photographing target is located is determined, the center position of the photographing target may be determined, and then an area within a preset range of the center position may be used as the area where the photographing target is located, for example, a range of 10 × 10 pixels around the center position of the photographing target may be used as the area where the photographing target is located. Optionally, the specific preset range may be changed according to the size of the shot object, and may be manually adjusted by the terminal user as required, or the size of the preset range may be automatically changed by the system according to the detection of the shot object. After the area where the photographic target is located is determined, a focusing area including the area where the photographic target is located is determined as a focusing area where the photographic target is located among the plurality of focusing areas divided in step S110. For example, the shooting field of view is divided into four focusing areas in a shape of a Chinese character 'tian', and if the shooting target falls in the upper left focusing area in the shape of the Chinese character 'tian', the upper left focusing area in the shape of the Chinese character 'tian' is used as the focusing area where the shooting target is located in the shot image.
And step 130, performing quality grading on the focusing area where the shooting target is located.
The quality score can be an evaluation score for the shooting effect of the focusing area where the shooting target is located.
In the embodiment of the present application, the quality scoring of the focusing area where the shooting target is located may be performed based on statistical characteristics of the focusing area where the shooting target is located, specifically, the quality scoring may be performed based on a pixel mean value, a standard deviation, and an average gradient of the area where the shooting target is located. The average value reflects the average brightness of a focusing area where a shooting target is located, and the larger the average value is in a certain range, the higher the quality score is; the average brightness standard deviation reflects the discrete degree of the gray value in a focusing area where the shooting target is located relative to the average value, and the standard deviation is larger in a certain range, so that the quality score is higher; the average gradient reflects the definition of a focusing area where the shooting target is located, and the larger the average gradient is in a certain range, the higher the definition is, and the higher the corresponding quality score is. Or analyzing from the angle of one or more quality parameters such as definition, contrast, white balance and the like of the focusing area where the shooting target is located, and performing quality scoring or weighted quality scoring by combining the analysis results of multiple angles, for example, designing a scoring system corresponding to each quality parameter and completing quality scoring of the focusing area where the shooting target is located by combining the scoring systems of the quality parameters.
And 140, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
In the embodiment of the application, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, it is indicated that the shooting effect of the area where the shooting target is located in the shot image does not meet the requirement, that is, the image is shot under the condition that the shooting target is out of focus, focusing operation needs to be performed on the shooting target again, if the quality score meets the preset score range of the focusing area where the shooting target is located, it is indicated that the shooting effect of the area where the shooting target is located in the shot image meets the requirement, focusing is accurate, and shooting can be continuously performed by using the focusing parameter.
According to the embodiment of the application, the preset scoring range is set for each focusing area, the preset scoring range of each focusing area can be set by combining the characteristics of the area in the focusing state, and compared with the method that all focusing areas use the fixed scoring range to evaluate the quality score of the focusing area where the shooting target is located, whether the shooting target is in the focusing state or not can be judged more accurately.
It should be noted that the method for refocusing the shooting target in the embodiment of the present application is not limited, and may be any automatic focusing method in the art. For example, the distance between the shooting target and the terminal device is measured by using ultrasonic waves, a distance sensor, or at least two cameras, and then automatic focusing is performed according to the distance between the shooting target and the terminal device.
According to the automatic focusing method provided by the embodiment of the application, firstly, focusing areas of a shooting view are divided, and a preset grading range of each focusing area is determined; secondly, determining a focusing area where a shooting target is located in the obtained shooting image; thirdly, performing quality scoring on a focusing area where the shooting target is located; and finally, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, the shooting target is focused again.
Fig. 2 is a schematic flow chart of another auto-focusing method provided in an embodiment of the present application, which is used to further describe the above embodiment, and includes:
and step 210, determining a division rule of the focusing area according to the proportion of the shooting target in the shooting visual field.
For example, the division may be performed according to a certain division rule when the shooting view field is divided, where the division rule may be determined according to a ratio of the shooting target in the shooting view field, for example, the division rule may be a division rule in which multiple specifications are preset, for example, if the shooting view field size is 100 × 200 pixels, the division rule may be preset into multiple specifications such as 10 × 10 pixels, 50 × 50 pixels, 100 × 100 pixels, and the like, each specification corresponds to a ratio of the shooting target in the shooting view field, for example, a ratio of the shooting target corresponding to the division rule of 10 × 10 pixels in the shooting view field is 1% to 20%; the proportion of the shooting targets corresponding to the division rule of 100 × 100 pixels in the shooting visual field is more than 40%. The division rule may be determined by calculating the proportion of the shooting target in the shooting field of view, calculating the area occupied by the shooting target according to the proportion, and then enlarging the area in proportion to serve as the division reference area of the division rule. For example, if the ratio of the imaging target in the imaging field of view is 20% and the imaging field of view is 100 × 200 pixels, the area of the imaging target is 4000 pixels, and the area of the imaging target is increased by 25% by 4000 pixels and then 5000 pixels is used as the division reference area of the current division rule.
Optionally, after the division reference area of the division rule is determined according to the proportion of the shooting target in the shooting view, optionally, the division rule can be further perfected by combining the shape characteristic of the shooting target, for example, the shooting target is divided into three types, namely a rectangle, a square and a circle according to the shape characteristic of the shooting target, when the division rule is determined, the division reference area of the division rule can be determined according to the proportion of the shooting target in the shooting view, and the division shape of the division rule is determined according to the shape characteristic of the shooting target.
In the embodiment of the application, the division rule of the focusing area is determined according to the proportion of the shooting target in the shooting visual field, so that the accuracy of the division of the shooting visual field can be ensured, and the condition that automatic focusing is inaccurate due to too large or too small division of the focusing area when the focusing area is divided is avoided.
And step 220, dividing the shooting view into at least two focusing areas according to the division rule of the focusing areas.
Illustratively, the division rule includes a detailed description of how to divide the shooting visual field, and the shooting visual field can be divided into at least two focusing areas according to the division rule. For example, when the ratio of the imaging target in the imaging field of view is 45%, and the ratio of the imaging target in the imaging field of view is 40% or more in accordance with the division rule, and the imaging field of view is divided in accordance with the specification of 100 × 100 pixels, the imaging field of view is divided into 2 focusing regions of 100 × 100 pixels by 100 × 200 pixels. For another example, if the imaging target accounts for 20% of the imaging field of view having a size of 100 × 200 pixels, the imaging target has an area of 4000 pixels, is expanded by 25% to 5000 pixels, and has a circular shape, the imaging field of view can be divided into concentric circles, wherein the area of the first circle is 5000 pixels, and the area of each of the subsequent concentric circles is increased by 5000 pixels compared to the previous circle.
And step 230, determining a preset scoring range of each focusing area.
And 240, determining a focusing area where the shooting target is located in the obtained shooting image.
And step 250, performing quality scoring on the focusing area where the shooting target is located.
And step 260, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
The automatic focusing method provided by the embodiment of the application can determine the division rule according to the proportion of the shooting target in the shooting field to divide the shooting field before shooting, and determine the preset scoring range of each divided focusing area, firstly determine the focusing area where the shooting target is located during shooting, judge whether the quality scoring of the focusing area meets the preset scoring range corresponding to the focusing area, and refocus the shooting target if the quality scoring of the focusing area does not meet the preset scoring range corresponding to the focusing area, so that the divided focusing area is more reasonable, and the focusing efficiency and accuracy are further improved.
Fig. 3 is a schematic flowchart of another auto-focusing method provided in an embodiment of the present application, which is used to further describe the above embodiment, and includes:
and 310, dividing a focusing area of a shooting visual field.
And step 320, controlling the camera to carry out focusing shooting on each focusing area.
Illustratively, after the focusing area division is carried out on the shooting visual field, the camera in the terminal equipment is controlled to carry out focusing shooting on each divided focusing area in sequence. The specific focusing shooting method is not limited in this application, and may be a focusing shooting method commonly used by those skilled in the art, for example, a distance between a shooting target and a terminal device is measured by commonly using ultrasonic waves, a distance sensor, or at least two cameras, and then automatic focusing is performed according to the distance between the shooting target and the terminal device, and the like.
Optionally, in order to improve the focusing and shooting efficiency, when the cameras are controlled to perform focusing and shooting on each focusing area, at least two cameras may be simultaneously controlled to perform focusing operation on the divided focusing areas, for example, if 10 focusing areas are divided, two cameras may be simultaneously controlled to perform focusing and shooting on each pair of 5 focusing areas, so as to greatly shorten the focusing and shooting time. Optionally, when the plurality of cameras are used to perform focusing operation on the plurality of divided focusing areas, corresponding focusing areas may be set for the cameras according to characteristics of the cameras, for example, a focusing area at the edge of a shooting field of view is set for a wide-angle camera.
Step 330, analyzing the shooting result of each focusing area, and determining a preset scoring range of each focusing area.
Illustratively, the shooting result of each focusing area is analyzed, and the quality of the shooting result of each focusing area is scored. Optionally, the process of performing quality scoring on the shooting result of each focusing area may be the same as the process of performing quality scoring on the area where the shooting target is located in the foregoing embodiment, or other quality scoring methods may also be used, which is not limited in this application.
After the shooting results of the focusing regions are analyzed for quality scoring, the preset scoring range of each focusing region can be determined according to the quality scoring. The embodiment of the present application does not limit the manner of determining the preset scoring range of each focusing region, and the preset scoring range of the focusing region may be obtained by adding or subtracting a preset numerical value to or expanding or reducing a preset ratio from the quality score of each focusing region, for example, if the quality score of a certain focusing region is 60, the preset scoring range 55-65 of the focusing region is obtained by adding or subtracting 5 from 60.
It should be noted that the preset score range should be a specific range, and not higher is better. For example, when the quality of a captured image is measured by contrast, if the contrast is too high, the captured image may be distorted, resulting in poor results of the captured image. The best effect of the shot image can be achieved only within a certain range.
And step 340, determining a focusing area where the shooting target is located in the obtained shooting image.
And step 350, performing quality scoring on the focusing area where the shooting target is located.
And step 360, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
The automatic focusing method provided by the embodiment of the application can divide the shooting field before shooting, control the camera to carry out focusing shooting on each divided focusing area, analyze each focusing shooting result to determine the preset grading range of each focusing area, determine the focusing area where the shooting target is located during shooting, judge whether the quality grading of the focusing area meets the preset grading range corresponding to the focusing area, refocus the shooting target if the quality grading of the focusing area does not meet the preset grading range corresponding to the focusing area, determine the preset quality grading corresponding to the area according to the shooting result of each focusing area, improve the accuracy of the quality grading of the focusing area, and further improve the efficiency and the accuracy of the automatic focusing.
Fig. 4 is a schematic flow chart of another automatic focusing method provided in the embodiment of the present application, which is further described in the foregoing embodiment, and is suitable for a case where an area where a shooting target is located includes at least two focusing areas. Specifically, the method comprises the following steps:
and step 410, carrying out focusing area division on the shooting visual field, and determining a preset grading range of each focusing area.
And step 420, determining the area of the shooting target in the acquired shooting image.
And step 430, if the area where the shooting target is located comprises at least two focusing areas, combining the at least two focusing areas.
For example, if the area where the shooting target is located does not fall within one of the divided focusing areas but falls within at least two focusing areas, the at least two focusing areas are combined to obtain a new focusing area, and the new focusing area can completely contain the area where the shooting target is located. For example, the shooting field of view is divided into 4 square areas in a shape of Chinese character 'tian', and the shooting target is located at the right middle position, the area of the shooting target may include 2 square focusing areas above and below the right. The right 2 square focusing areas are merged to obtain a new focusing area which can completely contain the shooting target.
And step 440, performing quality scoring on the combined focusing area.
In the embodiment of the present application, the quality scoring may be performed on the combined focusing region by regarding the combined focusing region as a new region, and performing the quality scoring based on the statistical characteristics or the quality parameters of the combined new region. The weight value of each focus area contained in the area where the shooting target is located before combination can also be determined firstly; and determining the quality score of the combined focusing area according to the quality score and the weight value of each focusing area contained in the area where the shooting target is located before combination.
Specifically, the determination of the weight value of each focusing area included in the area where the shooting target is located before merging may be performed according to the importance degree of each part of the shooting target, where the weight value is set for each focusing area included in the area where the shooting target is located, for example, when the shooting target is a person, the shooting quality requirement for the face is higher than the shooting quality requirement for the feet of the person, and therefore, when the weight value is determined, the weight value of the focusing area where the face is located may be set higher, and the weight of the focusing area where the feet are located may be set lower. The weight value of each focusing area may also be determined according to the proportion of the shooting target in each focusing area, for example, the area where the shooting target is located includes a focusing area 1 and a focusing area 2, most of the shooting target is located in the focusing area 1, and only a small part of the shooting target is located in the focusing area 2, the weight value of the focusing area 1 is higher than that of the focusing area 2.
After the weight values of the focusing areas included in the area where the shooting target is located are determined, quality distribution needs to be performed on the shooting areas, the quality scores are combined with the weight values of the corresponding focusing areas, and the quality scores of the combined focusing areas are calculated. For example, the area where the shooting target is located includes a focusing area 1 and a focusing area 2, the quality score of the focusing area 1 is a, the weight value is a, the quality score of the focusing area 2 is B, and the weight value is B, so that the quality score obtained by combining the focusing area 1 and the focusing area 2 is a × a + B × B.
And step 450, determining a preset scoring range of the target according to preset scoring ranges corresponding to at least two focusing areas included in the area where the shooting target is located.
The target preset scoring range may be a preset scoring range corresponding to the combined focusing region. The preset scoring range corresponding to at least two focusing areas contained in the area where the shooting target is located before combination can be determined. For example, the average value of preset score ranges corresponding to at least two focusing areas included in an area where the shooting target is located before merging may be used as the target preset score range. The method may further include setting a weight value for at least two focusing areas included in an area where the shooting target is located before merging (for example, the weight value of each focusing area may be determined according to a proportion of the shooting target in each focusing area), and determining a target preset scoring range according to the weight value of each focusing area and a preset scoring range corresponding to each focusing area, for example, the area where the shooting target is located before merging includes a focusing area 1 and a focusing area 2, the weight value of the focusing area 1 is a, the preset scoring range is C, the weight value of the focusing area 2 is b, and the preset scoring range is D, so that the target preset scoring range is C × a + D × b.
And 460, if the quality score of the combined focusing area does not meet the preset score range of the target, performing focusing operation on the shooting target again.
For example, the quality score of the combined focusing area is compared with the target preset score range of the combined focusing area, whether the shooting target is shot under the focusing condition is judged, and if the shooting target is not shot under the focusing condition (that is, the target preset score range is not met), the focusing operation is performed on the shooting target again.
According to the automatic focusing method provided by the embodiment of the application, when the area where the shooting target is located comprises at least two divided focusing areas, the at least two included focusing areas are combined, the quality score of the combined focusing areas and the corresponding target preset score range are determined, whether the shooting target needs to be focused again is further judged, whether the shooting target needs to be focused again can be rapidly and accurately determined when the shooting target is dispersed in the multiple focusing areas, and the focusing efficiency and accuracy are improved.
Fig. 5 is a schematic flowchart of another auto-focusing method provided in an embodiment of the present application, which is used to further describe the above embodiment, and includes:
step 510, dividing focusing areas of the shooting visual field, and determining a preset scoring range of each focusing area.
And step 520, determining a focusing area where the shooting target is located in the acquired shooting image.
And step 530, performing quality scoring on the focusing area where the shooting target is located.
And 540, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, re-acquiring the shot image for quality score.
For example, the quality score does not satisfy the preset score range, and may not be caused by focusing inaccuracy or by external uncontrollable environmental factors. For example, when a user holds a terminal device to shoot a target, shooting is fuzzy due to hand shaking, and for example, when the user shoots a flower on a tree, the flower is blown out in a gust of wind, and the flower shakes to cause shooting to be fuzzy, the above phenomena all can cause that the quality score does not meet the preset score range of the focusing area where the shooting target is located, at this time, the automatic focusing cannot be explained to be inaccurate during shooting, but the quality score is caused by external uncontrollable environmental factors, so when the quality score does not meet the preset score range of the focusing area where the shooting target is located, the shooting target can be directly refocused, and the steps 510 to 520 are returned to be executed again, the shooting image is obtained again according to the same focusing parameters, and the quality score is performed on the focusing area where the shooting target. The quality of the shot images is graded by acquiring the shot images for multiple times, so that the shooting fuzzy phenomenon caused by external environment factors but not the shooting fuzzy phenomenon caused by inaccurate automatic focusing is eliminated, and unnecessary focusing operation is reduced. For example, if the quality score meets the preset score range of the focusing area where the shooting target is located after the shooting image is obtained again for the second time and the quality score is carried out on the focusing area where the shooting target is located, the shooting can be continuously carried out by adopting the original focusing parameters, and one time of unnecessary focusing operation is reduced.
And 550, if the quality score of the re-acquired shot image does not meet the preset score range of the focusing area where the shot target is located, performing focusing operation on the shot target again.
For example, if the quality score of the re-acquired shot image still does not meet the preset score range of the focusing area where the shot target is located, it is indicated that the reason why the quality score of the shot image does not meet the preset score range is that the shot target is out of focus, and is not caused by external uncontrollable environmental factors, and the shooting target needs to be focused again.
The automatic focusing method provided by the embodiment of the application can divide a shooting field into a plurality of focusing areas before shooting, and determine the preset scoring range of each focusing area, the focusing area where a shooting target is located is determined firstly during shooting, when the quality scoring of the focusing area does not meet the preset scoring range corresponding to the focusing area, the quality scoring and the preset scoring range corresponding to the focusing area are judged by acquiring the image of the focusing area where the shooting target is located for many times, and the shooting target is focused again if the preset scoring range corresponding to the focusing area is not met. The condition that the refocusing operation is started due to the fact that the quality score does not meet the requirement caused by external uncontrollable factors is avoided, unnecessary refocusing operation is reduced, and the efficiency and the accuracy of automatic focusing are improved.
Fig. 6 is a schematic flowchart of another auto-focusing method provided in an embodiment of the present application, which is used to further describe the above embodiment, and includes:
and step 610, carrying out focusing area division on the shooting visual field, and determining a preset grading range of each focusing area.
And step 620, determining a focusing area where the shooting target is located in the obtained shooting image.
And 630, performing quality scoring on the focusing area where the shooting target is located.
Step 640, determining whether the quality score meets a preset score range of a focusing area where the shooting target is located, if so, executing step 680, and if not, executing step 650.
In order to prevent the quality score from not meeting the preset score range of the focusing region due to the deviation determined in the focusing region where the shooting target is located, the shooting target may not be directly refocused first when the quality score does not meet the preset score range, step 640 is performed to expand the focusing region where the shooting target is located, and step 620 is performed again to perform quality score on the expanded focusing region where the shooting target is located. If the quality score of the focusing area where the shooting target is located meets the preset score range of the focusing area, step 670 is executed, and the image is still shot according to the original focusing parameters.
And 650, enlarging the focusing area where the shooting target is located, and performing quality scoring again.
Optionally, there are many ways to expand the focus area of the shooting target, and the present application is not limited thereto, for example, the area of the shooting target surrounded by the edge of the shooting target may be expanded by a preset range (for example, 10 pixels are expanded from top to bottom and from left to right) on the original basis to obtain the expanded area of the shooting target, and then the expanded focus area of the shooting target is determined according to the expanded area of the shooting target. Or combining the focusing area where the original shooting target is located and at least one sub-focusing area adjacent to the focusing area to form an expanded area where the shooting target is located. For example, when the shooting field of view is divided into a plurality of focusing areas in the form of concentric circles from the center to the edge, assuming that the focusing area where the shooting target is located determined in step 610 is the area where the first concentric circle is located at the center, when the area where the shooting target is located is expanded, the first concentric circle and the second concentric circle may be merged, and the focusing area where the two merged concentric circles are located may be used as the expanded focusing area where the shooting target is located.
In the embodiment of the present application, after the area where the shooting target is located is enlarged, step 620 is performed again, and quality scoring is performed on the focus area where the enlarged shooting target is located.
Step 660, determining whether the expanded preset scoring range of the focusing region is satisfied after the quality scoring is performed again, if so, performing step 680, and if not, performing step 670.
The expanded focusing area comprises an original focusing area and a newly added focusing area, so that the preset scoring range of the expanded focusing area can be determined according to the preset scoring ranges of the original focusing area and the newly added focusing area, a specific determination method is not limited by the application, the average value of the original focusing area and the newly added focusing area can be used as the preset scoring range of the expanded focusing area, the weight values can be set for the original focusing area and the newly added focusing area, and the preset scoring range of the original focusing area and the weight values of the original focusing area and the newly added focusing area are combined to calculate the preset scoring range of the expanded focusing area.
For example, if the quality score of the focusing area where the shooting target is located after the range is expanded still does not meet the preset score range of the expanded focusing area, it is indicated that the reason why the shooting image quality score does not meet the preset score range is that the shooting target is out of focus, and it is not that the area where the shooting target is located is determined to have a deviation, and step 660 needs to be executed to perform focusing operation on the shooting target again. If the quality score of the focusing area where the shooting target is located after the range is expanded meets the preset score range of the expanded focusing area, it is indicated that the automatic focusing of the shooting target is accurate, and if the image quality score does not meet the requirement, it is determined that the focusing area where the shooting target is located is deviated, and then step 670 is executed to perform image shooting with the original focusing parameters.
And step 670, carrying out focusing operation on the shooting target again.
And step 680, shooting the image by using the original focusing parameters.
The automatic focusing method provided by the embodiment of the application can divide a shooting field into a plurality of focusing areas before shooting, determine the preset scoring range of each focusing area, determine the focusing area where a shooting target is located when shooting, expand the focusing area where the shooting target is located to perform quality scoring again when the quality scoring of the focusing area does not meet the preset scoring range corresponding to the focusing area, compare the quality scoring with the expanded preset scoring range of the focusing area, and perform focusing again if the quality scoring still does not meet the expanded preset scoring range of the focusing area. The situation that the refocusing operation is started due to the fact that the determined focusing area of the shooting target has deviation is avoided, unnecessary refocusing operation is reduced, and focusing efficiency and accuracy are improved.
Fig. 7 is a schematic structural diagram of an auto-focusing apparatus according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus includes: the system comprises a region dividing module 710, a scoring range determining module 720, a region determining module 730, a quality scoring module 740 and a focusing module 750.
A region division module 710, configured to perform focusing region division on a shooting field of view;
a scoring range determining module 720, configured to determine a preset scoring range of each focus region divided by the region dividing module 710;
the area determining module 730 is configured to determine a focusing area where the shooting target is located in the obtained shooting image;
a quality scoring module 740, configured to perform quality scoring on the focusing area where the shooting target is located, where the focusing area is determined by the area determining module 730;
the focusing module 750 is configured to perform focusing operation on the shooting target again if the quality score of the quality scoring module 740 does not meet the preset scoring range of the focusing area where the shooting target is located.
Further, the area division module 710 is configured to determine a division rule of the focusing area according to a proportion of the shooting target in the shooting field of view; and dividing the shooting visual field into at least two focusing areas according to the division rule of the focusing areas.
Further, the scoring range determining module 720 is configured to control the camera to perform focusing shooting on each focusing area; and analyzing the shooting result of each focusing area, and determining the preset grading range of each focusing area.
Further, the quality scoring module 740 is further configured to, if the area where the shooting target is located includes at least two focusing areas, merge the at least two focusing areas;
performing quality scoring on the combined focusing area;
correspondingly, the focusing module 750 is configured to determine a preset target scoring range according to preset scoring ranges corresponding to at least two focusing areas included in the area where the shooting target is located;
and if the quality score of the combined focusing area does not meet the preset target score range, carrying out focusing operation on the shooting target again.
Further, the quality scoring module 740 is specifically configured to determine a weight value of each focus area included in the area where the shooting target is located before merging when performing quality scoring on the merged focus areas;
and determining the quality score of the combined focusing area according to the quality score and the weight value of each focusing area contained in the area where the shooting target is located before combination.
Further, the focusing module 750 is configured to, if the quality score does not meet a preset score range of a focusing area where the shooting target is located, re-acquire the shot image for quality scoring;
and if the quality score of the re-acquired shot image does not meet the preset score range of the focusing area where the shot target is located, carrying out focusing operation on the shot target again.
Further, the focusing module 750 is configured to, if the quality score does not meet a preset score range of a focusing area where the shooting target is located, enlarge the focusing area where the shooting target is located and perform quality scoring again;
and if the repeated quality scoring does not meet the preset scoring range of the enlarged focusing area, performing focusing operation on the shooting target again.
In the automatic focusing device provided in the embodiment of the present application, first, the region division module 710 performs focusing region division on a shooting view, and the score range determination module 720 determines a preset score range of each focusing region divided by the region division module 710; then, the area determining module 730 determines a focusing area where the shooting target is located in the acquired shooting image, and the quality scoring module 740 performs quality scoring on the focusing area where the shooting target is located determined by the area determining module 720; finally, the focusing module 750 performs focusing operation on the shooting target again when the quality score of the quality scoring module 740 does not meet the preset scoring range of the focusing area where the shooting target is located. According to the embodiment of the application, the shooting view field can be divided into a plurality of focusing areas before shooting, the preset scoring range of each focusing area is determined, the focusing area where the shooting target is located is determined firstly during shooting, whether the quality score of the focusing area meets the preset scoring range corresponding to the focusing area or not is judged, if not, the shooting target is refocused, the focusing operation is simplified, and the focusing efficiency and accuracy are improved.
The device can execute the methods provided by all the embodiments of the application, and has corresponding functional modules and beneficial effects for executing the methods. For details of the technology not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present application.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal may include: a housing (not shown), a memory 801, a Central Processing Unit (CPU) 802 (also called a processor, hereinafter referred to as CPU), a computer program stored in the memory 801 and operable on the processor 802, a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU802 and the memory 801 are provided on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 801 is used for storing executable program codes; the CPU802 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 801.
The terminal further comprises: peripheral interface 803, RF (Radio Frequency) circuitry 805, audio circuitry 806, speakers 811, power management chip 808, input/output (I/O) subsystem 809, touch screen 812, other input/control devices 810, and external port 804, which communicate over one or more communication buses or signal lines 807.
It should be understood that the illustrated terminal device 800 is merely one example of a terminal, and that the terminal device 800 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a terminal device provided in this embodiment, where the terminal device is a smart phone as an example.
A memory 801, the memory 801 being accessible by the CPU802, the peripheral interface 803, and the like, the memory 801 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 803, said peripheral interface 803 allowing input and output peripherals of the device to be connected to the CPU802 and the memory 801.
I/O subsystem 809, which I/O subsystem 809 may connect input and output peripherals on the device, such as touch screen 812 and other input/control devices 810, to peripheral interface 803. The I/O subsystem 809 may include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810. Where one or more input controllers 8092 receive electrical signals from or transmit electrical signals to other input/control devices 810, other input/control devices 810 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is worth noting that the input controller 8092 may be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
The touch screen 812 may be a resistive type, a capacitive type, an infrared type, or a surface acoustic wave type, according to the operating principle of the touch screen and the classification of media for transmitting information. The touch screen 812 may be classified by installation method: external hanging, internal or integral. Classified according to technical principles, the touch screen 812 may be: a vector pressure sensing technology touch screen, a resistive technology touch screen, a capacitive technology touch screen, an infrared technology touch screen, or a surface acoustic wave technology touch screen.
A touch screen 812, which touch screen 812 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like. Optionally, the touch screen 812 sends an electrical signal (e.g., an electrical signal of the touch surface) triggered by the user on the touch screen to the processor 802.
The display controller 8091 in the I/O subsystem 809 receives electrical signals from the touch screen 812 or sends electrical signals to the touch screen 812. The touch screen 812 detects a contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 812, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 812 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 805 is mainly used to establish communication between the smart speaker and a wireless network (i.e., a network side), and implement data reception and transmission between the smart speaker and the wireless network. Such as sending and receiving short messages, e-mails, etc.
The audio circuit 806 is mainly used to receive audio data from the peripheral interface 803, convert the audio data into an electric signal, and transmit the electric signal to the speaker 811.
Speaker 811 is used to convert the voice signals received by the smart speaker from the wireless network through RF circuit 805 into sound and play the sound to the user.
And the power management chip 808 is used for supplying power and managing power to the hardware connected with the CPU802, the I/O subsystem and the peripheral interface.
In this embodiment, the cpu802 is configured to:
carrying out focusing area division on a shooting visual field, and determining a preset grading range of each focusing area;
determining a focusing area where a shooting target is located in the obtained shooting image;
carrying out quality scoring on a focusing area where the shooting target is located;
and if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
Further, the dividing of the focusing area of the shooting field of view includes:
determining a division rule of a focusing area according to the proportion of a shooting target in the shooting visual field;
and dividing the shooting visual field into at least two focusing areas according to the division rule of the focusing areas.
Further, the determining the preset scoring range of each focusing area includes:
controlling the camera to carry out focusing shooting on each focusing area;
and analyzing the shooting result of each focusing area, and determining the preset grading range of each focusing area.
Further, the quality scoring of the focusing area where the shooting target is located includes:
if the area where the shooting target is located comprises at least two focusing areas, combining the at least two focusing areas;
performing quality scoring on the combined focusing area;
correspondingly, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
determining a preset scoring range of a target according to preset scoring ranges corresponding to at least two focusing areas contained in the area where the shooting target is located;
and if the quality score of the combined focusing area does not meet the preset target score range, carrying out focusing operation on the shooting target again.
Further, the quality scoring of the combined focusing area includes:
determining the weight value of each focus area contained in the area where the shooting target is located before combination;
and determining the quality score of the combined focusing area according to the quality score and the weight value of each focusing area contained in the area where the shooting target is located before combination.
Further, if the quality score does not satisfy the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, re-acquiring the shot image for quality scoring;
and if the quality score of the re-acquired shot image does not meet the preset score range of the focusing area where the shot target is located, carrying out focusing operation on the shot target again.
Further, if the quality score does not satisfy the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, enlarging the focusing area where the shooting target is located and carrying out quality scoring again;
and if the repeated quality scoring does not meet the preset scoring range of the enlarged focusing area, performing focusing operation on the shooting target again.
Embodiments of the present application further provide a storage medium containing terminal device executable instructions, which when executed by a terminal device processor, are configured to perform an auto-focusing method, where the method includes:
carrying out focusing area division on a shooting visual field, and determining a preset grading range of each focusing area;
determining a focusing area where a shooting target is located in the obtained shooting image;
carrying out quality scoring on a focusing area where the shooting target is located;
and if the quality score does not meet the preset score range of the focusing area where the shooting target is located, carrying out focusing operation on the shooting target again.
Further, the dividing of the focusing area of the shooting field of view includes:
determining a division rule of a focusing area according to the proportion of a shooting target in the shooting visual field;
and dividing the shooting visual field into at least two focusing areas according to the division rule of the focusing areas.
Further, the determining the preset scoring range of each focusing area includes:
controlling the camera to carry out focusing shooting on each focusing area;
and analyzing the shooting result of each focusing area, and determining the preset grading range of each focusing area.
Further, the quality scoring of the focusing area where the shooting target is located includes:
if the area where the shooting target is located comprises at least two focusing areas, combining the at least two focusing areas;
performing quality scoring on the combined focusing area;
correspondingly, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
determining a preset scoring range of a target according to preset scoring ranges corresponding to at least two focusing areas contained in the area where the shooting target is located;
and if the quality score of the combined focusing area does not meet the preset target score range, carrying out focusing operation on the shooting target again.
Further, the quality scoring of the combined focusing area includes:
determining the weight value of each focus area contained in the area where the shooting target is located before combination;
and determining the quality score of the combined focusing area according to the quality score and the weight value of each focusing area contained in the area where the shooting target is located before combination.
Further, if the quality score does not satisfy the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, re-acquiring the shot image for quality scoring;
and if the quality score of the re-acquired shot image does not meet the preset score range of the focusing area where the shot target is located, carrying out focusing operation on the shot target again.
Further, if the quality score does not satisfy the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, enlarging the focusing area where the shooting target is located and carrying out quality scoring again;
and if the repeated quality scoring does not meet the preset scoring range of the enlarged focusing area, performing focusing operation on the shooting target again.
The computer storage media of the embodiments of the present application may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the autofocus operations described above, and may also perform related operations in the autofocus method provided in any embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. An auto-focusing method, comprising:
carrying out focusing area division on a shooting visual field, and determining a preset grading range of each focusing area; the shooting view is a range which can be shot by a camera on the terminal equipment;
determining a focusing area containing an area where a shooting target is located in the obtained shooting image in each divided focusing area as a focusing area of the shooting target;
carrying out quality scoring on a focusing area where the shooting target is located;
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, focusing the shooting target again;
wherein, the determining the preset scoring range of each focusing area comprises:
synchronously controlling at least two cameras to simultaneously carry out focusing shooting on each focusing area;
and analyzing the shooting result of each focusing area, and determining the preset grading range of each focusing area.
2. The auto-focusing method according to claim 1, wherein the dividing of the focusing area of the photographing field of view comprises:
determining a division rule of a focusing area according to the proportion of a shooting target in the shooting visual field;
and dividing the shooting visual field into at least two focusing areas according to the division rule of the focusing areas.
3. The automatic focusing method according to claim 1, wherein the quality scoring of the focusing area where the shooting target is located comprises:
if the area where the shooting target is located comprises at least two focusing areas, combining the at least two focusing areas;
performing quality scoring on the combined focusing area;
correspondingly, if the quality score does not meet the preset score range of the focusing area where the shooting target is located, performing focusing operation on the shooting target again includes:
determining a preset scoring range of a target according to preset scoring ranges corresponding to at least two focusing areas contained in the area where the shooting target is located;
and if the quality score of the combined focusing area does not meet the preset target score range, carrying out focusing operation on the shooting target again.
4. The auto-focusing method of claim 3, wherein the quality scoring of the combined focusing area comprises:
determining the weight value of each focus area contained in the area where the shooting target is located before combination;
and determining the quality score of the combined focusing area according to the quality score and the weight value of each focusing area contained in the area where the shooting target is located before combination.
5. The automatic focusing method according to claim 1, wherein if the quality score does not satisfy a preset score range of a focusing area where the shooting target is located, performing focusing operation on the shooting target again comprises:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, re-acquiring the shot image for quality scoring;
and if the quality score of the re-acquired shot image does not meet the preset score range of the focusing area where the shot target is located, carrying out focusing operation on the shot target again.
6. The automatic focusing method according to claim 1, wherein if the quality score does not satisfy a preset score range of a focusing area where the shooting target is located, performing focusing operation on the shooting target again comprises:
if the quality score does not meet the preset score range of the focusing area where the shooting target is located, enlarging the focusing area where the shooting target is located and carrying out quality scoring again;
and if the repeated quality scoring does not meet the preset scoring range of the enlarged focusing area, performing focusing operation on the shooting target again.
7. An auto-focusing apparatus, comprising:
the area division module is used for carrying out focusing area division on the shooting visual field; the shooting view is a range which can be shot by a camera on the terminal equipment;
the scoring range determining module is used for determining the preset scoring range of each focusing region divided by the region dividing module;
the area determining module is used for determining a focusing area containing an area where a shooting target is located in the obtained shooting image in each divided focusing area as the focusing area of the shooting target;
the quality scoring module is used for performing quality scoring on the focusing area where the shooting target is located, which is determined by the area determining module;
the focusing module is used for carrying out focusing operation on the shooting target again if the quality score of the quality scoring module does not meet the preset scoring range of the focusing area where the shooting target is located;
the scoring range determining module is specifically used for synchronously controlling at least two cameras to simultaneously carry out focusing shooting on each focusing area; and analyzing the shooting result of each focusing area, and determining the preset grading range of each focusing area.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out an auto-focusing method as claimed in any one of claims 1 to 6.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the auto-focusing method as claimed in any one of claims 1 to 6 when executing the computer program.
CN201810935373.6A 2018-08-16 2018-08-16 Automatic focusing method and device, storage medium and terminal Active CN108668086B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810935373.6A CN108668086B (en) 2018-08-16 2018-08-16 Automatic focusing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810935373.6A CN108668086B (en) 2018-08-16 2018-08-16 Automatic focusing method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN108668086A CN108668086A (en) 2018-10-16
CN108668086B true CN108668086B (en) 2021-05-04

Family

ID=63788412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810935373.6A Active CN108668086B (en) 2018-08-16 2018-08-16 Automatic focusing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN108668086B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112004019B (en) * 2019-05-27 2023-02-24 福建天晴数码有限公司 Tracking focusing method and computer readable storage medium
WO2021102961A1 (en) * 2019-11-29 2021-06-03 深圳市大疆创新科技有限公司 Focusing method for photographing apparatus, image processing device, and storage medium
CN111182212B (en) * 2019-12-31 2021-08-24 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, storage medium, and electronic device
CN111358425A (en) * 2020-03-17 2020-07-03 苏州微清医疗器械有限公司 Automatic focusing method and fundus camera
CN111970452B (en) * 2020-08-31 2022-06-03 北京百度网讯科技有限公司 Method, device and equipment for adjusting focal length and storage medium
CN113810615A (en) * 2021-09-26 2021-12-17 展讯通信(上海)有限公司 Focusing processing method and device, electronic equipment and storage medium
CN114598811A (en) * 2022-01-18 2022-06-07 影石创新科技股份有限公司 Panoramic video view quality evaluation method, electronic device and computer-readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
CN101931752A (en) * 2009-06-19 2010-12-29 卡西欧计算机株式会社 Camera head and focusing method
CN103200361A (en) * 2012-01-06 2013-07-10 株式会社日立制作所 Video signal processing apparatus
CN104270562A (en) * 2014-08-15 2015-01-07 广东欧珀移动通信有限公司 Method and device for focusing when photographing
CN105472250A (en) * 2015-12-23 2016-04-06 浙江宇视科技有限公司 Automatic focusing method and device
CN105872363A (en) * 2016-03-28 2016-08-17 广东欧珀移动通信有限公司 Adjustingmethod and adjusting device of human face focusing definition
CN106934790A (en) * 2015-12-30 2017-07-07 浙江大华技术股份有限公司 A kind of evaluation method of image definition, the automatic method for focusing on and related device
JP2018125618A (en) * 2017-01-30 2018-08-09 アイホン株式会社 Focus adjustment method for camera in intercom apparatus with camera

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
CN101931752A (en) * 2009-06-19 2010-12-29 卡西欧计算机株式会社 Camera head and focusing method
CN103200361A (en) * 2012-01-06 2013-07-10 株式会社日立制作所 Video signal processing apparatus
CN104270562A (en) * 2014-08-15 2015-01-07 广东欧珀移动通信有限公司 Method and device for focusing when photographing
CN105472250A (en) * 2015-12-23 2016-04-06 浙江宇视科技有限公司 Automatic focusing method and device
CN106934790A (en) * 2015-12-30 2017-07-07 浙江大华技术股份有限公司 A kind of evaluation method of image definition, the automatic method for focusing on and related device
CN105872363A (en) * 2016-03-28 2016-08-17 广东欧珀移动通信有限公司 Adjustingmethod and adjusting device of human face focusing definition
JP2018125618A (en) * 2017-01-30 2018-08-09 アイホン株式会社 Focus adjustment method for camera in intercom apparatus with camera

Also Published As

Publication number Publication date
CN108668086A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN108668086B (en) Automatic focusing method and device, storage medium and terminal
KR102566998B1 (en) Apparatus and method for determining image sharpness
CN104917959A (en) Photographing method and terminal
CN108769538B (en) Automatic focusing method and device, storage medium and terminal
CN109120854B (en) Image processing method, image processing device, electronic equipment and storage medium
CN109194866B (en) Image acquisition method, device, system, terminal equipment and storage medium
CN105320695A (en) Picture processing method and device
CN109040523B (en) Artifact eliminating method and device, storage medium and terminal
CN109040524B (en) Artifact eliminating method and device, storage medium and terminal
CN110442521B (en) Control unit detection method and device
WO2018184260A1 (en) Correcting method and device for document image
CN114913121A (en) Screen defect detection system and method, electronic device and readable storage medium
CN112291473B (en) Focusing method and device and electronic equipment
CN109120864B (en) Light supplement processing method and device, storage medium and mobile terminal
CN110677580B (en) Shooting method, shooting device, storage medium and terminal
US8983227B2 (en) Perspective correction using a reflection
EP2888716B1 (en) Target object angle determination using multiple cameras
CN109040729B (en) Image white balance correction method and device, storage medium and terminal
JP6283329B2 (en) Augmented Reality Object Recognition Device
CN112351197B (en) Shooting parameter adjusting method and device, storage medium and electronic equipment
CN113418091B (en) Method, device and equipment for installing camera shooting assembly
CN112584110B (en) White balance adjusting method and device, electronic equipment and storage medium
CN108540726B (en) Method and device for processing continuous shooting image, storage medium and terminal
CN113709353B (en) Image acquisition method and device
CN110012208B (en) Photographing focusing method and device, storage medium and electronic equipment

Legal Events

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