WO2021134179A1 - Focusing method and apparatus, photographing device, movable platform and storage medium - Google Patents

Focusing method and apparatus, photographing device, movable platform and storage medium Download PDF

Info

Publication number
WO2021134179A1
WO2021134179A1 PCT/CN2019/129852 CN2019129852W WO2021134179A1 WO 2021134179 A1 WO2021134179 A1 WO 2021134179A1 CN 2019129852 W CN2019129852 W CN 2019129852W WO 2021134179 A1 WO2021134179 A1 WO 2021134179A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target object
photographing device
weight
focusing
Prior art date
Application number
PCT/CN2019/129852
Other languages
French (fr)
Chinese (zh)
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
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/129852 priority Critical patent/WO2021134179A1/en
Priority to CN201980053920.0A priority patent/CN112585941A/en
Publication of WO2021134179A1 publication Critical patent/WO2021134179A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/51Housings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/54Mounting of pick-up tubes, electronic image sensors, deviation or focusing coils
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/55Optical parts specially adapted for electronic image sensors; Mounting thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Definitions

  • the present invention relates to the field of cameras, in particular to a focusing method, device, photographing equipment, movable platform and storage medium.
  • Camera functions are used in many application scenarios, and devices that provide camera functions include mobile phones, cameras, and so on. During the shooting process, in order to ensure a clear imaging picture, a focusing process is necessary.
  • many shooting devices support an auto focus (Auto Focus, AF for short) function to complete focusing through the AF function.
  • Auto Focus Auto Focus, AF for short
  • the focus area is often selected as the center area of the image taken by the photographing device.
  • the purpose of AF is to ensure that the image in the focus area is clearly imaged.
  • this AF processing method it is difficult to ensure that the target object that the user pays attention to is clearly imaged among several objects being photographed.
  • the invention provides a focusing method, device, photographing equipment, movable platform and storage medium, which can realize rapid focusing of target objects.
  • the first aspect of the present invention provides a focusing method, including:
  • a second aspect of the present invention provides a focusing device, which is provided in a first photographing device.
  • the focusing device includes: a memory and a processor; wherein the memory stores executable code, when the executable code is When the processor executes, the processor realizes:
  • a third aspect of the present invention provides a photographing device, including:
  • the lens assembly is arranged inside the housing of the photographing device
  • the sensor module is arranged inside the housing and at the rear end of the lens assembly, the sensor module includes a circuit board and an imaging sensor, and the imaging sensor is arranged on the front surface of the circuit board facing the lens assembly ;
  • the focusing device according to the second aspect is arranged inside the housing.
  • the fourth aspect of the present invention provides a movable platform, including:
  • the power system is arranged on the body and used to provide power for the movable platform
  • the photographing device is arranged on the body and used to photograph a first image and perform focusing processing on a target object in the first image.
  • a fifth aspect of the present invention provides a computer-readable storage medium having executable code stored in the computer-readable storage medium, and the executable code is used to implement the focusing method described in the first aspect.
  • the position area (referred to as the first position area) corresponding to the target object being focused in the image currently collected by the shooting device performing the focusing method is determined, and then the image can be calculated.
  • the image definition of the image, and the image definition corresponding to the first location area containing the target object is set to have the first weight, and the image definition corresponding to the areas other than the first location area in the image has the first weight.
  • the first weight is greater than the second weight, so that the shooting device can quickly and accurately identify the focused subject-the target object.
  • the statistical value of the sharpness of the image is calculated according to the first weight and the second weight. When the statistical value of the sharpness of the image meets the set focusing conditions, it means that the image of the target object is blurred, so as to focus on the target object Processing to ensure clear imaging of the target object.
  • FIG. 1 is a schematic flowchart of a focusing method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a focusing process provided by an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of another focusing method provided by an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of another focusing method provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an application scenario of a focusing method provided by an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a focusing device provided by an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a photographing device provided by an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a movable platform provided by an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a focusing method provided by an embodiment of the present invention. As shown in FIG. 1, the focusing method may include the following steps:
  • the first photographing device may be a visible light zoom camera.
  • the first photographing device can be integrated and used in other devices, or can be used independently.
  • the first photographing device may be implemented as a camera on a terminal device such as a mobile phone, a notebook computer, and the like.
  • the first photographing device may be a camera mounted on a drone for use.
  • the target object mentioned in the embodiment of the present invention may be set by the user according to requirements. Specifically, before the user uses the above-mentioned first photographing device to photograph the target object, the user can set the target object on the first photographing device to inform the first photographing device of what the target object is, so that the first photographing device finally completes Focusing on the target object is to ensure that the image of the target object is clear.
  • the process of focusing is to continuously adjust the object distance of the first photographing device to ensure that the target object photographed by the first photographing device is always clearly imaged.
  • the user's setting of the target object may be implemented as: the user inputs a category corresponding to the target object. Therefore, the first photographing device considers the object corresponding to the category in the first image collected as the target object.
  • the target object is a human body, and other objects may be trees, buildings, flowers, vehicles, etc. that exist around the person.
  • the first camera can identify whether the first image contains the target object set by the user and the first location area of the target object in the first image, where the first location area covers the target object And is smaller than the area of the first image.
  • the first imaging device can identify whether the first image contains the target object based on the visible light characteristics of the target object.
  • the so-called visible light feature refers to the optical feature of the target object.
  • the corresponding visible light feature can be the contour shape of the human body, facial features, and so on.
  • the implementation of human body recognition based on these features can be implemented with reference to the existing related technologies, which will not be repeated here.
  • the boundary contour of the target object can be determined as the first location area of the target object, or the smallest rectangular frame surrounding the target object can also be determined as the first position area of the target object. Location area.
  • the first image can be divided into N grids according to the set grid size. Therefore, assuming that the M grids contain part of the target object, the M grids can be determined.
  • the area covered by each grid is the first location area, or it can be determined that the area covered by the M grids and the surrounding K grids is the first location area, where the M grids and the surrounding K grids are the first location area.
  • K grids will form the smallest rectangular frame covering the target object.
  • the focus area is often the central area of the image, that is, to ensure that the central area of the image is clear.
  • the traditional focusing scheme will make the background appear clear and the target object as the foreground subject is not clearly imaged , Resulting in blurring of the foreground subject in auto focus.
  • the first photographing device can automatically select the focus area as the first location area where the target object is located, and then execute the auto-focus algorithm to make the first location area The target object achieves the clearest imaging purpose, thereby completing the focus processing for the target object.
  • the first imaging device selects the focus area as the first position area where the target object is located.
  • the method is to set the image definition corresponding to the first position area in the first image to have the first weight, and the first image is divided by the first weight.
  • the image definition corresponding to other areas outside the location area has a second weight, and the first weight is greater than the second weight.
  • the second weight may be set to 0, and the first weight may be set to a value greater than 0, for example, set to 1.
  • the image sharpness can be represented by the image gradient value, that is, the image sharpness of the first image is obtained by calculating the gradient of each pixel in the first image. Assuming that the above first location area contains 100 pixels, it can be considered that the gradient values of these 100 pixels are all set with the first weight. Assume that the 100 pixels contained in the first image except for the first location area There are 500 pixels in addition, then these 500 pixels are set to have the second weight.
  • the target object is highlighted, that is, the focus area is positioned on the target object.
  • the sharpness statistical value of the first image can be calculated according to the setting results of the first weight and the second weight, so as to determine whether it is necessary to perform focus processing on the target object based on the sharpness statistical value. Because if the image of the target object is clear at this time, there is no need to perform focus processing.
  • the statistical value of the definition of the first image is obtained according to the first weight and the second weight, which can be implemented as:
  • the first weight and the second weight a weighted sum calculation is performed on the image gradient value corresponding to the first location area and the image gradient value corresponding to other location areas to obtain the sharpness statistical value of the first image.
  • the statistical value of the sharpness of the first image is 100 The sum of the gradient values of each pixel.
  • the statistical value of the sharpness of the first image is greater than the set threshold, it is considered that the target object is clearly imaged and does not need to be focused.
  • the first image is If the sharpness statistical value is less than the set threshold, it is considered that the target object is not sharply imaged and needs to be focused.
  • the collected video can be segmented to obtain an image sequence composed of multiple frames of images. Assuming that the first image is the last frame of the image in the image sequence, it can also be determined according to a certain frame of image that has been focused before the first image is captured, whether it is necessary to perform focus processing on the target object when the first image is currently captured. Optionally, if the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold, focus processing is performed on the target object, where the reference image has been focused on the target object before Of an image.
  • the reference image may be updated with the image taken after the focus is completed, so as to perform focus processing on the image subsequently collected by the first photographing device.
  • the focusing process (adjusting the object distance) and the zooming process (focusing) always exist at the same time.
  • the following zooming process may also be performed:
  • the first location area is moved to the central area of the screen according to the relative position of the first location area and the main optical axis of the first photographing device.
  • the image is often enlarged. Therefore, after the first image is moved so that the first position area is located in the center area of the screen, the first image can be enlarged.
  • the first camera device mounted on the drone as an example.
  • the first camera device is mounted on the drone's pan/tilt.
  • the first camera device can determine the relative position of the first location area to the main optical axis. Report to the pan/tilt, and the pan/tilt adjusts its pose so that during the zooming process, the first location area containing the target object in the first image is always located in the center area of the screen.
  • the weight of the image clarity between the location area of the target object and other areas in the image is set differently, so as to achieve focusing on the target object. Automatic selection of the area, and then when the target object needs to be focused, the object distance and image distance are adjusted to ensure that the target object in the focus area is clearly imaged to complete the accurate focus of the target object.
  • the process of executing the focusing solutions provided by the embodiments of the present invention in different application scenarios will be briefly introduced.
  • the commonly used application scenarios of the first shooting device include photographing scenes and video recording scenes.
  • the first image collected by the first photographing device mentioned above should be understood as the preview that the user can preview through the first photographing device before triggering the actual photographing operation on the first photographing device
  • Each frame of the multi-frame image For example, suppose the first shooting device is a mobile phone. When the user activates the shooting function and points the camera toward the target object (ie, the object being photographed), the image of the target object will be displayed on the screen of the mobile phone, that is, in the preview box
  • the image presented in the preview frame can also be regarded as a kind of video, and multiple frames of images can be obtained by sampling the video, which are assumed to be three frames of images denoted as F1, F2, and F3, respectively.
  • the shooting button After the user adjusts the shooting angle, click the shooting button on the screen, and at this time, a real photo of the target object is triggered, and a photo of the target object will be taken, which is assumed to be Z1.
  • the focusing process in the embodiment of the present invention occurs before the user clicks the shooting button, through the multiple frames of images obtained in the preview process-F1, F2, and F3, respectively, corresponding to the definition statistical values (the calculation method is as described above) First, focus on the target object, and then, when the user clicks the shooting button, a photo with good focus effect, namely Z1, will be obtained.
  • F1, F2, and F3 are the first three frames of images obtained after the user starts the shooting function, then F1 can be selected as the initial reference image, and the focus processing will be completed based on F1, F2, and F3 to obtain a suitable object distance Later, the reference image can be updated with the focused photo Z1 obtained by shooting.
  • the preview video will be seen on the screen at this time, and multiple frames of images can be sampled, such as F4, F5, F6, through this preview process
  • the multi-frame images obtained in the image-F4, F5, F6 focus again on the target object to ensure that the user clicks the shooting button again to take the photo Z2 with a good focus effect, that is, the target object is clearly imaged in the photo Z2.
  • the reference image can be updated to the photo Z2.
  • a set number of images can be sampled from the previewed video stream for focusing processing, such as 3 frames, 5 frames, or even 1 frame.
  • the processing process for each frame of the image is the same, as shown in steps 101-104.
  • the target object will be focused on the target object in combination with the corresponding sharpness statistics of the multiple frames of images. The specific process will be described below .
  • the first image collected by the first shooting device mentioned above is each frame image obtained after sampling the recorded video.
  • the video can be sampled to obtain a frame of image, and the statistical value of the definition of each frame of image can be calculated by the method described above.
  • multiple frames of images obtained by sequential sampling can also be used as a group, such as 3 frames, 5 frames, and the target object is focused on the target object with the corresponding sharpness statistics of the multiple frames in each group. .
  • the reference image can be initialized to the first frame of image obtained by sampling, and it is set that the first group of images needs to be focused, so that after the first group of images is focused, you can A certain appropriate object distance is obtained.
  • the object distance can make the target object in the next video image captured by the first shooting device clear.
  • the reference image can be updated to the first image in the second group of images.
  • the difference between the sharpness statistics of the other images in the second group and the reference image is large, it means that it needs to be done at this time.
  • a new object distance can be determined based on the second set of images, and so on.
  • the multi-frame image includes the first image and the first image captured by the first image. At least one frame of image adjacent to the first image collected by the device. Furthermore, the object distance of the first photographing device is adjusted to the target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images.
  • the first image here may refer to any frame of image obtained by segmenting the preview video in the photographing scene, or may refer to any frame of image sampled in the recording scene.
  • the purpose of auto focusing is to find the target object distance position.
  • the captured image has the largest statistical value of sharpness at the target object distance position.
  • the focusing process is illustrated as an example: assuming that the currently collected image is F1, calculate the sharpness statistical value corresponding to F1, and reduce the object distance of the first photographing device by a set step. Assuming that the next frame of image F2 is collected at this object distance, the sharpness statistical value of F2 is calculated. If the sharpness statistical value of F2 is greater than the sharpness statistical value of F1, it means that the adjustment direction of the smaller object distance is correct. Otherwise, it is necessary to determine the adjustment direction to increase the object distance. In this way, the object distance is gradually reduced, and a frame of image is collected at each object distance position.
  • the multi-frame images collected in sequence are F1, F2, F3, F4, and that the object distances corresponding to these four frames are W1, W2, W3, respectively , W4, it can be determined that the target object distance is the maximum of these four object distances.
  • W2 the maximum of these four object distances.
  • the sharpness statistical value corresponding to image F2 will also be the largest of the four images.
  • these four frames of images can be understood as images obtained by segmenting the preview video. Therefore, the first image in the foregoing may include these four frames of images.
  • the focusing process may include the following steps:
  • K1 is an integer greater than or equal to 1.
  • sharpness statistics of image P1, image P2, and image P3 show a tendency to increase, it indicates that the current adjustment direction of the object distance is correct, and further adjustment of the object distance in this direction can make the image clearer.
  • sharpness statistical values of the image P1, the image P2, and the image P3 do not show a tendency to increase, it indicates that the current adjustment direction of the object distance is incorrect, and the object distance needs to be adjusted in the opposite direction to make the image clearer.
  • K2 is an integer greater than or equal to 1.
  • step 206 Determine whether the sharpness statistics of the K2 frame images and the K1 frame images collected during the movement of K2 set steps show a mountain-like change feature, if yes, perform step 207, otherwise repeat step 203.
  • steps 204 to 207 the purpose of steps 204 to 207 is to continue to adjust the object distance according to the previously determined object distance adjustment direction, so as to find the object distance position that makes the image of the target object clearest.
  • image P4, image P5, and image P6 Calculate the sharpness statistics of these three frames respectively. It is determined whether the sharpness statistical values of the image P1, the image P2, the image P3, the image P4, the image P5, and the image P6 show a mountain-like characteristic, that is, whether they show a trend of gradually increasing and then gradually decreasing.
  • the above image P1 can be updated with another frame of image collected after a delay of the set time. , Re-execute the above steps 201-207.
  • FIG. 3 is a schematic flowchart of another focusing method provided by an embodiment of the present invention. As shown in FIG. 3, the focusing method may include the following steps:
  • two parameters are set: auto focus state and reference image.
  • the auto-focus state is used to indicate whether the currently collected image needs to be subjected to auto-focus processing. Initially, this state is set to need to be focused, which means that the first captured image needs to be used for focus processing.
  • the reference image may be an automatically generated image, and the size of the image is equal to the size of each image actually collected subsequently.
  • the weight of the gradient value of each pixel in the initial reference image (assuming that the gradient value is used as a measure of image sharpness) can be set to a set value, such as 0, so that the weight of the gradient value of all pixels The sum is the sharpness statistical value of the initial reference image.
  • step 302. Determine whether there is a target object in the first image captured by the first photographing device, if it exists, execute step 303, and if it does not exist, execute step 304.
  • the focus area can still be positioned to the center position area of the first image.
  • the range of the central location area can be set.
  • Step 306 is executed, otherwise, step 307 is executed.
  • the auto-focusing state does not require focusing
  • the next image is taken, and the processing logic of steps 302 to 307 is continued to be executed for the next image.
  • the auto-focus state is in need of focusing
  • the focusing processing procedure described above is executed.
  • the description in the above embodiments is based on a single first photographing device (such as a visible light zoom camera) to realize the recognition and focus processing of the target object.
  • a single first photographing device such as a visible light zoom camera
  • the visual field angle of the visible light zoom camera is generally small, so the image obtained is visually It will feel very small and the visual effect is poor.
  • the embodiment of the present invention also provides a focusing method as shown in FIG. 3.
  • FIG. 4 is a schematic flowchart of another focusing method provided by an embodiment of the present invention.
  • the focusing method is executed by the first photographing device described above. As shown in FIG. 4, the focusing method may include the following steps:
  • the second location area corresponding to the target object in the second image and the coordinate system mapping relationship between the first shooting device and the second shooting device determine the first image corresponding to the target object in the first image captured by the first shooting device. Location area, where the shooting time of the first image and the second image are the same.
  • the angle of view of the first photographing device is smaller than the angle of view of the second photographing device.
  • the second photographing device may be an infrared camera, or the second photographing device may also be a visible light wide-angle camera.
  • FIG. 5 For ease of understanding, an application scenario shown in FIG. 5 is taken as an example for illustration.
  • the first photographing device is a visible light zoom camera with a field of view angle of FOV1
  • the second photographing device is an infrared camera with a field of view angle of FOV2
  • FOV1 is smaller than FOV2.
  • both the first photographing device and the second photographing device can be mounted on the drone.
  • the image coordinate mapping relationship of the two shooting devices has been determined in advance according to the shooting parameters of the first shooting device and the shooting parameters of the second shooting device.
  • both the first shooting device and the second shooting device shoot an image of the target object
  • the image collected by the first shooting device is called the first image
  • the image collected by the second shooting device is called the second image . Since the second photographing device has a larger field of view, the data content contained in the second image is much more than that of the first image, so that the target object can be captured more quickly by the second photographing device.
  • Different features can be adopted according to the different types of the second photographing device to identify the target object in the second image.
  • the target object when the second photographing device is an infrared camera, the target object can be identified in the second image according to the temperature characteristic of the target object.
  • the temperature value ranges corresponding to different types of target objects are different, according to which the target objects can be identified.
  • the target object when the second photographing device is a visible light wide-angle camera, the target object can be identified in the second image according to the visible light feature of the target object.
  • the meaning of the visible light feature can be referred to the above description.
  • the second location area corresponding to the target object in the second image is determined, and then, according to the image coordinate mapping relationship between the two shooting devices, it can be determined that the target object is in the first image
  • the subsequent focus processing steps are performed on the first image.
  • FIG. 6 is a schematic structural diagram of a focusing device provided by an embodiment of the present invention.
  • the focusing device may be provided in the first photographing device mentioned above.
  • the focusing device includes: a memory 11 and a processor 12;
  • the memory 11 stores executable code, and when the executable code is executed by the processor 12, the processor 12 is enabled to implement:
  • the image definition includes an image gradient value. Therefore, in the process of obtaining the definition statistical value of the first image, the processor 12 is specifically configured to: according to the first weight and the second weight, the image corresponding to the first location area A weighted sum calculation is performed between the gradient value and the image gradient value corresponding to the other location area to obtain the sharpness statistical value of the first image.
  • the processor 12 is specifically configured to: if the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold, perform focusing processing on the target object, so The reference image is an image that has been in focus.
  • the processor 12 is further configured to update the reference image with an image taken after focusing.
  • the second weight is set to zero.
  • the processor 12 is further configured to: if the first location area is not located in the central area of the frame of the first photographing device, then according to the first location area and the main image of the first photographing device The relative position of the optical axis moves the first position area to the center area of the screen.
  • the processor 12 is specifically configured to: The target object is identified in the image; the target is determined according to the second location area corresponding to the target object in the second image and the image coordinate system mapping relationship between the first photographing device and the second photographing device The first location area corresponding to the object in the first image; wherein the shooting time of the first image and the second image are the same.
  • the angle of view of the first photographing device is smaller than that of the second photographing device.
  • the first photographing device is a visible light zoom camera
  • the second photographing device is an infrared camera or a visible light wide-angle camera.
  • the processor 12 is specifically configured to: identify the target object in the second image according to the temperature characteristic of the target object.
  • the processor 12 is specifically configured to: identify the target object in the second image according to the visible light characteristic of the target object.
  • the processor 12 is specifically configured to: determine the object distance adjustment direction of the first photographing device, wherein the object distance is adjusted according to the object distance adjustment direction such that The sharpness statistical value of a multi-frame image shows an increasing trend, and the multi-frame image includes the first image and at least one frame of image adjacent to the first image collected by the first photographing device; The object distance of the first photographing device is adjusted to a target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images.
  • FIG. 7 is a schematic structural diagram of a photographing device provided by an embodiment of the present invention. As shown in FIG. 7, the photographing device includes:
  • the lens assembly 21 is arranged inside the housing of the photographing device.
  • the focusing device 23 is arranged inside the housing.
  • the sensor module 22 is arranged inside the housing and at the rear end of the lens assembly 21.
  • the sensor module 22 includes a circuit board and an imaging sensor. The imaging sensor is arranged on the front surface of the circuit board facing the lens assembly 21.
  • the image collected by the photographing device will be imaged by the aforementioned imaging sensor, and the focusing device 23 is used for focusing processing on the target object contained in the image collected by the photographing device.
  • the photographing device corresponds to the first photographing device described above.
  • FIG. 8 is a schematic structural diagram of a movable platform provided by an embodiment of the present invention.
  • the movable platform is implemented as a drone as an example.
  • the movable platform can also be implemented as a handheld PTZ, PTZ vehicles, electric cars, electric bicycles, etc.
  • the movable platform includes: a body 31, a power system 32 provided on the body 31, and a first photographing device 33 provided on the body 31.
  • the power system 32 is used to provide power for the movable platform.
  • the first photographing device 33 is a photographing device as shown in FIG. 7, which is used to photograph a first image and perform focusing processing on a target object in the first image.
  • the movable platform may further include: a second photographing device 34 arranged on the body 31.
  • the angle of view of the first photographing device 33 is smaller than that of the second photographing device 34.
  • the second photographing device 34 is used for photographing a second image containing the target object, and transmitting the second image to the first photographing device 33, so that the first photographing device 33 can use the target object in the second image according to the target object.
  • the corresponding location area in the image determines the location area corresponding to the target object in the first image.
  • the unmanned aerial vehicle may also include a pan/tilt 35 arranged on the body 31, so that the first photographing device 33 and the second photographing device 34 may be set On the pan-tilt 35, the first photographing device 33 and the second photographing device 34 can move relative to the body through the pan-tilt 35.
  • the power system 32 of the drone may include an electronic governor, one or more rotors, and one or more motors corresponding to the one or more rotors.
  • an embodiment of the present invention also provides a computer-readable storage medium having executable code stored in the computer-readable storage medium, and the executable code is used to implement the focusing method provided in the foregoing embodiments.

Abstract

Provided by the present application are a focusing method and apparatus, a photographing device, a movable platform, and a storage medium. The focusing method comprises: determining a first position region corresponding to a target object in a first image collected by a first photographing device; setting the image definition corresponding to the first position region in the first image to have a first weight, and the image definition corresponding to regions in the first image other than the first position region to have a second weight, wherein the first weight is greater than the second weight; acquiring a definition statistical value of the first image according to the first weight and the second weight; and if the definition statistical value of the first image meets a set focusing condition, then perform focusing on the target object so as to ensure that the target object is clearly imaged.

Description

对焦方法、装置、拍摄设备、可移动平台和存储介质Focusing method, device, shooting equipment, movable platform and storage medium 技术领域Technical field
本发明涉及相机领域,尤其涉及一种对焦方法、装置、拍摄设备、可移动平台和存储介质。The present invention relates to the field of cameras, in particular to a focusing method, device, photographing equipment, movable platform and storage medium.
背景技术Background technique
很多应用场景中都会使用到摄像功能,提供摄像功能的设备包括手机、相机等等。在拍摄过程中,为保证成像画面清晰,对焦过程是必需的,目前,很多拍摄设备都支持自动对焦(Auto Focus,简称AF)功能,以通过该AF功能完成对焦。Camera functions are used in many application scenarios, and devices that provide camera functions include mobile phones, cameras, and so on. During the shooting process, in order to ensure a clear imaging picture, a focusing process is necessary. Currently, many shooting devices support an auto focus (Auto Focus, AF for short) function to complete focusing through the AF function.
目前,在执行AF的过程中,对焦区域往往选择的是拍摄设备所拍摄的图像的中心区域,此时,AF的目的即为保证对焦区域内的图像成像清晰。这种AF处理方式,很难保证在被拍摄到的若干物体中用户所关注的目标物体成像清晰。At present, in the process of performing AF, the focus area is often selected as the center area of the image taken by the photographing device. At this time, the purpose of AF is to ensure that the image in the focus area is clearly imaged. With this AF processing method, it is difficult to ensure that the target object that the user pays attention to is clearly imaged among several objects being photographed.
发明内容Summary of the invention
本发明提供了一种对焦方法、装置、拍摄设备、可移动平台和存储介质,可以实现对目标物体的快速对焦。The invention provides a focusing method, device, photographing equipment, movable platform and storage medium, which can realize rapid focusing of target objects.
本发明的第一方面提供了一种对焦方法,包括:The first aspect of the present invention provides a focusing method, including:
确定在第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域;其中,所述第一位置区域为覆盖所述目标物体且小于所述第一图像的区域;Determine a first location area corresponding to a target object in a first image captured by a first photographing device; wherein the first location area is an area that covers the target object and is smaller than the first image;
设置所述第一图像中所述第一位置区域所对应的图像清晰度具有第一权重;其中,所述第一图像中除所述第一位置区域外的其他区域所对应的图像清晰度具有第二权重,所述第一权重大于所述第二权重;Set the image definition corresponding to the first position area in the first image to have a first weight; wherein, the image definition corresponding to the areas other than the first position area in the first image has A second weight, where the first weight is greater than the second weight;
根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值;Acquiring a sharpness statistical value of the first image according to the first weight and the second weight;
若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理。If the sharpness statistical value of the first image meets the set focus condition, then focus processing is performed on the target object.
本发明的第二方面提供了一种对焦装置,设于第一拍摄设备,所述对焦装置包括:存储器、处理器;其中,所述存储器上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器实现:A second aspect of the present invention provides a focusing device, which is provided in a first photographing device. The focusing device includes: a memory and a processor; wherein the memory stores executable code, when the executable code is When the processor executes, the processor realizes:
确定在所述第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域;其中,所述第一位置区域为覆盖所述目标物体且小于所述第一图像的区域;Determining a first location area corresponding to a target object in a first image captured by the first photographing device; wherein the first location area is an area that covers the target object and is smaller than the first image;
设置所述第一图像中所述第一位置区域所对应的图像清晰度具有第一权重;其中,所述第一图像中除所述第一位置区域外的其他区域所对应的图像清晰度具有第二权重,所述第一权重大于所述第二权重;Set the image definition corresponding to the first position area in the first image to have a first weight; wherein, the image definition corresponding to the areas other than the first position area in the first image has A second weight, where the first weight is greater than the second weight;
根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值;Acquiring a sharpness statistical value of the first image according to the first weight and the second weight;
若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理。If the sharpness statistical value of the first image meets the set focus condition, then focus processing is performed on the target object.
本发明的第三方面提供了一种拍摄设备,包括:A third aspect of the present invention provides a photographing device, including:
镜头组件,设于所述拍摄设备的外壳内部;The lens assembly is arranged inside the housing of the photographing device;
传感器模块,设于所述外壳内部并设于所述镜头组件的后端,所述传感器模块包括电路板以及成像传感器,所述成像传感器设于所述电路板的朝向所述镜头组件的前表面;The sensor module is arranged inside the housing and at the rear end of the lens assembly, the sensor module includes a circuit board and an imaging sensor, and the imaging sensor is arranged on the front surface of the circuit board facing the lens assembly ;
如第二方面所述的对焦装置,设于所述外壳内部。The focusing device according to the second aspect is arranged inside the housing.
本发明的第四方面提供了一种可移动平台,包括:The fourth aspect of the present invention provides a movable platform, including:
机体;Body
动力系统,设于所述机体上,用于为所述可移动平台提供动力;The power system is arranged on the body and used to provide power for the movable platform;
如第三方面所述的拍摄设备,设于所述机体上,用于拍摄第一图像,并对所述第一图像中的目标物体进行对焦处理。The photographing device according to the third aspect is arranged on the body and used to photograph a first image and perform focusing processing on a target object in the first image.
本发明的第五方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有可执行代码,所述可执行代码用于实现上述第一方面所述的 对焦方法。A fifth aspect of the present invention provides a computer-readable storage medium having executable code stored in the computer-readable storage medium, and the executable code is used to implement the focusing method described in the first aspect.
在本发明提供的对焦方法中,首先,确定被关注的目标物体在执行对焦方法的拍摄设备当前所采集的图像中所对应的位置区域(称为第一位置区域),进而,可以计算这张图像的图像清晰度,并且设置包含目标物体的该第一位置区域所对应的图像清晰度具有第一权重,而该图像中除该第一位置区域外的其他区域所对应的图像清晰度具有第二权重,第一权重大于第二权重,以此使得该拍摄设备能够快速、准确地识别出对焦主体——目标物体。之后,根据第一权重和第二权重计算得到该图像的清晰度统计值,当该图像的清晰度统计值符合设定的对焦条件时,说明该目标物体成像模糊,从而对该目标物体进行对焦处理,以保证目标物体成像清晰。In the focusing method provided by the present invention, firstly, the position area (referred to as the first position area) corresponding to the target object being focused in the image currently collected by the shooting device performing the focusing method is determined, and then the image can be calculated. The image definition of the image, and the image definition corresponding to the first location area containing the target object is set to have the first weight, and the image definition corresponding to the areas other than the first location area in the image has the first weight. Two weights, the first weight is greater than the second weight, so that the shooting device can quickly and accurately identify the focused subject-the target object. Afterwards, the statistical value of the sharpness of the image is calculated according to the first weight and the second weight. When the statistical value of the sharpness of the image meets the set focusing conditions, it means that the image of the target object is blurred, so as to focus on the target object Processing to ensure clear imaging of the target object.
附图说明Description of the drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation of the application. In the attached picture:
图1为本发明实施例提供的一种对焦方法的流程示意图;FIG. 1 is a schematic flowchart of a focusing method according to an embodiment of the present invention;
图2为本发明实施例提供的一种执行对焦过程的流程示意图;FIG. 2 is a schematic flowchart of a focusing process provided by an embodiment of the present invention;
图3为本发明实施例提供的另一种对焦方法的流程示意图;3 is a schematic flowchart of another focusing method provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种对焦方法的流程示意图;4 is a schematic flowchart of another focusing method provided by an embodiment of the present invention;
图5为本发明实施例提供的一种对焦方法的应用场景的示意图;FIG. 5 is a schematic diagram of an application scenario of a focusing method provided by an embodiment of the present invention;
图6为本发明实施例提供的一种对焦装置的结构示意图;6 is a schematic structural diagram of a focusing device provided by an embodiment of the present invention;
图7为本发明实施例提供的一种拍摄设备的结构示意图;FIG. 7 is a schematic structural diagram of a photographing device provided by an embodiment of the present invention;
图8为本发明实施例提供的一种可移动平台的结构示意图。FIG. 8 is a schematic structural diagram of a movable platform provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述, 显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.
图1为本发明实施例提供的一种对焦方法的流程示意图,如图1所示,该对焦方法可以包括如下步骤:FIG. 1 is a schematic flowchart of a focusing method provided by an embodiment of the present invention. As shown in FIG. 1, the focusing method may include the following steps:
101、确定在第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域,其中,第一位置区域为覆盖目标物体且小于第一图像的区域。101. Determine a first location area corresponding to a target object in a first image captured by a first photographing device, where the first location area is an area that covers the target object and is smaller than the first image.
102、设置第一图像中第一位置区域所对应的图像清晰度具有第一权重,第一图像中除第一位置区域外的其他区域所对应的图像清晰度具有第二权重,第一权重大于第二权重。102. Set the image definition corresponding to the first position area in the first image to have the first weight, and the image definition corresponding to the areas other than the first position area in the first image have the second weight, and the first weight is greater than The second weight.
103、根据第一权重和第二权重获取第一图像的清晰度统计值。103. Acquire a sharpness statistical value of the first image according to the first weight and the second weight.
104、若第一图像的清晰度统计值符合设定的对焦条件,则对目标物体进行对焦处理。104. If the sharpness statistical value of the first image meets the set focusing condition, perform focusing processing on the target object.
本发明实施例中,第一拍摄设备可以是可见光变焦相机。In the embodiment of the present invention, the first photographing device may be a visible light zoom camera.
在实际应用中,该第一拍摄设备可以集成在其他设备中使用,也可以独立地使用。比如,该第一拍摄设备可以实现为诸如手机、笔记本电脑等终端设备上的摄像头。再比如,该第一拍摄设备可以是挂载在无人机上使用的相机。In practical applications, the first photographing device can be integrated and used in other devices, or can be used independently. For example, the first photographing device may be implemented as a camera on a terminal device such as a mobile phone, a notebook computer, and the like. For another example, the first photographing device may be a camera mounted on a drone for use.
本发明实施例中所提及的目标物体可以是用户根据需求而设定的。具体来说,用户使用上述第一拍摄设备对目标物体进行拍摄前,可以在第一拍摄设备上进行目标物体的设置,以告知第一拍摄设备目标物体是什么,从而使得第一拍摄设备最终完成针对该目标物体的对焦,即保证目标物体成像清晰。The target object mentioned in the embodiment of the present invention may be set by the user according to requirements. Specifically, before the user uses the above-mentioned first photographing device to photograph the target object, the user can set the target object on the first photographing device to inform the first photographing device of what the target object is, so that the first photographing device finally completes Focusing on the target object is to ensure that the image of the target object is clear.
其中,对焦的过程即为不断调整第一拍摄设备的物距,以保证第一拍摄设备拍得的目标物体始终成像清晰。Among them, the process of focusing is to continuously adjust the object distance of the first photographing device to ensure that the target object photographed by the first photographing device is always clearly imaged.
可选地,用户对目标物体的设置可以实现为:用户输入目标物体对应的类别。从而,第一拍摄设备认为采集的第一图像中对应于该类别的物体为目标物体。Optionally, the user's setting of the target object may be implemented as: the user inputs a category corresponding to the target object. Therefore, the first photographing device considers the object corresponding to the category in the first image collected as the target object.
受到第一拍摄设备的视场角的影响,在采集的第一图像中除了目标物体外,还可能包含其他物体。比如,目标物体为人体,其他物体可能是人周围存在的树木、建筑、花草、车辆等等。第一拍摄设备在采集第一图像后,可以识别该第一图像中是否包含用户设置的目标物体以及该目标物体在第一图像中的第一位置区域,其中,第一位置区域为覆盖目标物体且小于第一图像的区域。Affected by the angle of view of the first photographing device, in addition to the target object, other objects may be included in the first captured image. For example, the target object is a human body, and other objects may be trees, buildings, flowers, vehicles, etc. that exist around the person. After capturing the first image, the first camera can identify whether the first image contains the target object set by the user and the first location area of the target object in the first image, where the first location area covers the target object And is smaller than the area of the first image.
实际应用中,第一拍摄设备可以基于目标物体的可见光特征来识别第一图像中是否包含目标物体。所谓可见光特征是指目标物体的光学特征,比如目标物体为人体时,对应的可见光特征可以是人体的轮廓形状、人脸特征等。基于这些特征进行人体识别的实现方式可以参考现有相关技术实现,在此不赘述。当识别出第一图像中包含目标物体时,可以确定该目标物体的边界轮廓作为该目标物体的第一位置区域,或者,也可以确定围绕该目标物体的最小矩形框作为该目标物体的第一位置区域。In practical applications, the first imaging device can identify whether the first image contains the target object based on the visible light characteristics of the target object. The so-called visible light feature refers to the optical feature of the target object. For example, when the target object is a human body, the corresponding visible light feature can be the contour shape of the human body, facial features, and so on. The implementation of human body recognition based on these features can be implemented with reference to the existing related technologies, which will not be repeated here. When it is recognized that the first image contains the target object, the boundary contour of the target object can be determined as the first location area of the target object, or the smallest rectangular frame surrounding the target object can also be determined as the first position area of the target object. Location area.
具体来说,实际应用中,可以按照设定的网格尺寸将第一图像划分为N个网格,从而,假设其中的M个网格内都包含了目标物体的一部分,则可以确定这M个网格所覆盖的区域即为第一位置区域,或者,也可以确定由这M个网格及周围的K个网格所覆盖的区域为第一位置区域,其中,这M个网格和K个网格会构成覆盖目标物体的最小矩形框。Specifically, in practical applications, the first image can be divided into N grids according to the set grid size. Therefore, assuming that the M grids contain part of the target object, the M grids can be determined. The area covered by each grid is the first location area, or it can be determined that the area covered by the M grids and the surrounding K grids is the first location area, where the M grids and the surrounding K grids are the first location area. K grids will form the smallest rectangular frame covering the target object.
传统对焦方案中,对焦区域往往选择的是图像的中心区域,即保证图像中心区域成像清晰。但是,如果第一图像中的目标物体不在第一图像的中心区域,第一图像的中心区域为背景,那么,基于传统的对焦方案将会使得背景呈现清晰而作为前景主体的目标物体未清晰成像,导致自动对焦出现前景主体对焦模糊的问题。In traditional focusing schemes, the focus area is often the central area of the image, that is, to ensure that the central area of the image is clear. However, if the target object in the first image is not in the central area of the first image, and the central area of the first image is the background, the traditional focusing scheme will make the background appear clear and the target object as the foreground subject is not clearly imaged , Resulting in blurring of the foreground subject in auto focus.
为了能够克服该问题,本发明实施例中,第一拍摄设备如果能够自动地 将对焦区域选为目标物体所在的第一位置区域,进而通过执行自动对焦算法便可以使得该第一位置区域内的目标物体达到最清晰成像的目的,从而完成针对目标物体的对焦处理。In order to overcome this problem, in the embodiment of the present invention, if the first photographing device can automatically select the focus area as the first location area where the target object is located, and then execute the auto-focus algorithm to make the first location area The target object achieves the clearest imaging purpose, thereby completing the focus processing for the target object.
第一拍摄设备将对焦区域选为目标物体所在的第一位置区域的实现方式为:设置第一图像中该第一位置区域所对应的图像清晰度具有第一权重,第一图像中除第一位置区域外的其他区域所对应的图像清晰度具有第二权重,第一权重大于第二权重。The first imaging device selects the focus area as the first position area where the target object is located. The method is to set the image definition corresponding to the first position area in the first image to have the first weight, and the first image is divided by the first weight. The image definition corresponding to other areas outside the location area has a second weight, and the first weight is greater than the second weight.
其中,可选地,比如第二权重可以设置为0,第一权重可以设置为大于0的数值,比如设置为1。Optionally, for example, the second weight may be set to 0, and the first weight may be set to a value greater than 0, for example, set to 1.
实际应用中,图像清晰度可以通过图像梯度值表示,即通过求取第一图像中各像素的梯度以得到该第一图像的图像清晰度。假设上述第一位置区域内包含100个像素点,那么可以认为这100个像素点的梯度值均被设置有第一权重,假设第一图像中除第一位置区域外包含的这100个像素点外还有500个像素点,那么这500个像素点被设置为具有第二权重。In practical applications, the image sharpness can be represented by the image gradient value, that is, the image sharpness of the first image is obtained by calculating the gradient of each pixel in the first image. Assuming that the above first location area contains 100 pixels, it can be considered that the gradient values of these 100 pixels are all set with the first weight. Assume that the 100 pixels contained in the first image except for the first location area There are 500 pixels in addition, then these 500 pixels are set to have the second weight.
通过上述第一权重和第二权重的设置,使得目标物体被突出出来,亦即实现了将对焦区域定位到目标物体上。Through the above-mentioned setting of the first weight and the second weight, the target object is highlighted, that is, the focus area is positioned on the target object.
之后,可以根据第一权重和第二权重的设置结果计算第一图像的清晰度统计值,以便基于该清晰度统计值确定是否需要对目标物体执行对焦处理。因为如果此时目标物体成像清晰,则不需要进行对焦处理。After that, the sharpness statistical value of the first image can be calculated according to the setting results of the first weight and the second weight, so as to determine whether it is necessary to perform focus processing on the target object based on the sharpness statistical value. Because if the image of the target object is clear at this time, there is no need to perform focus processing.
在图像清晰度以图像梯度值来表示的情况下,根据第一权重和第二权重获取第一图像的清晰度统计值,可以实现为:In the case where the image definition is represented by the image gradient value, the statistical value of the definition of the first image is obtained according to the first weight and the second weight, which can be implemented as:
根据第一权重和第二权重对第一位置区域所对应的图像梯度值与其他位置区域所对应的图像梯度值进行加权求和计算,以得到第一图像的清晰度统计值。以上述100个像素点具有第一权重,上述500个像素点具有第二权重,并且第一权重为1,第二权重为0为例来说,第一图像的清晰度统计值即为这100个像素点的梯度值之和。According to the first weight and the second weight, a weighted sum calculation is performed on the image gradient value corresponding to the first location area and the image gradient value corresponding to other location areas to obtain the sharpness statistical value of the first image. Taking the above 100 pixels with the first weight, the above 500 pixels with the second weight, and the first weight is 1 and the second weight is 0 as an example, the statistical value of the sharpness of the first image is 100 The sum of the gradient values of each pixel.
因为梯度值越大,说明图像越清晰,因此,可选地,若第一图像的清晰 度统计值大于设定阈值,则认为目标物体成像清晰,无需进行对焦处理,反之,若第一图像的清晰度统计值小于该设定阈值,则认为目标物体成像不清晰,需进行对焦处理。Because the larger the gradient value, the clearer the image. Therefore, optionally, if the statistical value of the sharpness of the first image is greater than the set threshold, it is considered that the target object is clearly imaged and does not need to be focused. On the contrary, if the first image is If the sharpness statistical value is less than the set threshold, it is considered that the target object is not sharply imaged and needs to be focused.
另外,在一些实际应用场景中,需要对目标物体进行跟踪录像,此时,可以对采集的视频进行分割处理以得到由多帧图像组成的图像序列。假设第一图像为图像序列中的最后一帧图像,也可以根据采集第一图像之前采集的已经对焦的某帧图像来确定在当前采集到第一图像时是否需要针对目标物体进行对焦处理。可选地,若第一图像的清晰度统计值与参考图像的清晰度统计值的差值大于设定阈值,则对目标物体进行对焦处理,其中,该参考图像是此前已经针对目标物体实现对焦的一帧图像。In addition, in some practical application scenarios, it is necessary to track and record the target object. At this time, the collected video can be segmented to obtain an image sequence composed of multiple frames of images. Assuming that the first image is the last frame of the image in the image sequence, it can also be determined according to a certain frame of image that has been focused before the first image is captured, whether it is necessary to perform focus processing on the target object when the first image is currently captured. Optionally, if the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold, focus processing is performed on the target object, where the reference image has been focused on the target object before Of an image.
此时,在完成对焦处理后,可以以完成对焦后拍得的图像更新参考图像,以用于对第一拍摄设备后续采集的图像进行对焦处理。At this time, after the focus processing is completed, the reference image may be updated with the image taken after the focus is completed, so as to perform focus processing on the image subsequently collected by the first photographing device.
另外,在实际应用中,对焦过程(调物距)和变焦过程(调焦距)总是同时存在的,在一些实施例中,在执行上文中的对焦过程之前,还可以执行如下变焦过程:In addition, in practical applications, the focusing process (adjusting the object distance) and the zooming process (focusing) always exist at the same time. In some embodiments, before performing the above focusing process, the following zooming process may also be performed:
若所述第一位置区域不位于第一拍摄设备的画面中心区域,则根据第一位置区域与第一拍摄设备的主光轴的相对位置将第一位置区域移动至画面中心区域。If the first location area is not located in the central area of the screen of the first photographing device, the first location area is moved to the central area of the screen according to the relative position of the first location area and the main optical axis of the first photographing device.
在变焦过程中往往会对图像进行放大的处理,因此,在移动第一图像,使得其中的第一位置区域位于画面中心区域后,可以对第一图像进行放大处理。During the zooming process, the image is often enlarged. Therefore, after the first image is moved so that the first position area is located in the center area of the screen, the first image can be enlarged.
以第一拍摄设备被挂载在无人机上为例进行说明,第一拍摄设备被挂载在无人机的云台上,第一拍摄设备可以将第一位置区域与主光轴的相对位置上报给云台,云台进行位姿调整以使得变焦过程中,第一图像中包含目标物体的第一位置区域始终位于画面中心区域。Take the first camera device mounted on the drone as an example. The first camera device is mounted on the drone's pan/tilt. The first camera device can determine the relative position of the first location area to the main optical axis. Report to the pan/tilt, and the pan/tilt adjusts its pose so that during the zooming process, the first location area containing the target object in the first image is always located in the center area of the screen.
综上,本发明实施例中,通过对目标物体在图像中的位置区域进行识别,以区别设置目标物体所在位置区域和图像中其他区域的图像清晰度的权重, 从而实现对包含目标物体的对焦区域的自动选定,进而在需要对目标物体进行对焦时,以保证该对焦区域内的目标物体成像清晰为目标来调整物距、像距,完成对目标物体的准确对焦。To sum up, in the embodiment of the present invention, by identifying the location area of the target object in the image, the weight of the image clarity between the location area of the target object and other areas in the image is set differently, so as to achieve focusing on the target object. Automatic selection of the area, and then when the target object needs to be focused, the object distance and image distance are adjusted to ensure that the target object in the focus area is clearly imaged to complete the accurate focus of the target object.
下面,结合第一拍摄设备常用的应用场景,对在不同应用场景下执行本发明实施例提供的对焦方案的过程进行简单介绍。其中,第一拍摄设备常用的应用场景包括拍照场景和录像场景。In the following, in combination with commonly used application scenarios of the first photographing device, the process of executing the focusing solutions provided by the embodiments of the present invention in different application scenarios will be briefly introduced. Among them, the commonly used application scenarios of the first shooting device include photographing scenes and video recording scenes.
针对拍照场景来说,此时,上文中提到的第一拍摄设备采集的第一图像,应该理解为是用户在对第一拍摄设备触发真正的拍照操作之前能够通过第一拍摄设备预览到的多帧图像中的各帧图像。举例来说,假设第一拍摄设备为手机,当用户启动拍摄功能并将摄像头朝向目标物体(即为被拍对象)后,目标物体的影像会呈现在手机屏幕上,亦即呈现在预览框中,此时,呈现在预览框中的影像也可以视为是一种视频,对该视频进行采样可以得到多帧图像,假设为分别表示为F1、F2、F3的三帧图像。当用户调整好拍摄角度后,点击屏幕上的拍摄按钮,此时触发对目标物体的真正拍照,会拍得一张目标物体的照片,假设表示为Z1。而本发明实施例中的对焦过程即发生在用户点击该拍摄按钮之前,通过预览过程中得到的多帧图像——F1、F2、F3各自对应的清晰度统计值(计算方式如前文所述)先实现对目标物体的对焦,之后,当用户点击拍摄按钮后才会得到对焦效果良好的照片即Z1。其中,如果F1、F2、F3是用户启动拍摄功能后最先得到的三帧图像,则可以选择F1作为初始的参考图像,待基于F1、F2、F3完成本次对焦处理,得到合适的物距后,可以以拍摄得到的已经对焦的照片Z1更新参考图像。在拍得照片Z1后,如果用户继续对目标物体进行拍摄,那么此时又会通过屏幕看到预览视频,又可以采样得到多帧图像,比如表示为F4、F5、F6,通过本次预览过程中得到的多帧图像——F4、F5、F6再一次对目标物体进行对焦,以便保证用户再次点击拍摄按钮拍得的照片Z2具有良好的对焦效果,即目标物体在照片Z2中成像清晰,此时,参考图像可以进更新为照片Z2。For the photographing scene, at this time, the first image collected by the first photographing device mentioned above should be understood as the preview that the user can preview through the first photographing device before triggering the actual photographing operation on the first photographing device Each frame of the multi-frame image. For example, suppose the first shooting device is a mobile phone. When the user activates the shooting function and points the camera toward the target object (ie, the object being photographed), the image of the target object will be displayed on the screen of the mobile phone, that is, in the preview box At this time, the image presented in the preview frame can also be regarded as a kind of video, and multiple frames of images can be obtained by sampling the video, which are assumed to be three frames of images denoted as F1, F2, and F3, respectively. After the user adjusts the shooting angle, click the shooting button on the screen, and at this time, a real photo of the target object is triggered, and a photo of the target object will be taken, which is assumed to be Z1. However, the focusing process in the embodiment of the present invention occurs before the user clicks the shooting button, through the multiple frames of images obtained in the preview process-F1, F2, and F3, respectively, corresponding to the definition statistical values (the calculation method is as described above) First, focus on the target object, and then, when the user clicks the shooting button, a photo with good focus effect, namely Z1, will be obtained. Among them, if F1, F2, and F3 are the first three frames of images obtained after the user starts the shooting function, then F1 can be selected as the initial reference image, and the focus processing will be completed based on F1, F2, and F3 to obtain a suitable object distance Later, the reference image can be updated with the focused photo Z1 obtained by shooting. After the photo Z1 is taken, if the user continues to shoot the target object, then the preview video will be seen on the screen at this time, and multiple frames of images can be sampled, such as F4, F5, F6, through this preview process The multi-frame images obtained in the image-F4, F5, F6 focus again on the target object to ensure that the user clicks the shooting button again to take the photo Z2 with a good focus effect, that is, the target object is clearly imaged in the photo Z2. When the time, the reference image can be updated to the photo Z2.
综上,在拍照场景中,可以从预览的视频流从采样得到设定数量的图像 以用于对焦处理,比如3帧、5帧,甚至可以是1帧。针对其中的每帧图像的处理过程是一致的,如步骤101-104所示,此时,最终会结合该多帧图像各自对应的清晰度统计值对目标物体进行对焦处理,具体过程下文会描述。In summary, in a photographing scene, a set number of images can be sampled from the previewed video stream for focusing processing, such as 3 frames, 5 frames, or even 1 frame. The processing process for each frame of the image is the same, as shown in steps 101-104. At this time, the target object will be focused on the target object in combination with the corresponding sharpness statistics of the multiple frames of images. The specific process will be described below .
针对录像场景来说,此时,上文中提到的第一拍摄设备采集的第一图像,即为对录得的视频进行采样后得到的各帧图像。此时,在录取视频的同时,可以对视频进行采样,采得一帧帧图像,分别通过上文中介绍的方式计算每帧图像的清晰度统计值。在该场景中,可选地,也可以将依次采样得到的多帧图像作为一组,比如3帧、5帧,以每组中多帧图像各自对应的清晰度统计值对目标物体进行对焦处理。具体来说,在该场景中,参考图像可以初始化为采样得到的第一帧图像,并且设定第一组图像需要进行对焦处理,从而,在对第一组图像进行对焦处理后,可以得到某种合适的物距,在目标物体相对第一拍摄设备的位置不发生改变的情况下,该物距可以使得第一拍摄设备接下来拍摄的视频画面中目标物体成像清晰。基于此,参考图像可以更新为第二组图像中的第一帧图像,当第二组中的其他图像与该参考图像的清晰度统计值的差值较大时,说明此时还需要进行再一次的对焦处理,可以根据第二组图像确定出新的物距,依此类推。For a video recording scene, at this time, the first image collected by the first shooting device mentioned above is each frame image obtained after sampling the recorded video. At this time, while recording the video, the video can be sampled to obtain a frame of image, and the statistical value of the definition of each frame of image can be calculated by the method described above. In this scene, optionally, multiple frames of images obtained by sequential sampling can also be used as a group, such as 3 frames, 5 frames, and the target object is focused on the target object with the corresponding sharpness statistics of the multiple frames in each group. . Specifically, in this scene, the reference image can be initialized to the first frame of image obtained by sampling, and it is set that the first group of images needs to be focused, so that after the first group of images is focused, you can A certain appropriate object distance is obtained. Under the condition that the position of the target object relative to the first shooting device does not change, the object distance can make the target object in the next video image captured by the first shooting device clear. Based on this, the reference image can be updated to the first image in the second group of images. When the difference between the sharpness statistics of the other images in the second group and the reference image is large, it means that it needs to be done at this time. Once the focus is processed again, a new object distance can be determined based on the second set of images, and so on.
不管是上述哪种应用场景,概括来说,对焦处理的执行原理如下:Regardless of the above application scenarios, in summary, the execution principle of focus processing is as follows:
确定第一拍摄设备的物距调节方向,其中,根据该物距调节方向调节物距使得多帧图像的清晰度统计值呈变大趋势,该多帧图像中包括第一图像以及由第一拍摄设备采集的与第一图像相邻的至少一帧图像。进而,将第一拍摄设备的物距调节到目标物距,该目标物距与多帧图像中的最大清晰度统计值对应。其中,这里的第一图像可以是指拍照场景中分割预览视频得到的任一帧图像,也可以是指录像场景中采样的任一帧图像。Determine the object distance adjustment direction of the first photographing device, where the object distance is adjusted according to the object distance adjustment direction so that the statistical value of the sharpness of the multi-frame image becomes larger. The multi-frame image includes the first image and the first image captured by the first image. At least one frame of image adjacent to the first image collected by the device. Furthermore, the object distance of the first photographing device is adjusted to the target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images. Wherein, the first image here may refer to any frame of image obtained by segmenting the preview video in the photographing scene, or may refer to any frame of image sampled in the recording scene.
由上述对焦原理介绍可知,自动对焦的目的即为:寻找到目标物距位置,相比于在非目标物距位置处,在目标物距位置处,拍得的图像的清晰度统计值最大。According to the introduction of the above focusing principle, the purpose of auto focusing is to find the target object distance position. Compared with the non-target object distance position, the captured image has the largest statistical value of sharpness at the target object distance position.
为便于理解,示例性说明对焦过程:假设当前采集的图像为F1,计算F1 对应的清晰度统计值,并以设定的步长减少第一拍摄设备的物距。假设以该物距采集到下一帧图像F2,计算F2的清晰度统计值。如果F2的清晰度统计值大于F1的清晰度统计值,说明较小物距的调节方向是正确的,反之,则需要确定调节方向为增大物距。如此,逐步减少物距,并在每个物距位置采集得到一帧图像。根据上文中提到的结合多帧图像进行对焦处理的介绍,假设依次采集到的多帧图像为F1、F2、F3、F4,并且假设这四帧图像对应的物距分别为W1、W2、W3、W4,则可以确定目标物距为这四个物距中的最大值,假设为W2,此时,实际上,图像F2对应的清晰度统计值也将是这四个图像中最大的。以上述拍照场景为例,这四帧图像可以理解为是对预览视频分割得到的图像,从而,前文中的第一图像可以包括这四帧图像。For ease of understanding, the focusing process is illustrated as an example: assuming that the currently collected image is F1, calculate the sharpness statistical value corresponding to F1, and reduce the object distance of the first photographing device by a set step. Assuming that the next frame of image F2 is collected at this object distance, the sharpness statistical value of F2 is calculated. If the sharpness statistical value of F2 is greater than the sharpness statistical value of F1, it means that the adjustment direction of the smaller object distance is correct. Otherwise, it is necessary to determine the adjustment direction to increase the object distance. In this way, the object distance is gradually reduced, and a frame of image is collected at each object distance position. According to the introduction of combining multi-frame images for focus processing mentioned above, suppose that the multi-frame images collected in sequence are F1, F2, F3, F4, and that the object distances corresponding to these four frames are W1, W2, W3, respectively , W4, it can be determined that the target object distance is the maximum of these four object distances. Suppose it is W2. At this time, in fact, the sharpness statistical value corresponding to image F2 will also be the largest of the four images. Taking the above-mentioned photographing scene as an example, these four frames of images can be understood as images obtained by segmenting the preview video. Therefore, the first image in the foregoing may include these four frames of images.
上述介绍了对焦过程的原理,下面结合图2提供一种具体的执行对焦过程的实现方式。如图2所示,该对焦过程可以包括如下步骤:The principle of the focusing process has been described above, and a specific implementation manner of performing the focusing process is provided below in conjunction with FIG. 2. As shown in FIG. 2, the focusing process may include the following steps:
201、确定采集的图像P1的清晰度统计值与参考图像的清晰度统计值的差值均大于设定阈值。201. Determine that the difference between the sharpness statistical value of the collected image P1 and the sharpness statistical value of the reference image is greater than a set threshold.
202、驱动对焦电机向目标物体的方向移动镜头以减少物距。202. Drive the focus motor to move the lens in the direction of the target object to reduce the object distance.
203、确定移动K1个设定步长期间采集的K1帧图像的清晰度统计值是否呈现变大趋势,若是,则执行步骤204,否则执行步骤205。203. Determine whether the sharpness statistical value of the K1 frame image collected during the movement of K1 set steps shows a tendency to increase, if yes, perform step 204; otherwise, perform step 205.
其中,K1为大于或等于1的整数。Among them, K1 is an integer greater than or equal to 1.
其中,步骤202的执行可以理解为是:对焦电机以设定步长逐步减小物距,在每移动一个步长时,会采集一帧图像。假设K1=2,从而移动两次步长分别采集的图像为:图像P2和图像P3。分别计算这两帧图像的清晰度统计值,以确定图像P1、图像P2和图像P3的清晰度统计值是否呈现变大趋势。Wherein, the execution of step 202 can be understood as: the focus motor gradually reduces the object distance with a set step length, and each time it moves by a step length, one frame of image is collected. Assuming K1=2, the images collected by moving two steps are: image P2 and image P3. The sharpness statistical values of the two frames of images are respectively calculated to determine whether the sharpness statistical values of the image P1, the image P2, and the image P3 show a tendency to become larger.
如果图像P1、图像P2和图像P3的清晰度统计值呈现变大趋势,说明当前的物距调节方向是正确的,按照这个方向继续调节物距可以使得成像更清晰。相反,图像P1、图像P2和图像P3的清晰度统计值若未呈现变大趋势,说明当前的物距调节方向是不正确的,需要反方向来调节物距以使得成像更清晰。If the sharpness statistics of image P1, image P2, and image P3 show a tendency to increase, it indicates that the current adjustment direction of the object distance is correct, and further adjustment of the object distance in this direction can make the image clearer. On the contrary, if the sharpness statistical values of the image P1, the image P2, and the image P3 do not show a tendency to increase, it indicates that the current adjustment direction of the object distance is incorrect, and the object distance needs to be adjusted in the opposite direction to make the image clearer.
204、继续驱动对焦电机向目标物体的方向移动镜头K2个设定步长,以减 少物距。204. Continue to drive the focus motor to move the lens K2 set steps in the direction of the target object to reduce the object distance.
205、驱动对焦电机向背离目标物体的方向移动镜头K2个设定步长,以增大物距。205. Drive the focus motor to move the lens K2 set steps in a direction away from the target object to increase the object distance.
其中,K2为大于或等于1的整数。Among them, K2 is an integer greater than or equal to 1.
206、确定移动K2个设定步长期间采集的K2帧图像和上述K1帧图像的清晰度统计值是否呈现山峰状变化特征,若是,则执行步骤207,否则重复执行步骤203。206. Determine whether the sharpness statistics of the K2 frame images and the K1 frame images collected during the movement of K2 set steps show a mountain-like change feature, if yes, perform step 207, otherwise repeat step 203.
207、驱动对焦电机移动至作为峰顶的清晰度统计值所对应的物距位置。207. Drive the focus motor to move to the object distance position corresponding to the sharpness statistical value of the peak top.
其中,步骤204-207的目的是继续按照此前确定出的物距调节方向来调节物距,以便寻找到使得目标物体成像最为清晰的物距位置。Among them, the purpose of steps 204 to 207 is to continue to adjust the object distance according to the previously determined object distance adjustment direction, so as to find the object distance position that makes the image of the target object clearest.
具体地,在每移动一个设定步长的时候可以采集一帧图像,假设K2=3,从而移动三次步长分别采集的图像为:图像P4、图像P5和图像P6。分别计算这三帧图像的清晰度统计值。确定图像P1、图像P2、图像P3、图像P4、图像P5和图像P6的清晰度统计值是否呈现山峰状特征,即是否呈现逐步变大继而又逐步变小的趋势。若有该趋势,且假设最大值即峰顶为图像P3的清晰度统计值,则说明拍摄图像P3时的物距位置是最佳的,以该物距位置拍摄,会使得目标物体成像最为清晰,所以控制对焦电机移动至该物距位置。Specifically, one frame of image can be collected every time a set step is moved, assuming K2=3, so that the images collected by moving three steps are: image P4, image P5, and image P6. Calculate the sharpness statistics of these three frames respectively. It is determined whether the sharpness statistical values of the image P1, the image P2, the image P3, the image P4, the image P5, and the image P6 show a mountain-like characteristic, that is, whether they show a trend of gradually increasing and then gradually decreasing. If there is this trend, and assuming that the maximum value, that is, the peak top, is the sharpness statistical value of the image P3, it means that the object distance position when the image P3 is taken is the best, and shooting at this object distance position will make the image of the target object clearest , So control the focus motor to move to the object distance position.
值得说明的是,如果重新多次尝试按照此前确定的移动方向移动K2个步长仍旧不能确定出上述物距位置,此时,可以以延迟设定时间后采集的另一帧图像更新上述图像P1,重新执行上述步骤201-207。It is worth noting that if you try to move K2 steps according to the previously determined moving direction several times, the above object distance position cannot be determined. At this time, the above image P1 can be updated with another frame of image collected after a delay of the set time. , Re-execute the above steps 201-207.
综上两种应用场景的举例可知,实际应用中,对目标物体进行拍摄的过程中,由于第一拍摄设备相对目标物体的位姿时不断发生改变的,因此需要不断地对目标物体进行对焦处理,以保证目标物体在拍得的画面中始终保持清晰成像。从而,需要针对拍摄过程中采集的各帧图像进行图1所示实施例中的图像清晰度统计值的计算处理,以及结合连续采集的设定数量图像的图像清晰度统计值完成在这些图像采集时间的该第一拍摄设备的物距的调整即对焦处理。To sum up the examples of the two application scenarios, it can be seen that in actual applications, in the process of shooting the target object, because the position of the first shooting device relative to the target object is constantly changing, it is necessary to continuously focus on the target object. , In order to ensure that the target object always maintains a clear image in the captured image. Therefore, it is necessary to perform the calculation processing of the image sharpness statistical value in the embodiment shown in FIG. 1 for each frame of images collected during the shooting process, and to combine the image sharpness statistical value of the set number of images continuously collected to complete the image acquisition. The adjustment of the object distance of the first photographing device over time is the focusing process.
图3为本发明实施例提供的另一种对焦方法的流程示意图,如图3所示,该对焦方法可以包括如下步骤:FIG. 3 is a schematic flowchart of another focusing method provided by an embodiment of the present invention. As shown in FIG. 3, the focusing method may include the following steps:
301、初始化自动对焦状态为需要对焦,初始化参考图像的清晰度统计值为预设值。301. Initialize the auto focus state to focus, and initialize the statistical value of the sharpness of the reference image to a preset value.
本实施例中,设置两个参数:自动对焦状态和参考图像。In this embodiment, two parameters are set: auto focus state and reference image.
其中,自动对焦状态用于表示当前采集的图像是否需要进行自动对焦处理,初始情况下,该状态设置为需要对焦,意味着采集的第一张图像需要被用于进行对焦处理。Among them, the auto-focus state is used to indicate whether the currently collected image needs to be subjected to auto-focus processing. Initially, this state is set to need to be focused, which means that the first captured image needs to be used for focus processing.
其中,初始情况下,参考图像可以是自动生成的一张图像,该图像的尺寸与后续实际采集的各图像的尺寸相等。实际应用中,可以将初始的参考图像中各像素的梯度值(假设以梯度值作为图像清晰度的度量指标)的权重均设置为设定值比如为0,从而,全部像素的梯度值的加权和即为初始的参考图像的清晰度统计值。当然,也可以以采集的第一帧图像作为初始的参考图像,并计算该图像的图像清晰度,以该图像清晰度作为参考图像的图像清晰度统计值。Wherein, in the initial situation, the reference image may be an automatically generated image, and the size of the image is equal to the size of each image actually collected subsequently. In practical applications, the weight of the gradient value of each pixel in the initial reference image (assuming that the gradient value is used as a measure of image sharpness) can be set to a set value, such as 0, so that the weight of the gradient value of all pixels The sum is the sharpness statistical value of the initial reference image. Of course, it is also possible to use the acquired first frame of image as the initial reference image, and calculate the image definition of the image, and use the image definition as the statistical value of the image definition of the reference image.
302、确定在第一拍摄设备采集的第一图像中是否存在目标物体,若存在,则执行步骤303,若不存在,则执行步骤304。302. Determine whether there is a target object in the first image captured by the first photographing device, if it exists, execute step 303, and if it does not exist, execute step 304.
303、设置第一图像中包含目标物体的第一位置区域所对应的图像清晰度具有第一权重,其他区域所对应的图像清晰度具有第二权重,第一权重大于第二权重。303. Set the image definition corresponding to the first location area containing the target object in the first image to have a first weight, and image definitions corresponding to other areas have a second weight, and the first weight is greater than the second weight.
通过步骤303将对焦区域定位到目标物体的执行过程可以参见前述实施例中的说明。For the execution process of locating the focus area to the target object through step 303, refer to the description in the foregoing embodiment.
304、设置第一图像的中心位置区域所对应的图像清晰度具有第一权重,非中心位置区域所对应的图像清晰度具有第二权重。304. Set the image definition corresponding to the central position area of the first image to have the first weight, and set the image definition corresponding to the non-central position area to have the second weight.
当第一图像中不包含目标物体时,仍可以将对焦区域定位到第一图像的中心位置区域。实际应用中,可以设定该中心位置区域的范围。When the target object is not included in the first image, the focus area can still be positioned to the center position area of the first image. In practical applications, the range of the central location area can be set.
305、根据第一权重和第二权重获取第一图像的清晰度统计值,确定第一 图像的清晰度统计值与参考图像的清晰度统计值的差值是否大于设定阈值,若大于,则执行步骤306,否则,执行步骤307。305. Obtain the sharpness statistical value of the first image according to the first weight and the second weight, and determine whether the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold; if it is greater, then Step 306 is executed, otherwise, step 307 is executed.
306、确定自动对焦状态为需要对焦。306. Determine that the auto-focus state is in need of focusing.
307、确定自动对焦状态为不需要对焦。307. Determine that the auto focus state is that no focus is required.
当确定自动对焦状态为不需要对焦时,意味着第一图像不需要进行对焦处理,此时,拍摄下一张图像,针对该下一张图像继续执行步骤302至307的处理逻辑。相反地,如果确定自动对焦状态为需要对焦,意味着第一图像需要进行对焦处理,此时,执行前文所介绍的对焦处理过程。When it is determined that the auto-focusing state does not require focusing, it means that the first image does not need to be subjected to focusing processing. At this time, the next image is taken, and the processing logic of steps 302 to 307 is continued to be executed for the next image. Conversely, if it is determined that the auto-focus state is in need of focusing, it means that the first image needs to be subjected to focusing processing. At this time, the focusing processing procedure described above is executed.
以上各实施例中介绍的是基于单独的第一拍摄设备(如可见光变焦相机)实现针对目标物体的识别、对焦处理。而在一些实际应用场景中,当仅有一个可见光变焦相机时,如果被拍摄的目标物体距离可见光变焦相机较远,由于可见光变焦相机的视场角一般较小,从而拍摄得到的图像在视觉上会感觉很小,可视效果差,此时,不利于快速地识别到目标物体,从而实现针对目标物体的快速、准确的对焦处理。为此,本发明实施例还提供了如图3所示的对焦方法。The description in the above embodiments is based on a single first photographing device (such as a visible light zoom camera) to realize the recognition and focus processing of the target object. In some practical application scenarios, when there is only one visible light zoom camera, if the target object to be photographed is far away from the visible light zoom camera, the visual field angle of the visible light zoom camera is generally small, so the image obtained is visually It will feel very small and the visual effect is poor. At this time, it is not conducive to quickly identifying the target object, so as to achieve fast and accurate focusing processing for the target object. To this end, the embodiment of the present invention also provides a focusing method as shown in FIG. 3.
图4为本发明实施例提供的另一种对焦方法的流程示意图,该对焦方法由上文中的第一拍摄设备执行,如图4所示,该对焦方法可以包括如下步骤:FIG. 4 is a schematic flowchart of another focusing method provided by an embodiment of the present invention. The focusing method is executed by the first photographing device described above. As shown in FIG. 4, the focusing method may include the following steps:
401、在第二拍摄设备采集的第二图像中识别出目标物体。401. Identify a target object in a second image collected by a second photographing device.
402、根据目标物体在第二图像中对应的第二位置区域以及第一拍摄设备与第二拍摄设备的坐标系映射关系,确定目标物体在第一拍摄设备采集的第一图像中对应的第一位置区域,其中,第一图像与第二图像的拍摄时间相同。402. According to the second location area corresponding to the target object in the second image and the coordinate system mapping relationship between the first shooting device and the second shooting device, determine the first image corresponding to the target object in the first image captured by the first shooting device. Location area, where the shooting time of the first image and the second image are the same.
403、设置第一图像中第一位置区域所对应的图像清晰度具有第一权重,第一图像中除第一位置区域外的其他区域所对应的图像清晰度具有第二权重,第一权重大于第二权重。403. Set the image definition corresponding to the first position area in the first image to have the first weight, and the image definition corresponding to the areas other than the first position area in the first image has the second weight, and the first weight is greater than The second weight.
404、根据第一权重和第二权重获取第一图像的清晰度统计值。404. Acquire a sharpness statistical value of the first image according to the first weight and the second weight.
405、若第一图像的清晰度统计值符合设定的对焦条件,则对目标物体进行对焦处理。405. If the sharpness statistical value of the first image meets the set focusing condition, perform focusing processing on the target object.
本实施例中,第一拍摄设备的视场角小于第二拍摄设备的视场角。实际应用中,第二拍摄设备可以为红外相机,或者,第二拍摄设备还可以为可见光广角相机。In this embodiment, the angle of view of the first photographing device is smaller than the angle of view of the second photographing device. In practical applications, the second photographing device may be an infrared camera, or the second photographing device may also be a visible light wide-angle camera.
为便于理解,下面以图5所示的一种应用场景为例来说明。For ease of understanding, an application scenario shown in FIG. 5 is taken as an example for illustration.
在图5中,假设第一拍摄设备为可见光变焦相机,视场角为FOV1,第二拍摄设备为红外相机,视场角为FOV2,FOV1小于FOV2。实际应用中,第一拍摄设备和第二拍摄设备可以均挂载在无人机上。另外,根据第一拍摄设备的拍摄参数和第二拍摄设备的拍摄参数预先已经确定了两个拍摄设备的图像坐标映射关系。In FIG. 5, it is assumed that the first photographing device is a visible light zoom camera with a field of view angle of FOV1, and the second photographing device is an infrared camera with a field of view angle of FOV2, and FOV1 is smaller than FOV2. In practical applications, both the first photographing device and the second photographing device can be mounted on the drone. In addition, the image coordinate mapping relationship of the two shooting devices has been determined in advance according to the shooting parameters of the first shooting device and the shooting parameters of the second shooting device.
从而,在相同时刻,第一拍摄设备和第二拍摄设备都向目标物体拍摄一张图像,将第一拍摄设备采集的图像称为第一图像,第二拍摄设备采集的图像称为第二图像。由于第二拍摄设备具有更大的视场角,因此,第二图像中包含的数据内容远远多于第一图像,从而,通过第二拍摄设备可以更快地捕捉到目标物体。Therefore, at the same moment, both the first shooting device and the second shooting device shoot an image of the target object, the image collected by the first shooting device is called the first image, and the image collected by the second shooting device is called the second image . Since the second photographing device has a larger field of view, the data content contained in the second image is much more than that of the first image, so that the target object can be captured more quickly by the second photographing device.
可以根据第二拍摄设备的种类的不同而采用不同的特征以在第二图像中进行目标物体的识别。Different features can be adopted according to the different types of the second photographing device to identify the target object in the second image.
比如,当第二拍摄设备为红外相机时,可以根据目标物体的温度特征在第二图像中识别出目标物体。不同种类的目标物体所对应的温度取值范围是不同的,据此,可以识别出目标物体。For example, when the second photographing device is an infrared camera, the target object can be identified in the second image according to the temperature characteristic of the target object. The temperature value ranges corresponding to different types of target objects are different, according to which the target objects can be identified.
再比如,当第二拍摄设备为可见光广角相机时,可以根据目标物体的可见光特征在第二图像中识别出目标物体。可见光特征的含义可以参见前文中的说明。For another example, when the second photographing device is a visible light wide-angle camera, the target object can be identified in the second image according to the visible light feature of the target object. The meaning of the visible light feature can be referred to the above description.
当识别出第二图像中包含目标物体时,确定目标物体在第二图像中对应的第二位置区域,进而,根据两个拍摄设备间的图像坐标映射关系,可以确定目标物体在第一图像中的第一位置区域,进而,针对第一图像进行后续的对焦处理步骤,参见前述其他实施例中的介绍。When it is recognized that the target object is contained in the second image, the second location area corresponding to the target object in the second image is determined, and then, according to the image coordinate mapping relationship between the two shooting devices, it can be determined that the target object is in the first image For the first position area of the first image, the subsequent focus processing steps are performed on the first image. Refer to the introduction in the foregoing other embodiments.
图6为本发明实施例提供的一种对焦装置的结构示意图,该对焦装置可以设于上文中的第一拍摄设备,如图6所示,该对焦装置包括:存储器11、处理器12;其中,所述存储器11上存储有可执行代码,当所述可执行代码被所述处理器12执行时,使所述处理器12实现:FIG. 6 is a schematic structural diagram of a focusing device provided by an embodiment of the present invention. The focusing device may be provided in the first photographing device mentioned above. As shown in FIG. 6, the focusing device includes: a memory 11 and a processor 12; The memory 11 stores executable code, and when the executable code is executed by the processor 12, the processor 12 is enabled to implement:
确定在所述第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域;其中,所述第一位置区域为覆盖所述目标物体且小于所述第一图像的区域;Determining a first location area corresponding to a target object in a first image captured by the first photographing device; wherein the first location area is an area that covers the target object and is smaller than the first image;
设置所述第一图像中所述第一位置区域所对应的图像清晰度具有第一权重;其中,所述第一图像中除所述第一位置区域外的其他区域所对应的图像清晰度具有第二权重,所述第一权重大于所述第二权重;Set the image definition corresponding to the first position area in the first image to have a first weight; wherein, the image definition corresponding to the areas other than the first position area in the first image has A second weight, where the first weight is greater than the second weight;
根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值;Acquiring a sharpness statistical value of the first image according to the first weight and the second weight;
若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理。If the sharpness statistical value of the first image meets the set focus condition, then focus processing is performed on the target object.
可选地,所述图像清晰度包括图像梯度值。从而,在获取所述第一图像的清晰度统计值的过程中,所述处理器12具体用于:根据所述第一权重和所述第二权重对所述第一位置区域所对应的图像梯度值与所述其他位置区域所对应的图像梯度值进行加权求和计算,以得到所述第一图像的清晰度统计值。Optionally, the image definition includes an image gradient value. Therefore, in the process of obtaining the definition statistical value of the first image, the processor 12 is specifically configured to: according to the first weight and the second weight, the image corresponding to the first location area A weighted sum calculation is performed between the gradient value and the image gradient value corresponding to the other location area to obtain the sharpness statistical value of the first image.
可选地,所述处理器12具体用于:若所述第一图像的清晰度统计值与参考图像的清晰度统计值差值大于设定阈值,则对所述目标物体进行对焦处理,所述参考图像是已经对焦的图像。Optionally, the processor 12 is specifically configured to: if the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold, perform focusing processing on the target object, so The reference image is an image that has been in focus.
可选地,所述处理器12还用于:以完成对焦后拍得的图像更新所述参考图像。Optionally, the processor 12 is further configured to update the reference image with an image taken after focusing.
可选地,所述第二权重设置为0。Optionally, the second weight is set to zero.
可选地,所述处理器12还用于:若所述第一位置区域不位于所述第一拍摄设备的画面中心区域,则根据所述第一位置区域与所述第一拍摄设备的主光轴的相对位置将所述第一位置区域移动至所述画面中心区域。Optionally, the processor 12 is further configured to: if the first location area is not located in the central area of the frame of the first photographing device, then according to the first location area and the main image of the first photographing device The relative position of the optical axis moves the first position area to the center area of the screen.
可选地,在确定在所述第一拍摄设备采集的第一图像中目标物体所对应 的第一位置区域的过程中,所述处理器12具体用于:在第二拍摄设备采集的第二图像中识别出所述目标物体;根据所述目标物体在所述第二图像中对应的第二位置区域以及所述第一拍摄设备与所述第二拍摄设备的图像坐标系映射关系,确定目标物体在所述第一图像中对应的所述第一位置区域;其中,所述第一图像与所述第二图像的拍摄时间相同。Optionally, in the process of determining the first location area corresponding to the target object in the first image captured by the first photographing device, the processor 12 is specifically configured to: The target object is identified in the image; the target is determined according to the second location area corresponding to the target object in the second image and the image coordinate system mapping relationship between the first photographing device and the second photographing device The first location area corresponding to the object in the first image; wherein the shooting time of the first image and the second image are the same.
可选地,所述第一拍摄设备的视场角小于所述第二拍摄设备。Optionally, the angle of view of the first photographing device is smaller than that of the second photographing device.
可选地,所述第一拍摄设备为可见光变焦相机,所述第二拍摄设备为红外相机或可见光广角相机。Optionally, the first photographing device is a visible light zoom camera, and the second photographing device is an infrared camera or a visible light wide-angle camera.
可选地,所述第二拍摄设备为红外相机时,所述处理器12具体用于:根据所述目标物体的温度特征在所述第二图像中识别出所述目标物体。Optionally, when the second photographing device is an infrared camera, the processor 12 is specifically configured to: identify the target object in the second image according to the temperature characteristic of the target object.
可选地,所述第二拍摄设备为可见光广角相机时,所述处理器12具体用于:根据所述目标物体的可见光特征在所述第二图像中识别出所述目标物体。Optionally, when the second photographing device is a visible light wide-angle camera, the processor 12 is specifically configured to: identify the target object in the second image according to the visible light characteristic of the target object.
可选地,在对目标物体进行对焦处理的过程中,所述处理器12具体用于:确定所述第一拍摄设备的物距调节方向,其中,根据所述物距调节方向调节物距使得多帧图像的清晰度统计值呈变大趋势,所述多帧图像中包括所述第一图像以及由所述第一拍摄设备采集的与所述第一图像相邻的至少一帧图像;将所述第一拍摄设备的物距调节到目标物距,所述目标物距与多帧图像中的最大清晰度统计值对应。Optionally, in the process of focusing processing on the target object, the processor 12 is specifically configured to: determine the object distance adjustment direction of the first photographing device, wherein the object distance is adjusted according to the object distance adjustment direction such that The sharpness statistical value of a multi-frame image shows an increasing trend, and the multi-frame image includes the first image and at least one frame of image adjacent to the first image collected by the first photographing device; The object distance of the first photographing device is adjusted to a target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images.
图7为本发明实施例提供的一种拍摄设备的结构示意图,如图7所示,该拍摄设备包括:FIG. 7 is a schematic structural diagram of a photographing device provided by an embodiment of the present invention. As shown in FIG. 7, the photographing device includes:
镜头组件21,传感器模块22,以及如图6所示的对焦装置23。The lens assembly 21, the sensor module 22, and the focusing device 23 as shown in FIG. 6.
其中,镜头组件21,设于拍摄设备的外壳内部。对焦装置23,设于外壳内部。传感器模块22,设于外壳内部并设于镜头组件21的后端,传感器模块22包括电路板以及成像传感器,成像传感器设于电路板的朝向镜头组件21的前表面。Among them, the lens assembly 21 is arranged inside the housing of the photographing device. The focusing device 23 is arranged inside the housing. The sensor module 22 is arranged inside the housing and at the rear end of the lens assembly 21. The sensor module 22 includes a circuit board and an imaging sensor. The imaging sensor is arranged on the front surface of the circuit board facing the lens assembly 21.
可以理解的是,该拍摄设备采集的图像会通过上述成像传感器进行成像,对焦装置23则用于对该拍摄设备采集的图像中包含的目标物体进行对焦处理。 该拍摄设备对应于上文中描述的第一拍摄设备,对焦装置23的执行过程参见前述实施例中的介绍,在此不赘述。It is understandable that the image collected by the photographing device will be imaged by the aforementioned imaging sensor, and the focusing device 23 is used for focusing processing on the target object contained in the image collected by the photographing device. The photographing device corresponds to the first photographing device described above. For the execution process of the focusing device 23, refer to the introduction in the foregoing embodiment, which is not repeated here.
图8为本发明实施例提供的一种可移动平台的结构示意图,在图8中,以该可移动平台实现为无人机为例进行的示意,当然,该可移动平台还可以实现为手持云台、云台车、电动汽车、电动自行车,等等。FIG. 8 is a schematic structural diagram of a movable platform provided by an embodiment of the present invention. In FIG. 8, the movable platform is implemented as a drone as an example. Of course, the movable platform can also be implemented as a handheld PTZ, PTZ vehicles, electric cars, electric bicycles, etc.
如图8所示,该可移动平台包括:机体31,设于机体31上的动力系统32,以及设于机体31上的第一拍摄设备33。As shown in FIG. 8, the movable platform includes: a body 31, a power system 32 provided on the body 31, and a first photographing device 33 provided on the body 31.
其中,动力系统32用于为可移动平台提供动力。Among them, the power system 32 is used to provide power for the movable platform.
其中,第一拍摄设备33为如图7所示的拍摄设备,用于拍摄第一图像,并对第一图像中的目标物体进行对焦处理。Wherein, the first photographing device 33 is a photographing device as shown in FIG. 7, which is used to photograph a first image and perform focusing processing on a target object in the first image.
可选地,该可移动平台还可以包括:设于机体31上的第二拍摄设备34。第一拍摄设备33的视场角小于第二拍摄设备34。Optionally, the movable platform may further include: a second photographing device 34 arranged on the body 31. The angle of view of the first photographing device 33 is smaller than that of the second photographing device 34.
其中,第二拍摄设备34用于拍摄包含所述目标物体的第二图像,并将所述第二图像传输至第一拍摄设备33,以供第一拍摄设备33根据所述目标物体在第二图像中对应的位置区域确定目标物体在所述第一图像中对应的位置区域。Wherein, the second photographing device 34 is used for photographing a second image containing the target object, and transmitting the second image to the first photographing device 33, so that the first photographing device 33 can use the target object in the second image according to the target object. The corresponding location area in the image determines the location area corresponding to the target object in the first image.
第一拍摄设备和第二拍摄设备的作用和工作过程,可以参见前述其他实施例中的介绍,在此不赘述。For the functions and working processes of the first photographing device and the second photographing device, reference may be made to the introduction in the foregoing other embodiments, which will not be repeated here.
另外,当可移动平台实现为无人机时,如图8所示,无人机上还可以包括设于机体31上的云台35,从而,第一拍摄设备33和第二拍摄设备34可以设置在云台35上,第一拍摄设备33和第二拍摄设备34通过云台35可以相对机体而移动。In addition, when the movable platform is implemented as an unmanned aerial vehicle, as shown in FIG. 8, the unmanned aerial vehicle may also include a pan/tilt 35 arranged on the body 31, so that the first photographing device 33 and the second photographing device 34 may be set On the pan-tilt 35, the first photographing device 33 and the second photographing device 34 can move relative to the body through the pan-tilt 35.
无人机的动力系统32可以包括电子调速器、一个或多个旋翼以及与该一个或多个旋翼对应的一个或多个电机。The power system 32 of the drone may include an electronic governor, one or more rotors, and one or more motors corresponding to the one or more rotors.
无人机上还可以设置诸如惯性测量单元等其他器件(图中未示出),在此不列举。Other devices such as an inertial measurement unit (not shown in the figure) can also be provided on the drone, which will not be listed here.
另外,本发明实施例还提供一种计算机可读存储介质,所述计算机可读 存储介质中存储有可执行代码,所述可执行代码用于实现如前述各实施例提供的对焦方法。In addition, an embodiment of the present invention also provides a computer-readable storage medium having executable code stored in the computer-readable storage medium, and the executable code is used to implement the focusing method provided in the foregoing embodiments.
以上各个实施例中的技术方案、技术特征在不相冲突的情况下均可以单独,或者进行组合,只要未超出本领域技术人员的认知范围,均属于本申请保护范围内的等同实施例。The technical solutions and technical features in each of the above embodiments can be singly or combined without conflict, as long as they do not exceed the cognitive scope of those skilled in the art, they all belong to equivalent embodiments within the protection scope of the present application.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the embodiments of the present invention, which do not limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the description and drawings of the present invention, or directly or indirectly applied to other related technologies In the same way, all fields are included in the scope of patent protection of the present invention.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments can still be modified, or some or all of the technical features can be equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention. range.

Claims (29)

  1. 一种对焦方法,其特征在于,所述方法包括:A focusing method, characterized in that the method includes:
    确定在第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域;其中,所述第一位置区域为覆盖所述目标物体且小于所述第一图像的区域;Determine a first location area corresponding to a target object in a first image captured by a first photographing device; wherein the first location area is an area that covers the target object and is smaller than the first image;
    设置所述第一图像中所述第一位置区域所对应的图像清晰度具有第一权重;其中,所述第一图像中除所述第一位置区域外的其他区域所对应的图像清晰度具有第二权重,所述第一权重大于所述第二权重;Set the image definition corresponding to the first position area in the first image to have a first weight; wherein, the image definition corresponding to the areas other than the first position area in the first image has A second weight, where the first weight is greater than the second weight;
    根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值;Acquiring a sharpness statistical value of the first image according to the first weight and the second weight;
    若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理。If the sharpness statistical value of the first image meets the set focus condition, then focus processing is performed on the target object.
  2. 根据权利要求1所述的方法,其特征在于,所述图像清晰度包括图像梯度值;The method according to claim 1, wherein the image definition includes an image gradient value;
    所述根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值,包括:The acquiring the sharpness statistical value of the first image according to the first weight and the second weight includes:
    根据所述第一权重和所述第二权重对所述第一位置区域所对应的图像梯度值与所述其他位置区域所对应的图像梯度值进行加权求和计算,以得到所述第一图像的清晰度统计值。Perform a weighted sum calculation on the image gradient value corresponding to the first location area and the image gradient value corresponding to the other location area according to the first weight and the second weight to obtain the first image The clarity statistics.
  3. 根据权利要求1所述的方法,其特征在于,所述若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理,包括:The method according to claim 1, wherein if the statistical value of the sharpness of the first image meets a set focusing condition, performing focusing processing on the target object comprises:
    若所述第一图像的清晰度统计值与参考图像的清晰度统计值差值大于设定阈值,则对所述目标物体进行对焦处理,所述参考图像是已经对焦的图像。If the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than the set threshold, then focus processing is performed on the target object, and the reference image is an image that has been focused.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    以完成对焦后拍得的图像更新所述参考图像。The reference image is updated with the image taken after focusing.
  5. 根据权利要求1所述的方法,其特征在于,所述第二权重设置为0。The method according to claim 1, wherein the second weight is set to zero.
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若所述第一位置区域不位于所述第一拍摄设备的画面中心区域,则根据所述第一位置区域与所述第一拍摄设备的主光轴的相对位置将所述第一位置 区域移动至所述画面中心区域。If the first position area is not located in the central area of the screen of the first photographing device, move the first position area according to the relative position of the first position area and the main optical axis of the first photographing device To the central area of the screen.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述确定在第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域,包括:The method according to any one of claims 1 to 6, wherein the determining the first location area corresponding to the target object in the first image captured by the first photographing device comprises:
    在第二拍摄设备采集的第二图像中识别出所述目标物体;Identifying the target object in the second image collected by the second photographing device;
    根据所述目标物体在所述第二图像中对应的第二位置区域以及所述第一拍摄设备与所述第二拍摄设备的图像坐标系映射关系,确定目标物体在所述第一图像中对应的所述第一位置区域;According to the second location area corresponding to the target object in the second image and the image coordinate system mapping relationship between the first photographing device and the second photographing device, it is determined that the target object corresponds to the first image The first location area;
    其中,所述第一图像与所述第二图像的拍摄时间相同。Wherein, the shooting time of the first image and the second image are the same.
  8. 根据权利要求7所述的方法,其特征在于,所述第一拍摄设备的视场角小于所述第二拍摄设备。The method according to claim 7, wherein the angle of view of the first photographing device is smaller than that of the second photographing device.
  9. 根据权利要求7所述的方法,其特征在于,所述第一拍摄设备为可见光变焦相机,所述第二拍摄设备为红外相机或可见光广角相机。The method according to claim 7, wherein the first photographing device is a visible light zoom camera, and the second photographing device is an infrared camera or a visible light wide-angle camera.
  10. 根据权利要求9所述的方法,其特征在于,所述第二拍摄设备为红外相机,所述在第二拍摄设备采集的第二图像中识别出所述目标物体,包括:The method according to claim 9, wherein the second photographing device is an infrared camera, and the recognizing the target object in the second image collected by the second photographing device comprises:
    根据所述目标物体的温度特征在所述第二图像中识别出所述目标物体。The target object is identified in the second image according to the temperature characteristic of the target object.
  11. 根据权利要求9所述的方法,其特征在于,所述第二拍摄设备为可见光广角相机,所述在第二拍摄设备采集的第二图像中识别出所述目标物体,包括:The method of claim 9, wherein the second photographing device is a visible light wide-angle camera, and the recognizing the target object in the second image collected by the second photographing device comprises:
    根据所述目标物体的可见光特征在所述第二图像中识别出所述目标物体。The target object is identified in the second image according to the visible light characteristic of the target object.
  12. 根据权利要求1所述的方法,其特征在于,所述对所述目标物体进行对焦处理,包括:The method according to claim 1, wherein the performing focus processing on the target object comprises:
    确定所述第一拍摄设备的物距调节方向,其中,根据所述物距调节方向调节物距使得多帧图像的清晰度统计值呈变大趋势,所述多帧图像中包括所述第一图像以及由所述第一拍摄设备采集的与所述第一图像相邻的至少一帧图像;The object distance adjustment direction of the first photographing device is determined, wherein the object distance is adjusted according to the object distance adjustment direction so that the statistical value of the sharpness of a multi-frame image tends to become larger, and the multi-frame image includes the first An image and at least one frame of image adjacent to the first image collected by the first photographing device;
    将所述第一拍摄设备的物距调节到目标物距,所述目标物距与多帧图像中的最大清晰度统计值对应。The object distance of the first photographing device is adjusted to a target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images.
  13. 一种对焦装置,其特征在于,设于第一拍摄设备,所述对焦装置包括:存储器、处理器;其中,所述存储器上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器实现:A focusing device, characterized in that it is provided in a first photographing device, the focusing device includes: a memory and a processor; wherein executable code is stored in the memory, and when the executable code is used by the processor When executed, the processor is made to realize:
    确定在所述第一拍摄设备采集的第一图像中目标物体所对应的第一位置区域;其中,所述第一位置区域为覆盖所述目标物体且小于所述第一图像的区域;Determining a first location area corresponding to a target object in a first image captured by the first photographing device; wherein the first location area is an area that covers the target object and is smaller than the first image;
    设置所述第一图像中所述第一位置区域所对应的图像清晰度具有第一权重;其中,所述第一图像中除所述第一位置区域外的其他区域所对应的图像清晰度具有第二权重,所述第一权重大于所述第二权重;Set the image definition corresponding to the first position area in the first image to have a first weight; wherein, the image definition corresponding to the areas other than the first position area in the first image has A second weight, where the first weight is greater than the second weight;
    根据所述第一权重和所述第二权重获取所述第一图像的清晰度统计值;Acquiring a sharpness statistical value of the first image according to the first weight and the second weight;
    若所述第一图像的清晰度统计值符合设定的对焦条件,则对所述目标物体进行对焦处理。If the sharpness statistical value of the first image meets the set focus condition, then focus processing is performed on the target object.
  14. 根据权利要求13所述的对焦装置,其特征在于,所述图像清晰度包括图像梯度值;The focusing device according to claim 13, wherein the image sharpness comprises an image gradient value;
    所述处理器具体用于:根据所述第一权重和所述第二权重对所述第一位置区域所对应的图像梯度值与所述其他位置区域所对应的图像梯度值进行加权求和计算,以得到所述第一图像的清晰度统计值。The processor is specifically configured to: perform a weighted sum calculation on the image gradient value corresponding to the first location area and the image gradient value corresponding to the other location areas according to the first weight and the second weight , In order to obtain the sharpness statistical value of the first image.
  15. 根据权利要求13所述的对焦装置,其特征在于,所述处理器具体用于:若所述第一图像的清晰度统计值与参考图像的清晰度统计值差值大于设定阈值,则对所述目标物体进行对焦处理,所述参考图像是已经对焦的图像。The focusing device according to claim 13, wherein the processor is specifically configured to: if the difference between the sharpness statistical value of the first image and the sharpness statistical value of the reference image is greater than a set threshold, The target object is subjected to focusing processing, and the reference image is an image that has been focused.
  16. 根据权利要求15所述的对焦装置,其特征在于,所述处理器还用于:以完成对焦后拍得的图像更新所述参考图像。The focusing device according to claim 15, wherein the processor is further configured to update the reference image with an image taken after focusing.
  17. 根据权利要求13所述的对焦装置,其特征在于,所述第二权重设置为0。The focusing device according to claim 13, wherein the second weight is set to zero.
  18. 根据权利要求13所述的对焦装置,其特征在于,所述处理器还用于:若所述第一位置区域不位于所述第一拍摄设备的画面中心区域,则根据所述第一位置区域与所述第一拍摄设备的主光轴的相对位置将所述第一位置区域 移动至所述画面中心区域。The focusing device according to claim 13, wherein the processor is further configured to: if the first location area is not located in the central area of the frame of the first photographing device, then according to the first location area The relative position with the main optical axis of the first photographing device moves the first position area to the center area of the screen.
  19. 根据权利要求13至18中任一项所述的对焦装置,其特征在于,所述处理器具体用于:The focusing device according to any one of claims 13 to 18, wherein the processor is specifically configured to:
    在第二拍摄设备采集的第二图像中识别出所述目标物体;根据所述目标物体在所述第二图像中对应的第二位置区域以及所述第一拍摄设备与所述第二拍摄设备的图像坐标系映射关系,确定目标物体在所述第一图像中对应的所述第一位置区域;其中,所述第一图像与所述第二图像的拍摄时间相同。Identify the target object in the second image captured by the second photographing device; according to the second location area corresponding to the target object in the second image and the first photographing device and the second photographing device The mapping relationship of the image coordinate system is determined to determine the first location area corresponding to the target object in the first image; wherein the shooting time of the first image and the second image are the same.
  20. 根据权利要求19所述的对焦装置,其特征在于,所述第一拍摄设备的视场角小于所述第二拍摄设备。The focusing device according to claim 19, wherein the angle of view of the first photographing device is smaller than that of the second photographing device.
  21. 根据权利要求19所述的对焦装置,其特征在于,所述第一拍摄设备为可见光变焦相机,所述第二拍摄设备为红外相机或可见光广角相机。The focusing device according to claim 19, wherein the first photographing device is a visible light zoom camera, and the second photographing device is an infrared camera or a visible light wide-angle camera.
  22. 根据权利要求21所述的对焦装置,其特征在于,所述第二拍摄设备为红外相机,所述处理器具体用于:The focusing device according to claim 21, wherein the second photographing device is an infrared camera, and the processor is specifically configured to:
    根据所述目标物体的温度特征在所述第二图像中识别出所述目标物体。The target object is identified in the second image according to the temperature characteristic of the target object.
  23. 根据权利要求21所述的对焦装置,其特征在于,所述第二拍摄设备为可见光广角相机,所述处理器具体用于:The focusing device according to claim 21, wherein the second photographing device is a visible light wide-angle camera, and the processor is specifically configured to:
    根据所述目标物体的可见光特征在所述第二图像中识别出所述目标物体。The target object is identified in the second image according to the visible light characteristic of the target object.
  24. 根据权利要求13所述的对焦装置,其特征在于,所述处理器具体用于:确定所述第一拍摄设备的物距调节方向,其中,根据所述物距调节方向调节物距使得多帧图像的清晰度统计值呈变大趋势,所述多帧图像中包括所述第一图像以及由所述第一拍摄设备采集的与所述第一图像相邻的至少一帧图像;将所述第一拍摄设备的物距调节到目标物距,所述目标物距与多帧图像中的最大清晰度统计值对应。The focusing device according to claim 13, wherein the processor is specifically configured to: determine an object distance adjustment direction of the first photographing device, wherein the object distance is adjusted according to the object distance adjustment direction so that multiple frames The sharpness statistical value of the image has a tendency to increase, and the multi-frame image includes the first image and at least one frame of image adjacent to the first image collected by the first photographing device; The object distance of the first photographing device is adjusted to the target object distance, and the target object distance corresponds to the maximum sharpness statistical value in the multiple frames of images.
  25. 一种拍摄设备,其特征在于,包括:A photographing equipment, characterized in that it comprises:
    镜头组件,设于所述拍摄设备的外壳内部;The lens assembly is arranged inside the housing of the photographing device;
    传感器模块,设于所述外壳内部并设于所述镜头组件的后端,所述传感器模块包括电路板以及成像传感器,所述成像传感器设于所述电路板的朝向 所述镜头组件的前表面;The sensor module is arranged inside the housing and at the rear end of the lens assembly, the sensor module includes a circuit board and an imaging sensor, and the imaging sensor is arranged on the front surface of the circuit board facing the lens assembly ;
    权利要求13至24中任一项所述的对焦装置,设于所述外壳内部。The focusing device according to any one of claims 13 to 24, which is provided inside the housing.
  26. 一种可移动平台,其特征在于,包括:A movable platform, characterized in that it comprises:
    机体;Body
    动力系统,设于所述机体上,用于为所述可移动平台提供动力;The power system is arranged on the body and used to provide power for the movable platform;
    权利要求25所述的拍摄设备,设于所述机体上,用于拍摄第一图像,并对所述第一图像中的目标物体进行对焦处理。The photographing device according to claim 25, which is arranged on the body and is used to photograph a first image and perform focus processing on a target object in the first image.
  27. 根据权利要求26所述的可移动平台,其特征在于,还包括:The movable platform according to claim 26, further comprising:
    另一拍摄设备,设于所述机体上,用于拍摄包含所述目标物体的第二图像,并将所述第二图像传输至所述拍摄设备,以供所述拍摄设备根据所述目标物体在所述第二图像中对应的位置区域确定所述目标物体在所述第一图像中对应的位置区域。Another photographing device is arranged on the body and used to photograph a second image containing the target object, and transmit the second image to the photographing device, so that the photographing device can use it according to the target object The corresponding location area in the second image determines the location area corresponding to the target object in the first image.
  28. 根据权利要求27所述的可移动平台,其特征在于,所述拍摄设备的视场角小于所述另一拍摄设备。The movable platform according to claim 27, wherein the angle of view of the photographing device is smaller than that of the another photographing device.
  29. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有可执行代码,所述可执行代码用于实现权利要求1至12中任一项所述的对焦方法。A computer-readable storage medium, wherein executable code is stored in the computer-readable storage medium, and the executable code is used to implement the focusing method according to any one of claims 1 to 12.
PCT/CN2019/129852 2019-12-30 2019-12-30 Focusing method and apparatus, photographing device, movable platform and storage medium WO2021134179A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/129852 WO2021134179A1 (en) 2019-12-30 2019-12-30 Focusing method and apparatus, photographing device, movable platform and storage medium
CN201980053920.0A CN112585941A (en) 2019-12-30 2019-12-30 Focusing method and device, shooting equipment, movable platform and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/129852 WO2021134179A1 (en) 2019-12-30 2019-12-30 Focusing method and apparatus, photographing device, movable platform and storage medium

Publications (1)

Publication Number Publication Date
WO2021134179A1 true WO2021134179A1 (en) 2021-07-08

Family

ID=75117329

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129852 WO2021134179A1 (en) 2019-12-30 2019-12-30 Focusing method and apparatus, photographing device, movable platform and storage medium

Country Status (2)

Country Link
CN (1) CN112585941A (en)
WO (1) WO2021134179A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810615A (en) * 2021-09-26 2021-12-17 展讯通信(上海)有限公司 Focusing processing method and device, electronic equipment and storage medium
CN113837079A (en) * 2021-09-24 2021-12-24 苏州贝康智能制造有限公司 Automatic focusing method and device for microscope, computer equipment and storage medium
CN113923358A (en) * 2021-10-09 2022-01-11 上海深视信息科技有限公司 Online automatic focusing method and system in flying shooting mode
CN114697548A (en) * 2022-03-21 2022-07-01 迈克医疗电子有限公司 Microscopic image shooting focusing method and device
CN114845050A (en) * 2022-04-15 2022-08-02 深圳市道通智能航空技术股份有限公司 Focusing method, camera device, unmanned aerial vehicle and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103096124A (en) * 2013-02-20 2013-05-08 浙江宇视科技有限公司 Auxiliary focusing method and auxiliary focusing device
CN108702435A (en) * 2017-04-26 2018-10-23 华为技术有限公司 A kind of terminal and camera
CN108769538A (en) * 2018-08-16 2018-11-06 Oppo广东移动通信有限公司 Atomatic focusing method, device, storage medium and terminal
US20190279342A1 (en) * 2017-03-01 2019-09-12 Fotonation Limited Method of providing a sharpness measure for an image
WO2019227441A1 (en) * 2018-05-31 2019-12-05 深圳市大疆创新科技有限公司 Video control method and device of movable platform

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408709B (en) * 2007-10-10 2010-09-29 鸿富锦精密工业(深圳)有限公司 Image viewfinding device and automatic focusing method thereof
CN102148965B (en) * 2011-05-09 2014-01-15 厦门博聪信息技术有限公司 Video monitoring system for multi-target tracking close-up shooting
KR101906827B1 (en) * 2012-04-10 2018-12-05 삼성전자주식회사 Apparatus and method for taking a picture continously
CN105898135A (en) * 2015-11-15 2016-08-24 乐视移动智能信息技术(北京)有限公司 Camera imaging method and camera device
CN106707674B (en) * 2015-11-17 2021-02-26 深圳光峰科技股份有限公司 Automatic focusing method of projection equipment and projection equipment
CN105407283B (en) * 2015-11-20 2018-12-18 成都因纳伟盛科技股份有限公司 A kind of multiple target initiative recognition tracing and monitoring method
CN105338248B (en) * 2015-11-20 2018-08-28 成都因纳伟盛科技股份有限公司 Intelligent multiple target active tracing monitoring method and system
CN105611158A (en) * 2015-12-23 2016-05-25 北京奇虎科技有限公司 Automatic focus following method and device and user equipment
CN109413324A (en) * 2017-08-16 2019-03-01 中兴通讯股份有限公司 A kind of image pickup method and mobile terminal
CN110035218B (en) * 2018-01-11 2021-06-15 华为技术有限公司 Image processing method, image processing device and photographing equipment
CN108419015B (en) * 2018-04-11 2020-08-04 浙江大华技术股份有限公司 Focusing method and device
CN108924427B (en) * 2018-08-13 2020-08-04 浙江大华技术股份有限公司 Camera focusing method and device and camera
CN110278383B (en) * 2019-07-25 2021-06-15 浙江大华技术股份有限公司 Focusing method, focusing device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103096124A (en) * 2013-02-20 2013-05-08 浙江宇视科技有限公司 Auxiliary focusing method and auxiliary focusing device
US20190279342A1 (en) * 2017-03-01 2019-09-12 Fotonation Limited Method of providing a sharpness measure for an image
CN108702435A (en) * 2017-04-26 2018-10-23 华为技术有限公司 A kind of terminal and camera
WO2019227441A1 (en) * 2018-05-31 2019-12-05 深圳市大疆创新科技有限公司 Video control method and device of movable platform
CN108769538A (en) * 2018-08-16 2018-11-06 Oppo广东移动通信有限公司 Atomatic focusing method, device, storage medium and terminal

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113837079A (en) * 2021-09-24 2021-12-24 苏州贝康智能制造有限公司 Automatic focusing method and device for microscope, computer equipment and storage medium
CN113810615A (en) * 2021-09-26 2021-12-17 展讯通信(上海)有限公司 Focusing processing method and device, electronic equipment and storage medium
CN113923358A (en) * 2021-10-09 2022-01-11 上海深视信息科技有限公司 Online automatic focusing method and system in flying shooting mode
CN114697548A (en) * 2022-03-21 2022-07-01 迈克医疗电子有限公司 Microscopic image shooting focusing method and device
CN114697548B (en) * 2022-03-21 2023-09-29 迈克医疗电子有限公司 Microscopic image shooting focusing method and device
CN114845050A (en) * 2022-04-15 2022-08-02 深圳市道通智能航空技术股份有限公司 Focusing method, camera device, unmanned aerial vehicle and storage medium

Also Published As

Publication number Publication date
CN112585941A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2021134179A1 (en) Focusing method and apparatus, photographing device, movable platform and storage medium
US8194995B2 (en) Fast camera auto-focus
US8335393B2 (en) Image processing apparatus and image processing method
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
CN108076278B (en) Automatic focusing method and device and electronic equipment
JP4794963B2 (en) Imaging apparatus and imaging program
JP4497211B2 (en) Imaging apparatus, imaging method, and program
US10027909B2 (en) Imaging device, imaging method, and image processing device
WO2017045558A1 (en) Depth-of-field adjustment method and apparatus, and terminal
JP6436783B2 (en) Image processing apparatus, imaging apparatus, image processing method, program, and storage medium
JP3823921B2 (en) Imaging device
US20110228053A1 (en) Stereoscopic imaging apparatus
US9485436B2 (en) Image processing apparatus and image processing method
US20110164868A1 (en) Method and apparatus for applying multi-autofocusing (af) using contrast af
US20170214845A1 (en) Focus detection apparatus, focus detection method, and image capturing apparatus
US20120019709A1 (en) Assisting focusing method using multiple face blocks
US10412321B2 (en) Imaging apparatus and image synthesis method
CN110753182B (en) Adjusting method and apparatus of image forming apparatus
CN108540720B (en) System and method for automatically selecting optimal image for bullet time
US20110164867A1 (en) Digital photographing apparatus and method that apply high-speed multi-autofocusing (af)
US10747089B2 (en) Imaging apparatus and control method of the same
KR20100079832A (en) Digital camera supporting an intelligent self-timer mode and controlling method for the same
CN105744158A (en) Video image display method and device and mobile terminal
US11770609B2 (en) Systems and methods for obtaining a super macro image
JP6071173B2 (en) Imaging apparatus, control method thereof, and program

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: 19958490

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19958490

Country of ref document: EP

Kind code of ref document: A1