WO2022161250A1 - 摄像控制方法、装置、计算机设备和存储介质 - Google Patents

摄像控制方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2022161250A1
WO2022161250A1 PCT/CN2022/073007 CN2022073007W WO2022161250A1 WO 2022161250 A1 WO2022161250 A1 WO 2022161250A1 CN 2022073007 W CN2022073007 W CN 2022073007W WO 2022161250 A1 WO2022161250 A1 WO 2022161250A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
area
ratio
value
frame image
Prior art date
Application number
PCT/CN2022/073007
Other languages
English (en)
French (fr)
Inventor
王文龙
华旭宏
杨国全
曹亚曦
王克彦
Original Assignee
浙江华创视讯科技有限公司
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
Priority claimed from CN202110114788.9A external-priority patent/CN112449117B/zh
Priority claimed from CN202110230319.3A external-priority patent/CN112601028B/zh
Application filed by 浙江华创视讯科技有限公司 filed Critical 浙江华创视讯科技有限公司
Priority to US18/274,742 priority Critical patent/US20240114246A1/en
Publication of WO2022161250A1 publication Critical patent/WO2022161250A1/zh

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/69Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • 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
    • 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
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • 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/695Control of camera direction for changing a field of view, e.g. pan, tilt or based on tracking of objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present application relates to the technical field of image communication, and in particular, to a camera control method, apparatus, computer device and storage medium.
  • the zoom function which can be zoomed through digital zoom and optical zoom to achieve appropriate image quality output.
  • the pictures in the real scene may have some complex situations, such as multiple depths of field, multiple faces, etc. If manual debugging is used, it is obviously difficult; and the zoom method cannot be determined accurately and quickly, resulting in image clarity. It cannot be balanced with face capture, and the problem that it is difficult to quickly roll back after the face disappears is also particularly prominent.
  • the embodiments of the present application provide a camera control method, apparatus, computer device, and storage medium to solve at least one problem existing in the background art.
  • an embodiment of the present application provides a camera control method, the method comprising:
  • the first ratio is the ratio of the current optical zoom ratio of the target imaging device to the maximum optical zoom ratio of the target imaging device
  • the second ratio is the proportion of the area of the face area currently captured by the target imaging device in the entire captured image
  • control the target imaging device to perform optical zooming If yes, control the target imaging device to perform optical zooming; if not, control the target imaging device to perform digital zooming.
  • the second ratio is the proportion of the area of the single-person face in the entire photographed picture
  • the second ratio is the proportion of the combined face area area in the entire shooting picture
  • the combined face area area is the multi-person face area The sum of the area corresponding to each face in .
  • the value range of the first ratio threshold is 0.45-0.55.
  • the value range of the second ratio threshold is 0.15-0.25.
  • the target imaging device is controlled to move and/or rotate according to the central position of the character area and the central position of the entire shot, so that the central position of the character area coincides with the central position of the entire shot.
  • the determining the center position of the character area based on the picture information currently captured by the target camera device specifically includes:
  • the area center position of the single-person face is determined as the person area center position
  • the central position of the merged human body area is determined as the central position of the character area, and the merged human body area is based on the corresponding faces of each of the multi-person faces.
  • a closed area determined by the image boundary of the human body, and the closed area covers each of the human body images.
  • controlling the movement and/or rotation of the target camera device according to the center position of the character area and the center position of the entire shooting picture specifically includes:
  • the object distance is the distance between the actual position of the currently photographed face and the actual position of the target imaging device.
  • the object distance is determined according to the optical zoom ratio where the target imaging device is currently located and the second ratio.
  • the area of the character area on the display screen of the target imaging device is the same as that of all the objects.
  • the range of the ratio of the total area of the display screen is 0.7-0.8; wherein,
  • the area of the character area is the area of the human body image area corresponding to the single-person face;
  • the area of the person area is the area of the combined human body area, and the combined human body area is based on the image boundary of the human body corresponding to each of the multi-person faces.
  • a determined closed area the closed area covers each of the human body images.
  • the area of the human image area is determined based on the area of the corresponding single-person face and a preset multiple, and the preset multiple is a preset area representing the human image area and the face area. area ratio.
  • the method further includes:
  • the target imaging device is controlled to perform the optical zooming back and back to the wide-angle end.
  • the method further includes:
  • controlling the target imaging device to perform optical zooming includes:
  • the target of the focus motor of the target imaging device is determined based on the coordinate values of the coordinate points corresponding to the first target frame image, the second target frame image, the third target frame image and the fourth target frame image included in the consecutive frame images Adjusting the step size, wherein the fourth target frame image is the frame image before the third target frame image, and the third target frame image, the second target frame image and the first target frame image are successively adjacent frame images, and the first target frame image is the last frame image of the consecutive frame images.
  • determining the coordinate value of the coordinate points corresponding to the first target frame image, the second target frame image, the third target frame image, and the fourth target frame image included in the consecutive frame images include:
  • the first angle change value and the first residual change rate of the first coordinate point are determined based on the first coordinate value, the second coordinate value and the fourth coordinate value, wherein the first coordinate value is the first target frame image
  • the corresponding coordinate value of the first coordinate point, the second coordinate value is the coordinate value of the second coordinate point corresponding to the second target frame image
  • the fourth coordinate value is the fourth target frame image
  • the coordinate value of the corresponding fourth coordinate point, the first angle change value is the amount of change between the first average sharpness value per step and the second average sharpness value per step, the first average sharpness per step
  • the degree value is the average resolution value per step between the first target frame image and the fourth target frame image
  • the second average resolution value per step is the first target frame image and the fourth target frame image.
  • the average sharpness value per step between the second target frame images, and the first residual change rate is used to indicate that the sharpness of the first target frame image and the second target frame image changes per step Rate;
  • the second angle change value and the second residual change rate of the second coordinate point are determined based on the second coordinate value, the third coordinate value and the fourth coordinate value, wherein the third coordinate value is the third target frame image
  • the coordinate value of the corresponding third coordinate point, the second angle change value is the amount of change between the third average sharpness value per step and the fourth average sharpness value per step, the third average sharpness per step
  • the degree value is the average resolution value per step between the second target frame image and the fourth target frame image
  • the fourth average resolution value per step is the second target frame image and the fourth target frame image.
  • the average sharpness value per step between the third target frame images, and the second residual change rate is used to indicate that the sharpness of the second target frame image and the third target frame image changes per step Rate;
  • a target adjustment step size of the focus motor of the target imaging apparatus is determined based on the first angle change value, the first residual change rate, the second angle change value, and the second residual change rate.
  • the focus of the target imaging device is determined based on the first angle change value, the first residual change rate, the second angle change value and the second residual change rate
  • the target adjustment step size of the motor includes:
  • a target adjustment step size of the focus motor of the target imaging apparatus is determined based on the first difference value and the second difference value.
  • determining the target adjustment step size of the focus motor of the target imaging device based on the first difference value and the second difference value includes:
  • the target adjustment step size is determined according to the target convergence value.
  • determining the target adjustment step size according to the target convergence value includes:
  • the target adjustment step size is a preset step size value
  • the target adjustment step size is determined as an initial step size, wherein the initial step size is a predetermined number of consecutive The step size to use when framing the image.
  • the method further includes:
  • Focus processing is performed on the target imaging device according to the target adjustment step size.
  • an embodiment of the present application further provides a camera control device, the device comprising:
  • a first determination module configured to determine a first ratio, where the first ratio is the ratio of the optical zoom ratio of the target imaging device currently located to the maximum optical zoom ratio of the target imaging device;
  • a second determination module configured to determine a second ratio, where the second ratio is the proportion of the area of the face area currently captured by the target imaging device in the entire captured image
  • a judgment module for judging whether the first ratio is less than or equal to a first ratio threshold and the second ratio is less than or equal to a second ratio threshold
  • control module configured to control the target imaging device to perform optical zooming when the result of the determination is yes; and control the target imaging device to perform digital zooming when the determination result is no.
  • an embodiment of the present application further provides a computer device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, any one of the foregoing method embodiments is implemented steps in .
  • an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in any one of the foregoing method embodiments.
  • the above-mentioned camera control method, device, computer device and computer-readable storage medium by determining a first ratio, the first ratio is the current optical zoom ratio of the target camera device and the maximum optical zoom ratio of the target camera device magnification ratio; determine a second ratio, the second ratio is the proportion of the area of the face area currently captured by the target imaging device in the entire shooting picture; determine whether the first ratio is less than or equal to the first ratio threshold and the second ratio is less than or equal to the second ratio threshold; if yes, control the target imaging device to perform optical zooming; if not, control the target imaging device to perform digital zooming; And the proportion of the face area realizes the adaptive selection of optical zoom and digital zoom, which not only meets the needs of accurate and rapid use of zoom technology for close-up, but also can obtain better image quality, which is beneficial to the face area. Closeup and capture.
  • the above-mentioned method, device, computer equipment and computer-readable storage medium for determining the focus step size can make the imaging device focus quickly because the step size adjustment is performed according to the coordinate values of the coordinate points in the continuous frame images, thereby reducing the time of the focus process. consumption to achieve the effect of improving focusing efficiency.
  • FIG. 1 is a schematic flowchart of a camera control method in one embodiment.
  • FIG. 2 is a schematic structural diagram of a pan-tilt camera in an embodiment.
  • FIG. 3 is a schematic flowchart of a camera control method in another embodiment.
  • 4 to 7 are schematic diagrams of zooming images in various embodiments.
  • FIG. 8 is a schematic diagram of the relationship between the object distance, the optical zoom ratio, and the proportion of the face area.
  • FIG. 9 is a schematic diagram of a human body image area and a human face area in one embodiment.
  • FIG. 10 is a schematic diagram of a screen area of digital zoom in one embodiment.
  • FIG. 11 is a schematic flowchart of an optical zooming and retracting method in an embodiment.
  • FIG. 12 is a schematic flowchart of a camera control method in a specific embodiment.
  • FIG. 13 is a flowchart of a method for determining a focus step size according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a hill-climbing focusing curve according to an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a camera control apparatus according to an embodiment of the present application.
  • FIG. 16 is a structural block diagram of an apparatus for determining a focus step size according to an embodiment of the present application.
  • FIG. 17 is a block diagram of a hardware structure of a mobile terminal according to a method for determining a focus step size according to an embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of an apparatus for determining a focus step size according to a specific embodiment of the present application.
  • Words like "connected,” “connected,” “coupled,” and the like referred to in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
  • the “plurality” referred to in this application means greater than or equal to two.
  • “And/or” describes the association relationship between associated objects, indicating that there can be three kinds of relationships. For example, “A and/or B” can mean that A exists alone, A and B exist at the same time, and B exists alone.
  • the terms “first”, “second”, “third”, etc. involved in this application are only to distinguish similar objects, and do not represent a specific order for the objects.
  • Optical zoom and digital zoom are the main zoom technologies used in current camera equipment.
  • the optical zoom mainly realizes the zooming of the image through the movement of the focusing lens group, and the image quality is not lost; while the digital zoom mainly realizes the enlargement of the image by cropping the image, and the larger the magnification, the image will be "interpolated". lead to more loss of image quality.
  • the image enlargement is obtained by digital zoom, then because the panoramic image can be obtained in real time in the digital zoom technology, when the face suddenly disappears, The panorama image that can be analyzed by the lens can be wider, and the slice of the next scene image will be faster.
  • optical zoom and digital zoom each have their preferred points, which need to be reasonably selected according to the actual situation and needs.
  • FIG. 1 is a schematic flowchart of the camera control method. As shown in the figure, the above method includes:
  • Step 101 determining a first ratio, where the first ratio is the ratio of the current optical zoom ratio of the target imaging device to the maximum optical zoom ratio of the target imaging device;
  • Step 102 determining a second ratio, where the second ratio is the proportion of the area of the face area currently captured by the target imaging device in the entire captured image;
  • Step 103 judging whether the first ratio is less than or equal to the first ratio threshold and the second ratio is less than or equal to the second ratio threshold;
  • Step 104 if the determination result in step 103 is yes, control the target imaging device to perform optical zoom; if the determination result in step 103 is no, control the target camera device to perform digital zoom.
  • the embodiment of the present application can realize the adaptive selection of optical zoom and digital zoom according to the current zoom ratio and the proportion of the face area, which not only meets the needs of using the zoom technology for close-up accurately and quickly, but also can A better image quality is obtained, which is beneficial to the close-up and capture of the face area.
  • the camera control method provided by the embodiment of the present application is, for example, applied to the application environment shown in FIG. 2 .
  • the target imaging device in FIG. 2 is specifically a PTZ camera, including a rotatable PTZ and a camera installed on the PTZ.
  • the camera When the camera is tracking and photographing a face, it analyzes and calculates the face area and the center position of the camera to drive the gimbal to move to the appropriate center position. At the same time, it analyzes the size of the face and the entire image to analyze the appropriate adjustment magnification of the camera.
  • the method provided by the embodiment of the present application can well solve the problem of focusing on a face area by a single pan-tilt camera, and realize fast frame selection and focusing of the face area.
  • the camera may be, but not limited to, a gun camera, a spherical camera, and a dome camera.
  • the camera may be located above or below the PTZ, and the relative orientation of the camera and the PTZ is not limited herein. It should be understood that although the above only describes driving the camera through the rotation of the PTZ, the application environment of the embodiments of the present application is not limited to this; specifically, in other embodiments, the target camera device can be controlled to move and/or move or turn.
  • the camera control method provided by the embodiment of the present application can be applied to a single camera, that is, the camera control device executing the camera control method can execute the steps in the above method by controlling one camera.
  • determining the first ratio may specifically include: determining the optical zoom ratio Xoz where the camera is currently located, calculating the ratio between Xoz and the maximum optical zoom ratio Xz of the camera, and determining the ratio as the first ratio, that is, Xoz/Xz.
  • the current optical zoom ratio of the camera may specifically refer to the current optical zoom ratio of the lens of the camera; similarly, the maximum optical zoom ratio of the camera may specifically refer to the maximum optical zoom ratio of the lens of the camera.
  • the maximum optical zoom ratio of the camera is determined according to the function of the camera and is usually fixed.
  • the area of the detected face area can be calculated by performing face area detection on the image captured by the camera, and according to an existing algorithm.
  • the area of the entire shot is usually known and can be determined according to the settings.
  • the second ratio is the proportion of the area of the single-person face in the entire captured image.
  • the second ratio is the proportion of the combined face area area in the entire shooting picture, wherein the combined face area area is the ratio of the multiple faces The sum of the area corresponding to each face.
  • the proportion of the face is obtained by analyzing the proportion of the area of the face area and the area of the entire picture.
  • a single face for example, by analyzing the area ratio of a single face;
  • a multi-person face for example, by merging the face regions, the combined face regions are counted to calculate the face ratio of the entire picture.
  • the determination of the second ratio corresponding to when the camera currently captures a single face and the determination of the second ratio corresponding to the current multi-person face captured by the camera may be used in the same embodiment, or may be used in the same embodiment. It is adopted in different embodiments; that is, when the second ratio corresponding to the single-person face currently captured by the camera is determined by the proportion of the area of the single-person face in the entire shooting picture, it corresponds to the camera's current
  • the method for determining the second ratio when multiple faces are photographed may be the above-mentioned method of merging the proportion of the area of the face area in the entire photographed picture, or other methods, and the two are not necessarily related, and vice versa .
  • step 103 it is determined whether the first ratio is less than or equal to the first ratio threshold and the second ratio is less than or equal to the second ratio threshold; here, set the first ratio threshold as N and the second ratio threshold as M, step 103 is to determine whether Xoz/Xz ⁇ N and Facepro ⁇ M.
  • the value range of N is 0.45-0.55; specifically, for example, N is 0.5, that is, 1/2.
  • the value range of M is 0.15-0.25; for example, M is 0.2, that is, 1/5.
  • step 104 if Xoz/Xz ⁇ N and Facepro ⁇ M, control the camera to perform optical zoom (indicated by "Soz”); if it is other than this, control the camera to perform digital zoom (indicated by "Soz”) Sdz" means).
  • the scaling strategy S adopted for the image zooming function is set as follows:
  • the optical zoom is used for zooming; when the proportion of the face exceeds a certain face threshold (ie the second ratio threshold), the digital Zooming by changing the magnification; it not only satisfies the function of enlarging the face, but also can obtain better image quality, and at the same time is conducive to the rapid detection of the face in the panoramic screen after the face disappears.
  • a certain face threshold ie the second ratio threshold
  • the embodiment of the present application achieves fast zooming by analyzing the zoom ratio relationship between the proportion of the human face and the magnification.
  • the above method further includes:
  • Step 001 determining the center position of the character area based on the picture information currently captured by the target camera device
  • Step 002 Control the target camera device to move and/or rotate according to the center position of the character area and the center position of the entire shooting image, so that the center position of the character area coincides with the center position of the entire shooting image.
  • the step of controlling the movement and/or rotation of the target camera device so that the center position of the character area coincides with the center position of the entire captured picture is performed before the step of determining the first ratio.
  • steps 001 to 002 are performed, steps 101 to 104 are performed.
  • steps 101 to 104 are performed.
  • steps 001 to 002 and steps 101 to 104 may be performed separately.
  • the image is zoomed by the zoom function, and the face is zoomed to an appropriate size, while ensuring that the person area is in the center of the screen after zooming.
  • the picture currently captured by the target camera device may have a single person's face, or there may be multiple people's faces.
  • moving the area center of the single face to the center of the entire shot can generally ensure the focus on the face; however, for the case of multiple faces, if only based on multiple How to display the picture may be determined by the regional center position of each face in the human face, which may result in incomplete display of the portrait in the picture due to the complex relationship such as the front and rear positions of each face.
  • determining the center position of the person area based on the picture information currently captured by the target camera device includes: corresponding to the single person face currently captured by the target camera device, the area center position of the single person face Determined as the center of the character area.
  • determining the center position of the human body region based on the picture information currently captured by the target camera device includes: corresponding to the multiple human faces currently captured by the target camera device, determining the center position of the combined human body region as the human body region The center position, the merged human body area is a closed area determined based on the image boundary of the human body corresponding to each of the multiple human faces, wherein the closed area covers each human body image.
  • the center position of the character area can be determined in different ways in the case of a single face and multiple faces; in the case of a single face, it can be determined according to the face area; in the case of multiple faces Next, it can be determined according to the image boundary of the human body.
  • the determination of the center position of the character area when the target camera device currently captures a single face, and the determination of the center position of the character area when the target camera device currently captures multiple faces can be performed in the It is adopted in the same embodiment, and can also be adopted in different embodiments; that is, when the regional center position of a single person's face is determined as the central position of the character region, it corresponds to the person when the target camera device currently captures the faces of multiple people.
  • the method for determining the center position of the area may adopt the above-mentioned method for determining the center position of the merged human body area, or other determining methods, and the two are not necessarily related, and vice versa.
  • the image boundary of the human body can be determined by the image processing module set inside or outside the target camera device.
  • the image processing module can directly determine the image boundary of the human body according to the currently captured image information, or can be calculated according to the face area combined with the algorithm.
  • the image boundary of the human body is not limited here.
  • Control the movement and/or rotation of the target camera device according to the center position of the character area and the center position of the entire shot including:
  • the object distance is the distance between the actual position of the currently photographed face and the actual position of the target imaging device.
  • the horizontal position offset angle is determined according to the horizontal offset between the central position of the character area and the central position of the entire shooting picture and the object distance. Specifically, it includes: calculating both according to the central position of the character area and the central position of the entire shooting picture.
  • the tangent function value arctan(Xoff/Sd) of the horizontal position offset angle is calculated according to the ratio between Xoff and the object distance Sd, and the horizontal position offset angle is calculated according to arctan(Xoff/Sd).
  • the vertical position offset angle is determined according to the vertical offset between the central position of the character area and the central position of the entire shooting picture and the object distance.
  • the vertical offset Yoff between the two is calculated according to the ratio between Yoff and the object distance Sd to calculate the tangent function value of the vertical position offset angle arctan(Yoff/Sd), and the vertical Position offset angle.
  • the horizontal position offset angle and the vertical position offset angle include not only the numerical value of the corresponding angle, but also the direction of the angle (for example, the direction of the angle is represented by positive and negative).
  • Controlling the rotation of the target camera device can be specifically realized by controlling the rotation of the PTZ to drive the target camera device to rotate.
  • the object distance is determined according to the current optical zoom ratio of the target imaging device and the second ratio.
  • A represents the center position of the screen
  • B represents the center position of the face area. Therefore, it is necessary to adjust the face to the center position of the screen and perform zooming, in order to ensure a good face focus effect.
  • the distance differences between the upper, lower, left, and right of the merged human body area and the corresponding boundaries of the shooting screen are Yup, Ydown, Xleft, and Xright, respectively; then after the adjustment to A' and A overlap, the upper, lower, left, and right of the merged body area are compared with the shooting.
  • the distance differences between the corresponding boundaries of the pictures become Y'up, Y'down, X'left, and X'right, respectively.
  • the pan/tilt movement is further performed according to the horizontal position offset angle and the vertical position offset angle, combined with the deviation of the central position of the character area relative to the central position of the entire shot.
  • the object distance Sd is calculated and obtained by calculating the proportion of the face area (ie, the second ratio), the current magnification of the motor Zoom, and the position of the focus motor.
  • the above method further includes: pre-establishing a correspondence between the object distance Sd and different optical zoom ratios and different second ratios where the target imaging device is located, and determining the object distance according to the correspondence.
  • FIG. 8 is a schematic diagram of the relationship between the object distance and the optical zoom ratio and the proportion of the face area. In the figure, the position of the Zoom motor corresponds to the object distance.
  • the ratio of the area of the character area in the display screen of the target camera device to the total area of the display screen is 0.7-0.8;
  • the area of the person area is the area of the human body image area corresponding to the single-person face;
  • the area of the person area is the area of the combined human body area
  • the combined human body area is a closed area determined based on the image boundary of the human body corresponding to each face in the multi-person face, and the closed area is Overlay each body image.
  • the ratio of the area of the character area in the display screen of the target camera device to the total area of the display screen is 0.75.
  • the lens of the target imaging device can perform adaptive focus zooming.
  • the area of the human body image area is determined based on the area area of the corresponding single-person face and a preset multiple, and the preset multiple is a preset ratio of the area representing the human body image area to the area of the human face area.
  • the width of the human body is set to be twice the width w of the human face, that is, the width of the human body is 2*w; the height of the part of the human body other than the head is 3 times the height h of the human face , that is, the height of the human body is 4*h; thus, the area of the human image area is determined.
  • the preset multiple is equal to 8, that is, the area of the human body image area is calculated by multiplying the area of the corresponding single-person face by 8 times.
  • the above method may further include:
  • control the target camera device to perform optical zoom back, and back to half of the current optical zoom ratio of the target camera device;
  • the target imaging device is controlled to perform the optical zooming back and back to the wide-angle end.
  • step 103 after controlling the target imaging device to perform digital zooming, the above method further includes:
  • area a is the area where the digital zoom zoomed image is cropped in the center; the outer border of area b is the image before digital zoom zoom (original image)
  • the inner boundary of the b area is the outer boundary of the a area, and the b area is the area that is cut out and not displayed in the digital zoom.
  • the position of the face area can be quickly locked by detecting area b, avoiding large magnification.
  • the back-and-forth zooming and vibration phenomenon of the screen caused by the rollback also accelerates the close-up locking of the face area again; when no face is detected in the b area, the digital zoom rollback is immediately performed, and the optical zoom rollback is performed according to the optical zoom.
  • the double fallback method is used to re-lock the face area.
  • the current optical zoom is Z; when the face area disappears, the present embodiment performs the following steps to roll back: the optical zoom is changed from Z to fast Return to the Z/2 position, and then perform the fast detection of the face area; when the face is still not detected, the optical zoom ratio will quickly return to the widest angle end, that is, to the minimum, and then perform the detection; if detected
  • the face area is adaptively scaled and scaled to an appropriate magnification according to the method provided in the above-mentioned embodiments of the present application; when the face area disappears, the step of returning the optical variable magnification to Z/2 is performed again. Also, do stills/close-ups. In this way, not only can the face zoom transition caused by the transition rollback be avoided, but also the time consumed by the camera movement is reduced, and the problem that the camera movement takes too long is avoided.
  • the camera control method provided by the embodiment of the present application can not only realize adaptive zooming and focusing according to the detection of the face area, but also can use a fast rollback mechanism to achieve precise rollback when the face disappears.
  • the face detection technology is used to detect the face area; when a face is detected, that is, there is a face, then through the PTZ auxiliary mechanism, Adjust the center position of the character area to coincide with the center position of the entire shooting image. Calculate the proportion of the face area according to the different situations of single face or multiple faces, and calculate the proportion of the face area according to the difference between the center of the character area and the center of the entire shooting image.
  • the appropriate optical zoom and digital zoom are used for adaptive zooming; real-time detection of the face area image, if When the face disappears, according to the fallback mechanism, that is, select the corresponding fallback method according to the optical zoom/digital zoom to perform the fallback to ensure that the face disappears and the face image can be quickly tracked to achieve accurate fallback; the camera is adaptive Zoom to an appropriate position, that is, the magnification stays at the valid position.
  • this embodiment provides an adaptive zooming technology based on a single camera.
  • the camera By analyzing regional faces, the camera performs adaptive zooming, and quickly changes the magnification to an appropriate magnification; , to fine-tune the position, and place a single face or a multi-person face area in the center of the screen; in order to ensure the image quality as much as possible and ensure adaptive zooming, digital zoom or digital zoom is determined according to the magnification of the camera and the proportion of the face area.
  • Optical zoom in addition, an efficient rollback mechanism is proposed in this embodiment to solve the problem of the rollback of the magnification of a single camera after the face disappears.
  • the efficient self-adaptive zooming technology for a single camera proposed in this embodiment realizes a fast close-up of the face area.
  • the optical zoom mainly realizes the zooming of the image through the movement of the focusing lens group, and the image quality is not lost.
  • the movement of the focusing lens group involves autofocus technology.
  • autofocus technology has been widely used in digital cameras, security monitoring, mobile phones, video conferencing and other fields.
  • autofocus technology in the security field mainly realizes focusing through image analysis: get the current frame , analyze the image sharpness value, calculate the next focus position and focus sharpness value, and continuously drive the focus motor until the sharpest sharpness value is found.
  • the focusing process usually in the focusing method, the focusing process always focuses back and forth near the peak point, resulting in slow focusing speed and reducing focusing efficiency.
  • FIG. 13 is a flow chart of a method for determining a focusing step according to an embodiment of the present application. Figure, as shown in Figure 13, the process includes the following steps:
  • Step 301 acquiring the focus motor position and the clarity of the frame image when the target imaging device collects a predetermined number of consecutive frame images respectively;
  • the target imaging device collects frame images
  • the corresponding focus motor position and definition when each frame image is collected are respectively recorded, so as to facilitate subsequent calculation.
  • the focus motor position includes information such as the focus step length, brightness, etc. when the target camera device collects a certain frame of image; the focus motor position and the clarity of the frame image can be obtained by comparing the focus motor position and the clarity of the frame image.
  • the degrees are stored in the target area and then retrieved from the target area; the predetermined number may be at least 4 frames of images.
  • the step of acquiring the focus motor position and the clarity of the frame images when the target imaging device separately collects a predetermined number of consecutive frame images is an operation before the target imaging device is photographed to form an image, that is, the focus is completed. The image is then photographed to obtain an image with higher definition, wherein the image includes pictures and/or images.
  • Step 302 Determine the coordinate point corresponding to each frame of image based on the respectively acquired multiple focus motor points and multiple resolutions, wherein the coordinate value of the coordinate point corresponding to each frame image includes the focus motor point when each frame image is collected. bits and the sharpness of each frame;
  • the determination of the coordinate points is to facilitate the positioning of the focus motor point of each frame of images when the hill-climbing focusing algorithm is used for focusing, thereby facilitating the determination of the curve of the hill-climbing focusing algorithm.
  • one-to-one correspondence between the focusing motor points and the sharpness is formed to form a two-dimensional coordinate system, and the focusing motor positioning points are connected through a curve to determine the curve of the mountain-climbing focusing algorithm.
  • Step 303 Determine the target adjustment of the focus motor of the target imaging device based on the coordinate values of the coordinate points corresponding to the first target frame image, the second target frame image, the third target frame image and the fourth target frame image included in the consecutive frame images Step length, wherein, the fourth target frame image is the frame image before the third target frame image, the third target frame image, the second target frame image and the first target frame image are successively adjacent frame images, and the first target frame image A frame image is the last frame image of consecutive frame images.
  • the target adjustment step size of the focus motor of the target imaging device is determined according to the coordinate values of the coordinate points of the target frame images of at least four frames, which reduces the repeated debugging process of the target adjustment step size, thereby reducing the need for the focusing process. It takes time to improve focusing efficiency.
  • the target adjustment step size can be adjusted according to actual needs, for example, it can be set to 1, or it can be set to other values;
  • the fourth target frame image can be a frame image adjacent to the third target frame, or a frame image not adjacent to the third target frame The image adjacent to the target frame image.
  • the step size adjustment is performed according to the coordinate values of the coordinate points in the consecutive frame images, so that the imaging device can be quickly focused, thereby reducing the time consumption of the focusing process, solving the problem of low focusing efficiency in the related art, and improving the focusing performance. efficiency.
  • the target imaging device is determined based on the coordinate values of the coordinate points corresponding to the first target frame image, the second target frame image, the third target frame image, and the fourth target frame image included in the consecutive frame images
  • the target adjustment steps of the focus motor include:
  • Step 3031 Determine the first angle change value and the first residual change rate of the first coordinate point based on the first coordinate value, the second coordinate value and the fourth coordinate value, wherein the first coordinate value corresponds to the first target frame image.
  • the coordinate value of the first coordinate point, the second coordinate value is the coordinate value of the second coordinate point corresponding to the second target frame image
  • the fourth coordinate value is the coordinate value of the fourth coordinate point corresponding to the fourth target frame image
  • the An angle change value is the amount of change between the first average resolution value per step and the second average resolution value per step
  • the first average resolution value per step is the difference between the first target frame image and the fourth target frame image
  • the average sharpness value per step between the two average sharpness values per step, the second average sharpness value per step is the average sharpness value per step between the first target frame image and the second target frame image
  • the first residual change rate is used for Indicates the rate of change per step of the sharpness of the first target frame image and the second target frame image;
  • Step 3032 Determine the second angle change value and the second residual change rate of the second coordinate point based on the second coordinate value, the third coordinate value and the fourth coordinate value, wherein the third coordinate value corresponds to the third target frame image.
  • the coordinate value of the third coordinate point of the The average resolution per step between the target frame image and the fourth target frame image, and the fourth average resolution value per step is the average resolution per step between the second target frame image and the third target frame image value, the second residual rate of change is used to indicate the rate of change per step of the clarity of the second target frame image and the third target frame image;
  • Step 3033 Determine the target adjustment step size of the focus motor of the target imaging device based on the first angle change value, the first residual change rate, the second angle change value, and the second residual change rate.
  • determining the first angle change value and the second angle change value is to determine the angle change of the coordinate point between the frame images of two adjacent frames collected, so as to determine whether the sharpness exceeds or is about to reach the focus peak value, When the sharpness exceeds the focus peak value, the second angle change value may be greater than the first angle change value. At this time, it can be determined that the focus peak value is located on the left side of the focus motor point corresponding to the first target frame image, so that a quick prediction can be made.
  • the position of the focus peak, and so on; similarly, the determination of the first residual change rate and the second residual change rate is also to determine the transformation of the definition between two adjacent frames, so as to quickly determine the position of the focus peak.
  • the first target frame image is the frame image with the focus motor at point B
  • the second target frame image is the frame image with the focus motor at point C
  • the third target frame image is the focus motor
  • the fourth target frame image is the frame image with the focus motor point at point A
  • the first angle change value and the second angle change value can be calculated by the following formulas:
  • Fv_cur represents the resolution of the current frame image (ie the first target frame image)
  • Fv_init represents the resolution of the initial frame image (ie the fourth target frame image)
  • Fv_bef represents the previous frame image (ie the second target frame image).
  • Pos_cur represents the focus step size of the current frame image (ie the first target frame image)
  • Pos_init represents the focus step size of the initial frame image (ie the fourth target frame image)
  • Pos_bef represents the previous frame image (that is, the focus step size of the second target frame image)
  • f_radio1 is the relative change rate of the first target frame image and the second target frame image with respect to the fourth target frame image, that is, the first average resolution per step value
  • f_radio2 is the relative change rate of the second target frame image and the third target frame image with respect to the fourth target frame image respectively, that is, the second average resolution value per step; in the normal hill-climbing focusing algorithm, It is usually used to measure whether the sharpness has reached the focus peak.
  • the first residual change rate and the second residual change rate can be calculated by the following formulas:
  • fv_radio1 is the first residual change rate
  • fv_radio2 is the second residual change rate
  • Fv_cur represents the sharpness value of the current frame
  • Fv_bef represents the sharpness value of the previous frame
  • Fv_bef' represents the previous The sharpness value of one frame
  • Step_cur represents the walking step of the current frame relative to the previous frame
  • Step_bef represents the focus step of the previous frame
  • fv_radio represents the change rate of the sharpness value of the previous and previous frames per step to calculate the residual change Rate.
  • determining the target adjustment step size of the focus motor of the target imaging device based on the first angle change value, the first residual change rate, the second angle change value and the second residual change rate includes:
  • Step 30331 determining the first difference between the first angle change value and the second angle change value
  • Step 30332 Determine the second difference between the first residual change rate and the second residual change rate
  • Step 30333 Determine the target adjustment step size of the focus motor of the target imaging device based on the first difference value and the second difference value.
  • the determination of the first difference is to determine the change between the angle change values of the adjacent frame images
  • the determination of the second difference is to determine the change of the definition of the adjacent frame images
  • the second difference is the fv_radio value in the aforementioned formula (3), and:
  • the first difference value f_radio_diff can be calculated by the following formula:
  • f_radio_B and f_radio_C respectively represent the focus motor angle of the two frames of images B and C, and the sharpness values of the three points B, C and D represent f b , f c , f d , B, C,
  • the position differences between the three points of D and the initial point are p b , p c , and p d .
  • f c 2 ⁇ [f b ⁇ (p c -p d )-f d ⁇ p b ] will affect the focus value f_radio_diff value, so that the convergence point verification can be performed in advance judgment, namely:
  • f_radio_diff When B has not reached the peak point, f_radio_diff ⁇ 0; when B is close to the peak point, f_radio_diff ⁇ 0.
  • step 30331 and step 30332 may be reversed, that is, step 30332 may be executed first, and then step 30331 may be executed.
  • determining the target adjustment step size of the focus motor of the target imaging device based on the first difference value and the second difference value includes:
  • Step 30333 determine the target convergence value based on the first difference and the second difference
  • Step 303332 Determine the target adjustment step size according to the target convergence value.
  • the purpose of determining the target convergence value is to determine whether the sharpness of the frame image exceeds the focus peak value or is near the focus peak value, and then determines the target adjustment step size so that the subsequent focus process can quickly reach the focus peak value.
  • the target convergence value can be determined by the following formula:
  • condition A is: fv_radio0&&f_radio_diff>default_radio1;
  • Condition B is: f_radio_diff ⁇ &&f_radio_C>0;
  • Condition C is: f_radio2 ⁇ default_radio2;
  • default_radio1 default_radio2 are limited to 5 and -25 respectively.
  • determining the target adjustment step size according to the target convergence value includes:
  • Step 3033321 when it is determined that the target convergence value satisfies the first condition, determine that the target adjustment step is a preset step value;
  • Step 3033322 If the target convergence value does not meet the first condition, determine the target adjustment step size as the initial step size, where the initial step size is the step size used by the target camera device when collecting a predetermined number of consecutive frame images.
  • the first condition can be (but not limited to) the following formula:
  • the focus step is set to walk according to the original setting; otherwise, the focus step is set to 1.
  • the method further includes:
  • Step 304 Perform focusing processing on the target imaging device according to the target adjustment step size.
  • the focusing process may (but is not limited to) reciprocate frame image acquisition and sharpness recording according to the target adjustment step size, and make the sharpness reach a focus peak value.
  • an embodiment of the present application further provides a camera control device 400 , the device includes: a first determination module 410 , a second determination module 420 , a determination module 430 and a control module 440 , wherein :
  • a first determination module 410 configured to determine a first ratio, where the first ratio is the ratio of the optical zoom ratio where the camera is currently located to the maximum optical zoom ratio of the camera;
  • the second determination module 420 is configured to determine a second ratio, where the second ratio is the proportion of the area of the face area currently captured by the camera in the entire captured image;
  • a judgment module 430 configured to judge whether the first ratio is less than or equal to the first ratio threshold and the second ratio is less than or equal to the second ratio threshold;
  • the control module 440 is configured to control the camera to perform optical zooming when the result of the determination is yes; and control the camera to perform digital zooming when the result of the determination is no.
  • the second ratio is the proportion of the area of the single-person face in the entire shooting picture; corresponding to the camera currently capturing multiple human faces , the second ratio is the proportion of the combined face area area in the entire shooting picture, and the combined face area area is the sum of the areas corresponding to each face in the multiple faces.
  • the value range of the first ratio threshold is 0.45-0.55.
  • the value range of the second ratio threshold is 0.15-0.25.
  • the apparatus further includes:
  • a third determining module configured to determine the center position of the character area based on the picture information currently captured by the camera
  • the control module 440 is further configured to control the movement and/or rotation of the camera according to the center position of the character area and the center position of the entire shot, so that the center position of the character area coincides with the center position of the entire shot.
  • control module 440 is configured to control the camera to move and/or rotate so that the center position of the character area coincides with the center position of the entire shot before the first determination module 410 determines the first ratio.
  • the third determining module is specifically used for:
  • the area center position of the single-person face is determined as the person area center position
  • the center position of the combined human body region is determined as the central position of the human body region, and the combined human body region is a closed region determined based on the image boundary of the human body corresponding to each face in the multi-person face. , the closed area covers each human body image.
  • control module 440 is specifically configured to:
  • the object distance is the distance between the actual position of the currently photographed face and the actual position of the camera.
  • the object distance is determined according to the optical zoom ratio at which the camera is currently located and the second ratio.
  • the ratio of the area of the character area to the total area of the displayed image in the display screen of the camera is in the range of 0.7-0.8. ;in,
  • the area of the person area is the area of the human image area corresponding to the single-person face;
  • the area of the person area is the area of the combined human body area
  • the combined human body area is a closed area determined based on the image boundary of the human body corresponding to each face in the multi-person face, and the closed area covers Each body image.
  • the area of the human body image area is determined based on the area area of the corresponding single-person face and a preset multiple, and the preset multiple is a preset ratio of the area representing the human body image area to the area of the human face area.
  • the above-mentioned apparatus further includes:
  • the fallback module is used to detect the face area on the display screen of the camera after controlling the camera to perform optical zooming;
  • control the camera to perform optical zoom back, and back to half of the current optical zoom ratio of the camera;
  • the camera is controlled to perform the optical zooming back and back to the wide-angle end.
  • the apparatus further includes:
  • the fallback module is used to detect the face area on the display screen of the camera after controlling the camera to perform digital zooming;
  • control module 440 includes:
  • the parameter acquisition module 441 is used to acquire the focus motor position and the definition of the frame image when the target camera device collects a predetermined number of consecutive frame images respectively;
  • the coordinate determination module 442 is configured to determine the coordinate point corresponding to each frame of image based on the plurality of the focus motor points and the plurality of the sharpness obtained respectively, wherein the coordinate value of the coordinate point corresponding to each frame of image includes the collected The focus motor position of each frame of image and the sharpness of each frame of image;
  • the step size determination module 443 is used to determine the target camera based on the coordinate values of the coordinate points corresponding to the first target frame image, the second target frame image, the third target frame image and the fourth target frame image included in the consecutive frame images.
  • the target adjustment step size of the focusing motor of the device wherein the fourth target frame image is the frame image before the third target frame image, and the third target frame image, the second target frame image and the first target frame image are adjacent in sequence frame images, and the first target frame image is the last frame image of the consecutive frame images.
  • the step size determination module 443 includes:
  • the first parameter determination unit 4431 is configured to determine the first angle change value and the first residual change rate of the first coordinate point based on the first coordinate value, the second coordinate value and the fourth coordinate value, wherein the first coordinate The value is the coordinate value of the first coordinate point corresponding to the first target frame image, the second coordinate value is the coordinate value of the second coordinate point corresponding to the second target frame image, and the fourth coordinate value The value is the coordinate value of the fourth coordinate point corresponding to the fourth target frame image, and the first angle change value is the amount of change between the first average resolution value per step and the second average resolution value per step,
  • the first average sharpness value per step is the average sharpness value per step between the first target frame image and the fourth target frame image
  • the second average sharpness value per step is the average resolution value per step between the first target frame image and the second target frame image
  • the first residual change rate is used to indicate the first target frame image and the second target frame image The rate of change of the resolution of the frame image per step;
  • the second parameter determination unit 4432 is configured to determine the second angle change value and the second residual change rate of the second coordinate point based on the second coordinate value, the third coordinate value and the fourth coordinate value, wherein the third coordinate The value is the coordinate value of the third coordinate point corresponding to the third target frame image, and the second angle change value is the amount of change between the third average resolution value per step and the fourth average resolution value per step,
  • the third average resolution value per step is the average resolution value per step between the second target frame image and the fourth target frame image
  • the fourth average resolution value per step is the average resolution value per step between the second target frame image and the third target frame image
  • the second residual change rate is used to indicate the second target frame image and the third target frame image The rate of change of the resolution of the frame image per step;
  • Step size determination unit 4433 configured to determine the focus of the target imaging device based on the first angle change value, the first residual change rate, the second angle change value and the second residual change rate The target adjustment step size of the motor.
  • the step size determining unit 4433 includes:
  • the first difference determination subunit 44331 is used to determine the first difference between the first angle change value and the second angle change value
  • the second difference determination subunit 44332 is configured to determine the second difference between the first residual change rate and the second residual change rate
  • the step size determination subunit 44333 determines the target adjustment step size of the focus motor of the target imaging device based on the first difference value and the second difference value.
  • the step size determination subunit 44333 includes:
  • the convergence determination subunit 443331 is used to determine the target convergence value based on the first difference value and the second difference value;
  • the target step size subunit 443332 is configured to determine the target adjustment step size according to the target convergence value.
  • the target step size subunit 443332 includes:
  • the first step length subunit 4433321 is used to determine that the target adjustment step is a preset step value when the target convergence value satisfies the first condition;
  • the second step size subunit 4433322 is configured to determine the target adjustment step size as the initial step size when the target convergence value does not meet the first condition, wherein the initial step size is when the target camera device collects a predetermined number of consecutive frame images The step size used.
  • control module 440 further includes:
  • the focus processing module 444 is configured to perform focus processing on the target camera device according to the target adjustment step size after determining the target adjustment step size of the focus motor of the target camera device.
  • Each module in the above-mentioned camera control device can be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • the above modules are all located in the same processor; or, the above modules are located in different processors in any combination.
  • the method for determining the focus step size may not only be implemented in the process of controlling the target imaging device to perform optical zooming in the imaging control method, but may also be implemented independently.
  • the parameter acquisition module 441 , the coordinate determination module 442 and the step size determination module 443 can also be implemented as a whole (eg, a focusing step size determination device), as shown in FIG. 16 .
  • FIG. 17 is a block diagram of a hardware structure of a mobile terminal according to a method for determining a focus step according to an embodiment of the present application.
  • the mobile terminal may include one or more (only one is shown in FIG.
  • processor 501 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 502 for storing data, wherein the above-mentioned mobile terminal may further include a transmission device 503 and an input and output device 504 for communication functions.
  • a processing device such as a microprocessor MCU or a programmable logic device FPGA
  • a memory 502 for storing data
  • the above-mentioned mobile terminal may further include a transmission device 503 and an input and output device 504 for communication functions.
  • FIG. 17 is only for illustration, which does not limit the structure of the above-mentioned mobile terminal.
  • the mobile terminal may further include more or less components than those shown in FIG. 17 , or have a different configuration than that shown in FIG. 17 .
  • the memory 502 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for determining a focus step size in an embodiment of the present invention.
  • the processor 501 runs the computer program stored in the memory 502 , so as to perform various functional applications and data processing, that is, to implement the above method.
  • Memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 502 may further include memory located remotely relative to the processor 501, and these remote memories may be connected to the mobile terminal 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.
  • Transmission device 503 is used to receive or transmit data via a network.
  • the specific example of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal.
  • the transmission device 503 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 503 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • the present application also relates to a specific device structure including:
  • Focus trigger module used to trigger focus processing
  • an angle change rate determination unit for performing angle change rate calculation
  • a relative change rate determination unit for performing a relative change rate calculation
  • a residual change rate determination unit for performing residual change rate calculation for performing residual change rate calculation
  • a step size adjustment unit (corresponding to the aforementioned target step size sub-unit 443332), for performing focus step size adjustment processing;
  • the focus climbing module (corresponding to the aforementioned focus processing module 444 ) is configured to perform focus processing according to the adjusted focus step size.
  • An embodiment of the present application further provides a computer device, including a processor and a memory, where the memory stores a computer program, and the processor implements the steps in any one of the foregoing method embodiments when the processor executes the computer program.
  • Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in any one of the foregoing method embodiments.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)

Abstract

一种摄像控制方法、装置、计算机设备和存储介质,通过确定第一比值,第一比值为目标摄像设备当前所处的光学变倍倍率与目标摄像设备的最大光学变倍倍率的比值;确定第二比值,第二比值为目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;判断是否第一比值小于等于第一比值阈值且第二比值小于等于第二比值阈值;若是,控制目标摄像设备进行光学变倍;若否,控制目标摄像设备进行数字变倍。

Description

摄像控制方法、装置、计算机设备和存储介质
相关申请
本申请要求2021年1月28日申请的,申请号为202110114788.9,发明名称为“一种聚焦步长确定方法、装置、存储介质及电子装置”的中国专利申请的优先权,以及2021年3月2日申请的,申请号为202110230319.3,发明名称为“摄像控制方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像通信技术领域,特别是涉及一种摄像控制方法、装置、计算机设备和存储介质。
背景技术
随着图像通信技术的发展,视频会议系统已经越来越普及,通过网络融合技术、编解码技术,实现语音、图像、数据等相关技术的远程实时传输。在当前的视频会议系统中,追求高质量的画质和音质。对于画质,更强调良好的人脸捕捉效果,即更侧重于人脸区域的聚焦。聚焦人脸区域,将人脸区域移到画面中心,采集合适的画面进行显示,特别是通过缩放技术调整至合适倍率进行特写显得越来越重要。对于当前拍摄的图像中仅存在单人时,可以对单人人脸进行特写,而对于拍摄到多人人脸时,可以进行全景特写。
目前,视频会议系统中的摄像设备大部分拥有变焦功能,可通过数字变倍和光学变倍进行缩放,实现合适的画质输出。然而,现实场景中的画面可能会存在一些复杂的情况,如多景深、多人脸等情况,如果采用手动调试,显然难度较大;并且,无法准确快速地决定变倍方式,造成图像清晰度和人脸捕捉无法兼顾,人脸消失后难以快速回退的问题也尤为突出。
发明内容
有鉴于此,本申请实施例为解决背景技术中存在的至少一个问题而提供一种摄像控制方法、装置、计算机设备和存储介质。
第一方面,本申请实施例提供了一种摄像控制方法,所述方法包括:
确定第一比值,所述第一比值为目标摄像设备当前所处的光学变倍倍率与所述目标摄像设备的最大光学变倍倍率的比值;
确定第二比值,所述第二比值为所述目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
判断是否所述第一比值小于等于第一比值阈值且所述第二比值小于等于第二比值阈值;
若是,控制所述目标摄像设备进行光学变倍;若否,控制所述目标摄像设备进行数字变倍。
在一个可选实施例中,对应于所述目标摄像设备当前拍摄到单人人脸,所述第二比值为所述单人人脸的区域面积在整幅拍摄画面中的占比;
对应于所述目标摄像设备当前拍摄到多人人脸,所述第二比值为合并人脸区域面积在整幅拍摄画面中的占比,所述合并人脸区域面积为所述多人人脸中各人脸对应的区域面积的加和。
在一个可选实施例中,所述第一比值阈值的取值范围为0.45-0.55。
在一个可选实施例中,所述第二比值阈值的取值范围为0.15-0.25。
在一个可选实施例中,所述方法还包括:
基于所述目标摄像设备当前拍摄到的画面信息确定人物区域中心位置;
根据所述人物区域中心位置和整幅拍摄画面的中心位置,控制所述目标摄像设备移动和/或转动,以使所述人物区域中心位置与所述整幅拍摄画面的中心位置重合。
在一个可选实施例中,所述控制所述目标摄像设备移动和/或转动以使所述人物区域中心位置与所述整幅拍摄画面的中心位置重合的步骤,在所述确定第一比值的步骤之前执行。
在一个可选实施例中,所述基于所述目标摄像设备当前拍摄到的画面信息确定人物区域中心位置,具体包括:
对应于所述目标摄像设备当前拍摄到单人人脸,将所述单人人脸的区域中心位置确定为所述人物区域中心位置;
对应于所述目标摄像设备当前拍摄到多人人脸,将合并人体区域的中心位置确定为所述人物区域中心位置,所述合并人体区域为基于所述多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,所述闭合区域覆盖各所述人体图像。
在一个可选实施例中,所述根据所述人物区域中心位置和整幅拍摄画面的中心位置,控制所述目标摄像设备移动和/或转动,具体包括:
根据所述人物区域中心位置和整幅拍摄画面的中心位置之间的水平偏移量以及物距确定水平位置偏移角度;
根据所述人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量以及物距确定竖直位置偏移角度;
根据所述水平位置偏移角度和所述竖直位置偏移角度控制所述目标摄像设备转动;
其中,所述物距为当前拍摄到的人脸的实际位置和所述目标摄像设备的实际位置之间的距离。
在一个可选实施例中,所述物距根据所述目标摄像设备当前所处的光学变倍倍率以及所述第二比值确定。
在一个可选实施例中,在控制所述目标摄像设备进行光学变倍之后,或在控制所述目标摄像设备进行数字变倍之后,在所述目标摄像设备的显示画面中人物区域面积与所述显示画面的总面积的比值的范围为0.7-0.8;其中,
对应于所述目标摄像设备当前拍摄到单人人脸,所述人物区域面积为所述单人人脸对应的人体图像区域面积;
对应于所述目标摄像设备当前拍摄到多人人脸,所述人物区域面积为合并人体区域面积,所述合并人体区域为基于所述多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,所述闭合区域覆盖各所述人体图像。
在一个可选实施例中,所述人体图像区域面积基于对应的所述单人人脸的区域面积和预设倍数确定,所述预设倍数为预设的表征人体图像区域面积与人脸区域面积的比值。
在一个可选实施例中,在控制所述目标摄像设备进行光学变倍之后,所述方法还包括:
对所述目标摄像设备的显示画面进行人脸区域检测;
对应于在所述显示画面中没有检测到人脸区域,控制所述目标摄像设备进行光学变倍回退,并回退至所述目标摄像设备当前所处的光学变倍倍率的一半;
对进行光学变倍回退后所述目标摄像设备的显示画面进行人脸区域检测;
对应于在所述进行光学变倍回退后所述目标摄像设备的显示画面中没有检测到人脸区域,控制所述目标摄像设备进行光学变倍回退,并回退至广角端。
在一个可选实施例中,在控制所述目标摄像设备进行数字变倍之后,所述方法还包括:
对所述目标摄像设备的显示画面进行人脸区域检测;
对应于在所述显示画面中没有检测到人脸区域,判断所述整幅拍摄画面中是否具有人脸区域;
若是,调整显示画面以显示所述人脸区域;若否,控制所述目标摄像设备进行数字变倍回退和光学变倍回退。
在一个可选实施例中,控制所述目标摄像设备进行光学变倍包括:
获取目标摄像设备在分别采集预定数量的连续帧图像时的聚焦马达点位以及帧图像的清晰度;
基于分别获取的多个所述聚焦马达点位以及多个所述清晰度,确定每帧图像对应的坐标点,其中,每帧图像对应的坐标点的坐标值包括采集每帧图像时的聚焦马达点位以及每帧图像的清晰度;
基于所述连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定所述目标摄像设备的聚焦马达的目标调整步长,其中,所述第四目标帧图像为所述第三目标帧图像之前的帧图像,所述第三目标帧图像、所述第二目标帧图像以及所述第一目标帧图像为依次相邻的帧图像,且所述第一目标帧图像为所述连续帧图像的最后一帧图像。
在一个可选实施例中,基于所述连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定所述目标摄像设备的聚焦马达的目标调整步长包括:
基于第一坐标值、第二坐标值和第四坐标值确定第一坐标点的第一角度变化值和第一残差变化率,其中,所述第一坐标值为所述第一目标帧图像对应的所述第一坐标点的坐标值,所述第二坐标值为所述第二目标帧图像对应的第二坐标点的坐标值,所述第四坐标值为所述第四目标帧图像对应的第四坐标点的坐标值,所述第一角度变化值是第一平均每步长清晰度值与第二平均每步长清晰度值的变化量,所述第一平均每步长清晰度值为所述第一目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第二平均每步长清晰度值为所述第一目标帧图像和所述第二目标帧图像之间的平均每步长清晰度值,所述第一残差变化率用于指示所述第一目标帧图像和所述第二目标帧图像的清晰度每步长变化率;
基于第二坐标值、第三坐标值和第四坐标值确定第二坐标点的第二角度变化值和第二残差变化率,其中,所述第三坐标值为所述第三目标帧图像对应的第三坐标点的坐标值,所述第二角度变化值是第三平均每步长清晰度值与第四平均每步长清晰度值的变化量,所述第三平均每步长清晰度值为所述第二目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第四平均每步长清晰度值为所述第二目标帧图像和所述第三目标帧图像之间的平均每步长清晰度值,所述第二残差变化率用于指示所述第二目标帧图像和所述第三目标帧图像的清晰度每步长变化率;
基于所述第一角度变化值、所述第一残差变化率、所述第二角度变化值和所述第二残差变化率确定所述目标摄像设备的聚焦马达的目标调整步长。
在一个可选实施例中,基于所述第一角度变化值、所述第一残差变化率、所述第二角度变化值和所述第二残差变化率确定所述目标摄像设备的聚焦马达的目标调整步长包括:
确定所述第一角度变化值与所述第二角度变化值之间的第一差值;
确定所述第一残差变化率与所述第二残差变化率之间的第二差值;
基于所述第一差值和所述第二差值确定所述目标摄像设备的聚焦马达的目标调整步长。
在一个可选实施例中,基于所述第一差值和所述第二差值确定所述目标摄像设备的聚焦马达的目标调整步长包括:
基于所述第一差值和所述第二差值确定目标收敛值;
根据所述目标收敛值确定所述目标调整步长。
在一个可选实施例中,根据所述目标收敛值确定所述目标调整步长包括:
在确定所述目标收敛值满足第一条件的情况下,确定所述目标调整步长为预设步长值;
在所述目标收敛值不满足所述第一条件的情况下,确定所述目标调整步长为初始步长,其中,所述初始步长为所述目标摄像设备在采集预定数量的所述连续帧图像时所使用的步长。
在一个可选实施例中,在确定所述目标摄像设备的聚焦马达的目标调整步长之后,所述方法还包括:
按照所述目标调整步长对所述目标摄像设备进行聚焦处理。
第二方面,本申请实施例还提供了一种摄像控制装置,所述装置包括:
第一确定模块,用于确定第一比值,所述第一比值为目标摄像设备当前所处的光学变倍倍率与所述目标摄像设备的最大光学变倍倍率的比值;
第二确定模块,用于确定第二比值,所述第二比值为所述目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
判断模块,用于判断是否所述第一比值小于等于第一比值阈值且所述第二比值小于等于第二比值阈值;
控制模块,用于在判断的结果为是时,控制所述目标摄像设备进行光学变倍;以及,在判断的结果为否时,控制所述目标摄像设备进行数字变倍。
第三方面,本申请实施例还提供了一种计算机设备,包括处理器和存储器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述各方法实施例中任意之一中的步骤。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述各方法实施例中任意之一中的步骤。
上述摄像控制方法、装置、计算机设备和计算机可读存储介质,通过确定第一比值,所述第一比值为目标摄像设备当前所处的光学变倍倍率与所述目标摄像设备的最大光学变倍倍率的比值;确定第二比值,所述第二比值为所述目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;判断是否所述第一比值小于等于第一比值阈值且所述第二比值小于等于第二比值阈值;若是,控制所述目标摄像设备进行光学变倍;若否,控制所述目标摄像设备进行数字变倍;如此,能够根据当前的变倍倍率以及人脸区域的占比实现光学变倍和数字变倍的自适应选择,既满足了准确快速利用缩放技术进行特写的需求,又可以得到较好的图像画质,从而有利于人脸区域的特写与捕捉。
上述聚焦步长确定方法、装置、计算机设备和计算机可读存储介质,由于根据连续帧图像中的坐标点的坐标值进行步长调整,能够使摄像设备进行快速聚焦,从而减少了聚焦过程的时间消耗,达到提高聚焦效率的效果。
本申请的一个或多个实施例的细节在以下附图和描述中提出,以使本申请的其他特征、目的和优点更加简明易懂。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为一个实施例中摄像控制方法的流程示意图。
图2为一个实施例中云台摄像机的结构示意图。
图3为另一个实施例中摄像控制方法的流程示意图。
图4至图7为各实施例中缩放画面的示意图。
图8为一种示意性的物距与光学变倍倍率以及人脸区域占比之间的关系图。
图9为一个实施例中人体图像区域与人脸区域的示意图。
图10为一个实施例中数字变倍的画面区域示意图。
图11为一个实施例中光学变倍回退方法的流程示意图。
图12为一种具体实施方式中摄像控制方法的流程示意图。
图13为根据本申请实施例的一种聚焦步长确定方法的流程图。
图14为根据本申请实施例的爬山聚焦曲线示意图。
图15为根据本申请实施例的摄像控制装置的示意图。
图16为根据本申请实施例的一种聚焦步长确定装置的结构框图。
图17为根据本申请实施例的一种聚焦步长确定方法的移动终端的硬件结构框图。
图18为根据本申请的具体实施例的一种聚焦步长确定装置的结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。此外,还可以理解的是,虽然这种开发过程中所作出的努力可能是复杂并且冗长的,然而对于与本申请公开的内容相关的本领域的普通技术人员而言,在本申请揭露的技术内容的基础上进行的一些设计,制造或者生产等变更只是常规的技术手段,不应当理解为本申请公开的内容不充分。
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域普通技术人员显式地和隐式地理解的是,本申请所描述的实施例在不冲突的情况下,可以与其它实施例相结合。
除非另作定义,本申请所涉及的技术术语或者科学术语应当为本申请所属技术领域内具有一般技能的人士所理解的通常意义。本申请所涉及的“一”、“一个”、“一种”、“该”等类似词语并不表示数量限制,可表示单数或复数。本申请所涉及的术语“包括”、“包含”、“具有”以及它们的任何变形,意图在于覆盖不排他的包含;例如包含了一系列步骤或模块(单元)的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以还包括没有列出的步骤或单元,或可以还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请所涉及的“连接”、“相连”、“耦接”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电气的连接,不管是直接的还是间接的。本申请所涉及的“多个”是指大于或者等于两个。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本申请所涉及的术语“第一”、“第二”、“第三”等仅仅是区别类似的对象,不代表针对对象的特定排序。
光学变倍和数字变倍是目前摄像设备主要采用的缩放技术。其中,光学变倍主要通过聚焦镜片组的移动来实现图像的缩放,图像画质不损失;而数字变倍主要通过对图像的裁剪实现图像的放大,且倍率越大,图像通过“插值”会导致画质损失越多。不仅如此,在实现对捕捉到的人脸区域的图像放大后,如果图像放大是通过数字变倍获得的,那么由于数字变倍技术中全景图像是可以实时获取的,当人脸突然消失时,镜头可以分析的全景画面可更广,对下一个场景画面的切面会更快速,该方法可实现单摄像设备二画面的检测;而对于通过光学变倍实现图像放大的情况,当人脸突然消失后,图像所能检测的区域会大大减小,对下个场景的切换速度会受影响。因此,光学变倍和数字变倍各自具有优选点,需要根据实际情况与需求进行合理选择。
本申请一实施例提供了一种摄像控制方法,图1为摄像控制方法的流程示意图,如图所示,上述方法包括:
步骤101,确定第一比值,第一比值为目标摄像设备当前所处的光学变倍倍率与目标摄像设备的最大光学变倍倍率的比值;
步骤102,确定第二比值,第二比值为目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
步骤103,判断是否第一比值小于等于第一比值阈值且第二比值小于等于第二比值阈值;
步骤104,若步骤103的判断结果为是,控制目标摄像设备进行光学变倍;若步骤103的判断结果为否,控制目标摄像设备进行数字变倍。
可以理解地,本申请实施例能够根据当前的变倍倍率以及人脸区域的占比实现光学变倍和数字变倍的自适应选择,既满足了准确快速利用缩放技术进行特写的需求,又可以得到较好的图像画质,从而有利于人脸区域的特写与捕捉。
本申请实施例提供的摄像控制方法,例如应用于如图2所示的应用环境中。其中,图2中的目标摄像设备具体为云台摄像机,包括可转动的云台和安装在云台上的摄像机。当摄像机跟踪拍摄人脸时,通过分析计算人脸区域与摄像机中心位置,带动云台移动到合适的中心位置,同时通过分析人脸与整画面图像大小,分析摄像机合适的调整倍率。本申请实施例提供的方法可以很好的解决单云台摄像机对于人脸区域聚焦问题,实现人脸区域的快速框选及聚焦。其中,摄像机可以但不限于是枪形摄像机、球形摄像机和半球摄像机,摄像机可以位于云台的上方也可以位于云台的下方,在此对摄像机与云台的相对方位不做限制。应当理解,虽然以上仅说明了通过云台的转动带动摄像机,但本申请实施例的应用环境并不限于此;具体地,在其他一些实施例中,目标摄像设备可以被控制而实现移动和/或转动。
此外,本申请实施例提供的摄像控制方法可应用于单摄像机,即执行摄像控制方法的摄像控制装置可通过控制一台摄像机而执行上述方法中的步骤。
在步骤101中,确定第一比值,可以具体包括:确定摄像机当前所处的光学变倍倍率Xoz,计算Xoz与摄像机的最大光学变倍倍率Xz的比值,将该比值确定为第一比值,即Xoz/Xz。
这里,摄像机当前所处的光学变倍倍率具体可以指摄像机的镜头当前所处的光学变倍倍率;同样地,摄像机的最大光学变倍倍率具体可以指摄像机的镜头的最大光学变倍倍率。
摄像机的最大光学变倍倍率根据摄像机的功能而确定,通常为固定不变的。
在步骤102中,确定第二比值,可以具体包括:确定摄像机当前拍摄到的人脸区域面积Sface,计算拍摄到的Sface与整幅拍摄画面的面积Sw的比值,将该比值确定为第二比值Facepro;换言之,Facepro=Sface/Sw。
这里,可以通过对摄像机的拍摄画面进行人脸区域检测,并根据已有算法计算检测到的人脸区域的面积。
整幅拍摄画面的面积通常为已知且可以根据设置情况而确定的。
在一具体实施例中,对应于摄像机当前拍摄到单人人脸,第二比值为单人人脸的区域面积在整幅拍摄画面中的占比。
在又一具体实施例中,对应于摄像机当前拍摄到多人人脸,第二比值为合并人脸区域面积在整幅拍摄画面中的占比,其中合并人脸区域面积为多人人脸中各人脸对应的区域面积的加和。
换言之,通过分析人脸区域面积与整幅画面的面积占比来求取人脸占比。其中,单人人脸例如通过分析单个人脸面积占比;多人人脸例如通过合并人脸区域,统计合并人脸区域计算整幅画面的人脸占比。
需要说明的是,对应于摄像机当前拍摄到单人人脸时第二比值的确定,与对应于摄像机当前拍摄到多人人脸时第二比值的确定,可以在同一实施例中采用,也可以在不同实施例中采用;即,当通过单人人脸的区域面积在整幅拍摄画面中的占比来确定对应于摄像机当前拍摄到单人人脸时的第二比值时,对应于摄像机当前拍摄到多人人脸时的第二比值的确定方法可以采用上述合并人脸区域面积在整幅拍摄画面中的占比的方法,也可以采用其他方法,二者不必要关联存在,反之亦然。
在步骤103中,判断是否第一比值小于等于第一比值阈值且第二比值小于等于第二比值阈值;这里,设第一比值阈值为N,第二比值阈值为M,步骤103即为判断是否Xoz/Xz≤N且Facepro≤M。
在一可选实施例中,N的取值范围为0.45-0.55;具体例如N为0.5,即1/2。M的取值范围为0.15-0.25;具体例如M为0.2,即1/5。
在步骤104中,若Xoz/Xz≤N且Facepro≤M,则控制摄像机进行光学变倍(用“Soz”表示);若为除此以外的其他情况,则控制摄像机进行数字变倍(用“Sdz”表示)。
作为一种具体实施方式,综合考虑图像缩放后的画质和图像放大后人脸的消失检测机制,设置对图像缩放功能采取的缩放策略S如下:
Figure PCTCN2022073007-appb-000001
其中,else表示除在其之上的条件以外的其他条件。
如此,当人脸在整幅画面中的占比较小且光学变倍倍率较小时,采用光学变倍进行缩放;当人脸占比超过一定人脸阈值(即第二比值阈值)时,采用数字变倍进行缩放;既满足放大人脸的功能,又可以得到较好的图像画质,同时有利于实现人脸消失后全景画面人脸的快速检测。
可以理解地,为实现快速的人像特写调节,本申请实施例通过分析人脸占比与倍率的缩放比例关系,做到快速缩放。
接下来,请参考图3,在一可选实施例中,上述方法还包括:
步骤001,基于目标摄像设备当前拍摄到的画面信息确定人物区域中心位置;
步骤002,根据人物区域中心位置和整幅拍摄画面的中心位置,控制目标摄像设备移动和/或转动,以使人物区域中心位置与整幅拍摄画面的中心位置重合。
作为一种可选的实施方式,控制目标摄像设备移动和/或转动以使人物区域中心位置与整幅拍摄画面的中心位置重合的步骤,在确定第一比值的步骤之前执行。换言之,参考图3,在执行完步骤001至步骤002之后,再执行步骤101至步骤104。如此,在检测到人脸区域后,先根据人脸区域将人物区域调整至画面的中心位置,再通过变倍功能将人脸缩放到合适大小,实现人脸聚焦。
当然,本申请并不限于此,步骤001至步骤002,和步骤101至步骤104,可以分别执行。如此,在检测到人脸区域后,通过变倍功能进行图像缩放,将人脸缩放到合适大小,同时保证人物区域在缩放后处于画面中心位置。
这里,由于目标摄像设备当前拍摄的画面可能存在单人人脸,也可能存在多人人脸。对于单人人脸的情况,将单人人脸的区域中心位置移动到整幅拍摄画面的中心位置一般可保证对人脸的聚焦需求;然而,对于多人人脸的情况,如果仅根据多人人脸中各人脸的区域中心位置来确定画面如何显示,则可能会由于各人脸的前后位置等复杂关系而导致画面中人像显示不完整。
基于此,在一具体实施例中,基于目标摄像设备当前拍摄到的画面信息确定人物区域中心位置,包括:对应于目标摄像设备当前拍摄到单人人脸,将单人人脸的区域中心位置确定为人物区域中心位置。
在又一具体实施例中,基于目标摄像设备当前拍摄到的画面信息确定人物区域中心位置,包括:对应于目标摄像设备当前拍摄到多人人脸,将合并人体区域的中心位置确定为人物区域中心位置,合并人体区域为基于多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,其中闭合区域覆盖各人体图像。
换言之,人物区域中心位置具体可以在单人人脸和多人人脸的情况下采用不同的方式确定;在单人人脸的情况下,可以根据人脸区域确定;在多人人脸的情况下,可以根据人体的图像边界来确定。
需要说明的是,对应于目标摄像设备当前拍摄到单人人脸时的人物区域中心位置的确定,与对应于目标摄像设备当前拍摄到多人人脸时的人物区域中心位置的确定,可以在同一实施例中采用,也可以在不同实施例中采用;即,当将单人人脸的区域中心位置确定为人物区域中心位置时,对应于目标摄像设备当前拍摄到多人人脸时的人物区域中心位置的确定方法可以采用上述根据合并人体区域的中心位置的确定方法,也可以采用其他确定方法,二者不必要关联存在,反之亦然。
人体的图像边界可以由设置于目标摄像设备之内或者之外的图像处理模块确定,图像处理模块可以根据当前拍摄到的画面信息直接确定人体的图像边界,也可以根据人脸区域结合算法来推算人体的图像边界,这里不做具体限制。
根据人物区域中心位置和整幅拍摄画面的中心位置,控制目标摄像设备移动和/或转动,具体包括:
根据人物区域中心位置和整幅拍摄画面的中心位置之间的水平偏移量以及物距确定水平位置偏移角度;
根据人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量以及物距确定竖直位置偏移 角度;
根据水平位置偏移角度和竖直位置偏移角度控制目标摄像设备转动;
其中,物距为当前拍摄到的人脸的实际位置和目标摄像设备的实际位置之间的距离。
根据人物区域中心位置和整幅拍摄画面的中心位置之间的水平偏移量以及物距确定水平位置偏移角度,具体例如包括:根据人物区域中心位置和整幅拍摄画面的中心位置计算二者之间的水平偏移量Xoff,根据Xoff与物距Sd之间的比值计算水平位置偏移角度的正切函数值arctan(Xoff/Sd),根据arctan(Xoff/Sd)计算水平位置偏移角度。
根据人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量以及物距确定竖直位置偏移角度,具体例如包括:根据人物区域中心位置和整幅拍摄画面的中心位置计算二者之间的竖直偏移量Yoff,根据Yoff与物距Sd之间的比值计算竖直位置偏移角度的正切函数值arctan(Yoff/Sd),根据arctan(Yoff/Sd)计算竖直位置偏移角度。
这里,水平位置偏移角度和竖直位置偏移角度不仅包括相应角度的数值,还包括角度的方向(例如以正负来表示角度的方向)。
控制目标摄像设备转动,具体可以通过控制云台转动而带动目标摄像设备转动来实现。
在一可选实施例中,物距根据目标摄像设备当前所处的光学变倍倍率以及第二比值确定。
下面,将结合一具体示例进行进一步详细说明。
对应于目标摄像设备当前拍摄到单人人脸的情况:
如图4所示,在缩放过程中,如果人脸本身处于画面边缘位置,很可能因为倍率的变大而导致人脸消失。其中,A表示画面的中心位置,B表示人脸区域的中心位置。因而,需要将人脸调整到画面中心位置而进行变倍,才能保证良好的人脸聚焦效果。
这里,请参考图5,为保证变倍到位,使得人脸处于画面中心,假设画面宽、高分别为w、h,则A位于(w/2,h/2)处。根据B与A的水平竖直偏移量Xoff,竖直偏移量Yoff,将B移动到A的位置。
对应于目标摄像设备当前拍摄到多人人脸的情况:
当画面中存在多人人脸时,需要均衡画面整体人像画面特写效果,这里请参考图6,将多人人体的图像作为整体区域,其中,B和C分别表示多人人脸中各人脸区域的中心位置。如将B和C对应的各人体区域作为合并人体区域,合并人体区域中心位置为A’,实际画面中心位置仍然为A,则调整A’与A重合。
如果重合之前,合并人体区域的上下左右与拍摄画面的相应边界之间的距离差值分别为Yup、Ydown、Xleft、Xright;则调整至A’与A重合之后,合并人体区域的上下左右与拍摄画面的相应边界之间的距离差值分别变为Y’up、Y’down、X’left、X’right,此时,Y’up=Y’down且X’left=X’right。
为保证人物区域居中,需要较精准的移动云台,需要计算云台移动的角度。
请参考图7,根据人物区域中心位置(用R表示,即在单人人脸实施例中R=B,在多人人脸实施例中R=A’)和整幅拍摄画面的中心位置之间的水平偏移量Xoff以及物距Sd确定水平位置偏移角度∠R’CA,∠R’CA=arctan(Xoff/Sd);根据人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量Yoff以及物距Sd确定竖直位置偏移角度∠R”CA,∠R”CA=arctan(Yoff/Sd)。
进一步根据水平位置偏移角度和竖直位置偏移角度,同时结合人物区域中心位置相对于整幅拍摄画面的中心位置的偏向进行云台移动。
这里,物距Sd通过人脸区域占比(即第二比值),马达当前倍率Zoom以及对焦马达的位置计算获取。
在一可选实施例中,上述方法还包括:预先建立物距Sd与目标摄像设备所处不同的光学变倍倍率以及各不同的第二比值之间的对应关系,根据对应关系确定物距。
可以理解地,由于人脸区域在不同的倍率下占比不同;即使在相同的倍率下,位于不同距离处的人所对应的人脸区域的占比也不一样,具体地,倍率相同的情况下,远距离人脸区域占比小,近距离人脸区域占比大。因此,可以根据不同的物距、目标摄像设备所处不同的光学变倍倍率以及各不同的第二比值,构建三者之间的关系表或关系图,从而有利于快速确定当前对应的物距。如图8为一种示意性的物距与光学变倍倍率以及人脸区域占比之间的关系图,图中,Zoom电机位置与物距相对应。
在一可选实施例中,在控制目标摄像设备进行光学变倍之后,或在控制目标摄像设备进行数字变倍之后,在目标摄像设备的显示画面中人物区域面积与显示画面的总面积的比值的范围为0.7-0.8;其中,
对应于目标摄像设备当前拍摄到单人人脸,人物区域面积为单人人脸对应的人体图像区域面积;
对应于目标摄像设备当前拍摄到多人人脸,人物区域面积为合并人体区域面积,合并人体区域为基于多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,闭合区域覆盖各人体图像。
在一具体实施例中,目标摄像设备的显示画面中人物区域面积与显示画面的总面积的比值为0.75。
可以理解地,为保证人像得到良好的缩放比例,本实施通过设置合适的比例范围,使得目标摄像设备镜头可以进行自适应聚焦缩放。
在一可选实施例中,人体图像区域面积基于对应的单人人脸的区域面积和预设倍数确定,预设倍数为预设的表征人体图像区域面积与人脸区域面积的比值。
具体地,请参考图9,根据人体黄金分割比例,一般人在坐姿情况下身高为5个头长,站姿情况下身高为7.5个头长,而视频会议场景中无论站姿还是坐姿更注重人体的上半部分,因此,在一可选实施例中,设置人体宽度为人脸宽度w的2倍,即人体宽度为2*w;人的除头部以外的身体部分的高度为人脸高度h的3倍,即人体高度为4*h;从而确定人体图像区域面积。在本实施例中,预设倍数等于8,即人体图像区域面积根据对应的单人人脸的区域面积乘以8倍进行计算。
接下来,对应于步骤103的判断结果为是,在控制目标摄像设备进行光学变倍之后,上述方法还可以包括:
对目标摄像设备的显示画面进行人脸区域检测;
对应于在显示画面中没有检测到人脸区域,控制目标摄像设备进行光学变倍回退,并回退至目标摄像设备当前所处的光学变倍倍率的一半;
对进行光学变倍回退后目标摄像设备的显示画面进行人脸区域检测;
对应于在进行光学变倍回退后目标摄像设备的显示画面中没有检测到人脸区域,控制目标摄像设备进行光学变倍回退,并回退至广角端。
对应于步骤103的判断结果为否,在控制目标摄像设备进行数字变倍之后,上述方法还包括:
对目标摄像设备的显示画面进行人脸区域检测;
对应于在显示画面中没有检测到人脸区域,判断整幅拍摄画面中是否具有人脸区域;
若是,调整显示画面以显示人脸区域;若否,控制目标摄像设备进行数字变倍回退和光学变倍回退。
可以理解地,在进行变倍缩放以对人脸进行聚焦后,还需要保证如何在人脸消失的状态下,快速回退到合适的位置。
在实际应用中,可以分为数字变倍回退方法(一)和光学变倍回退方法(二)。
(一)对于采用了数字变倍的情况,如图10所示,a区域为中心裁剪数字变倍放大的画面所在的区域;b区域的外边界为数字变倍放大前的画面(原始画面)边界,b区域的内边界为a区域的外边界,进而b区域为数字变倍中被裁减掉而未进行显示的区域。当a区域中人脸消失时,在通常的一些情况中,需要进行倍率回退进行检测,而本实施例可暂时采用不回退的方式进行人脸快速检测,具体地,通过检测每帧保留的原始画面进行人脸位置检测,在多数情况下,人脸若移动至b区域,即移动至a区域与原始画面之间,可通过检测b区域快速锁定人脸区域位置,避免了大幅度倍率回退导致的画面来回缩放震动现象,也加速人脸区域再次特写锁定;当在b区域中也未检测到人脸时,立即进行数字变倍回退,同时光学变倍回退,按照光学变倍的回退方法进行重新人脸区域的锁定。
(二)对于采用了光学变倍的情况,如图11所示,当前光学变倍倍率为Z;当人脸区域消失后,本实施例通过如下步骤进行回退:光学变倍倍率由Z快速回退至Z/2位置,再进行人脸区域快速检测;当依旧未检查到人脸时,光学变倍倍率快速回退到最广角端,即回退至最小,再进行检测;如果检测到人脸区域,则根据本申请上述实施例提供的方法自适应缩放并缩放至合适倍率;在人脸区域消失时,再次执行光学变倍倍率回退至Z/2的步骤。此外,进行静置/画面特写。如此,不仅可以避免过渡回退导致的人脸缩放过渡,同时减少了镜头移动耗费的时间,避免了镜头移动耗时过长的问题。
如此,本申请实施例提供的摄像控制方法不仅可以根据人脸区域检测实现自适应缩放聚焦,而且在人脸消失时,还可以采用快速回退机制实现精准回退。
作为一种具体实施方式,请参考图12;如图所示,首先,采用人脸检测技术,进行人脸区域检测;当检测到人脸时,即存在人脸,则通过云台辅助机制,调整人物区域中心位置与整幅拍摄画面的中心位置重合,具体根据单人人脸还是多人人脸的不同情况计算人脸区域占比,根据人物区域中心与整幅拍摄画面的中心位置之间的偏移量,云台辅助移动,将人物区域中心与画面中心对应;根据当前的倍率结合缩放策略,采用合适的光学变倍和数字变倍进行自适应缩放;实时检测人脸区域画面,若人脸消失,根据回退机制,即根据光学变倍/数字变倍选择对应的回退方法进行回退,保证在人脸消失的同时快速跟踪人脸画面,做到精准回退;摄像机自适应缩放至合适位置,即倍率停留有效位置。
由此可见,本实施方式提供了一种基于单摄像机的自适应缩放技术,通过对区域人脸分析,摄像机进行自适应缩放,快速变倍至合适倍率;在变倍过程中,综合考虑云台,进行位置微调,将单人人脸或者多人人脸区域置于画面中心;为尽量保证图像画质同时保证自适应缩放,根据相机所处倍率及人脸区域占比决定采用数字变倍还是光学变倍;此外,本实施方式中提出了高效的回退机制,解决人脸消失后单摄像机的倍率回退问题。本实施方式提出的单摄像机高效的自适应缩放技术,实现人脸区域快速特写。
光学变倍主要通过聚焦镜片组的移动来实现图像的缩放,图像画质不损失。聚焦镜片组的移动涉及自动对焦技术,当前自动对焦技术已广泛应用于数码相机、安防监控、手机、视频会议等领域,其中,自动对焦技术在安防领域主要通过图像分析来实现对焦:获取当前帧,分析图像清晰度值,计算下一步对焦位置与对焦清晰度值,不断驱动对焦马达,直到找到最清晰度值。但通常对焦方式中存在聚焦过程始终在峰值点附近来回对焦,从而导致对焦速度慢,降低了聚焦效率。
在一可选实施例中,在控制所述目标摄像设备进行光学变倍的过程中,提供一种聚焦步长确定方法,图13是根据本申请实施例的一种聚焦步长确定方法的流程图,如图13所示,该流程包括如下步骤:
步骤301,获取目标摄像设备在分别采集预定数量的连续帧图像时的聚焦马达点位以及帧图像的清晰度;
在本实施例中,在目标摄像设备采集帧图像时,分别记录采集每帧图像时对应的聚焦马达点位以及清晰度,以便于进行后续的计算。
其中,聚焦马达点位包括目标摄像设备采集某一帧图像时的聚焦步长、亮度等信息;聚焦马达点位以及帧图像的清晰度的获取方式可以是将聚焦马达点位以及帧图像的清晰度存储在目标区域,随后再从目标区域进行调取;预定数量可以是至少4帧的图像。
需要说明的是,获取目标摄像设备在分别采集预定数量的连续帧图像时的聚焦马达点位以及帧图像的清晰度的步骤是在对目标摄像设备进行图像拍摄形成图像之前的操作,即完成聚焦后再进行图像的拍摄,以获取清晰度较高的图像;其中,图像包括图片和/或影像。
步骤302,基于分别获取的多个聚焦马达点位以及多个清晰度,确定每帧图像对应的坐标点,其中,每帧图像对应的坐标点的坐标值包括采集每帧图像时的聚焦马达点位以及每帧图像的清晰度;
在本实施例中,确定坐标点是为了在利用爬山聚焦算法进行聚焦时,能够方便对每帧图像的聚焦马达点位进行定位,从而方便确定爬山聚焦算法的曲线。
其中,将聚焦马达点位与清晰度一一对应,从而形成二维坐标系,并将聚焦马达定位点位通过曲线进行连接,以确定爬山聚焦算法的曲线。
步骤303,基于连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定目标摄像设备的聚焦马达的目标调整步长,其中,第四目标帧图像为第三目标帧图像之前的帧图像,第三目标帧图像、第二目标帧图像以及第一目标帧图像为依次相邻的帧图像,且第一目标帧图像为连续帧图像的最后一帧图像。
在本实施例中,根据至少四帧的目标帧图像的坐标点的坐标值确定目标摄像设备的聚焦马达的目标调整步长,减少了目标调整步长的反复调试过程,从而减少了聚焦过程所需要花费的时间,提高了聚焦效率。
其中,目标调整步长可以根据实际需要进行调整,例如设为1,也可以设置为其它值;第四目标帧图像可以是与第三目标帧相邻的帧图像,也可以是不与第三目标帧图像相邻的图像。
通过上述步骤,根据连续帧图像中的坐标点的坐标值进行步长调整,能够使摄像设备进行快速聚焦,从而减少了聚焦过程的时间消耗,解决了相关技术中聚焦效率低问题,提高了聚焦效率。
在一个可选的实施例中,基于连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧 图像以及第四目标帧图像对应的坐标点的坐标值确定目标摄像设备的聚焦马达的目标调整步长包括:
步骤3031,基于第一坐标值、第二坐标值和第四坐标值确定第一坐标点的第一角度变化值和第一残差变化率,其中,第一坐标值为第一目标帧图像对应的第一坐标点的坐标值,第二坐标值为第二目标帧图像对应的第二坐标点的坐标值,第四坐标值为第四目标帧图像对应的第四坐标点的坐标值,第一角度变化值是第一平均每步长清晰度值与第二平均每步长清晰度值的变化量,第一平均每步长清晰度值为第一目标帧图像和第四目标帧图像之间的平均每步长清晰度值,第二平均每步长清晰度值为第一目标帧图像和第二目标帧图像之间的平均每步长清晰度值,第一残差变化率用于指示第一目标帧图像和第二目标帧图像的清晰度每步长变化率;
步骤3032,基于第二坐标值、第三坐标值和第四坐标值确定第二坐标点的第二角度变化值和第二残差变化率,其中,第三坐标值为第三目标帧图像对应的第三坐标点的坐标值,第二角度变化值是第三平均每步长清晰度值与第四平均每步长清晰度值的变化量,第三平均每步长清晰度值为第二目标帧图像和第四目标帧图像之间的平均每步长清晰度值,第四平均每步长清晰度值为第二目标帧图像和第三目标帧图像之间的平均每步长清晰度值,第二残差变化率用于指示第二目标帧图像和第三目标帧图像的清晰度每步长变化率;
步骤3033,基于第一角度变化值、第一残差变化率、第二角度变化值和第二残差变化率确定目标摄像设备的聚焦马达的目标调整步长。
在本实施例中,确定第一角度变化值和第二角度变化值是为了确定采集的相邻两帧的帧图像之间坐标点的角度变化,以确定清晰度是否超过或即将达到聚焦峰值,而当清晰度超过了聚焦峰值,第二角度变化值可能大于第一角度变化值,此时则可以判断聚焦峰值位于第一目标帧图像对应的聚焦马达点位的左侧,从而能够快速预判聚焦峰值的位置,以此类推;同理,确定第一残差变化率和第二残差变化率也是为了确定相邻两帧之间清晰度的变换,从而快速确定聚焦峰值的位置。
例如,如图14所示,第一目标帧图像为聚焦马达点位处于B点的帧图像,第二目标帧图像为聚焦马达点位处于C点的帧图像,第三目标帧图像为聚焦马达点位处于D点的帧图像,第四目标帧图像为聚焦马达点位处于A点的帧图像,第一角度变化值和第二角度变化值可以通过以下公式进行计算获得:
Figure PCTCN2022073007-appb-000002
Figure PCTCN2022073007-appb-000003
式(1)中,Fv_cur表示当前帧图像(即第一目标帧图像)的清晰度,Fv_init表示初始帧图像(即第四目标帧图像)的清晰度,Fv_bef表示前一帧图像(即第二目标帧图像)的清晰度, Pos_cur表示当前帧图像(即第一目标帧图像)的聚焦步长,Pos_init表示初始帧图像(即第四目标帧图像)的聚焦步长,Pos_bef表示前一帧图像(即第二目标帧图像)的聚焦步长,f_radio1为第一目标帧图像和第二目标帧图像分别相对于第四目标帧图像的清晰度相对变化率,即第一平均每步长清晰度值;f_radio2即为第二目标帧图像和第三目标帧图像分别相对于第四目标帧图像的清晰度相对变化率,即第二平均每步长清晰度值;在正常的爬山聚焦算法中,通常用来衡量清晰度是否到达聚焦峰值,当f_radio2<0,表示曲线呈下降趋势,即当前帧图像的清晰度已过峰值点;为避免遇到假波峰,会设定一定阈值限定;当f_radio2>0,表示曲线处于上升过程,但难以限定是否已接近稳定的峰值点,因而需要通过式(2)进行补充判断;在式(2)中,与前一帧形成的角度(θ 2>θ 4)越小,且与初始角度形成的角度(θ 1<θ 3)越小,则形成的角度差θ diff越接近峰值越小;f_radio即为第一角度变化值和第二角度变化值的计算公式。
第一残差变化率和第二残差变化率可以通过以下公式计算获得:
Figure PCTCN2022073007-appb-000004
式(3)中,fv_radio1即为第一残差变化率,fv_radio2即为第二残差变化率,Fv_cur表示当前帧的清晰度值,Fv_bef表示前一帧的清晰度值,Fv_bef′表示更前一帧的清晰度值,Step_cur表示当前帧相对于前一帧的行走步长,Step_bef表示前一帧图像的聚焦步长,fv_radio表示前后帧的清晰度值每步长变化率来计算残差变化率。
在一个可选的实施例中,基于第一角度变化值、第一残差变化率、第二角度变化值和第二残差变化率确定目标摄像设备的聚焦马达的目标调整步长包括:
步骤30331,确定第一角度变化值与所述第二角度变化值之间的第一差值;
步骤30332,确定第一残差变化率与所述第二残差变化率之间的第二差值;
步骤30333,基于第一差值和第二差值确定目标摄像设备的聚焦马达的目标调整步长。
在本实施例中,确定第一差值是为了确定相邻帧图像的角度变化值之间的变化情况,确定第二差值是为了确定相邻帧图像的清晰度变化情况。
其中,第二差值即为前述式(3)中的fv_radio值,且:
Figure PCTCN2022073007-appb-000005
如式(4)所示,当fv_radio大于0,则表示清晰度值处于曲线的上升阶段,当fv_radio小于0,则表示搜索区域已到达平缓区域,快接近聚焦峰值。
第一差值f_radio_diff可通过以下公式进行计算获得:
Figure PCTCN2022073007-appb-000006
式(5)中f_radio_B与f_radio_C分别代表B与C两帧图像的聚焦马达点位角度,B、C、D三点的清晰度值为分别代表f b,f c,f d,B、C、D三点与初始点的位置差为p b,p c,p d
其中:当f值远大于p值,且在帧图像的清晰度未达到聚焦峰值时,f b>f c>f d,p b>p c>p d。若B点的清晰度超过聚焦峰值,则f c>f b
由式(4)可得,f c 2·[f b·(p c-p d)-f d·p b]将影响聚焦值f_radio_diff值,从而可进行提前判断收敛点验证,即:
当B还未达到峰值点时,f_radio_diff≥0;当B接近峰值点时,f_radio_diff<0。
需要说明的是,步骤30331与步骤30332的执行顺序可以进行调换,即可以先执行步骤30332,再执行步骤30331。
在一个可选的实施例中,基于第一差值和第二差值确定目标摄像设备的聚焦马达的目标调整步长包括:
步骤303331,基于第一差值和第二差值确定目标收敛值;
步骤303332,根据目标收敛值确定目标调整步长。
在本实施例中,确定目标收敛值是为了确定帧图像的清晰度是否超过聚焦峰值或是否达到聚焦峰值附近,随后再确定目标调整步长,以使后续的聚焦过程能够快速的达到聚焦峰值。
其中,目标收敛值可以通过如下公式进行确定:
Figure PCTCN2022073007-appb-000007
式中,条件A为:fv_radio0&&f_radio_diff>default_radio1;
条件B为:f_radio_diff<&&f_radio_C>0;
条件C为:f_radio2<default_radio2;
其中:default_radio1,default_radio2分别限定为5与-25。
在一个可选的实施例中,根据目标收敛值确定目标调整步长包括:
步骤3033321,在确定目标收敛值满足第一条件的情况下,确定目标调整步长为预设步长值;
步骤3033322,在目标收敛值不满足第一条件的情况下,确定目标调整步长为初始步长,其中,初始步长为目标摄像设备在采集预定数量的连续帧图像时所使用的步长。
在本实施例中,第一条件可以(但不限于)为以下公式:
Figure PCTCN2022073007-appb-000008
其中,在未达到收敛条件时,即flag_near_peak=0时,聚焦步长设置按照原先的设置进行行走,否则按照将聚焦步长设置为1。
在一个可选的实施例中,在确定目标摄像设备的聚焦马达的目标调整步长之后,该方法还包括:
步骤304,按照目标调整步长对目标摄像设备进行聚焦处理。
在本实施例中,聚焦处理可以(但不限于)是按照目标调整步长往复进行帧图像的采集和清晰度记录,并使清晰度达到聚焦峰值。
应该理解的是,虽然上述各流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,上述各流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在此基础上,如图15所示,本申请实施例还提供了一种摄像控制装置400,该装置包括:第一确定模块410、第二确定模块420、判断模块430和控制模块440,其中:
第一确定模块410,用于确定第一比值,第一比值为摄像机当前所处的光学变倍倍率与摄像机的最大光学变倍倍率的比值;
第二确定模块420,用于确定第二比值,第二比值为摄像机当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
判断模块430,用于判断是否第一比值小于等于第一比值阈值且第二比值小于等于第二比值阈值;
控制模块440,用于在判断的结果为是时,控制摄像机进行光学变倍;以及,在判断的结果为否时,控制摄像机进行数字变倍。
在一可选实施例中,对应于摄像机当前拍摄到单人人脸,第二比值为单人人脸的区域面积在整幅拍摄画面中的占比;对应于摄像机当前拍摄到多人人脸,第二比值为合并人脸区域面积在整幅拍摄画面中的占比,合并人脸区域面积为多人人脸中各人脸对应的区域面积的加和。
在一可选实施例中,第一比值阈值的取值范围为0.45-0.55。
在一可选实施例中,第二比值阈值的取值范围为0.15-0.25。
在一可选实施例中,该装置还包括:
第三确定模块,用于基于摄像机当前拍摄到的画面信息确定人物区域中心位置;
控制模块440,还用于根据人物区域中心位置和整幅拍摄画面的中心位置,控制摄像机移动和/或转动,以使人物区域中心位置与整幅拍摄画面的中心位置重合。
在一可选实施例中,控制模块440,用于在第一确定模块410确定第一比值之前,控制摄像机移动和/或转动以使人物区域中心位置与整幅拍摄画面的中心位置重合。
在一可选实施例中,第三确定模块,具体用于:
对应于摄像机当前拍摄到单人人脸,将单人人脸的区域中心位置确定为人物区域中心位置;
对应于摄像机当前拍摄到多人人脸,将合并人体区域的中心位置确定为人物区域中心位置,合并人体区域为基于多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,闭合区域覆盖各人体图像。
在一可选实施例中,控制模块440,具体用于:
根据人物区域中心位置和整幅拍摄画面的中心位置之间的水平偏移量以及物距确定水平位置偏移角度;
根据人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量以及物距确定竖直位置偏移角度;
根据水平位置偏移角度和竖直位置偏移角度控制摄像机转动;
其中,物距为当前拍摄到的人脸的实际位置和摄像机的实际位置之间的距离。
在一可选实施例中,物距根据摄像机当前所处的光学变倍倍率以及第二比值确定。
在一可选实施例中,在控制摄像机进行光学变倍之后,或在控制摄像机进行数字变倍之后,在摄像机的显示画面中人物区域面积与显示画面的总面积的比值的范围为0.7-0.8;其中,
对应于摄像机当前拍摄到单人人脸,人物区域面积为单人人脸对应的人体图像区域面积;
对应于摄像机当前拍摄到多人人脸,人物区域面积为合并人体区域面积,合并人体区域为基于多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,该闭合区域覆盖各人体图像。
在一可选实施例中,人体图像区域面积基于对应的单人人脸的区域面积和预设倍数确定,预设倍数为预设的表征人体图像区域面积与人脸区域面积的比值。
在一可选实施例中,上述装置还包括:
回退模块,用于在控制摄像机进行光学变倍之后,对摄像机的显示画面进行人脸区域检测;
对应于在显示画面中没有检测到人脸区域,控制摄像机进行光学变倍回退,并回退至摄像机当前所处的光学变倍倍率的一半;
对进行光学变倍回退后摄像机的显示画面进行人脸区域检测;
对应于在进行光学变倍回退后摄像机的显示画面中没有检测到人脸区域,控制摄像机进行光学变倍回退,并回退至广角端。
在一可选实施例中,该装置还包括:
回退模块,用于在控制摄像机进行数字变倍之后,对摄像机的显示画面进行人脸区域检测;
对应于在显示画面中没有检测到人脸区域,判断整幅拍摄画面中是否具有人脸区域;
若是,调整显示画面以显示人脸区域;若否,控制摄像机进行数字变倍回退和光学变倍回退。
在一可选实施例中,控制模块440包括:
参数采集模块441,用于获取目标摄像设备在分别采集预定数量的连续帧图像时的聚焦马达点位以及帧图像的清晰度;
坐标确定模块442,用于基于分别获取的多个所述聚焦马达点位以及多个所述清晰度,确定每帧图像对应的坐标点,其中,每帧图像对应的坐标点的坐标值包括采集每帧图像时的聚焦马达点位以及每帧图像的清晰度;
步长确定模块443,用于基于连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定所述目标摄像设备的聚焦马达的目标调整步长,其中,第四目标帧图像为第三目标帧图像之前的帧图像,第三目标帧图像、第二目标帧图像以及第一目标帧图像为依次相邻的帧图像,且第一目标帧图像为连续帧图像的最后一帧图像。
在一个可选的实施例中,步长确定模块443包括:
第一参数确定单元4431,用于基于第一坐标值、第二坐标值和第四坐标值确定第一坐标点的第一角度变化值和第一残差变化率,其中,所述第一坐标值为所述第一目标帧图像对应的所述第一坐标点的坐标值,所述第二坐标值为所述第二目标帧图像对应的第二坐标点的坐标值,所述第四坐标值为所述第四目标帧图像对应的第四坐标点的坐标值,所述第一角度变化值是第一平均每步长清晰度值与第二平均每步长清晰度值的变化量,所述第一平均每步长清晰度值为所述第一目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第二平均每步长清晰度值为所述第一目标帧图像和所述第二目标帧图像之间的平均每步长清晰度值,所述第一残差变化率用于指示所述第一目标帧图像和所述第二目标帧图像的清晰度每步长变化率;
第二参数确定单元4432,用于基于第二坐标值、第三坐标值和第四坐标值确定第二坐标点的第二角度变化值和第二残差变化率,其中,所述第三坐标值为所述第三目标帧图像对应的第三坐标点的坐标值,所述第二角度变化值是第三平均每步长清晰度值与第四平均每步长清晰度值的变化量,所述第三平均每步长清晰度值为所述第二目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第四平均每步长清晰度值为所述第二目标帧图像和所述第三目标帧图像之间的平均每步长清晰度值,所述第二残差变化率用于指示所述第二目标帧图像和所述第三目标帧图像的清晰度每步长变化率;
步长确定单元4433,用于基于所述第一角度变化值、所述第一残差变化率、所述第二角度变化值和所述第二残差变化率确定所述目标摄像设备的聚焦马达的目标调整步长。
在一个可选的实施例中,步长确定单元4433包括:
第一差值确定子单元44331,用于确定第一角度变化值与第二角度变化值之间的第一差值;
第二差值确定子单元44332,用于确定第一残差变化率与第二残差变化率之间的第二差值;
步长确定子单元44333,基于第一差值和第二差值确定目标摄像设备的聚焦马达的目标调整步长。
在一个可选的实施例中,步长确定子单元44333包括:
收敛确定子单元443331,用于基于第一差值和第二差值确定目标收敛值;
目标步长子单元443332,用于根据所述目标收敛值确定所述目标调整步长。
在一个可选的实施例中,目标步长子单元443332包括:
第一步长子单元4433321,用于在确定目标收敛值满足第一条件的情况下,确定目标调整步长为预设步长值;
第二步长子单元4433322,用于在目标收敛值不满足第一条件的情况下,确定目标调整步长为初始步长,其中,初始步长为目标摄像设备在采集预定数量的连续帧图像时所使用的步长。
在一个可选的实施例中,控制模块440还包括:
聚焦处理模块444,用于在确定目标摄像设备的聚焦马达的目标调整步长之后,按照目标调整步长对所述目标摄像设备进行聚焦处理。
关于摄像控制装置的具体限定可以参见上文中对于摄像控制方法的限定,在此不再赘述。上述摄像控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
需要说明的是,所述聚焦步长确定方法不仅可以在所述摄像控制方法中控制所述目标摄像设备进行光学变倍的过程中实施,也可以单独实施。参数采集模块441、坐标确定模块442和步长确定模块443也可以作为一个整体(如聚焦步长确定装置)以单独实施,如图16所示。
所述聚焦步长确定方法的实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图17是本申请实施例的一种聚焦步长确定方法的移动终端的硬件结构框图。如图17所示,移动终端可以包括一个或多个(图17中仅示出一个)处理器501(处理器501可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器502,其中,上述移动终端还可以包括用于通信功能的传输设备503以及输入输出设备504。本领域普通技术人员可以理解,图17所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图17中所示更多或者更少的组件,或者具有与图17所示不同的配置。
存储器502可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的一种聚焦步长确定方法对应的计算机程序,处理器501通过运行存储在存储器502内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器502可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器502可进一步包括相对于处理器501远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输设备503用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输设备503包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备503可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。
如图18所示,本申请还涉及具体装置结构包括:
聚焦触发模块,用于触发聚焦处理;
角度变化率确定单元,用于执行角度变化率计算;
相对变化率确定单元,用于执行相对变化率计算;
残差变化率确定单元,用于执行残差变化率计算;
步长调整单元(对应前述的目标步长子单元443332),用于进行聚焦步长调整处理;
聚焦爬坡模块(对应前述的聚焦处理模块444),用于根据调整后的聚焦步长进行聚焦处理。
本申请实施例还提供了一种计算机设备,包括处理器和存储器,该存储器存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中任意之一中的步骤。
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中任意之一中的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (22)

  1. 一种摄像控制方法,其特征在于,所述方法包括:
    确定第一比值,所述第一比值为目标摄像设备当前所处的光学变倍倍率与所述目标摄像设备的最大光学变倍倍率的比值;
    确定第二比值,所述第二比值为所述目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
    判断是否所述第一比值小于等于第一比值阈值且所述第二比值小于等于第二比值阈值;
    若是,控制所述目标摄像设备进行光学变倍;若否,控制所述目标摄像设备进行数字变倍。
  2. 根据权利要求1所述的摄像控制方法,其特征在于,
    对应于所述目标摄像设备当前拍摄到单人人脸,所述第二比值为所述单人人脸的区域面积在整幅拍摄画面中的占比;
    对应于所述目标摄像设备当前拍摄到多人人脸,所述第二比值为合并人脸区域面积在整幅拍摄画面中的占比,所述合并人脸区域面积为所述多人人脸中各人脸对应的区域面积的加和。
  3. 根据权利要求1所述的摄像控制方法,其特征在于,所述第一比值阈值的取值范围为0.45-0.55。
  4. 根据权利要求1所述的摄像控制方法,其特征在于,所述第二比值阈值的取值范围为0.15-0.25。
  5. 根据权利要求1所述的摄像控制方法,其特征在于,所述方法还包括:
    基于所述目标摄像设备当前拍摄到的画面信息确定人物区域中心位置;
    根据所述人物区域中心位置和整幅拍摄画面的中心位置,控制所述目标摄像设备移动和/或转动,以使所述人物区域中心位置与所述整幅拍摄画面的中心位置重合。
  6. 根据权利要求5所述的摄像控制方法,其特征在于,所述控制所述目标摄像设备移动和/或转动以使所述人物区域中心位置与所述整幅拍摄画面的中心位置重合的步骤,在所述确定第一比值的步骤之前执行。
  7. 根据权利要求5所述的摄像控制方法,其特征在于,所述基于所述目标摄像设备当前拍摄到的画面信息确定人物区域中心位置,具体包括:
    对应于所述目标摄像设备当前拍摄到单人人脸,将所述单人人脸的区域中心位置确定为所述人物区域中心位置;
    对应于所述目标摄像设备当前拍摄到多人人脸,将合并人体区域的中心位置确定为所述人物区域中心位置,所述合并人体区域为基于所述多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,所述闭合区域覆盖各所述人体图像。
  8. 根据权利要求5所述的摄像控制方法,其特征在于,所述根据所述人物区域中心位置和整幅拍摄画面的中心位置,控制所述目标摄像设备移动和/或转动,具体包括:
    根据所述人物区域中心位置和整幅拍摄画面的中心位置之间的水平偏移量以及物距确定水平位置偏移角度;
    根据所述人物区域中心位置和整幅拍摄画面的中心位置之间的竖直偏移量以及物距确定竖直位置偏移角度;
    根据所述水平位置偏移角度和所述竖直位置偏移角度控制所述目标摄像设备转动;
    其中,所述物距为当前拍摄到的人脸的实际位置和所述目标摄像设备的实际位置之间的距离。
  9. 根据权利要求8所述的摄像控制方法,其特征在于,
    所述物距根据所述目标摄像设备当前所处的光学变倍倍率以及所述第二比值确定。
  10. 根据权利要求1所述的摄像控制方法,其特征在于,在控制所述目标摄像设备进行光学变倍之后,或在控制所述目标摄像设备进行数字变倍之后,在所述目标摄像设备的显示画面中人物区域面积与所述显示画面的总面积的比值的范围为0.7-0.8;其中,
    对应于所述目标摄像设备当前拍摄到单人人脸,所述人物区域面积为所述单人人脸对应的人体图像区域面积;
    对应于所述目标摄像设备当前拍摄到多人人脸,所述人物区域面积为合并人体区域面积,所述合并人体区域为基于所述多人人脸中各人脸对应的人体的图像边界而确定的一个闭合区域,所述闭合区域覆 盖各所述人体图像。
  11. 根据权利要求10所述的摄像控制方法,其特征在于,所述人体图像区域面积基于对应的所述单人人脸的区域面积和预设倍数确定,所述预设倍数为预设的表征人体图像区域面积与人脸区域面积的比值。
  12. 根据权利要求1所述的摄像控制方法,其特征在于,在控制所述目标摄像设备进行光学变倍之后,所述方法还包括:
    对所述目标摄像设备的显示画面进行人脸区域检测;
    对应于在所述显示画面中没有检测到人脸区域,控制所述目标摄像设备进行光学变倍回退,并回退至所述目标摄像设备当前所处的光学变倍倍率的一半;
    对进行光学变倍回退后所述目标摄像设备的显示画面进行人脸区域检测;
    对应于在所述进行光学变倍回退后所述目标摄像设备的显示画面中没有检测到人脸区域,控制所述目标摄像设备进行光学变倍回退,并回退至广角端。
  13. 根据权利要求1所述的摄像控制方法,其特征在于,在控制所述目标摄像设备进行数字变倍之后,所述方法还包括:
    对所述目标摄像设备的显示画面进行人脸区域检测;
    对应于在所述显示画面中没有检测到人脸区域,判断所述整幅拍摄画面中是否具有人脸区域;
    若是,调整显示画面以显示所述人脸区域;若否,控制所述目标摄像设备进行数字变倍回退和光学变倍回退。
  14. 根据权利要求1所述的摄像控制方法,其特征在于,所述控制所述目标摄像设备进行光学变倍包括:
    获取所述目标摄像设备在分别采集预定数量的连续帧图像时的聚焦马达点位以及帧图像的清晰度;
    基于分别获取的多个所述聚焦马达点位以及多个所述清晰度,确定每帧图像对应的坐标点,其中,每帧图像对应的坐标点的坐标值包括采集每帧图像时的聚焦马达点位以及每帧图像的清晰度;
    基于所述连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定所述目标摄像设备的聚焦马达的目标调整步长,其中,所述第四目标帧图像为所述第三目标帧图像之前的帧图像,所述第三目标帧图像、所述第二目标帧图像以及所述第一目标帧图像为依次相邻的帧图像,且所述第一目标帧图像为所述连续帧图像的最后一帧图像。
  15. 根据权利要求14所述的摄像控制方法,其特征在于,基于所述连续帧图像中包括的第一目标帧图像、第二目标帧图像、第三目标帧图像以及第四目标帧图像对应的坐标点的坐标值确定所述目标摄像设备的聚焦马达的目标调整步长包括:
    基于第一坐标值、第二坐标值和第四坐标值确定第一坐标点的第一角度变化值和第一残差变化率,其中,所述第一坐标值为所述第一目标帧图像对应的所述第一坐标点的坐标值,所述第二坐标值为所述第二目标帧图像对应的第二坐标点的坐标值,所述第四坐标值为所述第四目标帧图像对应的第四坐标点的坐标值,所述第一角度变化值是第一平均每步长清晰度值与第二平均每步长清晰度值的变化量,所述第一平均每步长清晰度值为所述第一目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第二平均每步长清晰度值为所述第一目标帧图像和所述第二目标帧图像之间的平均每步长清晰度值,所述第一残差变化率用于指示所述第一目标帧图像和所述第二目标帧图像的清晰度每步长变化率;
    基于第二坐标值、第三坐标值和第四坐标值确定第二坐标点的第二角度变化值和第二残差变化率,其中,所述第三坐标值为所述第三目标帧图像对应的第三坐标点的坐标值,所述第二角度变化值是第三平均每步长清晰度值与第四平均每步长清晰度值的变化量,所述第三平均每步长清晰度值为所述第二目标帧图像和所述第四目标帧图像之间的平均每步长清晰度值,所述第四平均每步长清晰度值为所述第二目标帧图像和所述第三目标帧图像之间的平均每步长清晰度值,所述第二残差变化率用于指示所述第二目标帧图像和所述第三目标帧图像的清晰度每步长变化率;
    基于所述第一角度变化值、所述第一残差变化率、所述第二角度变化值和所述第二残差变化率确定所述目标摄像设备的聚焦马达的目标调整步长。
  16. 根据权利要求15所述的摄像控制方法,其特征在于,基于所述第一角度变化值、所述第一残 差变化率、所述第二角度变化值和所述第二残差变化率确定所述目标摄像设备的聚焦马达的目标调整步长包括:
    确定所述第一角度变化值与所述第二角度变化值之间的第一差值;
    确定所述第一残差变化率与所述第二残差变化率之间的第二差值;
    基于所述第一差值和所述第二差值确定所述目标摄像设备的聚焦马达的目标调整步长。
  17. 根据权利要求16所述的摄像控制方法,其特征在于,基于所述第一差值和所述第二差值确定所述目标摄像设备的聚焦马达的目标调整步长包括:
    基于所述第一差值和所述第二差值确定目标收敛值;
    根据所述目标收敛值确定所述目标调整步长。
  18. 根据权利要求17所述的摄像控制方法,其特征在于,根据所述目标收敛值确定所述目标调整步长包括:
    在确定所述目标收敛值满足第一条件的情况下,确定所述目标调整步长为预设步长值;
    在所述目标收敛值不满足所述第一条件的情况下,确定所述目标调整步长为初始步长,其中,所述初始步长为所述目标摄像设备在采集预定数量的所述连续帧图像时所使用的步长。
  19. 根据权利要求14所述的摄像控制方法,其特征在于,在确定所述目标摄像设备的聚焦马达的目标调整步长之后,所述方法还包括:
    按照所述目标调整步长对所述目标摄像设备进行聚焦处理。
  20. 一种摄像控制装置,其特征在于,所述装置包括:
    第一确定模块,用于确定第一比值,所述第一比值为目标摄像设备当前所处的光学变倍倍率与所述目标摄像设备的最大光学变倍倍率的比值;
    第二确定模块,用于确定第二比值,所述第二比值为所述目标摄像设备当前拍摄到的人脸区域面积在整幅拍摄画面中的占比;
    判断模块,用于判断是否所述第一比值小于等于第一比值阈值且所述第二比值小于等于第二比值阈值;
    控制模块,用于在判断的结果为是时,控制所述目标摄像设备进行光学变倍;以及,在判断的结果为否时,控制所述目标摄像设备进行数字变倍。
  21. 一种计算机设备,包括处理器和存储器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至19中任意一项所述的摄像控制方法的步骤。
  22. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至19中任意一项所述的摄像控制方法的步骤。
PCT/CN2022/073007 2021-01-28 2022-01-20 摄像控制方法、装置、计算机设备和存储介质 WO2022161250A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/274,742 US20240114246A1 (en) 2021-01-28 2022-01-20 Photographing control method and apparatus, computer device and storage medium

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110114788.9 2021-01-28
CN202110114788.9A CN112449117B (zh) 2021-01-28 2021-01-28 一种聚焦步长确定方法、装置、存储介质及电子装置
CN202110230319.3 2021-03-02
CN202110230319.3A CN112601028B (zh) 2021-03-02 2021-03-02 摄像控制方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022161250A1 true WO2022161250A1 (zh) 2022-08-04

Family

ID=82654166

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/073007 WO2022161250A1 (zh) 2021-01-28 2022-01-20 摄像控制方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
US (1) US20240114246A1 (zh)
WO (1) WO2022161250A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115171200A (zh) * 2022-09-08 2022-10-11 深圳市维海德技术股份有限公司 基于变倍的目标跟踪特写方法、装置、电子设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101185322A (zh) * 2005-05-31 2008-05-21 诺基亚公司 用于成像设备的光学变焦以及数字变焦
JP2018106034A (ja) * 2016-12-27 2018-07-05 キヤノン株式会社 撮像装置及び撮像方法
CN109495681A (zh) * 2017-09-12 2019-03-19 天津三星通信技术研究有限公司 获取图像的方法和设备
CN111405185A (zh) * 2020-03-31 2020-07-10 浙江大华技术股份有限公司 一种摄像机变倍控制方法、装置、电子设备及存储介质
CN112449117A (zh) * 2021-01-28 2021-03-05 浙江华创视讯科技有限公司 一种聚焦步长确定方法、装置、存储介质及电子装置
CN112601028A (zh) * 2021-03-02 2021-04-02 浙江华创视讯科技有限公司 摄像控制方法、装置、计算机设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101185322A (zh) * 2005-05-31 2008-05-21 诺基亚公司 用于成像设备的光学变焦以及数字变焦
JP2018106034A (ja) * 2016-12-27 2018-07-05 キヤノン株式会社 撮像装置及び撮像方法
CN109495681A (zh) * 2017-09-12 2019-03-19 天津三星通信技术研究有限公司 获取图像的方法和设备
CN111405185A (zh) * 2020-03-31 2020-07-10 浙江大华技术股份有限公司 一种摄像机变倍控制方法、装置、电子设备及存储介质
CN112449117A (zh) * 2021-01-28 2021-03-05 浙江华创视讯科技有限公司 一种聚焦步长确定方法、装置、存储介质及电子装置
CN112601028A (zh) * 2021-03-02 2021-04-02 浙江华创视讯科技有限公司 摄像控制方法、装置、计算机设备和存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115171200A (zh) * 2022-09-08 2022-10-11 深圳市维海德技术股份有限公司 基于变倍的目标跟踪特写方法、装置、电子设备及介质
CN115171200B (zh) * 2022-09-08 2023-01-31 深圳市维海德技术股份有限公司 基于变倍的目标跟踪特写方法、装置、电子设备及介质

Also Published As

Publication number Publication date
US20240114246A1 (en) 2024-04-04

Similar Documents

Publication Publication Date Title
WO2021208371A1 (zh) 多摄变焦控制方法、装置、电子系统及存储介质
CN110493525B (zh) 变焦图像确定方法及装置、存储介质、终端
CN112261387B (zh) 用于多摄像头模组的图像融合方法及装置、存储介质、移动终端
US8797381B2 (en) Image processing apparatus and image processing method
US8306360B2 (en) Device and method for obtaining clear image
WO2019061079A1 (zh) 一种对焦处理方法及设备
US7957633B2 (en) Focus adjusting apparatus and focus adjusting method
JP2012151848A (ja) 関心領域の動的検知に基づいたシーン状態切換システム及び方法
WO2018094648A1 (zh) 拍摄构图引导方法及装置
US10491804B2 (en) Focus window determining method, apparatus, and device
WO2022007840A1 (zh) 图像融合方法及装置
WO2022161250A1 (zh) 摄像控制方法、装置、计算机设备和存储介质
TW201410016A (zh) 連動式攝影系統及其多攝影機的控制方法
CN112601028B (zh) 摄像控制方法、装置、计算机设备和存储介质
CN112887610A (zh) 拍摄方法、装置、电子设备及存储介质
CN111491105B (zh) 移动终端的对焦方法、移动终端及计算机存储介质
WO2023231869A1 (zh) 拍摄方法和装置
CN111726512B (zh) 一种区域对焦方法、装置、设备及存储介质
WO2020187197A1 (zh) 成像设备的变焦方法、图像处理方法及成像设备
CN112261281B (zh) 视野调整方法及电子设备、存储装置
WO2021184326A1 (zh) 电子装置的控制方法、装置、设备及系统
WO2020015754A1 (zh) 图像采集方法及图像采集设备
TWI768630B (zh) 可移動攝影系統和攝影構圖控制方法
CN114554095B (zh) 一种4k摄像机的目标对象确定方法以及相关装置
WO2023213161A1 (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: 22745125

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18274742

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22745125

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 22745125

Country of ref document: EP

Kind code of ref document: A1