WO2021035729A1 - 一种曝光方法、装置及摄像模组、电子设备 - Google Patents

一种曝光方法、装置及摄像模组、电子设备 Download PDF

Info

Publication number
WO2021035729A1
WO2021035729A1 PCT/CN2019/103836 CN2019103836W WO2021035729A1 WO 2021035729 A1 WO2021035729 A1 WO 2021035729A1 CN 2019103836 W CN2019103836 W CN 2019103836W WO 2021035729 A1 WO2021035729 A1 WO 2021035729A1
Authority
WO
WIPO (PCT)
Prior art keywords
exposure
area
global
picture
regions
Prior art date
Application number
PCT/CN2019/103836
Other languages
English (en)
French (fr)
Inventor
黄洪
王国栋
Original Assignee
中新智擎科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中新智擎科技有限公司 filed Critical 中新智擎科技有限公司
Priority to PCT/CN2019/103836 priority Critical patent/WO2021035729A1/zh
Priority to CN201980001756.9A priority patent/CN110710194B/zh
Publication of WO2021035729A1 publication Critical patent/WO2021035729A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/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/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time

Definitions

  • the embodiments of the present application relate to the field of electronic information technology, in particular to an exposure method, device, camera module, and electronic equipment.
  • the global exposure processing is usually performed, but the inventor found in the process of realizing the application that the global exposure processing lacks the exposure processing for the details of the picture, which easily leads to the partial overexposure or underexposure of the picture. In the case of exposure, it is impossible to get a clear picture.
  • the embodiments of the present application aim to provide an exposure method, device, camera module, and electronic equipment, which can reduce the occurrence of partial overexposure or underexposure of a picture, and ensure the shooting effect of the camera module.
  • a technical solution adopted in the embodiments of the present application is to provide an exposure method, including:
  • the determining whether there is an activity target in the global picture includes:
  • the binary image including white pixels and black pixels
  • the determining whether the activity target exists in the global picture according to the binary image includes:
  • the amplitude of change of at least one of the first regions is not less than the amplitude threshold, it is determined that the active target exists in the global picture.
  • the determining whether the change amplitude of each of the first regions is less than an amplitude threshold includes:
  • the ratio of the number of white pixels in the first region to the total number of pixels is not less than the amplitude threshold, it is determined that the change amplitude of the first region is not less than the amplitude threshold.
  • the performing partial exposure of the area includes:
  • the performing area partial exposure according to the target area includes:
  • the method before the step of performing regional local exposure or performing global exposure, the method further includes:
  • the method further includes:
  • an exposure device including:
  • the detection module is used to detect whether there is an object in the global picture
  • a determining module configured to determine whether there is an active target in the global picture when the object is not detected
  • the exposure module is used to perform regional local exposure when the active target exists in the global picture.
  • the determining module is specifically configured to:
  • the binary image including white pixels and black pixels
  • the determining module is specifically configured to:
  • the amplitude of change of at least one of the first regions is not less than the amplitude threshold, it is determined that the active target exists in the global picture.
  • the determining module is specifically configured to:
  • the ratio of the number of white pixels in the first region to the total number of pixels is not less than the amplitude threshold, it is determined that the change amplitude of the first region is not less than the amplitude threshold.
  • the exposure module is specifically used for:
  • the exposure module is specifically used for:
  • the exposure device further includes:
  • the stop module is used to stop updating the mixed Gaussian background model before performing regional local exposure or performing global exposure.
  • the acquiring module is further configured to acquire a partial picture including the object if the object is detected;
  • the exposure device further includes:
  • a calculation module for calculating the local average gray value of the partial picture
  • a judging module for judging whether the local average gray value satisfies a preset local target gray level condition
  • the exposure module is also used to perform partial exposure of the object according to the local average gray value
  • the exposure module is also used for global exposure.
  • a camera module including:
  • At least one processor and
  • the device can be used to perform the methods described above.
  • Another technical solution adopted in the embodiments of the present application is to provide an electronic device including the above-mentioned camera module.
  • another technical solution adopted in the embodiments of the present application is to provide a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium stores computer-executable instructions, so The computer-executable instructions are used to make the camera module execute the method described above.
  • the beneficial effect of the embodiments of the present application is that, different from the prior art, the embodiments of the present application provide an exposure method, a device, a camera module, and electronic equipment.
  • the exposure method after the global picture is acquired, the acquired If there is an object in the global picture of, if no object is detected, it is determined whether there is an active target in the global picture, if there is, then regional local exposure is performed, if not, then global exposure is performed. That is to say, this application can trigger the local exposure of the area by detecting the active target when the object in the global picture is not detected, which improves the probability of exposure processing for local details, thereby reducing the occurrence of local overexposure or underexposure in the picture. , So that the camera module can get clear pictures and ensure the shooting effect of the camera module.
  • FIG. 1 is a schematic flowchart of an exposure method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the structure of a binary image provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a global picture provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an exposure method provided by another embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an exposure device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an exposure apparatus provided by another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an exposure apparatus provided by another embodiment of the present application.
  • FIG. 8 is a schematic diagram of the hardware structure of a camera module provided by an embodiment of the present application.
  • the present application provides an exposure method and device.
  • the method and device are applied to a camera module, so that the camera module can increase the probability of performing partial exposure processing on a picture, and reduce the occurrence of partial over-exposure or under-exposure of the picture. Get clear pictures and ensure the shooting effect.
  • the camera module is a device capable of shooting video images, and the camera module may be a camera, a video camera, etc., or a camera module, etc.
  • the camera module can be applied to electronic equipment such as unmanned aerial vehicles and robots, so that the electronic equipment can realize visual detection and recognition based on the camera module.
  • FIG. 1 is a schematic flowchart of an exposure method provided by an embodiment of the present application.
  • the exposure method is executed by a camera module to increase the probability of performing partial exposure processing on a picture and ensure the shooting effect.
  • the exposure method includes:
  • the global picture is a complete picture directly obtained by the camera module, and the global picture may be an image frame of a video taken by the camera module or an image taken by the camera module.
  • the camera module when the camera module collects an image, it can collect an image with a size of m*n, and the image with a size of m*n is a global picture.
  • the global picture can be obtained through the camera of the camera module.
  • the above-mentioned "object” is a human face, and detecting whether there is an object in the global picture is to detect whether there is a human face in the global picture.
  • the object can also be a landscape, a pet, etc., which can be set according to actual applications.
  • a face detection algorithm based on deep learning can be used to detect whether there are features that match the facial features in the global picture. If there is a feature matching the face feature in the global picture, it is determined that the face is detected; if there is no feature matching the face feature in the global picture, it is determined that no face is detected.
  • step S300 If no object is detected, determine whether there is an active target in the global picture, if yes, go to step S400; if not, go to step S500.
  • the active target is a moving object in the global picture.
  • the frame difference method can be used to determine whether there is a moving target in the global picture, or the mixed Gaussian background model can be used to determine whether there is a moving target in the global picture.
  • the previous frame of the global picture is extracted, and the gray value of the pixel corresponding to the global picture and the previous frame is subtracted. If the corresponding pixel is After the absolute value of the subtracted gray value is greater than the preset threshold, the gray value of the pixel is determined to be 255. If the absolute value of the subtracted gray value of the corresponding pixel is less than or equal to the preset threshold, the pixel The gray value of the point is determined to be 0 to generate a binary image including black pixels (0) and white pixels (255). At this time, if there are white pixels in the binary image, it is determined that there is activity in the global picture Target, otherwise, determine that there is no active target in the global picture.
  • the Gaussian mixture background model When the Gaussian mixture background model is used to determine whether there are active targets in the global picture, a Gaussian mixture background model is established, and a binary image is generated according to the Gaussian mixture background model and the global picture, and then whether there are active targets in the global picture is determined according to the binary image.
  • the binary image includes white pixels and black pixels.
  • the Gaussian mixture background model when building a Gaussian mixture background model, initialize each Gaussian model matrix parameter, and extract T frames of images to train the Gaussian mixture background model; for the first pixel of the first frame of image, use the first mean and the first The variance constructs the first Gaussian model; for the subsequent pixels, if the gray value of the pixel is within 3 times the first variance, the pixel belongs to the first Gaussian model, and the parameters are updated; if the pixel is If the gray value of is not within the first variance of 3 times, the second Gaussian model is reconstructed according to the pixel.
  • each pixel in the global picture is matched with the mixed Gaussian background model, and the gray value of the matched pixel is determined to be 255 (white pixel).
  • the gray value of the pixel that fails to match is determined to be 0 (black pixel) to generate a binary image including black pixel (0) and white pixel (255).
  • the pixel is determined to be matched successfully, otherwise, the pixel is determined to be failed. .
  • the mixed Gaussian background model includes the first Gaussian model (first mean, first variance), the second Gaussian model (second mean, second variance), and the third Gaussian model (third mean, third Variance).
  • first mean, first variance the first mean, first variance
  • second mean, second variance the second Gaussian model
  • third mean, third Variance the third Gaussian model
  • the binary image When determining whether there is an active target in the global image based on the binary image, divide the binary image into multiple first regions (as shown in Figure 2), and then determine whether the change amplitude of each first region is less than the amplitude threshold. If the change amplitude of each first region is less than the amplitude threshold, it is determined that there is no active target in the global picture; if the change amplitude of at least one first region is not less than the amplitude threshold, it is determined that there is an active target in the global picture.
  • the plurality of first regions are arranged horizontally, and the size of each first region is the same.
  • the binary image is equally divided into 8 first regions, including first regions A to H; determine whether the change amplitude of the first region A is less than the amplitude threshold, and determine the change of the first region B Whether the amplitude is less than the amplitude threshold, determine whether the change amplitude of the first region C is less than the amplitude threshold, determine whether the change amplitude of the first region D is less than the amplitude threshold, determine whether the change amplitude of the first region E is less than the amplitude threshold, and determine the first region F Determine whether the change range of the first region G is less than the amplitude threshold, and determine whether the change range of the first region H is less than the amplitude threshold; if the change range of the first region A to H is less than the amplitude threshold, then It is determined that there is no active target in the global picture; if the amplitude of change in at least one of the first regions A to H is not less than the amplitude threshold, it is determined that there is an active target in the
  • the amplitude threshold when determining whether the change amplitude of each first area is less than the amplitude threshold, determine the total number of pixels in each first area and the number of white pixels, if the number of white pixels in the first area is equal to the total number of pixels If the ratio of is less than the amplitude threshold, it is determined that the change amplitude of the first region is less than the amplitude threshold; if the ratio of the number of white pixels in the first region to the total number of pixels is not less than the amplitude threshold, it is determined that the change amplitude of the first region is not less than Amplitude threshold.
  • each first area Since the size of each first area is equal, the total number of pixels in each first area is equal, and the total number of pixels in each first area is equal to the number of white pixels and the number of black pixels. with.
  • the total number of pixels in the first area F M6 and the number of white pixels m6 the total number of pixels in the first area G M7 and the number of white pixels m7, the total number of pixels in the first area H M8 and white pixels
  • the number of dots is m8; then, according to the ratio of the number of white pixels m1 to the total number of pixels M1 (m1/M1), the range of change in the first area A is determined.
  • the ratio (m2/M2) determines the range of change in the first area B, and the ratio of the number of white pixels m3 to the total number of pixels M3 (m3/M3) determines the range of change in the first area C, according to the number of white pixels
  • the ratio of m4 to the total number of pixels M4 determines the range of change in the first area D, and the ratio of the number of white pixels m5 to the total number of pixels M5 (m5/M5) determines the change in the first area E Amplitude, according to the ratio of the number of white pixels m6 to the total number of pixels M6 (m6/M6) to determine the range of change in the first area F, according to the ratio of the number of white pixels m7 to the total number of pixels M7 (m7/M7 ) Determine the range of change in the first region G, and determine the range of change in the first region H according to the ratio (m8/M8) of the number
  • the amplitude threshold is an empirical value pre-stored in the camera module, which can be set according to actual application conditions.
  • the amplitude threshold is preferably 1%. When the ratio of the number of white pixels in the first area to the total number of pixels is less than 1%, it is determined that the change amplitude of the first area is less than the amplitude threshold; If the ratio of the number of white pixels in a region to the total number of pixels is not less than 1%, it is determined that the change range of the first region is not less than the range threshold.
  • the first region with the largest change amplitude is determined as the target region, and the regional partial exposure is performed according to the target region.
  • the range of change in the first regions A to C is less than the amplitude threshold, and the range of change in the first region D to H is not less than the amplitude threshold, then in the first region D to H
  • the first area with the largest variation amplitude is determined as the target area. Since the first area E has the largest variation amplitude, the first area E is determined as the target area.
  • the first area with the largest ratio of the number of white pixels to the total number of pixels is determined as the first area with the largest variation. Since the total number of pixels in each first area is equal, the first area with the largest number of white pixels can be determined as the first area with the largest variation.
  • the global image is equally divided into a plurality of second regions (as shown in FIG. 3).
  • the global picture is equally divided into a plurality of second areas consistent with the first area. That is, when the global picture and the binary image center correspondingly overlap, the second area corresponds to the first area in a one-to-one correspondence.
  • the global image is equally divided into 8 second areas, including second areas A to H, where the second area A corresponds to the first area A, and the second area B corresponds to the first area B ,
  • the second area C corresponds to the first area C
  • the second area D corresponds to the first area D
  • the second area E corresponds to the first area E
  • the second area F corresponds to the first area F
  • the second area G corresponds to The first area G corresponds to the second area H corresponds to the first area H.
  • the second area corresponding to the target area is determined as the central area.
  • the second area Since the second area has a one-to-one correspondence with the first area, after the target area is determined, the second area corresponding to the target area can be determined.
  • the second area E is determined as the central area.
  • extract 2t+1 second regions for regional local exposure that is, extract 5 second regions (P regions) and 3 second regions ( Q area), 1 second area (R area), 3 second areas (Q area), and 5 second areas (P area) for area partial exposure, that is, first area P area is exposed.
  • the P area since the extracted second area is centered on the central area, the P area includes the second areas C to G, the Q area includes the second areas D to F, and the R area includes the second area E (central area).
  • Performing regional partial exposure in the above-mentioned sequence from large area to small area to large area can prevent sudden brightness jumps caused by directly exposing small areas, and achieve a smooth transition of brightness.
  • the preset adjustment method when performing regional partial exposure for each area, calculate the regional average gray value of the area to be subjected to regional partial exposure. If the regional average gray value is greater than the preset regional target gray level condition, the preset adjustment method is adopted, and the adjustment is lowered. The exposure time and gain value of the camera module; if the average gray value of the area is less than the target gray level condition of the preset area, the preset adjustment method is adopted to increase the exposure time and gain value of the camera module.
  • the target gray scale condition of the preset area may be the target gray value of the preset area, or may be the target gray range of the preset area.
  • the global average gray value of the global picture is calculated, and if the global average gray value is greater than the preset global target gray level condition, the preset adjustment method is adopted to lower the exposure time and gain value of the camera module; if the global average If the gray value is less than the preset global target gray level condition, the preset adjustment method is adopted to increase the exposure time and gain value of the camera module.
  • the preset global target grayscale condition may be a preset global target grayscale value or a preset global target grayscale range.
  • step S400 or step S500 in order to prevent the change of background brightness after exposure from affecting the detection of moving targets, before step S400 or step S500 is executed, the update of the Gaussian mixture background model will be stopped, and before step S400 or After step S500, the mixed Gaussian background model is re-established.
  • the exposure method further includes:
  • step S800 Determine whether the local average gray value meets the preset local target gray level condition, if it is not met, go to step S900; if it is met, go to step S500.
  • the local average gray value is equal to the preset local target gray condition, it is determined that the local average gray value meets the preset local target gray condition; if the local average gray value is not equal to the preset local target gray condition, It is determined that the local average gray value does not meet the preset local target gray level condition.
  • the preset local target gray scale condition may be a preset local target gray value or a preset local target gray range.
  • the preset local target grayscale condition is the preset local target grayscale range
  • the local average grayscale value is equal to the preset local target grayscale condition; if If the local average gray value exceeds the preset local target gray range, the local average gray value is not equal to the preset local target gray condition.
  • S900 Perform partial exposure of the object according to the local average gray value.
  • the preset adjustment method is adopted to lower the exposure time and gain value of the camera module; if the local average gray value is less than the preset local target gray level Conditions, the preset adjustment method is adopted to increase the exposure time and gain value of the camera module.
  • the camera module detects an object in the process of determining whether there is a moving target in the global picture, it stops the step of determining whether there is a moving target in the global picture, and performs steps S600-S800 .
  • the exposure frequency when adjusting the exposure time and gain value of the camera module, can be adjusted according to the performance of the camera module to achieve smooth exposure.
  • the active target is detected when the object in the acquired global picture is not detected to trigger the local exposure of the area, which improves the probability of exposure processing for local details, thereby reducing the local overexposure or overexposure of the picture.
  • the occurrence of underexposure enables the camera module to obtain clear pictures and ensures the shooting effect of the camera module.
  • FIG. 5 is a schematic structural diagram of an exposure device provided by an embodiment of the present application.
  • the functions of each module of the exposure device are executed by the camera module to increase the probability of partial exposure processing of the picture and ensure the shooting effect.
  • module used in the embodiments of the present application is a combination of software and/or hardware that can implement predetermined functions.
  • the devices described in the following embodiments can be implemented by software, implementation by hardware or a combination of software and hardware may also be conceived.
  • the exposure device includes:
  • the obtaining module 10 is used to obtain a global picture
  • the detection module 20 is used to detect whether there is an object in the global picture
  • the determining module 30 is configured to determine whether there is an active target in the global picture when the object is not detected;
  • the exposure module 40 is configured to perform regional partial exposure when the active target exists in the global picture.
  • the determining module 30 is specifically configured to:
  • the binary image including white pixels and black pixels
  • the determining module 30 is specifically configured to:
  • the amplitude of change of at least one of the first regions is not less than the amplitude threshold, it is determined that the active target exists in the global picture.
  • the determining module 30 is specifically configured to:
  • the ratio of the number of white pixels in the first region to the total number of pixels is not less than the amplitude threshold, it is determined that the change amplitude of the first region is not less than the amplitude threshold.
  • the exposure module 40 is specifically used for:
  • the exposure module 40 is specifically used for:
  • the exposure device further includes:
  • the stop module 50 is configured to stop updating the mixed Gaussian background model before performing regional local exposure or performing global exposure.
  • the obtaining module 10 is further configured to obtain a partial picture including the object if the object is detected;
  • the exposure device also includes:
  • the calculation module 60 is used to calculate the local average gray value of the partial picture
  • the judging module 70 is used to judge whether the local average gray value meets a preset local target gray level condition
  • the exposure module 40 is further configured to perform partial exposure of the object according to the local average gray value
  • the exposure module 40 is also used for global exposure.
  • the content of the device embodiment can be quoted from the method embodiment on the premise that the content does not conflict with each other, which will not be repeated here.
  • the acquisition module 10, the detection module 20, the determination module 30, the exposure module 40, the stop module 50, the calculation module 60, and the judgment module 70 may be processing chips of the camera module.
  • the active target is detected when the object in the acquired global picture is not detected to trigger the local exposure of the area, which improves the probability of exposure processing for local details, thereby reducing the local overexposure or overexposure of the picture.
  • the occurrence of underexposure enables the camera module to obtain clear pictures and ensures the shooting effect of the camera module.
  • FIG. 8 is a schematic diagram of the hardware structure of a camera module provided by an embodiment of the present application, including:
  • processors 110 and memory 120. Among them, one processor 110 is taken as an example in FIG. 8.
  • the processor 110 and the memory 120 may be connected through a bus or in other ways.
  • the connection through a bus is taken as an example.
  • the memory 120 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, as corresponding to an exposure method in the above-mentioned embodiment of the present application.
  • Program instructions and a module corresponding to an exposure device for example, the acquisition module 10, the detection module 20, the determination module 30, the exposure module 40, the stop module 50, the calculation module 60, and the judgment module 70, etc.
  • the processor 110 executes various functional applications and data processing of an exposure method by running non-volatile software programs, instructions, and modules stored in the memory 120, that is, implements an exposure method and data processing in the above method embodiments.
  • the memory 120 may include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of an exposure device.
  • the storage data area also stores preset data, including preset local target grayscale conditions, preset regional target grayscale conditions, preset global target grayscale conditions, preset thresholds, preset adjustment methods, amplitude thresholds, etc. .
  • the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 120 may optionally include memories remotely provided with respect to the processor 110, and these remote memories may be connected to the processor 110 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the program instructions and one or more modules are stored in the memory 120, and when executed by the one or more processors 110, each step of an exposure method in any of the foregoing method embodiments is executed, or, The function of each module of an exposure device in any of the above-mentioned device embodiments is realized.
  • the above-mentioned products can execute the methods provided in the above-mentioned embodiments of the present application, and have functional modules and beneficial effects corresponding to the execution methods.
  • functional modules and beneficial effects corresponding to the execution methods For technical details that are not described in detail in this embodiment, please refer to the method provided in the above embodiment of this application.
  • the embodiment of the present application also provides a non-volatile computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, FIG. 8
  • a processor 110 in any of the foregoing method embodiments may enable a computer to execute each step of an exposure method in any of the foregoing method embodiments, or implement the functions of each module of an exposure device in any of the foregoing device embodiments.
  • the embodiments of the present application also provide a computer program product.
  • the computer program product includes a computer program stored on a non-volatile computer-readable storage medium.
  • the computer program includes program instructions.
  • multiple processors, such as a processor 110 in FIG. 8, can make a computer execute each step of an exposure method in any of the foregoing method embodiments, or implement an exposure device in any of the foregoing device embodiments The functions of the various modules.
  • the device embodiments described above are merely illustrative.
  • the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each embodiment can be implemented by software plus a general hardware platform, and of course, it can also be implemented by hardware.
  • a person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by computer programs instructing relevant hardware.
  • the programs can be stored in a computer-readable storage medium, and the program can be executed during execution. At the time, it may include the flow of the implementation method of each method as described above.
  • the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Abstract

一种曝光方法、装置及摄像模组、电子设备,涉及电子信息技术领域。其中,曝光方法包括:获取全局图片(S100);检测全局图片是否存在物体(S200);若未检测到物体,则确定全局图片中是否存在活动目标(S300);若全局图片中存在活动目标,则进行区域局部曝光(S400);若全局图片中不存在活动目标,则进行全局曝光(S500)。能够减少图片局部过曝光或欠曝光情况的出现,保证摄像模组的拍摄效果。

Description

一种曝光方法、装置及摄像模组、电子设备 技术领域
本申请实施例涉及电子信息技术领域,特别是涉及一种曝光方法、装置及摄像模组、电子设备。
背景技术
随着深度学习技术和海量数据在机器视觉中的普及,越来越多基于摄像模组的机器视觉产品走向成熟。然而,基于视觉检测和识别的产品的稳定性除了受深度神经网络及海量训练数据的影响外,还受摄像模组本身的硬件影响。比如,在一些复杂光照条件下,如低照度或逆光情况下,摄像模组获取的图片质量较差,则会严重制约计算机视觉算法的准确性。因此,摄像模组通常需要进行曝光处理,以提高所获取图片的质量。
目前,摄像模组进行曝光处理时,通常进行全局曝光处理,但发明人在实现本申请的过程中发现:全局曝光处理缺少对图片细节处的曝光处理,容易导致图片局部仍存在过曝光或欠曝光的情况,无法得到清晰的图片。
发明内容
本申请实施例旨在提供一种曝光方法、装置及摄像模组、电子设备,能够减少图片局部过曝光或欠曝光情况的出现,保证摄像模组的拍摄效果。
为解决上述技术问题,本申请实施例采用的一个技术方案是:提供一种曝光方法,包括:
获取全局图片;
检测所述全局图片是否存在物体;
若未检测到所述物体,则确定所述全局图片中是否存在活动目标;
若所述全局图片中存在所述活动目标,则进行区域局部曝光;
若所述全局图片中不存在所述活动目标,则进行全局曝光。
可选地,所述确定所述全局图片中是否存在活动目标,包括:
建立混合高斯背景模型;
根据所述混合高斯背景模型和所述全局图片生成二值图像,所述二值图像包括白色像素点和黑色像素点;
根据所述二值图像确定所述全局图片中是否存在所述活动目标。
可选地,所述根据所述二值图像确定所述全局图片中是否存在所述活动目标,包括:
将所述二值图像等分为多个第一区域,所述多个第一区域横向排列;
确定每个所述第一区域的变化幅度是否小于幅度阈值;
若每个所述第一区域的变化幅度均小于所述幅度阈值,则确定所述全局图片中不存在所述活动目标;
若至少一个所述第一区域的变化幅度不小于所述幅度阈值,则确定所述全局图片中存在所述活动目标。
可选地,所述确定每个所述第一区域的变化幅度是否小于幅度阈值,包括:
确定每个所述第一区域中像素点的总数以及白色像素点的数量;
若所述第一区域中白色像素点的数量与像素点的总数的比值小于所述幅度阈值,则确定所述第一区域的变化幅度小于所述幅度阈值;
若所述第一区域中白色像素点的数量与像素点的总数的比值不小于所述幅度阈值,则确定所述第一区域的变化幅度不小于所述幅度阈值。
可选地,所述进行区域局部曝光,包括:
确定所述变化幅度最大的第一区域作为目标区域;
根据所述目标区域进行区域局部曝光。
可选地,所述根据所述目标区域进行区域局部曝光,包括:
将所述全局图片等分为多个第二区域,所述第二区域与所述第一区域一一对应;
确定与所述目标区域对应的第二区域作为中心区域;
依次提取以所述中心区域为中心的2t+1个第二区域进行区域局部曝光,其中,t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2,n为所述第二区域的数量。
可选地,在所述进行区域局部曝光或所述进行全局曝光的步骤之前,所述方法还包括:
停止更新所述混合高斯背景模型。
可选地,所述方法还包括:
若检测到所述物体,则获取包括所述物体的局部图片;
计算所述局部图片的局部平均灰度值;
判断所述局部平均灰度值是否满足预设局部目标灰度条件;
若不满足,则根据所述局部平均灰度值进行物体局部曝光;
否则,进行全局曝光。
为解决上述技术问题,本申请实施例采用的另一个技术方案是:提供一种曝光装置,包括:
获取模块,用于获取全局图片;
检测模块,用于检测所述全局图片是否存在物体;
确定模块,用于在未检测到所述物体时,确定所述全局图片中是否存在活动目标;
曝光模块,用于在所述全局图片中存在所述活动目标时,进行区域局部曝光;以及
用于在所述全局图片中不存在所述活动目标时,进行全局曝光。
可选地,所述确定模块具体用于:
建立混合高斯背景模型;
根据所述混合高斯背景模型和所述全局图片生成二值图像,所述二值图像包括白色像素点和黑色像素点;
根据所述二值图像确定所述全局图片中是否存在所述活动目标。
可选地,所述确定模块具体用于:
将所述二值图像等分为多个第一区域,所述多个第一区域横向排 列;
确定每个所述第一区域的变化幅度是否小于幅度阈值;
若每个所述第一区域的变化幅度均小于所述幅度阈值,则确定所述全局图片中不存在所述活动目标;
若至少一个所述第一区域的变化幅度不小于所述幅度阈值,则确定所述全局图片中存在所述活动目标。
可选地,所述确定模块具体用于:
确定每个所述第一区域中像素点的总数以及白色像素点的数量;
若所述第一区域中白色像素点的数量与像素点的总数的比值小于所述幅度阈值,则确定所述第一区域的变化幅度小于所述幅度阈值;
若所述第一区域中白色像素点的数量与像素点的总数的比值不小于所述幅度阈值,则确定所述第一区域的变化幅度不小于所述幅度阈值。
可选地,所述曝光模块具体用于:
确定所述变化幅度最大的第一区域作为目标区域;
根据所述目标区域进行区域局部曝光。
可选地,所述曝光模块具体用于:
将所述全局图片等分为多个第二区域,所述第二区域与所述第一区域一一对应;
确定与所述目标区域对应的第二区域作为中心区域;
依次提取以所述中心区域为中心的2t+1个第二区域进行区域局部曝光,其中,t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2,n为所述第二区域的数量。
可选地,所述曝光装置还包括:
停止模块,用于在进行区域局部曝光或进行全局曝光之前,停止更新所述混合高斯背景模型。
可选地,
所述获取模块还用于若检测到所述物体,则获取包括所述物体的局部图片;
所述曝光装置还包括:
计算模块,用于计算所述局部图片的局部平均灰度值;
判断模块,用于判断所述局部平均灰度值是否满足预设局部目标灰度条件;
若不满足,则所述曝光模块还用于根据所述局部平均灰度值进行物体局部曝光;
否则,所述曝光模块还用于进行全局曝光。
为解决上述技术问题,本申请实施例采用的另一个技术方案是:提供一种摄像模组,包括:
至少一个处理器,以及
与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够用于执行以上所述的方法。
为解决上述技术问题,本申请实施例采用的另一个技术方案是:提供一种电子设备,包括以上所述的摄像模组。
为解决上述技术问题,本申请实施例采用的另一个技术方案是:提供一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使摄像模组执行以上所述的方法。
本申请实施例的有益效果是:区别于现有技术的情况下,本申请实施例提供一种曝光方法、装置及摄像模组、电子设备,在曝光方法中,获取全局图片后,检测所获取的全局图片是否存在物体,若未检测到物体,则确定全局图片中是否存在活动目标,若存在,则进行区域局部曝光,若不存在,则进行全局曝光。即本申请能够在未检测到全局图片中的物体时,通过对活动目标的检测来触发区域局部曝光,提高了对局部细节进行曝光处理的几率,进而减少图片局部过曝光或欠曝光情况的出现,使得摄像模组能够得到清晰的图片,保证了摄像模组的拍摄效果。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是本申请实施例提供的一种曝光方法的流程示意图;
图2是本申请实施例提供的二值图像的结构示意图;
图3是本申请实施例提供的全局图片的结构示意图;
图4是本申请另一实施例提供的一种曝光方法的流程示意图;
图5是本申请实施例提供的一种曝光装置的结构示意图;
图6是本申请另一实施例提供的一种曝光装置的结构示意图;
图7是本申请又一实施例提供的一种曝光装置的结构示意图;
图8是本申请实施例提供的一种摄像模组的硬件结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整的描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,当元件被表述“固定于”另一个元件,它可以直接在另一个元件上、或者其间可以存在一个或多个居中的元件。当一个元件被表述“连接”另一个元件,它可以是直接连接到另一个元件、或者其间可以存在一个或多个居中的元件。本说明书所使用的术语“垂直的”、“水平的”、“左”、“右”以及类似的表述只是为了说明的目的。
此外,下面所描述的本申请各个实施例中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。
本申请提供了一种曝光方法及装置,该方法及装置应用于摄像模组,从而使得摄像模组能够提高对图片进行局部曝光处理的几率,减少图片局部过曝光或欠曝光情况的出现,以得到清晰的图片,保证拍摄效果。
其中,摄像模组为能够拍摄视频图像的器件,该摄像模组可以为照相机、摄像机等,也可以为摄像头模块等。
该摄像模组能够应用于无人飞行器、机器人等电子设备中,以使电子设备能够基于摄像模组实现视觉检测和识别。
下面,将通过具体实施例对本申请进行具体阐述。
请参阅图1,是本申请实施例提供的一种曝光方法的流程示意图,该曝光方法由摄像模组执行,用于提高对图片进行局部曝光处理的几率,保证拍摄效果。
具体地,该曝光方法包括:
S100:获取全局图片。
其中,全局图片为摄像模组直接获取到的完整图片,该全局图片可以为摄像模组拍摄的视频的图像帧,也可以为摄像模组拍摄的图像。
举例而言,摄像模组采集图像时,能够采集m*n大小的图像,则该m*n大小的图像即为全局图片。
具体地,该全局图片能够通过摄像模组的摄像头获取。
S200:检测全局图片是否存在物体。
在本申请实施例中,上述“物体”为人脸,检测全局图片是否存在物体亦即检测全局图片是否存在人脸。当然,在一些实施例中,该物体还可以为风景、宠物等,可以根据实际应用进行设定。
当检测全局图片是否存在人脸时,可采用基于深度学习的人脸检测算法,检测全局图片中是否存在与人脸特征匹配的特征。若全局图片中存在与人脸特征匹配的特征,则确定检测到人脸;若全局图片中不存在与人脸特征匹配的特征,则确定未检测到人脸。
S300:若未检测到物体,则确定全局图片中是否存在活动目标,若是,则转到步骤S400;若否,则转到步骤S500。
由于检测全局图片中是否存在物体时,若物体处于过曝光或欠曝光的状态,会导致物体的特征不明显,容易出现未检测到物体的情况,使得检测结果不准确,影响局部曝光,因此,为了进一步提高局部曝光的几率,在未检测到物体时,会确定全局图片中是否存在活动目标,以根据活动目标触发局部曝光。
其中,活动目标为全局图片中存在运动的物体。可以通过帧差法确定全局图片中是否存在活动目标,也可以通过混合高斯背景模型确定全局图片中是否存在活动目标。
当通过帧差法确定全局图片中是否存在活动目标时,提取全局图片的前一帧图像,将全局图片与前一帧图像对应的像素点的灰度值进行相减操作,若对应像素点的灰度值相减后的绝对值大于预设阈值,则将像素点的灰度值确定为255,若对应像素点的灰度值相减后的绝对值小于或等于预设阈值,则将像素点的灰度值确定为0,以生成包括黑色像素点(0)和白色像素点(255)的二值图像,此时,若二值图像中存在白色像素点,则确定全局图片中存在活动目标,否则,确定全局图片中不存在活动目标。
当通过混合高斯背景模型确定全局图片中是否存在活动目标时,建立混合高斯背景模型,并根据混合高斯背景模型和全局图片生成二值图像,然后根据二值图像确定全局图片中是否存在活动目标。其中,二值图像包括白色像素点和黑色像素点。
具体地,建立混合高斯背景模型时,初始化每个高斯模型矩阵参数,并提取T帧图像用来训练高斯混合背景模型;对于第一帧图像的第一个像素点,使用第一均值和第一方差构造第一高斯模型;对于后面来的像素点,如果该像素点的灰度值在3倍的第一方差内,则该像素点属于第一高斯模型,更新参数;如果该像素点的灰度值不在3倍的第一方差内,则根据该像素点重新构造第二高斯模型。
根据混合高斯背景模型和全局图片生成二值图像时,用全局图片中的每个像素点与混合高斯背景模型进行匹配,将匹配成功的像素点的灰度值确定为255(白色像素点),将匹配失败的像素点的灰度值确定为0 (黑色像素点),以生成包括黑色像素点(0)和白色像素点(255)的二值图像。
其中,若像素点的灰度值与混合高斯背景模型中的每个高斯模型的均值之差都大于对应高斯模型的方差的2倍,则确定该像素点匹配成功,否则,确定像素点匹配失败。
举例而言,混合高斯背景模型中包括第一高斯模型(第一均值,第一方差)、第二高斯模型(第二均值,第二方差)以及第三高斯模型(第三均值,第三方差),对于像素点A,若该像素点A的灰度值与第一均值之差大于第一方差的2倍,且该像素点A的灰度值与第二均值之差大于第二方差的2倍,且该像素点A的灰度值与第三均值之差大于第三方差的2倍,则确定该像素点匹配成功。
根据二值图像确定全局图片中是否存在活动目标时,将二值图像等分为多个第一区域(如图2所示),然后确定每个第一区域的变化幅度是否小于幅度阈值,若每个第一区域的变化幅度均小于幅度阈值,则确定全局图片中不存在活动目标;若至少一个第一区域的变化幅度不小于幅度阈值,则确定全局图片中存在活动目标。其中,多个第一区域横向排列,并且每个第一区域的尺寸均相等。
举例而言,请参阅图2,将二值图像等分为8个第一区域,包括第一区域A至H;确定第一区域A的变化幅度是否小于幅度阈值,确定第一区域B的变化幅度是否小于幅度阈值,确定第一区域C的变化幅度是否小于幅度阈值,确定第一区域D的变化幅度是否小于幅度阈值,确定第一区域E的变化幅度是否小于幅度阈值,确定第一区域F的变化幅度是否小于幅度阈值,确定第一区域G的变化幅度是否小于幅度阈值,确定第一区域H的变化幅度是否小于幅度阈值;若第一区域A至H的变化幅度均小于幅度阈值,则确定全局图片中不存在活动目标;若第一区域A至H中至少一个区域的变化幅度不小于幅度阈值,则确定全局图片中存在活动目标。
其中,确定每个第一区域的变化幅度是否小于幅度阈值时,确定每个第一区域中像素点的总数以及白色像素点的数量,若第一区域中白色 像素点的数量与像素点的总数的比值小于幅度阈值,则确定第一区域的变化幅度小于幅度阈值;若第一区域中白色像素点的数量与像素点的总数的比值不小于幅度阈值,则确定第一区域的变化幅度不小于幅度阈值。
由于每个第一区域的尺寸均相等,因此,每个第一区域中像素点的总数均相等,且每个第一区域中像素点的总数等于白色像素点的数量与黑色像素点的数量之和。
举例而言,请参阅图2,分别确定第一区域A中像素点的总数M1和白色像素点的数量m1、第一区域B中像素点的总数M2和白色像素点的数量m2、第一区域C中像素点的总数M3和白色像素点的数量m3、第一区域D中像素点的总数M4和白色像素点的数量m4、第一区域E中像素点的总数M5和白色像素点的数量m5、第一区域F中像素点的总数M6和白色像素点的数量m6、第一区域G中像素点的总数M7和白色像素点的数量m7、第一区域H中像素点的总数M8和白色像素点的数量m8;然后,根据白色像素点的数量m1与像素点的总数M1的比值(m1/M1)确定第一区域A的变化幅度,根据白色像素点的数量m2与像素点的总数M2的比值(m2/M2)确定第一区域B的变化幅度,根据白色像素点的数量m3与像素点的总数M3的比值(m3/M3)确定第一区域C的变化幅度,根据白色像素点的数量m4与像素点的总数M4的比值(m4/M4)确定第一区域D的变化幅度,根据白色像素点的数量m5与像素点的总数M5的比值(m5/M5)确定第一区域E的变化幅度,根据白色像素点的数量m6与像素点的总数M6的比值(m6/M6)确定第一区域F的变化幅度,根据白色像素点的数量m7与像素点的总数M7的比值(m7/M7)确定第一区域G的变化幅度,根据白色像素点的数量m8与像素点的总数M8的比值(m8/M8)确定第一区域H的变化幅度。其中,M1=M2=M3=M4=M5=M6=M7=M8。
其中,幅度阈值为预先存储于摄像模组中的经验值,可以根据实际应用情况进行设定。在本申请实施例中,该幅度阈值优选为1%,当第一区域中白色像素点的数量与像素点的总数的比值小于1%,则确定第一区域的变化幅度小于幅度阈值;若第一区域中白色像素点的数量与像素点 的总数的比值不小于1%,则确定第一区域的变化幅度不小于幅度阈值。
S400:进行区域局部曝光。
具体地,进行区域局部曝光时,在变化幅度不小于幅度阈值的第一区域中,确定变化幅度最大的第一区域作为目标区域,并根据目标区域进行区域局部曝光。
比如,请参阅图2,在第一区域A至H中,第一区域A至C的变化幅度小于幅度阈值,第一区域D至H的变化幅度不小于幅度阈值,则在第一区域D至H中确定变化幅度最大的第一区域作为目标区域,由于第一区域E的变化幅度最大,因此,将第一区域E确定为目标区域。
其中,将白色像素点的数量与像素点的总数的比值最大的第一区域确定为变化幅度最大的第一区域。由于每个第一区域中像素点的总数均相等,因此,能够将白色像素点的数量最多的第一区域确定为变化幅度最大的第一区域。
进一步地,根据目标区域进行区域局部曝光时,首先,将全局图片等分为多个第二区域(如图3所示)。
其中,全局图片等分为与第一区域一致的多个第二区域。即,当全局图片与二值图像中心对应重叠时,第二区域与第一区域一一对应。
比如,请参阅图3,将全局图片等分为8个第二区域,包括第二区域A至H,其中,第二区域A与第一区域A对应,第二区域B与第一区域B对应,第二区域C与第一区域C对应,第二区域D与第一区域D对应,第二区域E与第一区域E对应,第二区域F与第一区域F对应,第二区域G与第一区域G对应,第二区域H与第一区域H对应。
然后,确定与目标区域对应的第二区域作为中心区域。
由于第二区域与第一区域一一对应,当确定目标区域后,就能够确定与目标区域对应的第二区域。
比如,当将第一区域E确定为目标区域时,由于第一区域E与第二区域E对应,因此,将第二区域E确定为中心区域。
最后,依次提取以中心区域为中心的2t+1个第二区域进行区域局部曝光,其中,t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2,n 为第二区域的数量。
可以理解的是,依次提取以中心区域为中心的2t+1个第二区域进行区域局部曝光,即按照t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2的顺序依次提取2t+1个第二区域进行区域局部曝光,其中,所提取的第二区域以中心区域为中心。
比如,请参阅图3,假设第二区域的数量n=8,中心区域为第二区域E时,能够确定t=2,1,0,1,2。此时,按照t=2,1,0,1,2的顺序依次提取2t+1个第二区域进行区域局部曝光,即依次提取5个第二区域(P区域)、3个第二区域(Q区域)、1个第二区域(R区域)、3个第二区域(Q区域)和5个第二区域(P区域)进行区域局部曝光,亦即,先对P区域进行区域局部曝光,再对Q区域进行区域局部曝光,其次对R区域进行区域局部曝光,然后对Q区域进行区域局部曝光,最后对P区域进行区域局部曝光。其中,由于所提取的第二区域以中心区域为中心,因此,P区域包括第二区域C至G,Q区域包括第二区域D至F,R区域包括第二区域E(中心区域)。
按照上述由大区域到小区域再到大区域的顺序进行区域局部曝光,能够防止直接对小区域进行曝光所导致的亮度急剧跳变,实现亮度平滑过渡。
其中,对各区域进行区域局部曝光时,计算要进行区域局部曝光的区域的区域平均灰度值,若区域平均灰度值大于预设区域目标灰度条件,则采用预设调节方法,调低摄像模组的曝光时间和增益值;若区域平均灰度值小于预设区域目标灰度条件,则采用预设调节方法,调高摄像模组的曝光时间和增益值。该预设区域目标灰度条件可以为预设区域目标灰度值,也可以为预设区域目标灰度范围。
比如,当对P区域进行区域局部曝光时,则计算P区域的区域平均灰度值;当对Q区域进行区域局部曝光时,则计算Q区域的区域平均灰度值。
S500:进行全局曝光。
具体地,计算全局图片的全局平均灰度值,若全局平均灰度值大于 预设全局目标灰度条件,则采用预设调节方法,调低摄像模组的曝光时间和增益值;若全局平均灰度值小于预设全局目标灰度条件,则采用预设调节方法,调高摄像模组的曝光时间和增益值。该预设全局目标灰度条件可以为预设全局目标灰度值,也可以为预设全局目标灰度范围。
可以理解的是,在一些实施例中,为了防止曝光后背景亮度的变化对活动目标的检测造成影响,在执行步骤S400或步骤S500之前,会停止更新混合高斯背景模型,并在执行步骤S400或步骤S500之后,重新建立混合高斯背景模型。
进一步地,请参阅图4,在一些实施例中,该曝光方法还包括:
S600:若检测到物体,则获取包括物体的局部图片;
S700:计算局部图片的局部平均灰度值;
S800:判断局部平均灰度值是否满足预设局部目标灰度条件,若不满足,则转到步骤S900;若满足,则转到步骤S500。
具体地,若局部平均灰度值等于预设局部目标灰度条件,则确定局部平均灰度值满足预设局部目标灰度条件;若局部平均灰度值不等于预设局部目标灰度条件,则确定局部平均灰度值不满足预设局部目标灰度条件。
其中,预设局部目标灰度条件可以为预设局部目标灰度值,也可以为预设局部目标灰度范围。
当预设局部目标灰度条件为预设局部目标灰度范围时,若局部平均灰度值位于预设局部目标灰度范围内,则局部平均灰度值等于预设局部目标灰度条件;若局部平均灰度值超出预设局部目标灰度范围,则局部平均灰度值不等于预设局部目标灰度条件。
S900:根据局部平均灰度值进行物体局部曝光。
具体地,若局部平均灰度值大于预设局部目标灰度条件,则采用预设调节方法,调低摄像模组的曝光时间和增益值;若局部平均灰度值小于预设局部目标灰度条件,则采用预设调节方法,调高摄像模组的曝光时间和增益值。
可以理解的是,在一些实施例中,若摄像模组在确定全局图片中是 否存在活动目标的过程中检测到物体,则停止确定全局图片中是否存在活动目标的步骤,并执行步骤S600-S800。
进一步地,在一些实施例中,调节摄像模组的曝光时间和增益值时,能够根据摄像模组的性能调整曝光频率,实现平滑曝光。
在本申请实施例中,通过在未检测到所获取的全局图片中的物体时对活动目标进行检测来触发区域局部曝光,提高了对局部细节进行曝光处理的几率,进而减少图片局部过曝光或欠曝光情况的出现,使得摄像模组能够得到清晰的图片,保证了摄像模组的拍摄效果。
进一步地,请参阅图5,是本申请实施例提供的一种曝光装置的结构示意图,该曝光装置各个模块的功能由摄像模组执行,用于提高对图片进行局部曝光处理的几率,保证拍摄效果。
值得注意的是,本申请实施例所使用的术语“模块”为可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置可以以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能被构想的。
具体地,该曝光装置包括:
获取模块10,用于获取全局图片;
检测模块20,用于检测所述全局图片是否存在物体;
确定模块30,用于在未检测到所述物体时,确定所述全局图片中是否存在活动目标;
曝光模块40,用于在所述全局图片中存在所述活动目标时,进行区域局部曝光;以及
用于在所述全局图片中不存在所述活动目标时,进行全局曝光。
在一些实施例中,该确定模块30具体用于:
建立混合高斯背景模型;
根据所述混合高斯背景模型和所述全局图片生成二值图像,所述二值图像包括白色像素点和黑色像素点;
根据所述二值图像确定所述全局图片中是否存在所述活动目标。
在一些实施例中,该确定模块30具体用于:
将所述二值图像等分为多个第一区域,所述多个第一区域横向排列;
确定每个所述第一区域的变化幅度是否小于幅度阈值;
若每个所述第一区域的变化幅度均小于所述幅度阈值,则确定所述全局图片中不存在所述活动目标;
若至少一个所述第一区域的变化幅度不小于所述幅度阈值,则确定所述全局图片中存在所述活动目标。
在一些实施例中,该确定模块30具体用于:
确定每个所述第一区域中像素点的总数以及白色像素点的数量;
若所述第一区域中白色像素点的数量与像素点的总数的比值小于所述幅度阈值,则确定所述第一区域的变化幅度小于所述幅度阈值;
若所述第一区域中白色像素点的数量与像素点的总数的比值不小于所述幅度阈值,则确定所述第一区域的变化幅度不小于所述幅度阈值。
在一些实施例中,该曝光模块40具体用于:
确定所述变化幅度最大的第一区域作为目标区域;
根据所述目标区域进行区域局部曝光。
在一些实施例中,该曝光模块40具体用于:
将所述全局图片等分为多个第二区域,所述第二区域与所述第一区域一一对应;
确定与所述目标区域对应的第二区域作为中心区域;
依次提取以所述中心区域为中心的2t+1个第二区域进行区域局部曝光,其中,t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2,n为所述第二区域的数量。
在一些实施例中,请参阅图6,该曝光装置还包括:
停止模块50,用于在进行区域局部曝光或进行全局曝光之前,停止更新所述混合高斯背景模型。
在一些实施例中,获取模块10还用于若检测到所述物体,则获取包括所述物体的局部图片;
请参阅图7,曝光装置还包括:
计算模块60,用于计算所述局部图片的局部平均灰度值;
判断模块70,用于判断所述局部平均灰度值是否满足预设局部目标灰度条件;
若不满足,则曝光模块40还用于根据所述局部平均灰度值进行物体局部曝光;
否则,曝光模块40还用于进行全局曝光。
由于装置实施例和方法实施例是基于同一构思,在内容不互相冲突的前提下,装置实施例的内容可以引用方法实施例的,在此不再一一赘述。
在其他一些可替代实施例中,上述获取模块10、检测模块20、确定模块30、曝光模块40、停止模块50、计算模块60以及判断模块70可以为摄像模组的处理芯片。
在本申请实施例中,通过在未检测到所获取的全局图片中的物体时对活动目标进行检测来触发区域局部曝光,提高了对局部细节进行曝光处理的几率,进而减少图片局部过曝光或欠曝光情况的出现,使得摄像模组能够得到清晰的图片,保证了摄像模组的拍摄效果。
进一步地,请参阅图8,是本申请实施例提供的一种摄像模组的硬件结构示意图,包括:
一个或多个处理器110以及存储器120。其中,图8中以一个处理器110为例。
处理器110和存储器120可以通过总线或者其他方式连接,图8中以通过总线连接为例。
存储器120作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请上述实施例中的一种曝光方法对应的程序指令以及一种曝光装置对应的模块(例如,获取模块10、检测模块20、确定模块30、曝光模块40、停止模块50、计算模块60以及判断模块70等)。处理器110通过运行存储在存储器120中的非易失性软件程序、指令以及模块,从而执行一种 曝光方法的各种功能应用以及数据处理,即实现上述方法实施例中的一种曝光方法以及上述装置实施例的各个模块的功能。
存储器120可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据一种曝光装置的使用所创建的数据等。
所述存储数据区还存储有预设的数据,包括预设局部目标灰度条件、预设区域目标灰度条件、预设全局目标灰度条件、预设阈值、预设调节方法、幅度阈值等。
此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器120可选包括相对于处理器110远程设置的存储器,这些远程存储器可以通过网络连接至处理器110。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
所述程序指令以及一个或多个模块存储在所述存储器120中,当被所述一个或者多个处理器110执行时,执行上述任意方法实施例中的一种曝光方法的各个步骤,或者,实现上述任意装置实施例中的一种曝光装置的各个模块的功能。
上述产品可执行本申请上述实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请上述实施例所提供的方法。
本申请实施例还提供了一种非易失性计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个或多个处理器执行,例如图8中的一个处理器110,可使得计算机执行上述任意方法实施例中的一种曝光方法的各个步骤,或者,实现上述任意装置实施例中的一种曝光装置的各个模块的功能。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被一个或多个处理器执行,例如图 8中的一个处理器110,可使得计算机执行上述任意方法实施例中的一种曝光方法的各个步骤,或者,实现上述任意装置实施例中的一种曝光装置的各个模块的功能。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
通过以上的实施例的描述,本领域普通技术人员可以清楚地了解到各实施例可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机程序指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施方法的流程。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(RandomAccessMemory,RAM)等。
以上所述仅为本申请的实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;在本申请的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本申请的不同方面的许多其它变化,为了简明,它们没有在细节中提供;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (12)

  1. 一种曝光方法,其特征在于,包括:
    获取全局图片;
    检测所述全局图片是否存在物体;
    若未检测到所述物体,则确定所述全局图片中是否存在活动目标;
    若所述全局图片中存在所述活动目标,则进行区域局部曝光;
    若所述全局图片中不存在所述活动目标,则进行全局曝光。
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述全局图片中是否存在活动目标,包括:
    建立混合高斯背景模型;
    根据所述混合高斯背景模型和所述全局图片生成二值图像,所述二值图像包括白色像素点和黑色像素点;
    根据所述二值图像确定所述全局图片中是否存在所述活动目标。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述二值图像确定所述全局图片中是否存在所述活动目标,包括:
    将所述二值图像等分为多个第一区域,所述多个第一区域横向排列;
    确定每个所述第一区域的变化幅度是否小于幅度阈值;
    若每个所述第一区域的变化幅度均小于所述幅度阈值,则确定所述全局图片中不存在所述活动目标;
    若至少一个所述第一区域的变化幅度不小于所述幅度阈值,则确定所述全局图片中存在所述活动目标。
  4. 根据权利要求3所述的方法,其特征在于,所述确定每个所述第一区域的变化幅度是否小于幅度阈值,包括:
    确定每个所述第一区域中像素点的总数以及白色像素点的数量;
    若所述第一区域中白色像素点的数量与像素点的总数的比值小于所述幅度阈值,则确定所述第一区域的变化幅度小于所述幅度阈值;
    若所述第一区域中白色像素点的数量与像素点的总数的比值不小 于所述幅度阈值,则确定所述第一区域的变化幅度不小于所述幅度阈值。
  5. 根据权利要求3或4所述的方法,其特征在于,所述进行区域局部曝光,包括:
    确定所述变化幅度最大的第一区域作为目标区域;
    根据所述目标区域进行区域局部曝光。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述目标区域进行区域局部曝光,包括:
    将所述全局图片等分为多个第二区域,所述第二区域与所述第一区域一一对应;
    确定与所述目标区域对应的第二区域作为中心区域;
    依次提取以所述中心区域为中心的2t+1个第二区域进行区域局部曝光,其中,t=n/2-2,n/2-3,...,1,0,1,...,n/2-3,n/2-2,n为所述第二区域的数量。
  7. 根据权利要求2至6中任一项所述的方法,其特征在于,在所述进行区域局部曝光或所述进行全局曝光的步骤之前,所述方法还包括:
    停止更新所述混合高斯背景模型。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述方法还包括:
    若检测到所述物体,则获取包括所述物体的局部图片;
    计算所述局部图片的局部平均灰度值;
    判断所述局部平均灰度值是否满足预设局部目标灰度条件;
    若不满足,则根据所述局部平均灰度值进行物体局部曝光;
    否则,进行全局曝光。
  9. 一种曝光装置,其特征在于,包括:
    获取模块,用于获取全局图片;
    检测模块,用于检测所述全局图片是否存在物体;
    确定模块,用于在未检测到所述物体时,确定所述全局图片中是否 存在活动目标;
    曝光模块,用于在所述全局图片中存在所述活动目标时,进行区域局部曝光;以及
    用于在所述全局图片中不存在所述活动目标时,进行全局曝光。
  10. 一种摄像模组,其特征在于,包括:
    至少一个处理器,以及
    与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够用于执行如权利要求1至8中任一项所述的方法。
  11. 一种电子设备,其特征在于,包括如权利要求10所述的摄像模组。
  12. 一种非易失性计算机可读存储介质,其特征在于,所述非易失性计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使摄像模组执行如权利要求1至8中任一项所述的方法。
PCT/CN2019/103836 2019-08-30 2019-08-30 一种曝光方法、装置及摄像模组、电子设备 WO2021035729A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/103836 WO2021035729A1 (zh) 2019-08-30 2019-08-30 一种曝光方法、装置及摄像模组、电子设备
CN201980001756.9A CN110710194B (zh) 2019-08-30 2019-08-30 一种曝光方法、装置及摄像模组、电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/103836 WO2021035729A1 (zh) 2019-08-30 2019-08-30 一种曝光方法、装置及摄像模组、电子设备

Publications (1)

Publication Number Publication Date
WO2021035729A1 true WO2021035729A1 (zh) 2021-03-04

Family

ID=69193015

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103836 WO2021035729A1 (zh) 2019-08-30 2019-08-30 一种曝光方法、装置及摄像模组、电子设备

Country Status (2)

Country Link
CN (1) CN110710194B (zh)
WO (1) WO2021035729A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163101B (zh) * 2020-01-22 2023-02-28 浙江宇视科技有限公司 图像曝光调整方法、装置、设备和介质
CN113179375A (zh) * 2021-06-09 2021-07-27 北京澎思科技有限公司 曝光处理方法、装置、电子设备、存储介质及程序产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100158324A1 (en) * 2008-12-19 2010-06-24 Micro-Star Internationa'l Co., Ltd. Method for adjusting light source threshold value for face recognition
CN103051844A (zh) * 2012-12-31 2013-04-17 青岛中星微电子有限公司 一种图像背光补偿的方法及装置
CN106485729A (zh) * 2016-09-29 2017-03-08 江苏云光智慧信息科技有限公司 一种基于混合高斯模型的运动目标检测方法
CN106603933A (zh) * 2016-12-16 2017-04-26 中新智擎有限公司 一种曝光方法和装置
CN107147823A (zh) * 2017-05-31 2017-09-08 广东欧珀移动通信有限公司 曝光方法、装置、计算机可读存储介质和移动终端
CN107172364A (zh) * 2017-04-28 2017-09-15 努比亚技术有限公司 一种图像曝光补偿方法、装置和计算机可读存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008278430A (ja) * 2007-05-07 2008-11-13 Fujifilm Corp 撮像装置、撮像方法、及びプログラム
JP5898466B2 (ja) * 2011-11-11 2016-04-06 キヤノン株式会社 撮像装置、その制御方法、及びプログラム
CN105225254B (zh) * 2015-09-25 2017-12-05 凌云光技术集团有限责任公司 一种自动追踪局部目标的曝光方法及系统
CN105516589B (zh) * 2015-12-07 2018-07-03 凌云光技术集团有限责任公司 基于人脸识别的智能曝光方法及系统
CN106131449B (zh) * 2016-07-27 2019-11-29 维沃移动通信有限公司 一种拍照方法及移动终端
CN106484257A (zh) * 2016-09-22 2017-03-08 广东欧珀移动通信有限公司 拍照控制方法、装置和电子设备
CN108881710A (zh) * 2017-12-28 2018-11-23 北京旷视科技有限公司 图像处理方法、装置和系统及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100158324A1 (en) * 2008-12-19 2010-06-24 Micro-Star Internationa'l Co., Ltd. Method for adjusting light source threshold value for face recognition
CN103051844A (zh) * 2012-12-31 2013-04-17 青岛中星微电子有限公司 一种图像背光补偿的方法及装置
CN106485729A (zh) * 2016-09-29 2017-03-08 江苏云光智慧信息科技有限公司 一种基于混合高斯模型的运动目标检测方法
CN106603933A (zh) * 2016-12-16 2017-04-26 中新智擎有限公司 一种曝光方法和装置
CN107172364A (zh) * 2017-04-28 2017-09-15 努比亚技术有限公司 一种图像曝光补偿方法、装置和计算机可读存储介质
CN107147823A (zh) * 2017-05-31 2017-09-08 广东欧珀移动通信有限公司 曝光方法、装置、计算机可读存储介质和移动终端

Also Published As

Publication number Publication date
CN110710194A (zh) 2020-01-17
CN110710194B (zh) 2021-10-22

Similar Documents

Publication Publication Date Title
CN112308095A (zh) 图片预处理及模型训练方法、装置、服务器及存储介质
JP4482037B2 (ja) デジタル画像形成の露出
CN111079740A (zh) 图像的质量评价方法、电子设备和计算机可读存储介质
WO2021007690A1 (zh) 曝光控制方法、装置与可移动平台
CN108616700B (zh) 图像处理方法和装置、电子设备、计算机可读存储介质
CN109766828A (zh) 一种车辆目标分割方法、装置及通信设备
WO2021035729A1 (zh) 一种曝光方法、装置及摄像模组、电子设备
WO2020010638A1 (zh) 一种图像坏点检测方法及装置
US20230276034A1 (en) Method and system for adjusting projection dithering
US20220270266A1 (en) Foreground image acquisition method, foreground image acquisition apparatus, and electronic device
CN110610176A (zh) 一种基于人脸亮度的曝光自适应调节方法
CN105096267A (zh) 一种基于拍照识别调节眼部亮度的方法和装置
CN111240612A (zh) 一种调节屏幕分辨率的方法及终端
CN111917991A (zh) 图像的质量控制方法、装置、设备及存储介质
CN113177438A (zh) 图像处理方法、设备及存储介质
CN114429476A (zh) 图像处理方法、装置、计算机设备以及存储介质
CN113409353B (zh) 运动前景检测方法、装置、终端设备及存储介质
CN111539975B (zh) 一种运动目标的检测方法、装置、设备及存储介质
CN112070682A (zh) 图像亮度补偿的方法和装置
US20230146016A1 (en) Method and apparatus for extreme-light image enhancement
CN111797694A (zh) 一种车牌检测方法及装置
JP2021022236A (ja) 分類信頼度算出装置、領域分割装置、学習装置、分類信頼度算出方法、学習方法、分類信頼度算出プログラム、及び学習プログラム
Kumar et al. Haze elimination model-based color saturation adjustment with contrast correction
WO2021217445A1 (zh) 图像处理方法、装置、系统和存储介质
CN115170894A (zh) 一种烟火检测的方法及装置

Legal Events

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

Ref document number: 19943762

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 30/06/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19943762

Country of ref document: EP

Kind code of ref document: A1