Image processing method, device, apparatus, and computer-readable storage medium

By calculating the difference between the number of image units in the image to be adjusted and the reference image in which the brightness value is less than the threshold value is lower than the threshold value, adjusting the image to be adjusted based on the reference image, the problem of overexposure and unclear dark areas in the night vision mode is solved, and the efficiency of image processing is improved.

CN114494137BActive Publication Date: 2025-05-13TP-LINK INT CHENGDU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111622711.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-05-13
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In the night vision mode of infrared cameras, foreground objects are easily overexposed due to strong infrared light reflection, while distant objects are difficult to see clearly due to insufficient infrared light reflection. The prior art is difficult to take into account the presentation details of all areas in the picture, and the processing efficiency is low.

Method used

By acquiring the image to be adjusted and the reference image, the difference in the number of image units whose brightness value is smaller than the preset threshold value among the two is calculated. If the difference value is greater than the preset value, the image to be adjusted based on the reference image to be adjusted to obtain the target image.

Benefits of technology

This improves the efficiency of image processing, can better take into account the presentation details of all areas in the picture, and avoids the problems of overexposure and dark areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494137B_ABST
    Figure CN114494137B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, apparatus, device, and computer-readable storage medium. The method includes: acquiring an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after the brightness parameters of the capturing device for capturing the image to be adjusted are lowered; calculating the difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold; if the difference is greater than a preset value, adjusting the image to be adjusted based on the reference image to obtain a target image, which can improve the processing efficiency of overexposed images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image technology, and in particular, relates to an image processing method, apparatus, device, and computer-readable storage medium. Background Art

[0002] At present, when infrared cameras work in night vision mode, foreground objects that are close to the camera are easily overexposed due to strong infrared light reflection, while objects that are far away may not be clearly seen due to insufficient infrared light reflection. In related technologies, new night vision images are generally obtained directly by adjusting infrared lights. However, in this way, when an overexposed scene occurs, reducing the brightness of the infrared light can effectively optimize the overexposed area, so that the foreground brightness or overall brightness is within the normal range, but it is easy to cause the dark area to be too dark, and objects cannot be seen at all, and it is impossible to take into account the presentation details of all areas in the picture.

[0003] In addition, the related art also uses an automatic exposure method to correct the image brightness, but this method has a limited degree of adjustment and will cause other image parameters to change, affecting the image quality, and the image processing efficiency is low. Summary of the invention

[0004] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problem of low image processing efficiency in the related art.

[0005] In a first aspect, the present application provides an image processing method, comprising: acquiring an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering a brightness parameter of a shooting device that shoots the image to be adjusted;

[0006] Calculating a difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold;

[0007] If the difference is greater than a preset value, the image to be adjusted is adjusted based on the reference image to obtain a target image.

[0008] In a second aspect, the present application provides an image processing device, comprising: an acquisition module, configured to acquire an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering a brightness parameter of a shooting device that shoots the image to be adjusted;

[0009] a determination module, configured to calculate a difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold;

[0010] A processing module is used for adjusting the image to be adjusted based on the reference image to obtain a target image if the difference is greater than a preset value.

[0011] In a third aspect, the present application provides an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method described in the first aspect or any possible implementation manner of the first aspect by executing the executable instructions.

[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the first aspect or any of the possible implementations of the first aspect is implemented.

[0013] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.

[0014] The image processing method provided by the present application obtains an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering the brightness parameter of a shooting device that shoots the image to be adjusted; calculates the difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold; if the difference is greater than a preset value, the image to be adjusted is adjusted based on the reference image to obtain a solution for a target image, combined with the control of infrared lights and the analysis of local brightness information in the image, and the analysis process is more refined than related technologies, thereby improving the efficiency of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0016] Figure 1a A flowchart of an image processing method provided in one embodiment of the present application;

[0017] Figure 1b A flowchart of an image processing method provided by another embodiment of the present application;

[0018] Figure 1c An image schematic diagram provided for another embodiment of the present application;

[0019] Figure 1d A flowchart of an image processing method provided by another embodiment of the present application;

[0020] Figure 1e A schematic diagram of brightness parameter adjustment rules provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of the structure of an image processing device provided by another embodiment of the present application;

[0022] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.

[0024] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0025] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0026] Overexposure: the image brightness is too high;

[0027] ISP: Image Signal Processing, image signal processing;

[0028] YUV: is a color encoding method, commonly used in various video processing components. When encoding photos or videos, YUV allows for reduced bandwidth for chrominance, taking into account human perception. YUV is a type of true-color color space (color space). Y'UV, YUV, YCbCr, YPbPr and other special terms can all be called YUV, and there are overlaps with each other. "Y" represents brightness (Luminance or Luma), which is the grayscale value, and "U" and "V" represent chrominance (Chrominance or Chroma), which is used to describe the color and saturation of the image and is used to specify the color of the pixel.

[0029] Image unit: In this article, it refers to a small unit at the pixel level. One pixel can be a unit, or 2×2 pixels can be a unit.

[0030] It should be noted that the image involved in the present application is an infrared image, specifically a YUV image, and the adjustment of the brightness parameter of the shooting device refers to the adjustment of the brightness parameter of the infrared lamp brightness.

[0031] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0032] FIG1 is a flowchart of an image processing method provided by an exemplary embodiment of the present application. The method can be applied to the camera itself or to other electronic devices. The electronic device can be a computer, a mobile phone, or other devices with data processing functions. The present application does not limit this. When the method is applied to other electronic devices, it needs to be connected to the camera to obtain images from the camera and send relevant instructions to the camera. Specifically, the method includes at least the following steps:

[0033] S101, acquiring an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering a brightness parameter of a shooting device that shoots the image to be adjusted;

[0034] S102, calculating the difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold;

[0035] S103: If the difference is greater than a preset value, the image to be adjusted is adjusted based on the reference image to obtain a target image.

[0036] Specifically, the reference image in the aforementioned S101 can be a pre-captured image, and the reference image needs to be captured when the shooting environment of the shooting device is stable. Optionally, when the duration of no moving objects in the shooting range of the shooting device exceeds a preset duration and the brightness parameter of the shooting device is not adjusted for more than the preset duration, the captured image is used as a reference image.

[0037] Optionally, under the premise that the aforementioned acquisition conditions of the reference image are met, the reference image may also be acquired according to a preset period.

[0038] Furthermore, the brightness value in the aforementioned step S102 can be determined based on the brightness information of the image to be adjusted, the image to be adjusted can be a YUV image, the first preset threshold can be a preset brightness threshold, the image unit can be a pixel, or an n*n (n is greater than or equal to 2) pixel group, the first image unit is an image unit whose corresponding brightness value in the image to be adjusted is less than the first preset threshold, and the second image unit is an image unit whose corresponding brightness value in the reference image is less than the first preset threshold.

[0039] Furthermore, the brightness information of the image to be adjusted may include brightness values ​​corresponding to each image unit in the image to be adjusted.

[0040] Furthermore, in step S103, adjusting the image to be adjusted based on the reference image to obtain the target image may specifically include:

[0041] S1031, obtaining a first weight corresponding to the image to be adjusted and a second weight corresponding to the reference image;

[0042] S1032: Determine the target image corresponding to the image to be adjusted by using the first weight, the second weight, the brightness value of the first image unit, and the brightness value of the second image unit.

[0043] The values ​​of the first weight and the second weight may be set in advance by relevant personnel, and determining the target image corresponding to the image to be adjusted by using the first weight, the second weight, the brightness value of the first image unit, and the brightness value of the second image unit may specifically include:

[0044] Using the first weight, processing the brightness value of each first image unit in the image to be adjusted to obtain a first image to be synthesized;

[0045] Using the second weight, processing the brightness value of each second image unit in the reference image to obtain a second image to be synthesized;

[0046] The target image is determined according to the first image to be synthesized and the second image to be synthesized.

[0047] Specifically, using the first weight, processing the brightness value of each first image unit in the image to be adjusted to obtain the first image to be synthesized includes:

[0048] For each first image unit in the image to be adjusted, the brightness value is replaced by the first product of the brightness value of the first image unit and the first weight to obtain a first image to be synthesized. That is, the first image to be synthesized is an image obtained by processing the brightness value of a partial area (first image unit area) of the image to be adjusted.

[0049] Correspondingly, the brightness value of each second image unit in the reference image is processed by using the second weight to obtain a second image to be synthesized;

[0050] For each second image unit in the reference image, the brightness value of the second image unit is replaced by the second product of the brightness value of the second image unit and the second weight to obtain a second image to be synthesized. That is, the second image to be synthesized is an image obtained by processing the brightness value of a partial area (second image unit area) of the second image to be processed.

[0051] Further, determining the target image according to the first image to be synthesized and the second image to be synthesized may include:

[0052] Acquire the brightness value of each image unit in the first image to be synthesized, and the brightness value of each image unit in the second image to be synthesized;

[0053] The following processing is performed on any image unit in the first image to be synthesized to obtain a target image: the brightness value of any image unit is replaced by the average value of the sum of the brightness values ​​of the image units in the second image to be synthesized corresponding to the image unit.

[0054] That is, the target image is an image obtained by processing the brightness value of the first image to be synthesized using the second image to be synthesized.

[0055] The first image to be synthesized and the second image to be synthesized are of the same size, and the image units included in each of them correspond to each other one by one.

[0056] Furthermore, the method further comprises:

[0057] S01, obtaining an initial image;

[0058] S02, determining brightness information of the initial image according to the initial image;

[0059] S03, determining, according to the brightness information of the initial image, a first ratio of the total number of third image units in the initial image whose corresponding brightness values ​​are greater than a second preset threshold to the total number of image units in the initial image;

[0060] S04: If the first ratio is greater than a first preset ratio, lowering the brightness parameter of the shooting device.

[0061] Furthermore, the aforementioned second preset threshold is a pre-set brightness threshold, and the aforementioned third image unit is an image unit in the initial image, the corresponding brightness value of which is greater than the second preset threshold.

[0062] The acquisition time of the initial image is earlier than the acquisition time of the image to be adjusted.

[0063] Specifically, after step S04, the method further includes:

[0064] S05, obtaining a first image to be processed;

[0065] S06. Determine brightness information of the first image to be processed according to the first image to be processed;

[0066] S07. Determine, according to the brightness information of the first image to be processed, a second ratio of the total number of fourth image units in the first image to be processed, whose corresponding brightness values ​​are greater than the second preset threshold, to the total number of image units in the first image to be processed;

[0067] S08, if the second ratio is not greater than the first preset ratio, the first image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered; if the second ratio is greater than the first preset ratio, the brightness parameter of the shooting device is lowered again, and the step of acquiring the first image to be processed is performed, until the second ratio is not greater than the first preset ratio, the first image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered. That is, the following steps are executed in a loop: lowering the brightness parameter of the shooting device, and S05 to S08, until the second ratio is not greater than the first preset ratio, the first image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered.

[0068] The fourth image unit is an image unit in the first image to be processed, the corresponding brightness value of which is greater than the second preset threshold.

[0069] Further, if the first ratio is not greater than the first preset ratio, the method further includes:

[0070] Calculating an average brightness value of the initial image according to brightness information of the initial image;

[0071] If the average brightness value of the initial image is greater than a preset brightness average value, the brightness parameter of the shooting device is lowered.

[0072] If the average brightness value of the initial image is greater than the preset brightness average value, after lowering the brightness parameter of the shooting device, the method further includes:

[0073] S001, obtaining a second image to be processed;

[0074] S002. Determine brightness information of the second image to be processed according to the second image to be processed;

[0075] S003, calculating an average brightness value of the second image to be processed according to the brightness information of the second image to be processed;

[0076] S004: If the average brightness value of the second image to be processed is not greater than the preset brightness average value, the second image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered. If the average brightness value of the second image to be processed is greater than the preset brightness average value, the brightness parameter of the shooting device is lowered again, and the step of acquiring the second image to be processed is performed. After the average brightness value of the second image to be processed is not greater than the preset brightness average value, the second image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered. That is, the following steps are executed cyclically: lowering the brightness parameter of the shooting device, and S001 to S004, until the average brightness value of the second image to be processed is not greater than the preset brightness average value.

[0077] Furthermore, if the average brightness value of the initial image is not greater than the preset brightness average value, the method further includes:

[0078] If the average brightness value of the initial image is less than a second preset threshold, the brightness parameter of the shooting device is increased.

[0079] Furthermore, if the average brightness value of the initial image is less than a second preset threshold, after increasing the brightness parameter of the shooting device, the method further includes:

[0080] Acquire a third image to be processed;

[0081] Determining brightness information of the third image to be processed according to the third image to be processed;

[0082] Calculating an average brightness value of the third image to be processed according to the brightness information of the third image to be processed;

[0083] If the average brightness value of the third image to be processed is less than the second preset threshold, the brightness parameter of the shooting device is increased again, and the process proceeds to the step of acquiring the third image to be processed until the average brightness value of the third image to be processed is not less than the second preset threshold. After the average brightness value of the third image to be processed is not less than the second preset threshold, it can be further determined whether the scene is stable and meets the collection time requirement of the reference image. If so, the reference image is updated. If not, the initial image is continuously collected, and the process proceeds to the step of determining the brightness information of the initial image based on the initial image.

[0084] Further, for determining whether a scene is stable, and a method for determining whether the acquisition time requirement of a reference image is met, and a reference image updating process, the method includes:

[0085] When the time duration that there is no moving object in the shooting range of the shooting device continuously exceeds a first preset time duration, the brightness parameter of the shooting device has not been adjusted for more than the first preset time duration, and the time duration between the current moment and the last time the reference image was captured exceeds a second preset time duration, the shooting device is controlled to capture the reference image to be determined;

[0086] The reference image is updated using the reference image to be determined.

[0087] Specifically, using the reference image to be determined to update the reference image may include: using the reference image to be determined directly as a new reference image.

[0088] Further, after updating the reference image, the process may proceed to the step of acquiring an initial image and determining brightness information of the initial image according to the initial image.

[0089] Furthermore, if the difference is not greater than a preset value, it is further determined whether the scene is stable and meets the acquisition time requirement of the reference image. If so, the reference image is updated; if not, the initial image is continued to be acquired, and the step of determining the brightness information of the initial image based on the initial image is performed.

[0090] Furthermore, when the brightness parameter of the camera is lowered or raised, in order to avoid repeatedly adjusting the brightness parameter of the camera, for the above method, after the brightness parameter of the camera is lowered, if the average brightness value of the second image to be processed is not greater than the preset brightness average value, the brightness parameter of the camera can be further lowered until the average brightness value of the second image to be processed is not greater than the reduction threshold, and then the second image to be processed is used as the image to be adjusted, triggering the step of acquiring the image to be adjusted and the reference image. The reduction threshold can be the difference between the preset brightness average value and the first difference value. Specifically, the aforementioned reduction threshold can be determined according to user instructions. Specifically, the above method also includes:

[0091] Obtaining user setting information for the first difference value;

[0092] The reduction threshold is determined according to the first difference value and the preset brightness average value.

[0093] Specifically, the difference between the preset brightness average value and the first difference value may be used as the lowering threshold.

[0094] Accordingly, after the brightness parameter of the camera is increased, if the average brightness value of the third image to be processed is less than the second preset threshold, the brightness parameter of the camera can be further increased until the average brightness value of the third image to be processed is not less than the increased threshold, and then the step of determining whether the scene is stable is triggered. The increased threshold can be the sum of the second preset threshold and the second difference value. Specifically, the increased threshold can be determined according to a user instruction. Specifically, the method further includes:

[0095] Obtaining user setting information for the second difference value;

[0096] The increasing threshold is determined according to the second difference value and the second preset threshold.

[0097] Specifically, the sum of the second preset threshold and the second difference value may be used as the rising threshold.

[0098] Optionally, the aforementioned lowering threshold and raising threshold may also be preset fixed values.

[0099] The first difference value and the second difference value may be the same or different.

[0100] Furthermore, in the present application, the shooting device for capturing the reference image, the initial image, the first image to be processed, the second image to be processed, and the third image to be processed is the same shooting device.

[0101] Furthermore, the method of the present application supports adjusting images of multiple shooting devices separately.

[0102] The image processing method provided by the present application obtains an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering the brightness parameter of a shooting device that shoots the image to be adjusted; calculates the difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold; if the difference is greater than a preset value, the image to be adjusted is adjusted based on the reference image to obtain a solution for a target image, combined with the control of infrared lights and the analysis of local brightness information in the image, and the analysis process is more refined than related technologies, thereby improving the efficiency of image processing.

[0103] Furthermore, the present application also provides the following specific embodiments to further illustrate the solution of the present application.

[0104] Embodiment 1:

[0105] When the camera is in night vision mode, it collects a reference image every t time and replaces the last reference image. When the brightness parameters of the camera are adjusted, it stops collecting reference images. Before determining image synthesis, refer to Figure 1b As shown, the image unit of the current image can be obtained, and the scene judgment module can be used to determine whether the image is too bright (or overexposed) or too dark. If it is too bright, the infrared light brightness is adjusted downward by the infrared adjustment module. If it is too dark, the infrared light brightness is adjusted upward by the infrared adjustment module. After adjustment, the scene judgment module can be further used to determine whether image synthesis is required. If so, the image synthesis module is used to synthesize the image and continue to process the next frame of the image. If not, the reference image update module is used to determine whether the reference image needs to be updated. If so, the reference image is updated by the reference image update module and the next frame of the image is processed. If not, the next frame of the image can be directly processed.

[0106] It should be noted that, when the image is neither too bright (or overexposed) nor too dark, reference may be made to the relevant processing methods in the aforementioned embodiments, which will not be described in detail here.

[0107] Embodiment 2:

[0108] Get each frame of the YUA image, and take the brightness component Y in its image information as the basic data for brightness calculation. Define the average brightness as Y_ave, the high brightness threshold as Y_white, and the low brightness threshold as Y_black. Count the number of units higher than Y_white as n_white, the number of units lower than Y_black as n_black, and the units in the middle with normal and comfortable brightness as n_normal, such as Figure 1cAs shown. Define the total number of image units as N. Among them, n_white + n_black + n_normal = N.

[0109] Furthermore, f_upper_bound can be set as the preset percentage threshold of over-bright units, n_black’ as the n_black value of the pre-collected reference image, and n_inc_bound as the threshold of the increased number of over-dark regions. Specifically:

[0110] 1) If for the initial captured image, n_white / N > f_upper_bound, it is an overexposed scene, and the infrared light brightness needs to be adjusted downward until n_white / N of the newly captured image (Image A) is less than or equal to f_upper_bound, and then step 4) is executed; if for the initial captured image, n_white / N is less than or equal to f_upper_bound, then step 2) is executed;

[0111] 2) If for the initial captured image, Y_ave > Y_white, it means the captured scene is too bright, and the infrared light brightness needs to be adjusted downward until the average brightness of the newly captured image (Image B) is less than the high brightness threshold, and then step 4) is executed; if for the initial captured image, Y_ave is less than or equal to Y_white, then step 3) is executed;

[0112] 3) If for the initial captured image, Y_ave < Y_black, it means the captured scene is too dark, and the infrared light brightness needs to be adjusted upward until the average brightness of the newly captured image (Image C) is greater than the low brightness threshold, and then enter 5);

[0113] 4) After adjusting the infrared light brightness, if the difference between nblack of the aforementioned newly captured image (i.e., Image A) and n_black’ is greater than n_inc_bound, then step 5) is executed;

[0114] Among them, the analysis of this difference can avoid the existence of many dark areas in the original scene. The condition being established means that due to the downward adjustment of the infrared light, more over-dark regions have significantly appeared in the scene, and image synthesis is performed; otherwise, no synthesis is required.

[0115] 5) If in a stable state (no movement, no infrared adjustment) and the duration t_1 has elapsed, and the time since the previous collection of the reference image exceeds the duration t_2 (t_1 > t_2), a new reference image is collected and replaces the previously collected reference image; otherwise, no collection is performed, and go to execute step 1).

[0116] In actual scenes, overexposure is often caused by people walking close to each other or objects moving. The specific motion detection algorithm can be found in the prior art and will not be described here.) Most image synthesis methods process the entire image, but in the solution of this application, the brightness and details of the dark area are enhanced, so only the dark area is focused.

[0117] In the previous step, the YUA data of the current frame and the YUA data of the acquired image have been obtained. Therefore, the YUA channel values ​​of the unit to be synthesized and the corresponding unit of the acquired image are weighted fused to obtain the fused image.

[0118] Specifically, see Figure 1d For details, please refer to Figure 1d As shown, an initial image is captured, and it is determined whether n_white / N of the initial image is greater than f_upper_bound. If so, the infrared light brightness is adjusted downward and a first image (corresponding to the aforementioned first image to be processed) is captured, and it is determined whether n_white / N of the captured first image is greater than f_upper_bound. If so, the process returns to the step of downwardly adjusting the infrared light brightness and capturing the first image until n_white / N of the captured first image is not greater than f_upper_bound. The first image is then used as the image to be adjusted, and it is determined whether the difference of n_black-n_black' is greater than n_inc_bound for the image to be adjusted. If so, image synthesis is performed, and the initial image is continued to be captured after the synthesis; if not, it is determined whether the scene is stable and meets the capture time requirements of the reference image. If so, the reference image is updated, and the initial image is continued to be captured after the update; if not, the initial image is continued to be captured, and the process proceeds to the step of determining whether n_white / N of the initial image is greater than f_upper_bound.

[0119] Further, if n_white / N of the initial image is not greater than f_upper_bound, determine whether Y_ave of the initial image is greater than Y_white. If so, adjust the infrared light brightness downward and collect the second image (corresponding to the second image to be processed) to determine whether Y_ave of the second image is greater than Y_white. If so, go to the step of adjusting the infrared light brightness downward and collecting the second image until it is determined that Y_ave of the second image is not greater than Y_white. Then, use the second image as the image to be adjusted to determine whether the difference of n_black-n_black' is greater than n_inc_bound for the image to be adjusted. If so, perform image synthesis and continue to collect the initial image after synthesis; if not, determine whether the scene is stable and meets the collection time requirements of the reference image. If so, collect the reference image and continue to collect the initial image after updating; if not, continue to collect the initial image and go to the step of determining whether n_white / N of the initial image is greater than f_upper_bound.

[0120] Further, if the Y_ave of the collected initial image is not greater than Y_white, determine whether the Y_ave of the collected initial image is less than Y_black. If so, adjust the infrared light brightness upward and collect the third image (corresponding to the third image to be processed), and determine whether the Y_ave of the third image is less than Y_black. If so, go to the step of adjusting the infrared light brightness upward and collecting the third image until the Y_ave of the collected third image is not less than Y_black, determine whether the scene is stable and meets the collection time requirement of the reference image. If so, update the reference image and continue to collect the initial image after the update; if not, continue to collect the initial image and go to the step of determining whether n_white / N of the initial image is greater than f_upper_bound.

[0121] To avoid repeated adjustments to the brightness parameters, see Figure 1e As shown, the high brightness threshold Y_white is decomposed into Y_white and Y_white-δ. That is, when the infrared light needs to be dimmed, Y_white is used for judgment, and when the adjustment needs to be ended, Y_white-δ is used for judgment. The low brightness threshold is similar, and Y_ave brightens the infrared light below Y_black until Y_ave>Y_black+δ. In this way, each adjustment will exceed the threshold that needs to be adjusted, which can effectively avoid the problem of frequent adjustments near the threshold.

[0122] This application combines the adjustment of the shooting parameters of the shooting device with the image synthesis method, so as to optimize the image quality in the dark area while eliminating overexposed scenes. In addition, by utilizing the fact that the background will not change in a short period of time in a fixed monitoring scene, images are collected at a regular interval. When the background is too dark due to infrared light adjustment, the brightness and details of the dark background are effectively improved. When judging whether infrared light adjustment and image synthesis are needed, each has its own focus, and the same data is used without affecting each other. When judging overexposure, more attention is paid to the judgment of special areas (foreground areas), such as the judgment of the largest human detection and motion detection areas. This application can save CPU resources.

[0123] Figure 2 A schematic diagram of the structure of an image processing device provided by an exemplary embodiment of the present application, wherein the device comprises:

[0124] An acquisition module 21 is used to acquire an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after the brightness parameter of a shooting device that shoots the image to be adjusted is lowered;

[0125] A determination module 22, configured to calculate a difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold;

[0126] The processing module 23 is configured to adjust the image to be adjusted based on the reference image to obtain a target image if the difference is greater than a preset value.

[0127] Optionally, the device is also used for:

[0128] Get the initial image;

[0129] Determining brightness information of the initial image according to the initial image;

[0130] Determine, according to the brightness information of the initial image, a first ratio of the total number of third image units in the initial image whose corresponding brightness values ​​are greater than a second preset threshold to the total number of image units in the initial image;

[0131] If the first ratio is greater than a first preset ratio, the brightness parameter of the photographing device is lowered.

[0132] Optionally, the first ratio is greater than a first preset ratio, and after lowering the brightness parameter of the shooting device, the device is further used to:

[0133] Acquire a first image to be processed;

[0134] Determining brightness information of the first image to be processed according to the first image to be processed;

[0135] determining, according to the brightness information of the first image to be processed, a second ratio of the total number of fourth image units in the first image to be processed whose corresponding brightness values ​​are greater than the second preset threshold to the total number of image units in the first image to be processed;

[0136] If the second ratio is not greater than the first preset ratio, the first image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered; if the second ratio is greater than the first preset ratio, the brightness parameter of the shooting device is lowered again, and the step of acquiring the first image to be processed is performed until the second ratio is no greater than the first preset ratio, and the first image to be processed is used as the image to be adjusted.

[0137] Optionally, if the first ratio is not greater than the first preset ratio, the device is further configured to:

[0138] Calculating an average brightness value of the initial image according to brightness information of the initial image;

[0139] If the average brightness value of the initial image is greater than a preset brightness average value, the brightness parameter of the shooting device is lowered.

[0140] Optionally, the average brightness value of the initial image is greater than a preset brightness average value, and after lowering the brightness parameter of the shooting device, the device is further used to:

[0141] Acquire a second image to be processed;

[0142] determining brightness information of the second image to be processed according to the second image to be processed;

[0143] Calculating an average brightness value of the second image to be processed according to the brightness information of the second image to be processed;

[0144] If the average brightness value of the second image to be processed is not greater than the preset brightness average value, the second image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered; if the average brightness value of the second image to be processed is greater than the preset brightness average value, the brightness parameter of the shooting device is lowered again, and the step of acquiring the second image to be processed is performed until the average brightness value of the second image to be processed is no greater than the preset brightness average value, and the second image to be processed is used as the image to be adjusted.

[0145] Optionally, if the average brightness value of the initial image is not greater than the preset brightness average value, the device is further used to:

[0146] If the average brightness value of the initial image is less than a second preset threshold, the brightness parameter of the shooting device is increased.

[0147] Optionally, the average brightness value of the initial image is less than a second preset threshold, and after the brightness parameter of the shooting device is increased, the device is further used to:

[0148] Acquire a third image to be processed;

[0149] Determining brightness information of the third image to be processed according to the third image to be processed;

[0150] Calculating an average brightness value of the third image to be processed according to the brightness information of the third image to be processed;

[0151] If the average brightness value of the third image to be processed is less than the second preset threshold, the brightness parameter of the shooting device is increased again, and the step of acquiring the third image to be processed is performed until the average brightness value of the third image to be processed is not less than the second preset threshold.

[0152] Optionally, the device is also used for:

[0153] When the time duration for which there is no moving object in the shooting range of the shooting device continuously exceeds a first preset time duration, the brightness parameter of the shooting device is not adjusted for more than the first preset time duration, and the time duration from the current moment to the last time the reference image was captured exceeds a second preset time duration, the shooting device is controlled to capture the reference image to be determined;

[0154] The reference image is updated using the reference image to be determined.

[0155] Optionally, the device is used to adjust the image to be adjusted based on the reference image to obtain the target image, including:

[0156] Obtaining a first weight corresponding to the image to be adjusted and a second weight corresponding to the reference image;

[0157] The target image corresponding to the image to be adjusted is determined by using the first weight, the second weight, the brightness value of the first image unit, and the brightness value of the second image unit.

[0158] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.

[0159] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0160] Figure 3 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:

[0161] The memory 301 and the processor 302, the memory 301 is used to store the computer program and transmit the program code to the processor 302. In other words, the processor 302 can call and run the computer program from the memory 301 to implement the method in the embodiment of the present application.

[0162] For example, the processor 302 may be configured to execute the above method embodiments according to instructions in the computer program.

[0163] In some embodiments of the present application, the processor 302 may include but is not limited to:

[0164] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0165] In some embodiments of the present application, the memory 301 includes but is not limited to:

[0166] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0167] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0168] like Figure 3 As shown, the electronic device may also include:

[0169] The transceiver 303 may be connected to the processor 302 or the memory 301 .

[0170] The processor 302 may control the transceiver 303 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 303 may include a transmitter and a receiver. The transceiver 303 may further include an antenna, and the number of antennas may be one or more.

[0171] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0172] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0173] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0174] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0175] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0176] 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 modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0177] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: include: Acquire an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering a brightness parameter of a shooting device that shoots the image to be adjusted; Calculating a difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold; If the difference is greater than a preset value, the image to be adjusted is adjusted based on the reference image to obtain a target image.

2. The method according to claim 1, characterized in that The method further comprises: Get the initial image; Determining brightness information of the initial image according to the initial image; Determine, according to the brightness information of the initial image, a first ratio of the total number of third image units in the initial image whose corresponding brightness values ​​are greater than a second preset threshold to the total number of image units in the initial image; If the first ratio is greater than a first preset ratio, the brightness parameter of the photographing device is lowered.

3. The method according to claim 2, characterized in that The first ratio is greater than a first preset ratio, and after lowering the brightness parameter of the shooting device, the method further includes: Acquire a first image to be processed; Determining brightness information of the first image to be processed according to the first image to be processed; determining, according to the brightness information of the first image to be processed, a second ratio of the total number of fourth image units in the first image to be processed whose corresponding brightness values ​​are greater than the second preset threshold to the total number of image units in the first image to be processed; If the second ratio is not greater than the first preset ratio, the first image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered; if the second ratio is greater than the first preset ratio, the brightness parameter of the shooting device is lowered again, and the step of acquiring the first image to be processed is performed until the second ratio is no greater than the first preset ratio, and the first image to be processed is used as the image to be adjusted.

4. The method according to claim 2, characterized in that: If the first ratio is not greater than the first preset ratio, the method further includes: Calculating an average brightness value of the initial image according to brightness information of the initial image; If the average brightness value of the initial image is greater than a preset brightness average value, the brightness parameter of the shooting device is lowered.

5. The method according to claim 4, characterized in that The average brightness value of the initial image is greater than the preset brightness average value, and after lowering the brightness parameter of the shooting device, the method further includes: Acquire a second image to be processed; determining brightness information of the second image to be processed according to the second image to be processed; Calculating an average brightness value of the second image to be processed according to the brightness information of the second image to be processed; If the average brightness value of the second image to be processed is not greater than the preset brightness average value, the second image to be processed is used as the image to be adjusted, and the step of acquiring the image to be adjusted and the reference image is triggered; if the average brightness value of the second image to be processed is greater than the preset brightness average value, the brightness parameter of the shooting device is lowered again, and the step of acquiring the second image to be processed is performed until the average brightness value of the second image to be processed is no greater than the preset brightness average value, and the second image to be processed is used as the image to be adjusted.

6. The method according to claim 4, characterized in that If the average brightness value of the initial image is not greater than the preset brightness average value, the method further includes: If the average brightness value of the initial image is less than the second preset threshold, the brightness parameter of the shooting device is increased.

7. The method according to claim 6, characterized in that The average brightness value of the initial image is less than a second preset threshold, and after the brightness parameter of the shooting device is increased, the method further includes: Acquire a third image to be processed; Determining brightness information of the third image to be processed according to the third image to be processed; Calculating an average brightness value of the third image to be processed according to brightness information of the third image to be processed; If the average brightness value of the third image to be processed is less than the second preset threshold, the brightness parameter of the shooting device is increased again, and the step of acquiring the third image to be processed is performed until the average brightness value of the third image to be processed is not less than the second preset threshold.

8. The method according to claim 1, characterized in that: The method comprises: When the time duration for which there is no moving object in the shooting range of the shooting device continuously exceeds a first preset time duration, the brightness parameter of the shooting device is not adjusted for more than the first preset time duration, and the time duration from the current moment to the last time the reference image was captured exceeds a second preset time duration, the shooting device is controlled to capture the reference image to be determined; The reference image is updated using the reference image to be determined.

9. The method according to claim 1, characterized in that: Adjusting the image to be adjusted based on the reference image to obtain the target image includes: Obtaining a first weight corresponding to the image to be adjusted and a second weight corresponding to the reference image; The target image corresponding to the image to be adjusted is determined by using the first weight, the second weight, the brightness value of the first image unit, and the brightness value of the second image unit.

10. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be adjusted and a reference image, wherein the image to be adjusted is an image captured after lowering a brightness parameter of a shooting device that shoots the image to be adjusted; a determination module, configured to calculate a difference between the number of first image units in the image to be adjusted whose corresponding brightness values ​​are less than a first preset threshold and the number of second image units in the reference image whose corresponding brightness values ​​are less than the first preset threshold; A processing module is used for adjusting the image to be adjusted based on the reference image to obtain a target image if the difference is greater than a preset value.

11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Automatic exposure adjusting method and system

    CN103826066A

  • Image processing method, mobile terminal and computer readable storage medium

    CN107454330A