WO2022143053A1 - 自动聚焦方法、装置、电子设备及介质 - Google Patents

自动聚焦方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2022143053A1
WO2022143053A1 PCT/CN2021/136267 CN2021136267W WO2022143053A1 WO 2022143053 A1 WO2022143053 A1 WO 2022143053A1 CN 2021136267 W CN2021136267 W CN 2021136267W WO 2022143053 A1 WO2022143053 A1 WO 2022143053A1
Authority
WO
WIPO (PCT)
Prior art keywords
image block
image
monitoring area
scene monitoring
change
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.)
Ceased
Application number
PCT/CN2021/136267
Other languages
English (en)
French (fr)
Inventor
龚志东
史飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to US18/260,187 priority Critical patent/US12549852B2/en
Priority to EP21913794.0A priority patent/EP4274216A4/en
Publication of WO2022143053A1 publication Critical patent/WO2022143053A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/675Focus control based on electronic image sensor signals comprising setting of focusing regions
    • 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • G06T7/248Analysis of motion using feature-based methods, e.g. the tracking of corners or segments involving reference images or patches
    • 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/61Control of cameras or camera modules based on recognised objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Definitions

  • the embodiments of the present application relate to the technical field of video imaging, for example, to an automatic focusing method, apparatus, electronic device, and medium.
  • the depth of field of the image will become smaller due to the longer focal length and other reasons. At this time, it is often impossible to keep the target and the background clear at the same time, so the overall image is prone to double peaks as shown in Figure 1.
  • the focusing algorithm based on the hill-climbing method in the related art pays more attention to whether the overall image is clear for the focusing result, and does not pay attention to whether the clear area of the image after focusing is on the focused area of interest. Especially when the device is under large magnification, the image depth of field becomes shallow, and it is impossible to ensure that the background and the target are clear at the same time. After focusing, the clear point of the image is always in the background instead of focusing on the area of interest.
  • the embodiments of the present application provide an automatic focusing method, device, electronic device and medium, so as to achieve stable and efficient focusing on a target moving in and out of the screen or moving in the screen when the depth of field is small at the telephoto end.
  • an embodiment of the present application provides an auto-focusing method, and the method includes:
  • the scene monitoring area includes the image effective area pre-divided in the shooting picture
  • the image block change information determine whether to trigger the focusing operation on the scene monitoring area
  • a focus area of interest triggered by the movement of the target object relative to the scene monitoring area is determined, and a focus operation is performed on the focus area of interest.
  • the embodiments of the present application further provide an automatic focusing device, the device comprising:
  • the block change monitoring module is set to determine the relative reference frame image of the current frame image, the image block change information in the scene monitoring area; Wherein the scene monitoring area includes the image effective area pre-divided in the shooting picture;
  • a focus trigger judgment module configured to determine whether to trigger a focus operation on the scene monitoring area according to the image block change information
  • the focus trigger processing module is configured to, in response to determining to trigger a focus operation, determine a focus area of interest triggered by the movement of the target object relative to the scene monitoring area, and perform a focus operation on the focus area of interest.
  • the embodiments of the present application also provide an electronic device, including:
  • At least one processing device At least one processing device
  • a storage device configured to store at least one program
  • the at least one processing device When the at least one program is executed by the at least one processing device, the at least one processing device implements the autofocus method provided in any embodiment of the present application.
  • an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processing device, implements the autofocusing method provided in any embodiment of the present application.
  • Fig. 1 is a kind of double wave peak phenomenon provided in the embodiment of the present application to the focus algorithm based on mountain climbing method.
  • FIG. 2 is a flowchart of an automatic focusing method provided in an embodiment of the present application
  • FIG. 3 is a schematic diagram of regional division of a shooting picture according to the degree of attention provided in an embodiment of the present application
  • FIG. 4 is a schematic diagram of the division of common scenes in a focusing process provided in an embodiment of the present application.
  • FIG. 5 is a flowchart of another auto-focusing method provided in an embodiment of the present application.
  • FIG. 6 is a flowchart of another autofocus method provided in an embodiment of the present application.
  • FIG. 7 is a structural block diagram of an automatic focusing device provided in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • the peak A in the evaluation value of the overall image clarity at the telephoto end may be Focusing on the position of the focusing motor when the area of interest is clear, the results of the global search focusing algorithm in the related art or the mountain climbing search algorithm with the initial search point near the peak B will not meet the requirements.
  • the search area of the algorithm or the mountain climbing search algorithm with the initial search point near the peak B will not meet the requirements.
  • only enlarging the search area of the algorithm or relaxing the algorithm convergence conditions will increase the focus range, resulting in a longer blurring time of the scene, and a high probability of focusing on the background with rich details, affecting the effect of the device. Therefore, how to focus on the area of interest in the monitoring and focusing process to eliminate the double peak phenomenon of the sharpness evaluation value becomes particularly important.
  • FIG. 2 is a flowchart of an automatic focusing method provided in an embodiment of the present application.
  • the embodiments of the present application can be applied to the case of automatically focusing on the focus area of interest of indeterminate size during the focusing process when the depth of field at the telephoto end of the device is small.
  • the method can be executed by an automatic focusing device, which can be implemented in software and/or hardware, and integrated on any electronic device with network communication function.
  • the automatic focusing method provided in this embodiment may include the following steps:
  • S210 Determine the image block change information in the scene monitoring area relative to the reference frame image of the current frame image; wherein the scene monitoring area includes the image effective area pre-divided in the shooting picture.
  • FIG. 3 is a schematic diagram of dividing a shooting screen according to the degree of attention provided in the embodiment of the present application.
  • the shooting screen can be divided into M*N blocks in advance, and correspondingly obtained under the shooting screen
  • Each frame of image is divided into M*N image blocks, and the image block characteristics of each image block can be counted according to different image block positions subsequently.
  • the current frame image obtained under the shooting screen can be obtained in real time; and a stable image obtained under the shooting screen after the last focusing is obtained as a reference frame image.
  • the stable image is an image in which the color of most of the image blocks in multiple consecutive frames is consistent with the evaluation value of the sharpness of the image blocks.
  • the scene change monitoring is not performed on the entire shooting picture, but a scene monitoring area is selected in the shooting picture, focusing on the scene monitoring area. Changes within the scene are monitored. In this way, at least one area with higher sensitivity or attention is divided into the shooting picture, so that the area with higher attention can be used as the scene monitoring area to monitor the scene changes of the picture.
  • an image core area A and an image effective area B can be obtained by dividing the shooting picture, wherein both the image effective area B and the image core area A belong to areas with higher attention or sensitivity in the focusing process,
  • the image effective area B includes the image core area A, and compared with the image effective area B, the image core area A has the highest degree of attention.
  • the image effective area B may be used as the scene monitoring area by default.
  • the scene monitoring area is a dynamically changing area. If the attention degree changes in the subsequent process, the updated area with higher attention degree can be used to replace the image effective area B as the scene monitoring area.
  • the current frame image and the reference frame image obtained under the shooting screen will be divided into M*N image blocks, and each image block is divided into M*N image blocks.
  • S220 Determine whether to trigger focusing on the scene monitoring area according to the image block change information in the scene monitoring area.
  • the conditions for determining whether to trigger focusing on the scene monitoring area may include, but are not limited to, the following conditions: whether the captured images in the scene monitoring area change significantly (that is, whether the degree of change of the captured images in the scene monitoring area is obvious? ); And, whether the change trend of the shooting picture in the scene monitoring area is consistent as a whole (that is, whether the change trend of the current frame image relative to the reference frame image is overall consistent), and the above-mentioned current frame image is relative to the reference frame image in the scene monitoring area.
  • the block change information can determine whether the scene monitoring area satisfies the above conditions.
  • FIG. 4 is a schematic diagram of the division of common scenes in the focusing process provided in the embodiment of the present application.
  • the shooting picture of the reference frame image is the background
  • the target object moves to the scene monitoring area of the shooting picture (in this case, the image effective area B) and stabilizes the image
  • the case a is that the target object moves into the shooting picture In the scene monitoring area in
  • the case b is that the target object moves out of the scene monitoring area in the shooting screen.
  • the current frame image relative to the reference frame image obtained in the scene monitoring area changes the information of the image block in the scene monitoring area, will trigger the Focus on the scene monitoring area.
  • the area where the picture in the scene monitoring area changes obviously can be regarded as the focus area of interest triggered by the movement of the target relative to the scene monitoring area.
  • the focused area of interest will be dynamically changed according to the background content of the picture in the scene monitoring area and the target objects of the pictures entering and exiting the scene monitoring area.
  • the focusing algorithm based on the hill-climbing method can focus on the focused area of interest, so that the clear image after focusing is always focused on the area of interest area, to ensure that the end point focuses on the focused area of interest during the focusing process. Since it is not necessary to enlarge the search area of the algorithm or relax the convergence conditions of the algorithm, the range of focusing will be increased, so the scene blur time can be reduced, and the focus is likely to be focused on the area of interest that is more concerned, improving the telephoto end of the video conference.
  • the search can be performed more quickly, effectively and smoothly to find the focus motor position corresponding to the clear point of the target object in the shooting picture that belongs to the scene monitoring area, so as to realize automatic focusing in the current area of the target object; for case b, also It can effectively focus the clear point of the target object to the background after the target object moves out of the scene monitoring area, and realize automatic focusing on the background where the target object is before it moves out.
  • the automatic focusing method in the embodiment of the present application by monitoring the scene changes in the scene monitoring area in real time, the focusing operation can be triggered timely and accurately when the target is moved out of the shooting screen or moving in the shooting screen; Focusing on the area of interest triggered by the movement of the scene monitoring area can improve the situation that auto-focusing cannot focus on the needs of triggering the focused target in a complex background, and achieve stable and efficient focus on the target.
  • FIG. 5 is a flowchart of another auto-focusing method provided in the embodiment of the present application.
  • the embodiment of the present application is refined on the basis of the above-mentioned embodiment, and the embodiment of the present application may be different from one or more of the above-mentioned embodiments.
  • the automatic focusing method provided in the embodiment of the present application may include the following steps:
  • the scene monitoring area includes the image effective area pre-divided in the shooting picture
  • the image block feature information includes the image block definition evaluation value and the image block color evaluation value.
  • the image block corresponding to the position of each image block in the overlapping area between the current frame image and the scene monitoring area is denoted as the first image block
  • the reference frame image and the scene monitoring area map each image in the overlapping area
  • the image block corresponding to the block position is denoted as the second image block.
  • the first image block feature information of the current frame image and the second image block feature information of the reference frame image can be obtained at the same image block position.
  • the image block feature is represented by the image block definition evaluation value and the image block color evaluation value.
  • the sharpness value is mainly based on the high-frequency information of the divided M*N image blocks, and the high-frequency information of the image block can effectively represent the high-frequency information of each image block.
  • the richness of details, so the high-frequency information of the image block can be used to evaluate the sharpness of the image block.
  • the color evaluation value of the image block the color information is extracted from the RGB color of the M*N image block output by the chip.
  • the R/G and B/G values can be used to evaluate the color of the image block.
  • the temperature of the image block can be detected by infrared to represent the image block feature.
  • the image block change information includes the number of changed blocks and a change trend evaluation value.
  • determining the image block change information of the current frame image relative to the reference frame image in the scene monitoring area may include the following steps A1-A2:
  • Step A1 according to the first image block feature information and the second image block feature information of each image block position, determine the image block of each image block position in the scene monitoring area relative to the current frame image relative to the reference frame image Feature change value.
  • Step A2 if the image block feature change value at any image block position is greater than or equal to the preset image block feature change threshold, then the image block at the image block position is used as a change block, and statistics are obtained. The number of change blocks of the frame image relative to the reference frame image in the scene monitoring area.
  • the image block feature change value is used to indicate the before and after changes of the image block sharpness evaluation value and the before and after changes of the image block color evaluation value.
  • the image block feature is represented by the image block definition evaluation value and the image block color evaluation value.
  • FV i t can be used to represent the t frame image
  • the current frame image relative to the reference frame image in the same image block in the scene monitoring area can be calculated
  • the image block feature change value for the location can be obtained.
  • the feature change value of the image block may be an amount of change in the image block definition evaluation value used to indicate the change before and after the image block definition evaluation value, which reflects the transition from the reference frame image to the current frame image
  • the image block sharpness evaluation value of the same image block position changes before and after.
  • the image block feature change value can also be the image block color evaluation value change amount used to indicate the before and after changes of the image block color evaluation value. The change before and after the color evaluation value of the image block at the position of the image block.
  • the image block characteristic change value can also be an image block temperature change amount used to indicate the change before and after the image block temperature, which reflects the transition from the reference frame image to the current frame image before and after the image.
  • the temperature of the image block at the same image block position detected by infrared before and after changes can also be an image block temperature change amount used to indicate the change before and after the image block temperature, which reflects the transition from the reference frame image to the current frame image before and after the image.
  • the characteristic change value of the image block can be a parameter index among the above-mentioned change amount of the image block definition evaluation value, the image block color evaluation value change amount, and the image block temperature change amount, or The combination of multiple parameter indicators is expressed.
  • Steps B1-B2 determine the image block change information of the current frame image relative to the reference frame image in the scene monitoring area, and may also include the following Steps B1-B2:
  • Step B1 according to the image block sharpness evaluation value indicated by the first image block feature information of each image block position and the image block sharpness evaluation value indicated by the second image block feature information, statistics current frame image relative.
  • Step B2 Calculate the change trend evaluation value of the current frame image relative to the reference frame image in the scene monitoring area according to the number of the first change block, the second change block number and the number of image blocks in the scene monitoring area.
  • the first change block includes an image block where the image sharpness evaluation value becomes smaller
  • the second change block includes an image block where the image sharpness evaluation value becomes larger.
  • the sharpness evaluation value of the image block between different images is used to judge whether the change of the sharpness evaluation value of the image block at the same image block position becomes larger or smaller. Furthermore, it is possible to count the image blocks where the image sharpness evaluation value becomes smaller and the image blocks where the image sharpness evaluation value becomes larger can be counted at each image block position, so as to determine the number of the first change block and the second change number of blocks.
  • represents the adjustment operator
  • E represents the number of image blocks in the scene monitoring area
  • Num down i represents the number of image blocks in the scene monitoring area where the sharpness of the image blocks changes significantly and becomes smaller, that is, the first The number of changed blocks
  • Num up i represents the number of image blocks whose clarity has changed significantly and become larger in the scene monitoring area, that is, the number of the first changed blocks
  • Q represents the current frame image relative to the reference frame image.
  • the image block definition evaluation value calculated by the chip when the target object enters the screen of the scene monitoring area, the image block definition evaluation value calculated by the chip will also be affected by the change of the overall image.
  • the device exposure will change based on the overall image brightness information.
  • Perform automatic adjustment which is briefly described as the greater the brightness of the image in the same scene, the greater the sharpness evaluation value, which affects the judgment of the change trend of the image block sharpness evaluation value at each image block position. Therefore, according to the image block color evaluation value indicated by the first image block feature information at each image block position and the image block color evaluation value indicated by the second image block feature information, the image change in the scene monitoring area can be determined.
  • the resulting image sharpness evaluation value offset of the current frame image and then according to the image sharpness evaluation value offset of the current frame image to the image block sharpness of each image block position of the current frame image in the scene monitoring area
  • the evaluation value is corrected to obtain the image block definition evaluation value that truly reflects the position of each image block after the screen changes.
  • the color information evaluation value extract the stable block area SA and the change block area CA of the current frame image t and the reference frame image in the scene monitoring area
  • S represents the number of image blocks in the stable block area
  • C represents the number of image blocks in the changed block area.
  • the color information evaluation value is not the only feasible statistical value for judging the image stabilization area.
  • the image sharpness evaluation value offset ⁇ FV t of the current frame image t caused by the image change can be extracted, and the image block sharpness evaluation value of the i-th image block of the current frame image t can be extracted. After removing the offset ⁇ FV t , it can truly reflect the image definition evaluation value FV i,? The changing trend of real Trend i .
  • the following formula can be used Calculate the offset ⁇ FV t of the image sharpness evaluation value of the current frame image t caused by the image change, where, Indicates the sharpness evaluation value of the stable block SA in the t-frame image.
  • the automatic focusing method in the embodiment of the present application by monitoring the scene changes in the scene monitoring area in real time, it is possible to accurately obtain the image block change information of the current frame image relative to the reference frame image in the scene monitoring area.
  • the number of change blocks in the information and the evaluation value of the change trend realize the timely and accurate triggering of the focus operation when the target moves out of the shooting screen or moves in the shooting screen; and the focus area of interest triggered by the movement of the target relative to the scene monitoring area Perform the focusing operation to improve the situation where the automatic focusing cannot be more focused on the need to trigger the focused target under complex backgrounds, and achieve the effect of focusing the target clearly and stably and efficiently.
  • FIG. 6 is a flowchart of another auto-focusing method provided in the embodiment of the present application.
  • the embodiment of the present application is refined on the basis of the above-mentioned embodiment, and the embodiment of the present application may be different from one or more of the above-mentioned embodiments.
  • the automatic focusing method provided in the embodiment of the present application may include the following steps:
  • S620 according to the first image block feature information and the second image block feature information of each image block position, determine the image block change information of the current frame image relative to the reference frame image in the scene monitoring area; wherein, the image area
  • the block feature information includes the image block definition evaluation value and the image block color evaluation value
  • the image block change information includes the number of changed blocks and the change trend evaluation value.
  • S630 Determine whether the scene monitoring area satisfies the first focusing condition according to the number of changed blocks indicated by the image block change information; the first focusing condition is used to judge whether the degree of change of the captured image in the scene monitoring area is obvious.
  • the number of changed blocks in the scene monitoring area of the current frame image and the reference frame image is greater than the threshold value Num fir of the number of changed blocks as the first focusing condition, wherein the scene monitoring area is a dynamic area, and the scene monitoring area is under the default condition.
  • the area may be the image active area B.
  • the purpose of the first focusing condition is to determine whether the photographed image changes significantly in the scene monitoring area, so as to extract the location of the changed area.
  • the threshold Num fir of the number of changed blocks set in the first focusing condition will change based on the dynamic changes of the scene monitoring area, but the default threshold of the number of changed blocks is restored after each focusing.
  • S640 Determine whether the scene monitoring area satisfies the second focus condition according to the change trend evaluation value indicated by the image block change information; the second focus condition is used to judge whether the change trends of the captured images in the scene monitoring area are consistent.
  • the change trend evaluation value of the current frame image and the reference frame image in the scene monitoring area is greater than the preset change trend evaluation value threshold Q sen as the second focusing condition.
  • the second focusing condition is expressed as whether the change trends of the images captured by the current frame image and the reference frame image in the scene monitoring area are consistent as a whole. Judgment that the change trend is consistent as a whole can be judged according to the change trend evaluation value of the image block definition evaluation value of the extracted current frame image relative to the reference frame image in the scene monitoring area.
  • the change trend evaluation value Q indicated by the image block change information is smaller than the preset change trend evaluation value threshold in the second focusing condition, it is considered that a certain number of sharpness evaluation values simultaneously exist in the effective area of the image and become larger (image block details).
  • the blocks with increased) and the blocks with reduced sharpness evaluation value (decreased image block details) the overall image change trend is inconsistent, and no focusing is required.
  • the second focusing condition mainly realizes identifying the motion pattern of the moving object in the image, judging whether the focusing operation is triggered on the scene monitoring area, and based on the judgment result of triggering the focusing operation on the scene monitoring area, the corresponding dynamic
  • the focus weight is used to determine the focus area of interest triggered by the movement of the target relative to the scene monitoring area. Based on the judgment result that the scene monitoring area does not trigger the focus operation, it is determined whether it is necessary to switch and recalculate and update the scene monitoring area.
  • the color information of the current frame image relative to the reference frame image is in the scene monitoring area
  • the position of each image block in the scene monitoring area can be calculated.
  • the dynamic focus weight Weight i is calculated according to the corresponding relationship between the changed block caused by the obvious change of the image color and the M*N block of the shooting screen divided by the chip, and the area with a non-zero weight is the focus area of interest, and the formula is as follows :
  • the sharpness evaluation value FV output in the focusing algorithm can be obtained according to the calculated dynamic focusing weight Weight i , which is Wherein, FV i represents the image block definition evaluation value of the i-th image block. Furthermore, according to the sharpness evaluation value FV output in the focusing algorithm, the focusing algorithm based on the hill-climbing method can eliminate the interference of the non-focused region of interest, that is, for the case a, the search for the optimal sharpness evaluation value can be faster, more effective and more stable. It is necessary to find the position of the focusing motor where the clear point of the target object entering the image is located.
  • the automatic focusing method in the embodiment of the present application by monitoring the scene changes in the scene monitoring area in real time, it is possible to accurately obtain the image block change information of the current frame image relative to the reference frame image in the scene monitoring area.
  • the number of change blocks in the information and the evaluation value of the change trend realize the timely and accurate triggering of the focus operation when the target moves out of the shooting screen or moves in the shooting screen; and the focus area of interest triggered by the movement of the target relative to the scene monitoring area
  • the autofocusing method provided in the embodiments of the present application may further include the following steps C1-C2:
  • Step C1 if it is determined that the scene monitoring area satisfies the first focusing condition and does not meet the second focusing condition, then the focusing of the scene monitoring area is not triggered; and, determining the post-movement position area of the target object when it moves within the scene monitoring area, And use the moved location area as a new scene monitoring area.
  • Step C2 Determine whether to update the first focus condition and the reference frame image according to the intersection result between the new scene monitoring area and the pre-divided image core area in the shooting picture, so as to be used when entering the next round of focus monitoring.
  • the new scene monitoring area DetScene can be recalculated based on the change of the image block definition evaluation value and the image block color evaluation value change in the scene monitoring area relative to the reference frame image, and the following can be used formula:
  • ColChange i represents the amount of change in the color evaluation value of the image block of the i-th image block in the original scene monitoring area
  • Col thresh represents the threshold value for judging the color change of the image block
  • Thresh i i represents the i-th image area in the original scene monitoring area
  • FV thresh represents the threshold value for determining the image block sharpness change
  • the new scene monitoring area DetScene is the area where Scene i i is non-zero.
  • the judgment threshold value of the first focus condition adopts the default change block quantity threshold Num fir ; If the scene monitoring area and the image core area have no intersection, then the scene monitoring area DetScene is updated to the non-zero area in the formula (5), the first The threshold Num fir of the number of blocks for changing a focus condition is changed to where p represents the number of image blocks with a value of 1 in the scene monitoring area.
  • the subdivision of the situation c and the situation d is carried out according to whether the new scene monitoring area and the image core area have an intersection. . If the scene monitoring area has an intersection with the image core area, it is divided into case c, and if the scene monitoring area and the image core area do not intersect, it is divided into case d.
  • case c after the target object moves, it is still in or partially in the image core area with the highest attention in the default scene monitoring area.
  • the default scene monitoring area is the image effective area.
  • the default threshold Num fir triggers focus to make the background clear; in case d, the target moves to the effective area of the image but not the core area. At this time, there is no need to trigger the focus but the reference frame renew.
  • the subsequent objects leave the screen directly. If the scene monitoring area is still the image valid area at this time, then the number of changes in the blocks after the object is moved out cannot easily meet the default threshold of the first focusing condition. Therefore, in case d The scene monitoring area and related thresholds in the first focusing condition need to be updated from time to time to prevent the object from continuing to move out of the screen in case d but not meeting the first focusing condition, resulting in blurred images after the target object moves out of the screen. Therefore, if the first focusing condition is satisfied but the second focusing condition is not satisfied, no focusing is required, and the current round of detection ends. At the same time, the reference frame of the next round of detection, the scene monitoring area and the judgment threshold of the first focusing condition are updated.
  • FIG. 7 is a structural block diagram of an automatic focusing device provided in an embodiment of the present application.
  • the embodiments of the present application can be applied to the case of automatically focusing on the focus area of interest of indeterminate size during the focusing process when the depth of field at the telephoto end of the device is small.
  • the apparatus can be implemented in software and/or hardware, and can be integrated on any electronic device with a network communication function.
  • the automatic focusing device provided in this embodiment may include the following: a block change monitoring module 710 , a focus trigger determination module 720 , and a focus trigger processing module 730 . in:
  • the block change monitoring module 710 is set to determine the current frame image relative to the reference frame image, the image block change information in the scene monitoring area; wherein the scene monitoring area includes the image effective area pre-divided in the shooting picture;
  • the focus triggering judgment module 720 is configured to determine whether to trigger focusing on the scene monitoring area according to the change information of the image blocks in the scene monitoring area;
  • the focus trigger processing module 730 is configured to determine a focus area of interest triggered by the movement of the target object relative to the scene monitoring area, and perform a focusing operation on the focus area of interest if the focus is determined to be triggered.
  • the image block change information in the scene monitoring area includes:
  • the first image block feature information and the second image block feature information of each image block position determine the image block change information of the current frame image relative to the reference frame image in the scene monitoring area
  • the image block feature information includes the image block definition evaluation value and the image block color evaluation value; the image block change information includes the number of changed blocks and the change trend evaluation value.
  • the first image block feature information and the second image block feature information of the position of each image block determine the image block change of the current frame image relative to the reference frame image in the scene monitoring area information, including:
  • the first image block feature information and the second image block feature information of each image block position determine the image block feature change value of each image block position in the scene monitoring area relative to the current frame image relative to the reference frame image ;
  • the image block at the image block position is regarded as the change block, and statistics are obtained to obtain the relative value of the current frame image. the number of change blocks of the reference frame image in the scene monitoring area;
  • the image block characteristic change value is used to indicate the before and after changes of the image block sharpness evaluation value and the before and after changes of the image block color evaluation value.
  • the first image block feature information and the second image block feature information of the position of each image block determine the image block change of the current frame image relative to the reference frame image in the scene monitoring area information, including:
  • the image block sharpness evaluation value indicated by the first image block feature information of each image block position and the image block sharpness evaluation value indicated by the second image block feature information statistics of the current frame image relative to the reference frame image The number of first change blocks and the number of second change blocks in the scene monitoring area; wherein the first change block includes an image block where the image clarity evaluation value becomes smaller, and the second change block Including the image block where the image sharpness evaluation value becomes larger;
  • an evaluation value of the change trend of the current frame image relative to the reference frame image in the scene monitoring area is calculated.
  • the first focusing condition is used to judge whether the degree of change of the captured picture in the scene monitoring area is obvious ;
  • the change trend evaluation value indicated by the change information of the image block it is judged whether the scene monitoring area satisfies the second focus condition; the second focus condition is used to judge whether the change trends of the captured images in the scene monitor area are consistent ;
  • determining the focus area of interest triggered by the movement of the target relative to the scene monitoring area includes:
  • the image block color evaluation value indicated respectively by the first image block feature information and the second image block feature information of each image block position calculate the current frame image relative to the reference frame image each in the scene monitoring area. The amount of change in the color evaluation value of the image block at the position of the image block;
  • the focused area of interest includes a position area after the target object moves in when the target object moves into the scene monitoring area; or, a position area before the target object moves out when the target object moves out of the scene monitoring area.
  • the method further includes:
  • the focusing on the scene monitoring area is not triggered; and, determining the target object moving in the scene monitoring area moving the location area, and using the moved location area as a new scene monitoring area;
  • the auto-focusing device provided in this embodiment of the present application can execute the auto-focusing method provided in any of the above-mentioned embodiments of the present application, and has corresponding functions and beneficial effects of executing the auto-focusing method.
  • the auto-focusing method in the foregoing embodiment. related operations please refer to the auto-focusing method in the foregoing embodiment. related operations.
  • FIG. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • the electronic device provided in this embodiment of the present application includes: one or more processors 810 and a storage device 820 ; the number of processors 810 in the electronic device may be one or more.
  • the processor 810 is taken as an example; the storage device 820 is configured to store one or more programs; the one or more programs are executed by the one or more processors 810, so that the one or more processors 810 implement the The automatic focusing method described in any one of the application embodiments.
  • the electronic device may further include: an input device 830 and an output device 840 .
  • the processor 810 , the storage device 820 , the input device 830 and the output device 840 in the electronic device may be connected by a bus or in other ways, and the connection by a bus is taken as an example in FIG. 8 .
  • the storage device 820 in the electronic device may be configured to store one or more programs, and the programs may be software programs, computer-executable programs, and modules, as provided in the embodiments of the present application
  • the processor 810 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the storage device 820, ie, implements the autofocus method in the above method embodiments.
  • the storage device 820 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device, and the like. Additionally, storage device 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, storage 820 may include memory located remotely from processor 810, which may be connected to the device through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the input device 830 may be configured to receive input numerical or character information, and to generate key signal input related to user settings and function control of the electronic device.
  • the output device 840 may include a display device such as a display screen.
  • the scene monitoring area includes the image effective area pre-divided in the shooting picture
  • the image block change information in the scene monitoring area determine whether to trigger the scene monitoring area to be focused
  • a focused area of interest triggered by the movement of the target object relative to the scene monitoring area is determined, and a focusing operation is performed on the focused area of interest.
  • An embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, is used to execute an auto-focusing method, and the method includes:
  • the scene monitoring area includes the image effective area pre-divided in the shooting picture
  • the image block change information in the scene monitoring area determine whether to trigger focusing on the scene monitoring area
  • a focused area of interest triggered by the movement of the target object relative to the scene monitoring area is determined, and a focusing operation is performed on the focused area of interest.
  • the program When the program is executed by the processor, it can also be used to execute the autofocus method provided in any embodiment of the present application.
  • the computer storage medium of the embodiments of the present application may adopt 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.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
  • Computer readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (Read Only Memory, ROM), Erasable Programmable Read Only Memory (EPROM), flash memory, optical fiber, portable CD-ROM, optical storage device, magnetic storage device, or any suitable combination of the above .
  • a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • the storage medium of computer-executable instructions may be a non-transitory computer-readable storage medium.
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • suitable medium including but not limited to: wireless, wire, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language.
  • 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.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider to via Internet connection).
  • LAN local area network
  • WAN wide area network

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

本申请实施例公开了一种自动聚焦方法、装置、电子设备及介质。所述方法包括:确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;依据图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作;响应于确定触发聚焦操作,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。

Description

自动聚焦方法、装置、电子设备及介质
本申请要求在2020年12月30日提交中国专利局、申请号为202011607244.8的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及视频成像技术领域,例如涉及一种自动聚焦方法、装置、电子设备及介质。
背景技术
随着通讯技术的发展与普及,稳定的图像和声音信号传输为远程会议、远程教学提供了坚实基础,并且在室内场景中应用视频会议、远程教学等时,经常需要将视频设备置于长焦端状态。
但是,在长焦端状态下,图像会由于焦距变长等原因导致景深变小,此时往往无法使目标物与背景同时保持清晰,因此整体图像易出现如图1所示的双波峰情况。相关技术中基于爬山法的聚焦算法对于聚焦结果更多关注于整体图像是否清晰,而不会关注聚焦后图像清晰区域是否在聚焦感兴趣区域上。尤其设备在大倍率下,图像景深变浅,无法同时保证背景与目标物同时清晰,出现聚焦后图像清晰点一直在背景而非聚焦感兴趣区域的问题。
发明内容
本申请实施例中提供了一种自动聚焦方法、装置、电子设备及介质,以实现在长焦端景深较小情况下,对移入移出画面或在画面中移动的目标物进行稳定高效地聚焦。
第一方面,本申请实施例中提供了一种自动聚焦方法,所述方法包括:
确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
依据所述图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作;
响应于确定触发聚焦操作,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
第二方面,本申请实施例中还提供了一种自动聚焦装置,所述装置包括:
区块变化监测模块,设置为确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分 的图像有效区域;
聚焦触发判断模块,设置为依据图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作;
聚焦触发处理模块,设置为响应于确定触发聚焦操作,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
第三方面,本申请实施例中还提供了一种电子设备,包括:
至少一个处理装置;
存储装置,设置为存储至少一个程序;
当所述至少一个程序被所述至少一个处理装置执行,使得所述至少一个处理装置实现如本申请任意实施例中提供的所述自动聚焦方法。
第四方面,本申请实施例中还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理装置执行时实现如本申请任意实施例中提供的所述自动聚焦方法。
附图说明
在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本申请实施例中提供的一种双波峰现象对基于爬山法的聚焦算法影响曲线示意图;
图2是本申请实施例中提供的一种自动聚焦方法的流程图;
图3是本申请实施例中提供的一种对拍摄画面按照关注度进行区域划分的示意图;
图4是本申请实施例中提供的在聚焦过程中的常见场景的划分示意图;
图5是本申请实施例中提供的另一种自动聚焦方法的流程图;
图6是本申请实施例中提供的又一种自动聚焦方法的流程图;
图7是本申请实施例中提供的一种自动聚焦装置的结构框图;
图8是本申请实施例中提供的一种电子设备的结构示意图。
具体实施方式
在更加详细地讨论示例性实施例之前,应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将多项操作(或步骤)描述成顺序的处理,但是其中的许多操作(或步骤)可以被并行地、并发地或者同时实施。此外,多项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
为了更好地理解本申请方案,如图1示出的内容,对相关技术中的聚焦问题进行阐述,若在一个背景复杂的场景中,长焦端整体图像清晰度评价值中波峰A可能为聚焦感兴趣区域清晰时的聚焦电机位置,相关技术中的全局搜索聚焦算法或者初始搜索点在波峰B附近的爬山搜索算法结果会不符合需求。此时,仅仅放大算法的搜索区域或者放松算法收敛条件会增大聚焦的幅度,导致场景模糊时间较长,且大概率会聚焦至细节丰富的背景,影响设备使用效果。因此,如何在监测及聚焦过程中重点关注聚焦感兴趣区域,消除了清晰度评价值的双波峰现象变得尤为重要。
下面通过以下实施例及其示例方案,对本申请方案中提供的自动聚焦方法、装置、电子设备及存储介质进行详细阐述。
图2是本申请实施例中提供的一种自动聚焦方法的流程图。本申请实施例可适用于在设备长焦端景深较小的情况下,对聚焦过程中重点关注的不定大小的聚焦感兴趣区域进行自动聚焦的情况。该方法可由图自动聚焦装置执行,该装置可采用软件和/或硬件的方式实现,并集成在任何具有网络通信功能的电子设备上。如图2所示,本实施例中提供的自动聚焦方法,可包括以下步骤:
S210、确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中场景监测区域包括在拍摄画面中预划分的图像有效区域。
在本实施例中,图3是本申请实施例中提供的一种对拍摄画面按照关注度进行区域划分的示意图,可预先将拍摄画面划分为M*N个区块,相应在拍摄画面下得到的每一帧图像会被划分为M*N个图像区块,后续可按照不同的图像区块位置来统计每个图像区块的图像区块特征。在完成一次聚焦后进入当前次的聚焦监测阶段时,可实时获取在拍摄画面下得到的当前帧图像;以及,获取在上次聚焦结束后得到拍摄画面下的一帧稳定图像作为参考帧图像。其中,稳定图像为连续多帧大部分图像区块颜色与图像区块清晰度评价值一致的图像。
在本实施例中,参见图3,在对拍摄画面的场景进行监测时,并不是对整个拍摄画面进行场景变化的监测,而是在拍摄画面中选定一个场景监测区域,重点对场景监测区域内的场景变化进行监测。这样一来,在拍摄画面中至少划分有一块敏感度或关注度更高的区域,以便后续将该关注度更高的区域作为场景监测区域进行画面场景变化的重点监测。
示例性地,参见图3,可在拍摄画面中划分得到图像核心区域A和图像有效区域B,其中图像有效区域B与图像核心区域A均属于聚焦过程中关注度或敏感度更高的区域,但图像有效区域B包含图像核心区域A,与图像有效区域B相比图像核心区A内关注度最高。考虑到上述在拍摄画面场景中划分得到的图像有效区域B属于受关注的区域,因此可先默认将图像有效区域B作为场景监测区域。其中,场景监测区域是一个动态变化的区域,在后续过程中如果关 注度发生变化可使用更新后的关注度更高的区域代替图像有效区域B作为场景监测区域。
在本实施例中,参见图3,按照拍摄画面的区块划分规则,在拍摄画面下得到的当前帧图像与参考帧图像会被划分为M*N个图像区块,每个图像区块在所属帧图像中有唯一的图像区块位置,通过图像区块位置可以定位在当前帧图像与参考帧图像中涉及的图像区块。由于利用在拍摄画面下拍摄得到当前帧图像和参考帧图像,在场景监测区域内监测拍摄画面的场景变化。因此,可计算当前帧图像与参考帧图像分别映射在场景监测区域内同一图像区块位置的图像区块之间的前后变化情况,即可统计得到当前帧图像相对于参考帧图像在每个图像区块位置处的图像区块变化信息,以此统计结果表示在场景监测区域内监测到拍摄画面的前后变化情况。
S220、依据在场景监测区域内的图像区块变化信息,确定是否触发对场景监测区域进行聚焦。
在本实施例中,确定是否触发对场景监测区域进行聚焦的条件可包括但不限于以下条件:场景监测区域内的拍摄画面是否发生明显的变化(即场景监测区域内拍摄画面的变化程度是否明显);以及,场景监测区域内的拍摄画面变化趋势是否整体一致(即当前帧图像相对参考帧图像的变化趋势是否整体一致),而上述当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息可以判断场景监测区域是否满足上述条件。
S230、若确定触发在场景监测区域聚焦,则确定目标物相对场景监测区域移动所触发的聚焦感兴趣区域,并在聚焦感兴趣区域进行聚焦操作。
在本实施例中,图4是本申请实施例中提供的在聚焦过程中的常见场景的划分示意图,以室内的视频会议设备为例,在视频会议设备置于长焦端状态的情况下,假设参考帧图像的拍摄画面为背景,当目标物移动至拍摄画面的场景监测区域(此时为图像有效区域B)并使图像稳定后,如图4所示,情况a是目标物移入拍摄画面中的场景监测区域,情况b是目标物移出拍摄画面中的场景监测区域,上述无论哪种情况下得到的当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,均会触发对场景监测区域进行聚焦。此时,可将目标物在移入场景监测区域内或移出场景监测区域时,所引起的场景监测区域内的画面发生明显变化的区域,作为目标物相对场景监测区域移动所触发的聚焦感兴趣区域。其中,聚焦感兴趣区域会根据场景监测区域内画面的背景内容和进出场景监测区域的画面的目标物而进行动态变化。
在本实施例中,在确定目标物相对场景监测区域移动所触发的聚焦感兴趣区域后,可基于爬山法的聚焦算法在聚焦感兴趣区域进行聚焦,使聚焦后图像清晰点一直在聚焦感兴趣区域,保证在聚焦过程中终点关注聚焦感兴趣区域。 由于不需要放大算法的搜索区域或者放松算法收敛条件会增大聚焦的幅度,因此能降低场景模糊时间,且大概率聚焦至比较关注的感兴趣区域,改善视频会议中长焦端景深较小的情况下,目标物移入移出画面或在画面中移动时,无法稳定且高效地将目标物聚焦清楚的情况。例如,对于情况a能在搜索中更快速、有效和平稳得找到进入场景监测区域所属拍摄画面的目标物清晰点对应的聚焦电机位置,实现在目标物当前所在区域进行自动聚焦;对于情况b也能有效聚焦目标物清晰点到目标物移出场景监测区域后的背景,实现在目标物移出前所在背景处进行自动聚焦。
根据本申请实施例中的自动聚焦方法,通过在场景监测区域实时进行画面场景变化监测,实现在对目标物移出拍摄画面或在拍摄画面中移动时及时准确地触发聚焦操作;以及通过在目标物相对场景监测区域移动所触发的聚焦感兴趣区域进行聚焦操作,改善无法在复杂背景下自动聚焦更关注于触发聚焦目标物的需求的情况,实现稳定且高效地将目标物进行聚焦清晰的效果。
图5是本申请实施例中提供的另一种自动聚焦方法的流程图,本申请实施例在上述实施例的基础上进行细化,本申请实施例可以与上述一个或者多个实施例中多个示例方案结合。如图5所示,本申请实施例中提供的自动聚焦方法,可包括以下步骤:
S510、确定当前帧图像与参考帧图像分别映射在场景监测区域内的每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息。
其中,场景监测区域包括在拍摄画面中预划分的图像有效区域,图像区块特征信息包括图像区块清晰度评价值和图像区块颜色评价值。
在本实施例中,当前帧图像与场景监测区域映射重叠区域的每个图像区块位置对应的图像区块记为第一图像区块,参考帧图像与场景监测区域映射重叠区域的每个图像区块位置对应的图像区块记为第二图像区块。对于当前帧图像与参考帧图像而言,在同一个图像区块位置处可得到当前帧图像的第一图像区块特征信息以及参考帧图像的第二图像区块特征信息。其中,图像区块特征采用图像区块清晰度评价值和图像区块颜色评价值进行表示。
在本实施例中,对于图像区块清晰度评价值,清晰度值以划分的M*N图像区块的高频信息为主,图像区块高频信息能有效表现出每个图像区块的细节丰富程度,因此可采用图像区块的高频信息评价图像区块的清晰度。对于图像区块颜色评价值,颜色信息提取于芯片输出的M*N图像区块的RGB颜色,为提高抗干扰性,可采用R/G与B/G数值评价图像区块颜色。此外,在环境温度较稳定的场景下,可通过红外检测图像区块温度来表示图像区块特征。
S520、依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信 息。
其中,图像区块变化信息包括变化区块数量和变化趋势评价值。
在本实施例的一种示例方案中,可以与上述一个或者多个实施例中多个示例方案结合。其中,依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,可包括以下步骤A1-A2:
步骤A1、依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内每个图像区块位置的图像区块特征变化值。
步骤A2、若任一图像区块位置的图像区块特征变化值大于或等于预设的图像区块特征变化阈值,则将该图像区块位置处的图像区块作为变化区块,统计得到当前帧图像相对参考帧图像在场景监测区域内的变化区块数量。
其中,图像区块特征变化值用于指示图像区块清晰度评价值的前后变化情况和图像区块颜色评价值的前后变化情况。
在本实施例中,图像区块特征采用图像区块清晰度评价值和图像区块颜色评价值进行表示,例如,以图像区块清晰度评价值为例,可采用FV i t表示t帧图像中第i图像区块的图像区块清晰度评价值。针对每个图像区块位置,可基于同一图像区块位置的第一图像区块特征信息与第二图像区块特征信息,计算当前帧图像相对参考帧图像在场景监测区域内该同一图像区块位置的图像区块特征变化值。以此类推,可得到从参考帧图像到当前帧图像在场景监测区域内不同图像区块位置的图像区块特征变化值。
在本实施例中,图像区块特征变化值可为用于指示图像区块清晰度评价值前后变化情况的图像区块清晰度评价值变化量,其反映了从参考帧图像向当前帧图像过渡的前后过程中,同一图像区块位置的图像区块清晰度评价值的前后变化。图像区块特征变化值还可为用于指示图像区块颜色评价值的前后变化情况的图像区块颜色评价值变化量,其反映了从参考帧图像向当前帧图像过渡的前后过程中,同一图像区块位置的图像区块颜色评价值的前后变化。在环境温度较稳定的场景下,图像区块特征变化值还可为用于指示图像区块温度前后变化情况的图像区块温度变化量,其反映了从参考帧图像向当前帧图像过渡的前后过程中,通过红外检测的同一图像区块位置的图像区块温度的前后变化。
在本实施例中,图像区块特征变化值可采用上述提到的图像区块清晰度评价值变化量、图像区块颜色评价值变化量以及图像区块温度变化量中的一种参数指标或者多种参数指标的结合进行表示。同时,还可设置用于从多个图像区块中区分发生明显变化的变化区块的预设图像区块特征变化阈值;例如,设置图像区块清晰度评价值变化量的阈值为FV thresh以及设置图像区块颜色评价值变 化量的阈值为Col thresh。这样,就可以从不同像区块位置处的图像区块中筛选出出现明显变化的变化区块有哪些,进而就能统计得到当前帧图像相对参考帧图像在场景监测区域内的变化区块数量。
在本实施例的另一种示例方案中,可以与上述一个或者多个实施例中多个示例方案结合。其中,依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,还可包括以下步骤B1-B2:
步骤B1、依据每个图像区块位置的第一图像区块特征信息指示的图像区块清晰度评价值与第二图像区块特征信息指示的图像区块清晰度评价值,统计当前帧图像相对参考帧图像在场景监测区域内第一变化区块数量和第二变化区块数量。
步骤B2、依据第一变化区块数量、第二变化区块数量以及场景监测区域内的图像区块数量,计算当前帧图像相对参考帧图像在场景监测区域内变化趋势评价值。
在本实施例中,其中,第一变化区块包括出现图像清晰度评价值变小的图像区块,第二变化区块包括出现图像清晰度评价值变大的图像区块。对于每个图像区块位置,可确定同一图像区块位置的第一图像区块特征信息指示的图像区块清晰度评价值与第二图像区块特征信息指示的图像区块清晰度评价值之间的图像区块清晰度评价值,通过图像区块清晰度评价值判断同一图像区块位置的图像区块清晰度评价值的前后变化是变大还是变小。进而,可以统计每个图像区块位置出现图像清晰度评价值变小的图像区块以及统计出现图像清晰度评价值变大的图像区块,即可确定第一变化区块数量与第二变化区块数量。
在本实施例中,在确定第一变化区块数量、第二变化区块数量以及场景监测区域内的图像区块数量后,可采用以下公式计算变化趋势评价值:
Figure PCTCN2021136267-appb-000001
其中,α表示调节算子;E表示场景监测区域内的图像区块数量,Num down,i表示在场景监测区域内图像区块清晰度发生明显变化且变小的图像区块数量,即第一变化区块数量;Num up,i表示在场景监测区域内图像区块清晰度发生明显变化且变大的图像区块数量,即第一变化区块数量;Q表示当前帧图像相对参考帧图像在场景监测区域内变化趋势评价值。
在本实施例中,在目标物体进入场景监测区域的画面时,由于芯片计算的图像区块清晰度评价值也会受到整体图像的变化的影响而变化,例如设备曝光会基于整体图像亮度信息变化进行自动调整,简要表述为同一场景下图像亮度越大,清晰度评价值越大,从而影响每图像区块位置的图像区块清晰度评价值变化趋势的判断。因此,可依据每个图像区块位置的第一图像区块特征信息指 示的图像区块颜色评价值与第二图像区块特征信息指示的图像区块颜色评价值,确定场景监测区域的画面变化造成的当前帧图像的图像清晰度评价值偏移量,进而依据当前帧图像的图像清晰度评价值偏移量对当前帧图像在场景监测区域内每个图像区块位置的图像区块清晰度评价值进行校正,以得到真实反映每个图像区块位置在画面变化后的图像区块清晰度评价值。
示例性地,依据颜色信息评价值,提取出当前帧图像t与参考帧图像在场景监测区域内的稳定区块区域SA和变化区块区域CA,S表示稳定区块区域内图像区块数量,C表示变化区块区域内图像区块数量。需要说明的是,颜色信息评价值非唯一可行的判断图像稳定区块的统计值。可提取出图像变化造成的当前帧图像t的图像清晰度评价值偏移量ΔFV t,当前帧图像t第i图像区块的图像区块清晰度评价值
Figure PCTCN2021136267-appb-000002
剔除偏移量ΔFV t后,可真实反映第i图像区块在画面变动后图像清晰度评价值FV i,?real的变化趋势Trend i。其中,可采用以下公式
Figure PCTCN2021136267-appb-000003
计算图像变化造成的当前帧图像t的图像清晰度评价值偏移量ΔFV t其中,
Figure PCTCN2021136267-appb-000004
表示t帧图像中稳定区块SA的清晰度评价值。
S530、依据在场景监测区域内的图像区块变化信息,确定是否触发对场景监测区域进行聚焦。
S540、若确定触发进行聚焦,则确定目标物相对场景监测区域移动所触发的聚焦感兴趣区域,并在聚焦感兴趣区域进行聚焦操作。
根据本申请实施例中的自动聚焦方法,通过在场景监测区域实时进行画面场景变化监测,能够准确获得当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,通过图像区块变化信息中的变化区块数量和变化趋势评价值实现在对目标物移出拍摄画面或在拍摄画面中移动时及时准确地触发聚焦操作;以及通过在目标物相对场景监测区域移动所触发的聚焦感兴趣区域进行聚焦操作,改善无法在复杂背景下自动聚焦更关注于触发聚焦目标物的需求的情况,实现稳定且高效地将目标物进行聚焦清晰的效果。
图6是本申请实施例中提供的又一种自动聚焦方法的流程图,本申请实施例在上述实施例的基础上进行细化,本申请实施例可以与上述一个或者多个实施例中多个示例方案结合。如图6所示,本申请实施例中提供的自动聚焦方法,可包括以下步骤:
S610、确定当前帧图像与参考帧图像分别映射在场景监测区域内每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息;其中场景监测区域包括在拍摄画面中预划分的图像有效区域。
S620、依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息;其中,图像区块特征信息包括图像区块清晰度评价值和图像区块颜色评价 值;图像区块变化信息包括变化区块数量和变化趋势评价值。
S630、依据图像区块变化信息指示的变化区块数量,判断场景监测区域是否满足第一聚焦条件;第一聚焦条件用于判断场景监测区域内拍摄画面的变化程度是否明显。
在本实施例中,以当前帧图像与参考帧图像在场景监测区域内变化区块数量大于变化区块数量阈值Num fir作为第一聚焦条件,其中场景监测区域为动态区域,默认条件下场景监测区域可为图像有效区域B。第一聚焦条件的目的是判断出场景监测区域内拍摄画面是否发生明显变化,以便提取出发生变化的区域位置。此处第一聚焦条件中设置变化区块数量阈值Num fir会基于场景监测区域的动态变化而变化,但每次聚焦结束后恢复默认的变化区块数量阈值。如果在场景监测区域内变化区块数量满足第一聚焦条件,则开始判断是否满足第二聚焦条件;如果在场景监测区域内变化区块数量不满足第一聚焦条件,结束本轮检测,返回继续判断是否满足第一聚焦条件。
S640、依据图像区块变化信息指示的变化趋势评价值,判断场景监测区域是否满足第二聚焦条件;第二聚焦条件用于判断场景监测区域内拍摄画面的变化趋势是否一致。
在本实施例中,以当前帧图像与参考帧图像在场景监测区域内变化趋势评价值大于预设变化趋势评价值阈值Q sen作为第二聚焦条件。第二聚焦条件表述为当前帧图像与参考帧图像在场景监测区域内拍摄画面的变化趋势是否整体一致。变化趋势整体一致的判断,可依据于提取出的当前帧图像相对参考帧图像在场景监测区域内的图像区块清晰度评价值的变化趋势评价值进行判断。例如当图像区块变化信息指示的变化趋势评价值Q小于第二聚焦条件中预设变化趋势评价值阈值时,认为图像有效区内同时存在一定数量的清晰度评价值变大(图像区块细节增多)的区块和清晰度评价值减小(图像区块细节减少)的区块,整体图像变化趋势不一致,不需要聚焦。当图像区块变化信息指示的变化趋势评价值Q大于第二聚焦条件阈值中预设变化趋势评价值阈值Q sen时,认为图像有效区内变化区块绝大部分图像区块的清晰度评价值为变小或变大,则可认为当前图像信息的变化趋势整体一致,触发聚焦。
S650、若确定场景监测区域同时满足第一聚焦条件和第二聚焦条件,则确定触发对场景监测区域进行聚焦。
在本实施例中,第二聚焦条件主要实现对图像内运动物体的运动模式进行识别,判断是否对场景监测区域触发聚焦操作,基于对场景监测区域触发聚焦操作的判断结果,下发对应的动态聚焦权重以便确定目标物相对场景监测区域移动所触发的聚焦感兴趣区域,基于对场景监测区域不触发聚焦操作的判断结果,判断是否需要切换重新计算更新场景监测区域。
S660、若确定触发进行聚焦,则确定目标物相对场景监测区域移动所触发的聚焦感兴趣区域,并在聚焦感兴趣区域进行聚焦操作。
在本实施例中,参见图4,以情况a目标物移入场景监测区域的拍摄画面和情况b目标物移出场景监测区域的拍摄画面,在当前帧图像相对参考帧图像在场景监测区域内颜色信息与图像清晰度发生明显变化的变化区块数满足第一聚焦条件,同时场景监测区域内拍摄画面的变化趋势满足第二聚焦条件的情况下,可计算场景监测区域内每个图像区块位置的图像区块颜色评价值变化量ColChange i。根据图像颜色发生明显变化所造成的变化区块与芯片划分的拍摄画面的M*N区块对应关系,计算出动态聚焦权重Weight i,其中权重非零的区域即为聚焦感兴趣区域,公式如下:
Figure PCTCN2021136267-appb-000005
在本实施例中,参见图4,根据计算出的动态聚焦权重Weight i即可获得聚焦算法中的清晰度评价值FV output,即为
Figure PCTCN2021136267-appb-000006
其中,FV i表示第i图像区块的图像区块清晰度评价值。进而,根据聚焦算法中的清晰度评价值FV output,基于爬山法的聚焦算法可以剔除非聚焦感兴趣区域的干扰,即对于情况a能在最优清晰度评价值搜索中更快速、有效和平稳得找到进入图像的目标物清晰点所在聚焦电机位置,对于情况b也能有效聚焦清晰到目标物移出后的背景,聚焦完成后更新场景检测的参考帧。在场景变化触发自动聚焦结束后,将当前帧图像作为参考帧图像,场景监测区域及第一聚焦条件的变化区块数量阈值重新赋值默认参数Num fir,然后进行下一轮场景检测。
根据本申请实施例中的自动聚焦方法,通过在场景监测区域实时进行画面场景变化监测,能够准确获得当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,通过图像区块变化信息中的变化区块数量和变化趋势评价值实现在对目标物移出拍摄画面或在拍摄画面中移动时及时准确地触发聚焦操作;以及通过在目标物相对场景监测区域移动所触发的聚焦感兴趣区域进行聚焦操作,改善无法在复杂背景下自动聚焦更关注于触发聚焦目标物的需求的情况,实现稳定且高效地将目标物进行聚焦清晰的效果,例如提高视频会议设备长焦端目标物进入画面后,成功聚焦到目标物的概率;以及提高视频会议设备长焦端目标物在画面内移动时的画面稳定性。
在上述实施例的基础上,本申请实施例中提供的自动聚焦方法还可包括以下步骤C1-C2:
步骤C1、若确定场景监测区域满足第一聚焦条件,且不满足第二聚焦条件,则不触发对场景监测区域进行聚焦;以及,确定目标物在场景监测区域内移动时的移动后位置区域,并将移动后位置区域作为新的场景监测区域。
步骤C2、依据新的场景监测区域与在拍摄画面中预划分的图像核心区域的相交结果,确定是否对第一聚焦条件和参考帧图像进行更新,以在进入下一轮聚焦监测阶段时使用。
在本实施例中,在确定场景监测区域满足第一聚焦条件但不满足第二聚焦条件的情况下,则评估第一聚焦条件是否需要变更。此时,可基于当前帧图像相对参考帧图像在场景监测区域内的图像区块清晰度评价值变化量与图像区块颜色评价值变化量,重新计算得到新的场景监测区域DetScene,可采用如下公式:
Figure PCTCN2021136267-appb-000007
其中,ColChange i表示原场景监测区域内第i图像区块的图像区块颜色评价值变化量,Col thresh表示判定图像区块颜色变化的阈值,Thresh i i表示原场景监测区域内第i图像区块的图像区块清晰度评价值变化量,FV thresh表示判定图像区块清晰度变化的阈值,新的场景监测区域DetScene即为Scene i i非零的区域。
在本实施例中,参见图4,若新的场景监测区域与图像核心区有交集,则不需要更新原始的场景监测区域和第一聚焦条件的判断阈值,下一轮场景监测区域使用默认图像有效区域B,第一聚焦条件的判断阈值采用默认的变化区块数量阈值Num fir;若场景监测区域与图像核心区无交集,则场景监测区域DetScene更新为公式(5)中非零区域,第一聚焦条件的变化区块数量阈值Num fir变更为
Figure PCTCN2021136267-appb-000008
其中p表示场景监测区域内数值为1的图像区块数。
在本实施例中,参见图4,在满足第一聚焦条件但不满足第二聚焦条件的情况下,根据新的场景监测区域与图像核心区域是否有交集,进行情况c与情况d的细分。若场景监测区域与图像核心区有交集,则划分为情况c,若场景监测区域与图像核心区没有交集,则划分为情况d。在情况c中,目标物移动后依旧处于或部分处于默认场景监测区域下关注度最高的图像核心区域,默认场景监测区域即为图像有效区,当目标物如情况b继续移出画面时,默认监测场景区域下图像变化区块数易满足第一聚焦条件默认阈值Num fir继而触发聚焦使背景清晰;在情况d中,目标物移动至图像有效区但非核心区,此时无需触发聚焦但参考帧更新。
在本实施例中,参见图4,后续物体直接离开画面,若此时场景监测区域依然为图像有效区,则目标物移出后区块变化数目不易满足第一聚焦条件默认阈值,因此在情况d时需更新第一聚焦条件中场景监测区域和相关阈值,防止情况d中物体继续移出但不满足第一聚焦条件,从而造成目标物移出画面后图像模糊的情况。因此,在满足第一聚焦条件但不满足第二聚焦条件的情况下,不需要聚焦,本轮检测结束。同时更新下一轮检测的参考帧、场景监测区域和第 一聚焦条件的判断阈值。
图7是本申请实施例中提供的一种自动聚焦装置的结构框图。本申请实施例可适用于在设备长焦端景深较小的情况下,对聚焦过程中重点关注的不定大小的聚焦感兴趣区域进行自动聚焦的情况。该装置可采用软件和/或硬件的方式实现,并集成在任何具有网络通信功能的电子设备上。如图7所示,本实施例中提供的自动聚焦装置,可包括以下:区块变化监测模块710、聚焦触发判断模块720和聚焦触发处理模块730。其中:
区块变化监测模块710,设置为确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
聚焦触发判断模块720,设置为依据在场景监测区域内的图像区块变化信息,确定是否触发对所述场景监测区域进行聚焦;
聚焦触发处理模块730,设置为若确定触发聚焦,则确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
在上述实施例的基础上,确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息,包括:
确定当前帧图像与参考帧图像分别映射在场景监测区域内每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息;
依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息;
其中,所述图像区块特征信息包括图像区块清晰度评价值和图像区块颜色评价值;所述图像区块变化信息包括变化区块数量和变化趋势评价值。
在上述实施例的基础上,依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,包括:
依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内每个图像区块位置的图像区块特征变化值;
若任一图像区块位置的图像区块特征变化值大于或等于预设的图像区块特征变化阈值,则将该图像区块位置处的图像区块作为变化区块,统计得到当前帧图像相对参考帧图像在所述场景监测区域内的变化区块数量;
其中,所述图像区块特征变化值用于指示图像区块清晰度评价值的前后变化情况和图像区块颜色评价值的前后变化情况。
在上述实施例的基础上,依据每个图像区块位置的第一图像区块特征信息 与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,包括:
依据每个图像区块位置的第一图像区块特征信息指示的图像区块清晰度评价值与第二图像区块特征信息指示的图像区块清晰度评价值,统计当前帧图像相对参考帧图像在所述场景监测区域内第一变化区块数量和第二变化区块数量;其中所述第一变化区块包括出现图像清晰度评价值变小的图像区块,所述第二变化区块包括出现图像清晰度评价值变大的图像区块;
依据所述第一变化区块数量、所述第二变化区块数量以及所述场景监测区域内的图像区块数量,计算当前帧图像相对参考帧图像在场景监测区域内变化趋势评价值。
在上述实施例的基础上,依据在场景监测区域内的图像区块变化信息,确定是否触发对所述场景监测区域进行聚焦,包括:
依据所述图像区块变化信息指示的变化区块数量,判断所述场景监测区域是否满足第一聚焦条件;所述第一聚焦条件用于判断所述场景监测区域内拍摄画面的变化程度是否明显;
依据所述图像区块变化信息指示的变化趋势评价值,判断所述场景监测区域是否满足第二聚焦条件;所述第二聚焦条件用于判断所述场景监测区域内拍摄画面的变化趋势是否一致;
若确定所述场景监测区域同时满足第一聚焦条件和第二聚焦条件,则确定触发对所述场景监测区域进行聚焦。
在上述实施例的基础上,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,包括:
依据每个图像区块位置的第一图像区块特征信息与第二图像区块特征信息分别指示的图像区块颜色评价值,计算当前帧图像相对参考帧图像在所述场景监测区域内每个图像区块位置的图像区块颜色评价值变化量;
将所述场景监测区域内图像区块颜色评价值变化量的绝对值大于预设颜色评价值变化量阈值的位置区域作为目标物触发的所述聚焦感兴趣区域;
其中,所述聚焦感兴趣区域包括在目标物移入所述场景监测区域时的目标物移入后位置区域;或者,在目标物移出所述场景监测区域时的目标物移出前位置区域。
在上述实施例的基础上,所述方法还包括:
若确定所述场景监测区域满足所述第一聚焦条件,且不满足所述第二聚焦条件,则不触发对所述场景监测区域进行聚焦;以及,确定目标物在场景监测区域内移动时的移动后位置区域,并将所述移动后位置区域作为新的场景监测区域;
依据所述新的场景监测区域与在拍摄画面中预划分的图像核心区域的相交结果,确定是否对所述第一聚焦条件和所述参考帧图像进行更新,以在进入下一轮聚焦监测阶段时使用。
本申请实施例中所提供的自动聚焦装置可执行上述本申请任意实施例中所提供的自动聚焦方法,具备执行该自动聚焦方法相应的功能和有益效果,详细过程参见前述实施例中自动聚焦方法的相关操作。
图8是本申请实施例中提供的一种电子设备的结构示意图。如图8所示结构,本申请实施例中提供的电子设备包括:一个或多个处理器810和存储装置820;该电子设备中的处理器810可以是一个或多个,图8中以一个处理器810为例;存储装置820设置为存储一个或多个程序;所述一个或多个程序被所述一个或多个处理器810执行,使得所述一个或多个处理器810实现如本申请实施例中任一项所述的自动聚焦方法。
该电子设备还可以包括:输入装置830和输出装置840。
该电子设备中的处理器810、存储装置820、输入装置830和输出装置840可以通过总线或其他方式连接,图8中以通过总线连接为例。
该电子设备中的存储装置820作为一种计算机可读存储介质,可设置为存储一个或多个程序,所述程序可以是软件程序、计算机可执行程序以及模块,如本申请实施例中所提供的自动聚焦方法对应的程序指令/模块。处理器810通过运行存储在存储装置820中的软件程序、指令以及模块,从而执行电子设备的多种功能应用以及数据处理,即实现上述方法实施例中自动聚焦方法。
存储装置820可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储装置820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储装置820可包括相对于处理器810远程设置的存储器,这些远程存储器可以通过网络连接至设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置830可设置为接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。输出装置840可包括显示屏等显示设备。
并且,当上述电子设备所包括一个或者多个程序被所述一个或者多个处理器810执行时,程序进行如下操作:
确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
依据在场景监测区域内的图像区块变化信息,确定是否触发对所述场景监 测区域进行聚焦;
若确定触发聚焦,则确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
当然,本领域技术人员可以理解,当上述电子设备所包括一个或者多个程序被所述一个或者多个处理器810执行时,程序还可以进行本申请任意实施例中所提供的自动聚焦方法中的相关操作。
本申请实施例中提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时用于执行自动聚焦方法,该方法包括:
确定当前帧图像相对参考帧图像,在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
依据在场景监测区域内的图像区块变化信息,确定是否触发对所述场景监测区域进行聚焦;
若确定触发聚焦,则确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
该程序被处理器执行时还可以用于执行本申请任意实施例中所提供的自动聚焦方法。
本申请实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式CD-ROM、光存储器件、磁存储器件、或者上述的任意合适的组合。计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于:电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可执行指令的存储介质可以是非暂态计算机可读存储介质。
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不 限于:无线、电线、光缆、无线电频率(Radio Frequency,RF)等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。

Claims (10)

  1. 一种自动聚焦方法,包括:
    确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
    依据所述图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作;
    响应于确定触发所述聚焦操作,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
  2. 根据权利要求1所述的方法,其中,所述场景监测区域包括至少一个图像区块,所述确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,包括:
    确定当前帧图像与参考帧图像分别映射在场景监测区域内每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息;
    依据所述每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息;
    其中,所述第一图像区块特征信息和所述第二图像区块特征信息分别包括图像区块清晰度评价值和图像区块颜色评价值;所述图像区块变化信息包括变化区块数量和变化趋势评价值。
  3. 根据权利要求2所述的方法,其中,所述依据所述每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,包括:
    依据所述每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内所述每个图像区块位置处的图像区块特征变化值;
    响应于确定任一图像区块位置处的图像区块特征变化值大于或等于预设的图像区块特征变化阈值,将所述任一图像区块位置处的图像区块作为变化区块,统计得到当前帧图像相对参考帧图像在所述场景监测区域内的变化区块数量;
    其中,所述图像区块特征变化值用于指示图像区块清晰度评价值的前后变化情况和图像区块颜色评价值的前后变化情况。
  4. 根据权利要求2所述的方法,其中,所述依据所述每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息,确定当前帧图像相对参考帧图像在场景监测区域内的图像区块变化信息,包括:
    依据所述每个图像区块位置处的第一图像区块特征信息指示的图像区块清晰度评价值与第二图像区块特征信息指示的图像区块清晰度评价值,统计当前帧图像相对参考帧图像在所述场景监测区域内第一变化区块数量和第二变化区 块数量;其中所述第一变化区块包括出现图像清晰度评价值变小的图像区块,所述第二变化区块包括出现图像清晰度评价值变大的图像区块;
    依据所述第一变化区块数量、所述第二变化区块数量以及所述场景监测区域内的图像区块数量,计算当前帧图像相对参考帧图像在场景监测区域内变化趋势评价值。
  5. 根据权利要求2所述的方法,其中,所述依据所述图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作,包括:
    依据所述图像区块变化信息指示的变化区块数量,判断所述场景监测区域是否满足第一聚焦条件;所述第一聚焦条件用于判断所述场景监测区域内拍摄画面的变化程度是否明显;
    依据所述图像区块变化信息指示的变化趋势评价值,判断所述场景监测区域是否满足第二聚焦条件;所述第二聚焦条件用于判断所述场景监测区域内拍摄画面的变化趋势是否一致;
    基于所述场景监测区域同时满足第一聚焦条件和第二聚焦条件的判断结果,确定触发对所述场景监测区域的聚焦操作。
  6. 根据权利要求2所述的方法,其中,所述确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,包括:
    依据所述每个图像区块位置处的第一图像区块特征信息与第二图像区块特征信息分别指示的图像区块颜色评价值,计算当前帧图像相对参考帧图像在所述场景监测区域内所述每个图像区块位置处的图像区块颜色评价值变化量;
    将所述场景监测区域内图像区块颜色评价值变化量的绝对值大于预设颜色评价值变化量阈值的位置区域作为目标物触发的所述聚焦感兴趣区域;
    其中,所述聚焦感兴趣区域包括在目标物移入所述场景监测区域时的目标物移入后位置区域;或者,在目标物移出所述场景监测区域时的目标物移出前位置区域。
  7. 根据权利要求5所述的方法,还包括:
    基于所述场景监测区域满足所述第一聚焦条件,且不满足所述第二聚焦条件的判断结果,不触发对所述场景监测区域的聚焦操作;确定目标物在场景监测区域内移动时的移动后位置区域,并将所述移动后位置区域作为新的场景监测区域;
    依据所述新的场景监测区域与在拍摄画面中预划分的图像核心区域的相交结果,确定是否对所述第一聚焦条件和所述参考帧图像进行更新,以在进入下一轮聚焦监测阶段时使用。
  8. 一种自动聚焦装置,包括:
    区块变化监测模块,设置为确定当前帧图像相对参考帧图像在场景监测区 域内的图像区块变化信息;其中所述场景监测区域包括在拍摄画面中预划分的图像有效区域;
    聚焦触发判断模块,设置为依据所述图像区块变化信息,确定是否触发对所述场景监测区域的聚焦操作;
    聚焦触发处理模块,设置为响应于确定触发所述聚焦操作,确定目标物相对所述场景监测区域移动所触发的聚焦感兴趣区域,并在所述聚焦感兴趣区域进行聚焦操作。
  9. 一种电子设备,包括:
    至少一个处理装置;
    存储装置,设置为存储至少一个程序;
    当所述至少一个程序被所述至少一个处理装置执行,使得所述至少一个处理装置实现权利要求1-7中任一所述的自动聚焦方法。
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理装置执行时实现权利要求1-7中任一所述的自动聚焦方法。
PCT/CN2021/136267 2020-12-30 2021-12-08 自动聚焦方法、装置、电子设备及介质 Ceased WO2022143053A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/260,187 US12549852B2 (en) 2020-12-30 2021-12-08 Auto-focusing method and apparatus, electronic device, and medium
EP21913794.0A EP4274216A4 (en) 2020-12-30 2021-12-08 Auto-focusing method and apparatus, electronic device, and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011607244.8 2020-12-30
CN202011607244.8A CN114697524B (zh) 2020-12-30 2020-12-30 自动聚焦方法、装置、电子设备及介质

Publications (1)

Publication Number Publication Date
WO2022143053A1 true WO2022143053A1 (zh) 2022-07-07

Family

ID=82131592

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136267 Ceased WO2022143053A1 (zh) 2020-12-30 2021-12-08 自动聚焦方法、装置、电子设备及介质

Country Status (4)

Country Link
US (1) US12549852B2 (zh)
EP (1) EP4274216A4 (zh)
CN (1) CN114697524B (zh)
WO (1) WO2022143053A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190242A (zh) * 2022-07-08 2022-10-14 杭州海康威视数字技术股份有限公司 聚焦触发方法及装置
CN115209051A (zh) * 2022-07-08 2022-10-18 杭州海康威视数字技术股份有限公司 变焦摄像机的聚焦方法及装置
CN118540581A (zh) * 2024-07-25 2024-08-23 浙江大华技术股份有限公司 一种聚焦控制方法、装置、电子装置和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118555485A (zh) * 2024-07-26 2024-08-27 浙江大华技术股份有限公司 一种聚焦补偿方法、装置、设备及介质
CN120751255B (zh) * 2025-08-20 2025-12-02 浙江华飞智能科技有限公司 自动聚焦的方法及装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080226278A1 (en) * 2007-03-15 2008-09-18 Nvidia Corporation Auto_focus technique in an image capture device
CN104079832A (zh) * 2014-06-30 2014-10-01 苏州科达科技股份有限公司 一种一体化摄像机自动跟踪聚焦方法及系统
CN105262954A (zh) * 2015-11-17 2016-01-20 腾讯科技(深圳)有限公司 触发摄像头自动聚焦的方法和装置
CN105635554A (zh) * 2014-10-30 2016-06-01 展讯通信(上海)有限公司 自动对焦控制方法及装置
CN107124556A (zh) * 2017-05-31 2017-09-01 广东欧珀移动通信有限公司 对焦方法、装置、计算机可读存储介质和移动终端
CN111131717A (zh) * 2019-12-31 2020-05-08 深圳市维海德技术股份有限公司 聚焦方法、装置、设备与计算机可读存储介质
CN113572958A (zh) * 2021-07-15 2021-10-29 杭州海康威视数字技术股份有限公司 一种自动触发摄像机聚焦的方法及设备

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6088539A (en) * 1997-12-24 2000-07-11 Canon Kabushiki Kaisha Optical apparatus with focus adjusting function and focus adjustment control circuit
JP2003015026A (ja) * 2001-07-02 2003-01-15 Konica Corp 画像処理方法及び画像処理装置
CN103424953B (zh) * 2012-05-25 2017-08-11 中兴通讯股份有限公司 自动聚焦方法及装置
KR101990073B1 (ko) * 2012-11-12 2019-06-17 삼성전자주식회사 전자장치에서 다초점 영상 촬영 및 저장 방법 및 장치
EP3562143B1 (en) * 2013-01-09 2021-04-21 SONY Corporation Image processing device, image processing method, and program
TWI524108B (zh) * 2014-04-24 2016-03-01 瑞昱半導體股份有限公司 被動式自動對焦裝置與方法
US9686463B2 (en) 2015-03-10 2017-06-20 Qualcomm Incorporated Systems and methods for continuous auto focus (CAF)
CN105472250B (zh) * 2015-12-23 2018-12-07 浙江宇视科技有限公司 自动聚焦方法及装置
US9838594B2 (en) * 2016-03-02 2017-12-05 Qualcomm Incorporated Irregular-region based automatic image correction
CN107888819B (zh) * 2016-09-29 2020-07-07 华为技术有限公司 一种自动聚焦方法及装置
CN110383817B (zh) * 2017-03-15 2021-06-29 索尼公司 图像拾取设备、视频信号处理设备和视频信号处理方法
WO2019061079A1 (zh) * 2017-09-27 2019-04-04 深圳市大疆创新科技有限公司 一种对焦处理方法及设备
WO2019167483A1 (ja) * 2018-03-01 2019-09-06 富士フイルム株式会社 焦点調節操作検出装置、焦点調節操作検出方法及び焦点調節操作検出プログラム、並びに、撮像装置本体及び撮像装置
JP7336958B2 (ja) * 2019-10-21 2023-09-01 キヤノン株式会社 撮像装置及びその制御方法、プログラム、記憶媒体

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080226278A1 (en) * 2007-03-15 2008-09-18 Nvidia Corporation Auto_focus technique in an image capture device
CN104079832A (zh) * 2014-06-30 2014-10-01 苏州科达科技股份有限公司 一种一体化摄像机自动跟踪聚焦方法及系统
CN105635554A (zh) * 2014-10-30 2016-06-01 展讯通信(上海)有限公司 自动对焦控制方法及装置
CN105262954A (zh) * 2015-11-17 2016-01-20 腾讯科技(深圳)有限公司 触发摄像头自动聚焦的方法和装置
CN107124556A (zh) * 2017-05-31 2017-09-01 广东欧珀移动通信有限公司 对焦方法、装置、计算机可读存储介质和移动终端
CN111131717A (zh) * 2019-12-31 2020-05-08 深圳市维海德技术股份有限公司 聚焦方法、装置、设备与计算机可读存储介质
CN113572958A (zh) * 2021-07-15 2021-10-29 杭州海康威视数字技术股份有限公司 一种自动触发摄像机聚焦的方法及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4274216A4

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190242A (zh) * 2022-07-08 2022-10-14 杭州海康威视数字技术股份有限公司 聚焦触发方法及装置
CN115209051A (zh) * 2022-07-08 2022-10-18 杭州海康威视数字技术股份有限公司 变焦摄像机的聚焦方法及装置
CN115209051B (zh) * 2022-07-08 2024-02-13 杭州海康威视数字技术股份有限公司 变焦摄像机的聚焦方法及装置
CN115190242B (zh) * 2022-07-08 2024-02-13 杭州海康威视数字技术股份有限公司 聚焦触发方法及装置
CN118540581A (zh) * 2024-07-25 2024-08-23 浙江大华技术股份有限公司 一种聚焦控制方法、装置、电子装置和存储介质

Also Published As

Publication number Publication date
CN114697524A (zh) 2022-07-01
EP4274216A1 (en) 2023-11-08
US20240056684A1 (en) 2024-02-15
CN114697524B (zh) 2023-05-02
EP4274216A4 (en) 2024-12-18
US12549852B2 (en) 2026-02-10

Similar Documents

Publication Publication Date Title
WO2022143053A1 (zh) 自动聚焦方法、装置、电子设备及介质
US10951833B2 (en) Method and device for switching between cameras, and terminal
CN113837079B (zh) 显微镜的自动对焦方法、装置、计算机设备和存储介质
CN109495686B (zh) 拍摄方法及设备
CN107710736B (zh) 辅助用户捕获图像或视频的方法和系统
CN110753182A (zh) 成像设备的调节方法和设备
US12143718B2 (en) Methods and systems for capturing enhanced media in real-time
US12335629B2 (en) Imaging exposure control method and apparatus, device and storage medium
CN111405185B (zh) 一种摄像机变倍控制方法、装置、电子设备及存储介质
CN113810615B (zh) 对焦处理方法、装置、电子设备和存储介质
CN118784807A (zh) 一种投影仪自动对焦方法、装置、投影仪、设备及介质
CN114095693A (zh) 聚焦曲线校正方法、变焦跟踪方法以及相关设备
CN108769538B (zh) 自动对焦方法、装置、存储介质及终端
WO2020187197A1 (zh) 成像设备的变焦方法、图像处理方法及成像设备
CN113301324A (zh) 基于摄像装置的虚焦检测方法、装置、设备及介质
CN114926379A (zh) 一种图像融合方法、计算机可读存储介质及设备
CN111491105B (zh) 移动终端的对焦方法、移动终端及计算机存储介质
CN110839126B (zh) 一种变倍追踪方法、装置及可变倍摄像机
CN116668844A (zh) 曝光调节方法、装置、电子设备及存储介质
CN116320743B (zh) 对象识别方法、装置、电子设备以及计算机存储介质
CN113657255A (zh) 一种自动框选人的方法和存储设备
CN113691720B (zh) 一种激光云台摄像机的聚焦方法、装置、存储介质及设备
CN117479011A (zh) 一种无人机自动聚焦的方法、装置以及电子设备
CN110677561B (zh) 影像合成方法与系统
CN119521020A (zh) 图像处理方法、装置、设备和介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21913794

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18260187

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021913794

Country of ref document: EP

Effective date: 20230731

WWG Wipo information: grant in national office

Ref document number: 18260187

Country of ref document: US