CN113114947B - Focusing adjustment method and device, electronic equipment and storage medium - Google Patents

Focusing adjustment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113114947B
CN113114947B CN202110424767.7A CN202110424767A CN113114947B CN 113114947 B CN113114947 B CN 113114947B CN 202110424767 A CN202110424767 A CN 202110424767A CN 113114947 B CN113114947 B CN 113114947B
Authority
CN
China
Prior art keywords
evaluation value
image
image data
focusing
definition evaluation
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
CN202110424767.7A
Other languages
Chinese (zh)
Other versions
CN113114947A (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.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202110424767.7A priority Critical patent/CN113114947B/en
Publication of CN113114947A publication Critical patent/CN113114947A/en
Application granted granted Critical
Publication of CN113114947B publication Critical patent/CN113114947B/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
    • 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
    • H04N23/673Focus control based on electronic image sensor signals based on contrast or high frequency components of image signals, e.g. hill climbing method

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application provides a focusing adjustment method and device, electronic equipment and a storage medium, and relates to the technical field of focusing adjustment. The focusing adjusting method is applied to electronic equipment, the electronic equipment is in communication connection with shooting equipment, and the focusing adjusting method comprises the following steps: firstly, acquiring first image data shot by shooting equipment; secondly, calculating a first definition evaluation value of the first image data, and adjusting the focusing position of the shooting equipment to a first focusing position according to the first definition evaluation value; then, second image data captured by the capturing device based on the first focus position is acquired, a second sharpness evaluation value of the second image data is calculated, and the focus position of the capturing device is adjusted to a second focus position according to the second sharpness evaluation value. By the method, secondary focusing can be realized, and the focusing adjustment efficiency is improved.

Description

Focusing adjustment method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of focus adjustment technologies, and in particular, to a focus adjustment method and apparatus, an electronic device, and a storage medium.
Background
The inventor researches and discovers that the automatic focusing method in the prior art obtains a definition evaluation value by transmitting image data to an image processor, and adjusts a focusing module of a primary lens according to the definition evaluation value, so that the problem of image definition caused by later image processing cannot be avoided, and the problem of low focusing adjustment efficiency exists.
Disclosure of Invention
In view of the above, an object of the present application is to provide a focus adjustment method and apparatus, an electronic device, and a storage medium, so as to solve the problems in the prior art.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, the present invention provides a focus adjustment method, applied to an electronic device, where the electronic device is in communication connection with a shooting device, and the focus adjustment method includes:
acquiring first image data shot by the shooting equipment;
calculating a first definition evaluation value of the first image data, and adjusting the focusing position of the shooting device to a first focusing position according to the first definition evaluation value;
acquiring second image data shot by the shooting device based on the first focusing position, calculating a second definition evaluation value of the second image data, and adjusting the focusing position of the shooting device to a second focusing position according to the second definition evaluation value.
In an optional embodiment, the adjusting the focus position of the photographing apparatus to a second focus position according to the second sharpness evaluation value includes:
judging whether the difference value between the second definition evaluation value and the first definition evaluation value is larger than a preset difference threshold value or not;
and if so, adjusting the focusing position of the shooting equipment to a second focusing position according to the second definition evaluation value.
In an alternative embodiment, the step of acquiring second image data captured by the capturing device based on the first focus position includes:
controlling the shooting equipment to carry out shooting processing based on the first focusing position to obtain shot image data;
and carrying out image combing processing on the shot image data to obtain second image data.
In an alternative embodiment, the first image data includes at least one first image, and the step of calculating the first sharpness evaluation value of the first image data includes:
for each first image, carrying out segmentation processing on the first image to obtain at least one first image block;
and calculating the definition evaluation value of each first image block, and performing weighted calculation on the definition evaluation values of all the first image blocks to obtain the first definition evaluation value of the first image.
In an optional embodiment, the adjusting the focus position of the photographing apparatus to a first focus position according to the first sharpness evaluation value includes:
selecting at least one first definition evaluation value to obtain a target first definition evaluation value, wherein an image corresponding to the target first definition evaluation value is obtained by shooting the shooting equipment based on a first focus position;
adjusting a focus position of the photographing apparatus to a first focus position.
In an alternative embodiment, the second image data includes at least one second image, and the step of calculating the second sharpness evaluation value of the second image data includes:
for each second image, carrying out segmentation processing on the second image to obtain at least one second image block;
and calculating the definition evaluation value of each second image block, and performing weighted calculation on the definition evaluation values of all the second image blocks to obtain a second definition evaluation value of the second image.
In an optional implementation manner, the step of adjusting the focus position of the shooting device to a second focus position according to the second sharpness evaluation value includes:
selecting at least one second definition evaluation value to obtain a target second definition evaluation value, wherein an image corresponding to the target second definition evaluation value is obtained by shooting the shooting equipment based on a second focus position;
adjusting the focus position of the photographing apparatus to a second focus position.
In a second aspect, the present invention provides a focusing adjustment apparatus applied to an electronic device, where the electronic device is in communication connection with a shooting device, the focusing adjustment apparatus includes:
the data acquisition module is used for acquiring first image data shot by the shooting equipment;
the first adjusting module is used for calculating a first definition evaluation value of the first image data and adjusting the focusing position of the shooting device to a first focusing position according to the first definition evaluation value;
and the second adjusting module is used for acquiring second image data shot by the shooting device based on the first focusing position, calculating a second definition evaluation value of the second image data, and adjusting the focusing position of the shooting device to a second focusing position according to the second definition evaluation value.
In a third aspect, the present invention provides an electronic device comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the focus adjustment method of any of the preceding embodiments when executing the program.
In a fourth aspect, the present invention provides a storage medium, where the storage medium includes a computer program, and the computer program controls, when running, an electronic device where the storage medium is located to execute the focusing adjustment method according to any one of the foregoing embodiments.
According to the focusing adjusting method and device, the electronic device and the storage medium, after the focusing position is adjusted to the first focusing position according to the first definition evaluation value, the focusing position is adjusted to the second focusing position according to the second definition evaluation value, so that secondary focusing is achieved, and the problems that in the prior art, the focusing module of the primary lens is adjusted according to the definition evaluation value, the image definition problem caused by later image processing cannot be avoided, and the focusing adjusting efficiency is low are solved.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 shows a block diagram of a focus adjustment system provided in an embodiment of the present application.
Fig. 2 shows a block diagram of an electronic device according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a focus adjustment method according to an embodiment of the present disclosure.
Fig. 4 is a block diagram of a focusing adjustment apparatus according to an embodiment of the present disclosure.
Icon: 10-a focus adjustment system; 100-an electronic device; 110 — a first memory; 120-a first processor; 130-a communication module; 200-a photographing device; 400-a focus adjustment device; 410-a data acquisition module; 420-a first conditioning module; 430-second conditioning module.
Detailed Description
In order to obtain a clearer image, an integrated camera in the field of video monitoring generally adopts an autofocus focusing technology for fine control. At present, image data are generally transmitted to an image processor in automatic focusing to further obtain a definition evaluation value, the definition evaluation value is obtained in a Bayer domain under a wide dynamic mode, or the definition evaluation value is obtained in a yuv domain under a non-wide dynamic mode, and a focusing module of a lens is continuously adjusted according to the definition value until the corresponding position of the maximum definition value is reached. And in the later stage, the images are subjected to a series of digital image processing again and then output to an image acquisition system, and the image definition is influenced after a series of processing. If the image is automatically focused only once in the Bayer domain, the problem of image definition caused by later image processing cannot be avoided. If the auto-focusing is only carried out in the yuv domain, when the scene is switched to the wide dynamic mode, the definition evaluation value acquired by the yuv domain is insensitive to the definition, so that the auto-focusing is poor, and the image definition is reduced.
In order to improve at least one of the above technical problems of the present application, embodiments of the present application provide a focus adjustment method and apparatus, an electronic device, and a storage medium, and the following describes technical solutions of the present application through possible implementations.
The defects existing in the above solutions are the results obtained after the inventor has practiced and studied carefully, and therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present application below for the above problems should be the contributions of the inventor in the invention process.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. 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 application.
It should be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
Fig. 1 is a block diagram of a focus adjustment system 10 provided in an embodiment of the present application, which provides a possible implementation manner of the focus adjustment system 10, and referring to fig. 1, the focus adjustment system 10 may include one or more of an electronic device 100 and a shooting device 200.
The electronic device 100 is in communication connection with the photographing device 200 to adjust the focus position of the photographing device 200 according to image data photographed by the photographing device 200.
Alternatively, the specific types of the electronic device 100 and the photographing device 200 are not limited, and may be set according to actual application requirements. For example, in an alternative example, the electronic apparatus 100 and the photographing apparatus 200 may be different apparatuses.
For another example, in another alternative example, the electronic device 100 and the photographing device 200 may be the same device, and the photographing device 200 may be embodied as a lens focusing module.
Referring to fig. 2, a block diagram of an electronic device 100 according to an embodiment of the present disclosure is shown, where the electronic device 100 in this embodiment may be a server, a processing device, a processing platform, and the like, which are capable of performing data interaction and processing. The electronic device 100 includes a first memory 110, a first processor 120, and a communication module 130. The elements of the first memory 110, the first processor 120 and the communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The first memory 110 is used for storing programs or data. The first Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The first processor 120 is used to read/write data or programs stored in the first memory 110 and perform corresponding functions. The communication module 130 is used for establishing a communication connection between the electronic device 100 and other communication terminals through a network, and for transceiving data through the network.
It should be understood that the configuration shown in fig. 2 is merely a schematic diagram of the configuration of the electronic device 100, and that the electronic device 100 may include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Fig. 3 shows one of flowcharts of a focus adjustment method provided in the embodiment of the present application, which can be applied to the electronic device 100 shown in fig. 2 and executed by the electronic device 100 in fig. 2. It should be understood that, in other embodiments, the order of some steps in the focus adjustment method of this embodiment may be interchanged according to actual needs, or some steps may be omitted or deleted. The following describes in detail the flow of the focus adjustment method shown in fig. 3.
In step S310, first image data captured by the capturing apparatus 200 is acquired.
In step S320, a first sharpness evaluation value of the first image data is calculated, and the focus position of the photographing apparatus 200 is adjusted to the first focus position according to the first sharpness evaluation value.
In step S330, second image data captured by the capture device 200 based on the first focus position is acquired, a second sharpness evaluation value of the second image data is calculated, and the focus position of the capture device 200 is adjusted to a second focus position according to the second sharpness evaluation value.
According to the method, after the focusing position is adjusted to the first focusing position according to the first definition evaluation value, the focusing position is adjusted to the second focusing position according to the second definition evaluation value, secondary focusing is achieved, and the problem that in the prior art, the focusing module of the primary lens is adjusted according to the definition evaluation value, the problem of low focusing adjustment efficiency caused by the fact that the image definition problem caused by later image processing cannot be avoided is solved.
For step S310, it should be noted that the specific manner of acquiring the first image data is not limited, and may be set according to the actual application requirement. For example, in one alternative example, image data may be acquired by an image sensor.
For step S320, it should be noted that, a specific manner of calculating the first sharpness evaluation value of the first image data is not limited, and may be set according to actual application requirements. For example, in an alternative example, the first image data includes at least one first image, and the step of calculating the first sharpness evaluation value of the first image data may include the sub-steps of:
for each first image, carrying out segmentation processing on the first image to obtain at least one first image block; and calculating the definition evaluation value of each first image block, and performing weighted calculation on the definition evaluation values of all the first image blocks to obtain the first definition evaluation value of the first image.
Specifically, the unprocessed image data is Bayer domain data, and the sharpness evaluation value FV is counted in the Bayer domain, and is used as a criterion for evaluating sharpness of the image, and is used as a basis for autofocusing. The sharpness evaluation value is usually obtained by different types of evaluation functions such as an energy gradient function, a Robert function, a tenngrad function, a Brenner function, and a Variance function.
When the first image is in a low-illuminance scene, the sharpness evaluation value may be calculated using the low-frequency component, the image may be converted into a frequency domain, and the low-frequency component may be acquired as an evaluation criterion for focusing. When the first image is in a normal illumination scene, the sharpness evaluation value may be calculated using the high-frequency component, the image may be converted into a frequency domain, and the high-frequency component may be acquired as an evaluation criterion for focusing. The FV generated by the high-pass filter is named as FV2, the FV generated by the low-pass filter is named as FV1, the picture is divided into NxM blocks, and the FV of each block which is low-pass and high-pass is calculated as:
FV1_n=Alpha*H1_n+(1-Alpha)*V1_n;
FV2_n=Beta*H2_n+(1-Beta)*V2_n;
FV1_ n represents the definition evaluation value of the image block passing through the low-pass filter, H1_ n represents the statistic value of the first horizontal filter, V1_ n represents the statistic value of the first vertical filter, FV2_ n represents the definition evaluation value of the image block passing through the high-pass filter, H2_ n represents the statistic value of the second horizontal filter, V1_ n represents the statistic value of the second vertical filter, and Alpha and Beta are filter coefficients.
The overall FV of the first image through the low-pass filter is then:
Figure BDA0003028908530000081
where FV _ L represents the global sharpness evaluation value, weight, of the first image passing through the low pass filternRepresenting the weight of each image block, M and N represent image blocks of M rows and N columns. In the same way canAnd obtaining an image global definition evaluation value FV _ H of the first image after passing through a high-pass filter, taking FV _ L as a definition judgment standard of automatic focusing in a low-light environment, and adopting FV _ H in a normal environment.
Further, the specific manner of adjusting the focusing position of the photographing apparatus 200 to the first focusing position according to the first sharpness evaluation value is not limited, and may be set according to the actual application requirement. For example, in one alternative example, the following sub-steps may be included:
selecting at least one first definition evaluation value to obtain a target first definition evaluation value, wherein an image corresponding to the target first definition evaluation value is obtained by shooting the shooting equipment 200 based on a first focus position; the in-focus position of the photographing apparatus 200 is adjusted to the first in-focus position.
In detail, the automatic focusing in the application adopts a common algorithm for the blind to climb a slope, the principle is that the blind can sense the slope of the current hill and the definition value of the current hill, the step length of the blind is reduced along with the increase of the slope of the hill until the blind walks to the downhill, the movement is reversed, and the blind walks to the maximum definition point.
Before the target first definition evaluation value is selected and obtained, generally waiting for 3 frames to wait for image stabilization, and then judging whether the current focus position is the clearest point or not and whether the selected image is the clearest image or not. The method comprises the steps of firstly detecting whether FV is not larger than the current FV value twice in near and far directions, if so, the position of the current focus is the position corresponding to the FV peak value, and the image reaches the optimal definition. Otherwise, judging which area is currently located in a flat area, a slope area and a steep area according to the slope of the current FV definition evaluation function, and continuously adjusting the step length according to the slope, wherein the larger the slope is, the steeper the position of the slope of the definition evaluation value, the smaller the step length is, and the closer the step length is to the peak value; and when the slope is smaller than 0, indicating that the device is in a downhill state, reversing the direction, and moving to the position of the maximum definition value FV _1, so that the position of the definition point is found, taking the maximum definition evaluation value as a target first definition evaluation value, taking the focusing position of an image corresponding to the target first definition evaluation value as a first focusing position, and adjusting the focusing position of the shooting device 200 to the first focusing position.
For step S330, it should be noted that, a specific manner of acquiring the second image data captured by the capturing device 200 based on the first focus position is not limited, and may be set according to actual application requirements. For example, in one alternative example, the following sub-steps may be included:
controlling the photographing apparatus 200 to perform photographing processing based on the first focus position, resulting in photographed image data; and carrying out image combing processing on the shot image data to obtain second image data.
Optionally, the specific way of performing the image combing processing is not limited, and may be set according to the actual application requirements. For example, processing modes including, but not limited to, auto exposure, auto white balance, dead pixel correction, dessication, glare suppression, backlight compensation, color enhancement, lens shading correction, etc. may be included.
Further, the specific manner of calculating the second sharpness evaluation value of the second image data is not limited, and may be set according to the actual application requirement. For example, in an alternative example, the second image data includes at least one second image, and the step of calculating the second sharpness evaluation value of the second image data may include the sub-steps of:
for each second image, carrying out segmentation processing on the second image to obtain at least one second image block; and calculating the definition evaluation value of each second image block, and performing weighted calculation on the definition evaluation values of all the second image blocks to obtain a second definition evaluation value of the second image.
Note that, the specific step of calculating the second sharpness evaluation value of the second image may refer to the step of calculating the first sharpness evaluation value.
Further, the specific manner of adjusting the focusing position of the photographing apparatus 200 to the second focusing position according to the second sharpness evaluation value is not limited, and may be set according to the actual application requirement. For example, in an alternative example, the step of adjusting the in-focus position of the photographing apparatus 200 to the second in-focus position according to the second sharpness evaluation value may include the sub-steps of:
judging whether the difference value between the second definition evaluation value and the first definition evaluation value is larger than a preset difference threshold value or not; if so, the focusing position of the photographing apparatus 200 is adjusted to a second focusing position according to the second sharpness evaluation value.
In detail, after a series of image processing, the yuv domain acquires a definition value, and performs secondary auto-focusing, where the definition value corresponding to the clearest point of the graph is fv _2. And the difference value between the maximum clear point in the Bayer domain and the maximum clear point in the yuv domain is Delta = | fv _2-fv _1|, when Delta is smaller than a preset difference threshold value fvThr, secondary automatic focusing is not carried out, and if the Delta is larger than the threshold value fvThr, secondary automatic focusing is carried out in the yuv domain.
For another example, in another alternative example, the step of adjusting the in-focus position of the photographing apparatus 200 to the second in-focus position according to the second sharpness evaluation value may include the sub-steps of:
selecting at least one second definition evaluation value to obtain a target second definition evaluation value, wherein an image corresponding to the target second definition evaluation value is obtained by shooting the shooting equipment 200 based on a second focusing position; the in-focus position of the photographing apparatus 200 is adjusted to the second in-focus position.
It should be noted that the specific step of calculating the target second sharpness evaluation value may refer to the step of calculating the target first sharpness evaluation value, and the specific step of adjusting the in-focus position to the second in-focus position may refer to the step of adjusting the in-focus position to the first in-focus position.
Through the method, the embodiment of the application provides a feedback type self-adaptive automatic focusing method, and the problem of poor image definition caused by a series of image processing is solved. The main principle is that firstly, primary automatic focusing is carried out in a Bayer domain, the definition after image processing and the definition after primary automatic focusing are compared, secondary focusing can be carried out when the contrast exceeds a threshold value, so that real-time adjustment can be realized according to the definition, and the optimal focusing effect is achieved.
With reference to fig. 4, an embodiment of the present application further provides a focusing adjustment apparatus 400, where the functions implemented by the focusing adjustment apparatus 400 correspond to the steps executed by the foregoing method. The focusing adjustment apparatus 400 may be understood as a processor of the electronic device 100, or may be understood as a component that is independent from the electronic device 100 or the processor and implements the functions of the present application under the control of the electronic device 100. The focus adjustment apparatus 400 may include a data acquisition module 410, a first adjustment module 420, and a second adjustment module 430.
A data obtaining module 410, configured to obtain first image data captured by the capturing apparatus 200. In the embodiment of the present application, the data obtaining module 410 may be configured to perform step S310 shown in fig. 3, and for relevant contents of the data obtaining module 410, reference may be made to the foregoing description of step S310.
The first adjusting module 420 is configured to calculate a first sharpness evaluation value of the first image data, and adjust the focus position of the photographing apparatus 200 to the first focus position according to the first sharpness evaluation value. In the embodiment of the present application, the first adjusting module 420 may be configured to perform step S320 shown in fig. 3, and reference may be made to the foregoing description of step S320 for relevant contents of the first adjusting module 420.
And a second adjusting module 430, configured to acquire second image data captured by the capturing device 200 based on the first focus position, calculate a second sharpness evaluation value of the second image data, and adjust the focus position of the capturing device 200 to a second focus position according to the second sharpness evaluation value. In the embodiment of the present application, the second adjusting module 430 may be configured to perform step S330 shown in fig. 3, and reference may be made to the foregoing description of step S330 for relevant contents of the second adjusting module 430.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program is executed by a processor to perform the steps of the above-mentioned focus adjustment method.
The computer program product of the focusing adjustment method provided in the embodiments of the present application includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute steps of the focusing adjustment method in the above method embodiments, which may be specifically referred to the above method embodiments, and are not described herein again.
In summary, according to the focusing adjustment method and apparatus, the electronic device, and the storage medium provided in the embodiments of the present application, after the focusing position is adjusted to the first focusing position according to the first sharpness evaluation value, the focusing position is adjusted to the second focusing position according to the second sharpness evaluation value, so that secondary focusing is achieved, and a problem that in the prior art, the focusing module of the primary lens is adjusted according to the sharpness evaluation value, and therefore, the problem of low focusing adjustment efficiency caused by the problem of image sharpness introduced in post-image processing cannot be avoided.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. A focusing adjustment method is applied to electronic equipment, the electronic equipment is in communication connection with shooting equipment, and the focusing adjustment method comprises the following steps:
acquiring first image data shot by the shooting equipment, wherein the first image data is original Bayer data collected by an image sensor;
calculating a first definition evaluation value of the first image data, and adjusting the focusing position of the shooting device to a first focusing position according to the first definition evaluation value;
controlling the shooting equipment to carry out shooting processing based on the first focusing position to obtain shot image data;
performing image combing processing on the shot image data to obtain second image data, wherein the second image data is YUV data;
and calculating a second definition evaluation value of the second image data, and adjusting the focusing position of the shooting device to a second focusing position according to the second definition evaluation value.
2. The focus adjustment method according to claim 1, wherein the step of adjusting the focus position of the photographing apparatus to a second focus position according to the second sharpness evaluation value includes:
judging whether the difference value between the second definition evaluation value and the first definition evaluation value is larger than a preset difference threshold value or not;
and if so, adjusting the focusing position of the shooting equipment to a second focusing position according to the second definition evaluation value.
3. The focus adjustment method according to claim 1, wherein the first image data includes at least one first image, and the step of calculating the first sharpness evaluation value of the first image data includes:
for each first image, carrying out segmentation processing on the first image to obtain at least one first image block;
and calculating the definition evaluation value of each first image block, and performing weighted calculation on the definition evaluation values of all the first image blocks to obtain the first definition evaluation value of the first image.
4. The focus adjustment method according to claim 3, wherein the step of adjusting the focus position of the photographing apparatus to a first focus position according to the first sharpness evaluation value includes:
selecting at least one first definition evaluation value to obtain a target first definition evaluation value, wherein an image corresponding to the target first definition evaluation value is obtained by shooting the shooting equipment based on a first focus position;
adjusting a focus position of the photographing apparatus to a first focus position.
5. The focus adjustment method according to claim 1, wherein the second image data includes at least one second image, and the step of calculating the second sharpness evaluation value of the second image data includes:
for each second image, carrying out segmentation processing on the second image to obtain at least one second image block;
and calculating the definition evaluation value of each second image block, and performing weighted calculation on the definition evaluation values of all the second image blocks to obtain a second definition evaluation value of the second image.
6. The focus adjustment method according to claim 5, wherein the step of adjusting the focus position of the photographing apparatus to a second focus position according to the second sharpness evaluation value includes:
selecting at least one second definition evaluation value to obtain a target second definition evaluation value, wherein an image corresponding to the target second definition evaluation value is obtained by shooting the shooting equipment based on a second focus position;
adjusting the focus position of the photographing apparatus to a second focus position.
7. The utility model provides a focusing adjusting device which characterized in that is applied to electronic equipment, electronic equipment and shooting equipment communication connection, focusing adjusting device includes:
the data acquisition module is used for acquiring first image data shot by the shooting equipment, wherein the first image data is original Bayer data collected by an image sensor;
the first adjusting module is used for calculating a first definition evaluation value of the first image data and adjusting the focusing position of the shooting device to a first focusing position according to the first definition evaluation value;
the second adjusting module is used for controlling the shooting equipment to carry out shooting processing based on the first focusing position to obtain shot image data; carrying out image combing processing on the shot image data to obtain second image data, wherein the second image data is YUV data; and calculating a second definition evaluation value of the second image data, and adjusting the focusing position of the shooting device to a second focusing position according to the second definition evaluation value.
8. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the focus adjustment method of any one of claims 1 to 6 when executing the program.
9. A storage medium, comprising a computer program that, when executed, controls an electronic device in which the storage medium is located to perform the focus adjustment method according to any one of claims 1 to 6.
CN202110424767.7A 2021-04-20 2021-04-20 Focusing adjustment method and device, electronic equipment and storage medium Active CN113114947B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110424767.7A CN113114947B (en) 2021-04-20 2021-04-20 Focusing adjustment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110424767.7A CN113114947B (en) 2021-04-20 2021-04-20 Focusing adjustment method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113114947A CN113114947A (en) 2021-07-13
CN113114947B true CN113114947B (en) 2022-11-01

Family

ID=76719005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110424767.7A Active CN113114947B (en) 2021-04-20 2021-04-20 Focusing adjustment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113114947B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556470B (en) * 2021-09-18 2021-12-31 浙江宇视科技有限公司 Lens focusing method and device, computer equipment and storage medium
CN113917437A (en) * 2021-10-09 2022-01-11 福建汇川物联网技术科技股份有限公司 Focusing method and device of measuring equipment, electronic equipment and storage medium
CN114422693B (en) * 2022-01-14 2024-05-03 山东云海国创云计算装备产业创新中心有限公司 Focusing method, device, equipment and readable storage medium
CN114827461A (en) * 2022-04-15 2022-07-29 维沃移动通信(杭州)有限公司 Shooting focusing method and device and electronic equipment
CN115314633B (en) * 2022-06-27 2023-06-16 中国科学院合肥物质科学研究院 Camera focusing method, camera focusing device, computer equipment and storage medium
CN115047433B (en) * 2022-08-16 2022-11-01 杭州宇称电子技术有限公司 Optical automatic adjusting method for TOF distance measuring system and application thereof
CN115937324B (en) * 2022-09-09 2024-03-26 郑州思昆生物工程有限公司 Assembly quality evaluation method, device, equipment and storage medium
CN116112795B (en) * 2023-04-13 2023-06-23 北京城建智控科技股份有限公司 Adaptive focusing control method, camera and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605208A (en) * 2008-06-13 2009-12-16 富士胶片株式会社 Image processing equipment, imaging device, image processing method and program
CN110881103A (en) * 2019-09-19 2020-03-13 Oppo广东移动通信有限公司 Focusing control method and device, electronic equipment and computer readable storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100533245C (en) * 2006-05-23 2009-08-26 鸿富锦精密工业(深圳)有限公司 Real-time automatic focusing method
CN102025909A (en) * 2009-09-11 2011-04-20 致伸科技股份有限公司 Image acquisition device and method for judging re-execution of automatic focusing thereby
CN101726829B (en) * 2009-12-23 2012-01-18 重庆大学 Method for automatically focusing zoom lens
US20120262596A1 (en) * 2011-04-18 2012-10-18 Infineon Technologies Ag Image focusing devices and methods for controlling an image focusing device
JP6239855B2 (en) * 2013-05-08 2017-11-29 キヤノン株式会社 Focus adjustment apparatus, focus adjustment method and program, and imaging apparatus
JP2015198391A (en) * 2014-04-02 2015-11-09 キヤノン株式会社 Imaging apparatus, control method of imaging apparatus, and program
CN104079837B (en) * 2014-07-17 2018-03-30 广东欧珀移动通信有限公司 A kind of focusing method and device based on imaging sensor
WO2017206656A1 (en) * 2016-05-31 2017-12-07 努比亚技术有限公司 Image processing method, terminal, and computer storage medium
CN109696788B (en) * 2019-01-08 2021-12-14 武汉精立电子技术有限公司 Quick automatic focusing method based on display panel
CN110166692B (en) * 2019-05-31 2024-02-02 济南中维世纪科技有限公司 Method and device for improving automatic focusing accuracy and speed of camera
CN110418068B (en) * 2019-07-24 2020-12-08 浙江大华技术股份有限公司 Focusing method, device, electronic equipment and storage medium
CN110740255A (en) * 2019-09-09 2020-01-31 深圳市爱普泰科电子有限公司 Focusing apparatus and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605208A (en) * 2008-06-13 2009-12-16 富士胶片株式会社 Image processing equipment, imaging device, image processing method and program
CN110881103A (en) * 2019-09-19 2020-03-13 Oppo广东移动通信有限公司 Focusing control method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN113114947A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN113114947B (en) Focusing adjustment method and device, electronic equipment and storage medium
EP2134079B1 (en) Image processing apparatus, imaging apparatus, image processing method and program
US9426352B2 (en) Imaging apparatus, imaging method, and focus control apparatus
KR101812807B1 (en) A method of adaptive auto exposure contol based upon adaptive region's weight
JP7036176B2 (en) Display control device, display control method and display control program
US10298853B2 (en) Image processing apparatus, method of controlling image processing apparatus, and imaging apparatus
JP6797955B2 (en) Image processing device and control method of image processing device, imaging device, program
JP2013042371A (en) Image pickup device and distance information acquisition method
JP2003274258A (en) Camera
JP2010220207A (en) Image processing apparatus and image processing program
JPH04133576A (en) Image pickup device
JP2957800B2 (en) Automatic focusing device
JP6904838B2 (en) Image processing device, its control method and program
JP2016059051A (en) Imaging device and distance information acquisition method
KR20100044073A (en) An image pickup apparatus
JP2018181070A (en) Image processing device and image processing method
JP2002333571A (en) Automatic focusing device, automatic focusing method, and computer program for performing the same method
JP2010026008A (en) Focus adjustment device and method
JP2001013401A (en) Digital still video camera
JP7166903B2 (en) IMAGE PROCESSING DEVICE, CONTROL METHOD THEREOF, AND PROGRAM
EP1669786A1 (en) Imaging lens position control device
JP2010239493A (en) Image pickup apparatus, and method of correcting video signal
JP2010118850A (en) Image processor, imaging apparatus, and program
JP2008131475A (en) Imaging apparatus
KR101890188B1 (en) Method and Apparatus for Controlling Auto Focus for Subject Having Film Layer

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