A method, device, system and computer equipment for dynamic fill light of camera
By calculating the pixel difference between the camera frame image and the historical frame image, determining the moving block seeds and adjusting the brightness according to it, dynamic fill-up light of the monitoring device in a low-light environment is realized, solving the problem of poor monitoring picture quality and improving Picture quality and avoid increased hardware costs.
Patent Information
- Application Number
- CN202411249989.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing monitoring equipment can easily overexpose people or objects nearby when filling in low-light environments, resulting in the loss of important face details. The existing hardware solutions increase monitoring costs and reduce picture clarity.
By calculating the pixel difference between the camera frame image and the historical frame image, the moving block seed is determined, and the brightness is adjusted according to its corresponding neighborhood sub-regions to achieve dynamic fill light, avoiding overexposure.
It effectively suppresses the overexposure effect of reflective objects, improves the quality of the monitoring screen, flexibly adjusts the fill-up solution, and avoids increasing hardware costs and reducing picture clarity.
Smart Images

Figure CN118764718B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of monitoring systems, and in particular to a method, device, system and computer equipment for dynamic fill light for a camera. Background Art
[0002] With the development and progress of society, people's safety awareness is constantly improving. The coverage of monitoring equipment is very wide. In darker environments, the equipment will turn on its own infrared light to supplement the light to improve the monitoring effect in darker environments. However, there is often a problem of overexposure of people or objects nearby, and once a crime occurs, important facial details will be lost.
[0003] Existing fill light monitoring equipment is generally implemented through hardware solutions, that is, firstly, distance detection is performed through a wireless module, and the intensity of the fill light is controlled by judging the distance of the object from the fill light. However, this solution increases the monitoring cost on the one hand, and on the other hand, the current of the light board is controlled globally. Although the distance of the monitoring screen can be achieved by adjusting the current of the light board, dimming the light is often accompanied by an increase in gain and a deterioration in the monitoring screen effect (such as a decrease in clarity, etc.).
[0004] Currently, no effective solution has been proposed for the problem of poor monitoring image quality in the prior art. Summary of the invention
[0005] Based on this, it is necessary to provide a camera dynamic fill light method, device, system and computer equipment to address the above technical problems.
[0006] In a first aspect, the present application provides a method for dynamic fill light of a camera. The method comprises:
[0007] Calculating pixel differences between each sub-region of a current frame image and a corresponding sub-region of at least one historical frame image in a sequence of multiple frame images;
[0008] Determine the moving block seed in the current frame image according to the pixel difference;
[0009] When it is detected that the number of moving block seeds of the current frame image is greater than or equal to a preset number threshold, the current frame image is marked as a moving picture frame, and after all moving picture frames of the image sequence are marked, it is determined whether the number of all moving picture frames of the image sequence is greater than a preset frame number threshold;
[0010] If so, a neighborhood sub-region corresponding to the moving block seed is determined in each moving picture frame, a target adjustment brightness is determined according to the moving block seed and the neighborhood sub-region of each moving picture frame, and fill light adjustment is performed on each moving picture frame according to the target adjustment brightness.
[0011] In one embodiment, before calculating the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in the plurality of frame image sequences, the method further comprises:
[0012] Acquire at least two adjacent initial screen images captured by a camera, and determine a shaking sub-region in the two adjacent initial screen images;
[0013] When it is detected that the number of shaking sub-areas in the initial screen image is greater than or equal to a preset shaking area threshold, the brightness of the image captured by the camera is increased, and the initial screen image captured by the camera is continuously monitored;
[0014] When it is detected that the number of jitter sub-areas in the initial screen image is less than the jitter area threshold, the pixel difference between each sub-area of the current frame image and the corresponding sub-area of at least one historical frame image in a sequence of several frame images is calculated, wherein the jitter area threshold is greater than the quantity threshold.
[0015] In one embodiment, determining the moving block seed in the current frame image according to the pixel difference value includes:
[0016] Calculating a first pixel difference between a sub-region of a current frame image and a sub-region of a previous frame image, determining an image sub-region whose first pixel difference is greater than a preset first pixel threshold as a moving block seed, taking an area where the moving block seed is located as a first moving block area, and calculating a pixel difference between the first moving block area of the current frame image and the first moving block area of the previous frame image to obtain first moving block data;
[0017] Calculating a second pixel difference between a sub-region of a current frame image and a sub-region of a previous frame image, determining an image sub-region whose second pixel difference is greater than a preset second pixel threshold as a second moving block region, and calculating a pixel difference between the second moving block region of the current frame image and the second moving block region of the previous frame image to obtain second moving block data;
[0018] The difference between the first moving block data and the second moving block data is calculated to obtain interference data, and the interference data is removed.
[0019] In one embodiment, determining a neighborhood sub-region corresponding to a moving block seed in each moving picture frame includes:
[0020] The initial sub-neighborhoods adjacent to each moving block seed in the moving picture frame are retrieved in turn, the brightness values of the initial sub-neighborhoods are compared with the brightness values of the corresponding moving block seeds, and the initial sub-neighborhoods whose comparison results have a similarity greater than a preset brightness threshold are taken as neighborhood sub-areas.
[0021] In one embodiment, the fill light adjustment is performed on each moving picture frame according to the target brightness adjustment, including:
[0022] Obtain the global brightness of the moving picture frame, and obtain the picture brightness based on the global brightness and the preset brightness parameters;
[0023] When it is detected that the picture brightness is greater than or equal to a preset brightness parameter threshold, the picture brightness is adjusted based on a preset gain brightness, wherein the gain brightness is proportional to the picture brightness.
[0024] In one embodiment, the method further comprises:
[0025] When it is detected that the number of moving block seeds in the current frame image is less than the quantity threshold, the historical block areas where all the moving block seeds in the previous frame image are stored are obtained, and based on the brightness values of the areas corresponding to all the historical block areas in the current frame image, the picture image taken by the camera is filled with light.
[0026] In one of the embodiments, when it is detected that the number of moving block seeds in the current frame image is less than the number threshold, the method further includes:
[0027] The frame images whose number of moving block seeds is less than the number threshold are accumulated to obtain the still picture frame number. When it is detected that the still picture frame number is greater than the preset still frame number threshold, the brightness of the frame image is increased, and the initial picture image captured by the camera is continuously monitored.
[0028] In a second aspect, the present application also provides a camera dynamic fill light device. The device comprises:
[0029] An acquisition module is used to calculate the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in a sequence of several frame images; and determine the moving block seed in the current frame image according to the pixel difference;
[0030] A calculation module is used to mark the current frame image as a moving picture frame when it is detected that the number of moving block seeds of the current frame image is greater than or equal to a preset number threshold, and after completing the marking of all moving picture frames of the image sequence, determine whether the frame number of all moving picture frames of the image sequence is greater than a preset frame number threshold;
[0031] The calculation module is also used to determine the neighborhood sub-region corresponding to the mobile block seed in each moving picture frame, determine the target adjustment brightness according to the mobile block seed and the neighborhood sub-region of each moving picture frame, and perform fill light adjustment on each moving picture frame according to the target adjustment brightness.
[0032] In a third aspect, the present application further provides a camera system, the system comprising an overexposure prevention module, the overexposure prevention module comprising a shake detection module;
[0033] The jitter detection module is used to obtain multiple frames of adjacent initial screen images, and detect whether the camera system has jitter through the initial screen images; after detecting that the camera system does not have jitter, the collected initial screen images are sent to the anti-overexposure module;
[0034] The overexposure prevention module is used to execute the camera dynamic fill light method as described in any one of the above items based on the initial screen image.
[0035] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0036] Calculating pixel differences between each sub-region of a current frame image and a corresponding sub-region of at least one historical frame image in a sequence of multiple frame images;
[0037] Determine the moving block seed in the current frame image according to the pixel difference;
[0038] When it is detected that the number of moving block seeds of the current frame image is greater than or equal to a preset number threshold, the current frame image is marked as a moving picture frame, and after all moving picture frames of the image sequence are marked, it is determined whether the number of all moving picture frames of the image sequence is greater than a preset frame number threshold;
[0039] If so, a neighborhood sub-region corresponding to the moving block seed is determined in each moving picture frame, a target adjustment brightness is determined according to the moving block seed and the neighborhood sub-region of each moving picture frame, and fill light adjustment is performed on each moving picture frame according to the target adjustment brightness.
[0040] The above-mentioned method, device, system and computer equipment for dynamic fill light of a camera first calculate the pixel difference between each sub-region of the current frame image and the corresponding sub-region of multiple historical frame images in a sequence of several frame images, and determine at least one moving block seed based on the pixel difference. When it is detected that the number of moving block seeds of the current frame image is greater than or equal to the number threshold, the current frame image is marked as a moving picture frame. When the number of frames of all moving picture frames is greater than the frame number threshold, the neighborhood sub-region corresponding to the moving block seed is determined in the moving picture frame, and the target adjustment brightness is determined according to the moving block seed and the corresponding neighborhood sub-region of the moving picture frame, and fill light adjustment is performed on each moving picture frame according to the target adjustment brightness. Through the present application, the fill light adjustment can be guided by the brightness of the area where the key moving overexposed objects are located in the actual application, so that the fill light scheme can be flexibly adjusted according to the actual application scenario, effectively suppressing the overexposure effect of reflective objects and improving the picture quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a process of a dynamic fill light method for a camera in one embodiment;
[0042] Figure 2 A schematic diagram of a process for removing interference data in one embodiment;
[0043] Figure 3 A schematic diagram of a flow chart of a method for dynamic fill light for a camera in a preferred embodiment;
[0044] Figure 4 is a structural block diagram of a dynamic fill light device for a camera in one embodiment;
[0045] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] In one embodiment, Figure 1 As shown, a camera dynamic fill light method is provided, comprising the following steps:
[0048] Step S110, calculating the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in a plurality of frame image sequences; and determining the moving block seed in the current frame image according to the pixel difference.
[0049] Among them, the above-mentioned multiple frame image sequences are multiple frame image sequences sorted in chronological order. After acquiring the captured images, each frame image is divided according to a predetermined method to obtain multiple sub-regions, and then the pixel difference between each sub-region of the current frame image and the sub-region at the corresponding position of the historical frame image is further calculated. If the pixel difference between the current frame image and the previous frame image is greater than the preset dynamic detection threshold diffThresh, the sub-region is marked as a moving block seed, that is, the above-mentioned moving block seed reflects the area where the moving target is located.
[0050] Step S120, when it is detected that the number of moving block seeds of the current frame image is greater than or equal to a preset number threshold, the current frame image is marked as a moving picture frame. After completing the marking of all moving picture frames in the image sequence, it is determined whether the frame number of all moving picture frames in the image sequence is greater than the preset frame number threshold.
[0051] Among them, when it is detected that the number of moving block seeds is greater than or equal to the number threshold, the current frame is marked as a moving picture frame, and frame accumulation is performed. When the calculated number of moving picture frames is greater than the preset frame number threshold, it is considered that there are key moving objects that need attention in the monitoring picture. In practical applications, the above frame number threshold is generally set to five or six frames.
[0052] Step S130: If yes, then determine the neighborhood sub-region corresponding to the moving block seed in each moving picture frame, determine the target adjustment brightness according to the moving block seed and the neighborhood sub-region of each moving picture frame, and perform fill light adjustment on each moving picture frame according to the target adjustment brightness.
[0053] After obtaining the moving block seed, the corresponding neighborhood sub-region is determined according to the moving block seed in each moving picture frame, wherein the method for determining the neighborhood sub-region includes but is not limited to determining all areas immediately surrounding the moving block seed as the neighborhood sub-region; or searching the neighborhood sub-region according to the brightness value of the moving block seed and with the help of a flood filling algorithm, so as to accurately remove the non-overexposed area around the moving block seed to improve the sensitivity to the highlight area, and if the brightness value of the neighborhood sub-region is too similar to the brightness value of the moving block seed, it is considered that the neighborhood sub-region is an area with a similar degree of overexposure as the moving block seed. In summary, the neighborhood sub-regions corresponding to the moving block seeds in the moving picture frame can be found according to the above method. After determining the moving block seed and its corresponding neighborhood sub-region, the target adjustment brightness is determined according to the brightness values of the moving block seed and the neighborhood sub-region, which specifically includes that the target adjustment brightness can be determined according to the average brightness values of all moving block seeds and neighborhood sub-regions in the picture frame; the sum of the areas of each moving block seed and the corresponding neighborhood sub-region can also be calculated and recorded as the overexposed block area, and the brightness value of the overexposed block area with the largest area is determined as the target brightness value, wherein the present application does not impose too many restrictions on the overexposed block area, which can be the area where a person, an animal, or any reflective object is located. After determining the target adjustment brightness, fill light adjustment is performed on each moving picture frame according to the target adjustment brightness.
[0054] Through steps S110 to S130, moving objects in the picture can be quickly detected, and the picture can be filled in with light by referring to the overexposed area corresponding to the moving object. The fill light of the moving picture frame can be adjusted dynamically in real time according to the brightness of the moving overexposed object in the picture to suppress overexposure of reflective objects.
[0055] In one embodiment, the method further comprises:
[0056] Acquire at least two adjacent initial screen images captured by a camera, and determine a shaking sub-region in the two adjacent initial screen images;
[0057] When it is detected that the number of shaking sub-areas in the initial screen image is greater than or equal to a preset shaking area threshold, the brightness of the image captured by the camera is increased, and the initial screen image captured by the camera is continuously monitored;
[0058] When it is detected that the number of jitter sub-areas in the initial screen image is less than the jitter area threshold, the pixel difference between each sub-area of the current frame image and the corresponding sub-area of at least one historical frame image in a sequence of several frame images is calculated, wherein the jitter area threshold is greater than the quantity threshold.
[0059] Specifically, the initial screen image is an unprocessed image directly captured by the camera. Based on the acquired continuous multiple frames of initial screen images, the jitter sub-region in the initial screen image is determined by the pixel values of two adjacent frames of initial screen images. There are multiple methods for determining the jitter sub-region, including but not limited to dividing the multiple frames of initial screen images into multiple regions according to the same segmentation method, and then calculating the pixel value difference between the regions at the same position of different screen images, and determining the sub-region with too large pixel difference as the jitter sub-region. In practical applications, the sub-region with a pixel difference greater than 15 or 20 is often determined as the jitter sub-region (when the pixel value range is 0-1024). When it is detected that the number of jitter sub-regions in the initial screen image is greater than or equal to the jitter region threshold, it means that the camera is likely to have abnormal phenomena such as jitter at this time. At this time, the camera's screen brightness is increased, and the initial screen image captured by the camera is continuously monitored; if it is detected that the number of jitter sub-regions in the initial screen image is less than the jitter region threshold, it means that the camera does not have abnormal conditions such as jitter at this time, or the degree of the abnormal condition is small, and subsequent dynamic fill light calculation can be performed at this time. Considering that the device may shake during the monitoring process, if there is an overexposed object (such as a light source) in the picture at this time, the motion detection algorithm may be triggered and the intelligent infrared exposure adjustment may be entered, causing the picture to be abnormally darkened. Therefore, in this embodiment, the initial picture image captured by the camera is subjected to picture jitter detection, that is, if the camera position remains unchanged, the pixel values of the two frames before and after must be consistent or similar. Further, in order to avoid interference with the picture jitter detection due to the presence of moving objects in the picture, the jitter area threshold in this embodiment should be greater than the number threshold for judging the moving picture frames, so that the presence of moving objects will not be misjudged as picture jitter. In summary, if the number of phase jitter sub-areas in two adjacent picture frames is too large, it means that the picture is shaking or changing drastically at this time, and the dynamic fill light algorithm will not be started at this time. Otherwise, it is considered that the picture is in a normal state and can be operated according to normal logic to start the dynamic fill light algorithm. In this way, it can avoid the situation where the intelligent infrared is abnormally darkened due to the misjudgment of motion detection caused by the presence of picture jitter, large-area light sources or shaking of leaves in the picture.
[0060] In some embodiments, the method further comprises:
[0061] Calculating a first pixel difference between a sub-region of a current frame image and a sub-region of a previous frame image, determining an image sub-region whose first pixel difference is greater than a preset first pixel threshold as a moving block seed, taking an area where the moving block seed is located as a first moving block area, and calculating a pixel difference between the first moving block area of the current frame image and the first moving block area of the previous frame image to obtain first moving block data;
[0062] Calculating a second pixel difference between a sub-region of a current frame image and a sub-region of a previous frame image, determining an image sub-region whose second pixel difference is greater than a preset second pixel threshold as a second moving block region, and calculating a pixel difference between the second moving block region of the current frame image and the second moving block region of the previous frame image to obtain second moving block data;
[0063] The difference between the first moving block data and the second moving block data is calculated to obtain interference data, and the interference data is removed.
[0064] Specifically, the first pixel difference between the sub-region of the current frame image and the sub-region of the corresponding position of the previous frame image is calculated. If the first pixel difference is greater than the preset first pixel threshold, the sub-region can be assigned a value of 1, that is, the sub-region is marked as a moving block seed, and the first moving block region is determined by the above method, and the pixel difference between the first moving block region and the first moving block region of the previous frame image is further calculated to obtain the first moving block data. Similarly, the second pixel difference between the sub-region of the current frame image and the sub-region of the corresponding position of the previous frame image is calculated. If the second pixel difference is greater than the second pixel threshold, the sub-region is marked as the second moving block region, and the pixel difference between the second moving block region of the current frame image and the second moving block region of the previous frame sub-region is calculated to obtain the second moving block data. Finally, the difference between the first moving block data and the second moving block data is calculated. For example, a subtraction operation can be performed on the first moving block data and the second moving block data, so that interference data such as single moving dust or small flying insects can be eliminated, which can effectively avoid the interference of the above interference data on the subsequent motion detection algorithm. In some preferred embodiments, the acquired moving block data may also be corroded to further remove interfering data such as moving dust or small flying insects, and in order to avoid removing the moving process of the moving object, the corroded moving block data may be expanded, and then the corrosion and expansion operations may be performed again in sequence, so that most of the small reflective objects such as dust or small flying insects can be eliminated. Figure 2 The figure is a flow chart of eliminating interference data in an embodiment. The image sequence in the figure requires at least three frames, and then the differential binarization results of the current frame and the previous frame, as well as the differential binarization results of the current frame and the previous frame are calculated respectively. The above differential binarization is the calculation of the pixel difference in the above content. After respectively calculating the first moving block data and the second moving block data, the difference between the first moving block data and the second moving block data is calculated, that is, the two are subtracted, so that small-volume interference data can be eliminated. Furthermore, in order to improve the picture quality, the moving block data can be morphologically processed, such as corrosion followed by expansion, so as to better eliminate interference data such as single moving dust or small flying insects.
[0065] In some embodiments, the method further comprises:
[0066] The initial sub-neighborhoods adjacent to each moving block seed in the moving picture frame are retrieved in turn, the brightness values of the initial sub-neighborhoods are compared with the brightness values of the corresponding moving block seeds, and the initial sub-neighborhoods whose comparison results have a similarity greater than a preset brightness threshold are taken as neighborhood sub-areas.
[0067] Specifically, considering the existing motion detection methods, such as the frame difference method or the background difference method, when detecting a moving object, because the object has a large area of similar grayscale values, there is often a problem of a hole in the middle of the detected moving object, resulting in inaccurate detection of the moving object area. Therefore, in this embodiment, the initial sub-regions adjacent to each moving block seed are retrieved in turn, wherein preferably, the initial sub-regions can be searched by the idea of flood filling. Then, the brightness value of the initial sub-region is compared with the brightness value of the moving block seed. If the similarity of the brightness value exceeds the preset brightness threshold, the region is used as a neighborhood sub-region. Through this embodiment, overexposed areas can be accurately screened out to improve the sensitivity to highlight areas.
[0068] In some embodiments, the method further comprises:
[0069] Obtain the global brightness of the moving picture frame, and obtain the picture brightness based on the global brightness and the preset brightness parameters;
[0070] When it is detected that the picture brightness is greater than or equal to a preset brightness parameter threshold, the picture brightness is adjusted based on a preset gain brightness, wherein the gain brightness is proportional to the picture brightness.
[0071] Specifically, when the fill light adjustment is performed on the moving picture frame according to the target brightness adjustment, in order to avoid the situation where the picture brightness is too dark due to overexposure of the object during brightness adjustment, the picture brightness needs to be limited in the fill light adjustment stage in this embodiment. First, the global brightness of the moving picture frame is obtained. Preferably, the global brightness is the global average brightness of the picture, and the picture brightness is obtained based on the global average brightness and the preset brightness parameter. Preferably, the picture brightness can be obtained by dividing the global average brightness and the brightness parameter to obtain the ratio. In actual applications, the picture brightness can also be subjected to sliding average filtering to avoid too fast adjustment of the picture brightness when the global brightness fluctuates too much.
[0072] When the picture brightness is greater than or equal to the brightness parameter threshold, it means that the global brightness is lower than the brightness parameter. At this time, the picture brightness can be adjusted in combination with the gain brightness. For example, the gain brightness can be multiplied by the picture brightness to increase the picture brightness base and avoid the picture being too dark. The specific calculation method is as follows:
[0073]
[0074] Among them, ratioeEffY is the brightness of the above picture, ev_ref is the brightness after adjustment (when ratioeEffY < 1, no adjustment is required, that is, the brightness before and after adjustment is the same), ev ref is the gain brightness, in this embodiment, the gain brightness is the preset target brightness value of the exposure limit adjustment, currEvAvg is the global brightness, and the brightness parameter threshold is preferably set to 1. Preferably, when the picture brightness is greater than or equal to the brightness parameter threshold, the parameter strengths of the data wide dynamic, contrast, gamma and other modules can be linked at the same time, and the greater the value of the picture brightness, the stronger the linkage strength, so that the brightness of the dark area image can be stretched to a brighter optimal effect.
[0075] Similarly, when the brightness of the picture is less than the brightness parameter threshold, it means that the global brightness of the picture frame is not too dark at this time, and there is no need to perform exposure limiting. This embodiment introduces an exposure limiting strategy, and combines the digital wide dynamic module, contrast module and other brightness processing modules to brighten the dark area during the exposure adjustment process, so that the problem of too dark background can be avoided while suppressing the overexposure of reflective objects.
[0076] In some embodiments, the method further comprises:
[0077] When it is detected that the number of moving block seeds in the current frame image is less than the quantity threshold, the historical block areas where all the moving block seeds in the previous frame image are stored are obtained, and based on the brightness values of the areas corresponding to all the historical block areas in the current frame image, the picture image taken by the camera is filled with light.
[0078] Specifically, when it is detected that the number of moving block seeds in the current frame image is less than the number threshold, the camera's screen image is filled with light based on the previous frame image. Specifically, the area where all the moving block seeds in the previous frame image are located, that is, the above-mentioned historical block area, is selected, and the brightness value of the area corresponding to the historical block area in the current frame image is determined to guide the fill light adjustment of the screen. For example, the fill light adjustment of the screen image can be guided based on the brightness average of all areas corresponding to the historical block area in the current frame image, or the weighted brightness value. In this way, when the moving object is stationary in the monitoring screen, the brightness of the area where the current moving object is located can still be obtained to guide the fill light of the screen.
[0079] In some embodiments, the method further comprises:
[0080] The frame images whose number of moving block seeds is less than the number threshold are accumulated to obtain the still picture frame number. When it is detected that the still picture frame number is greater than the preset still frame number threshold, the brightness of the frame image is increased, and the initial picture image captured by the camera is continuously monitored.
[0081] Specifically, when it is detected that the number of moving block seeds in the current frame image is less than the number threshold, the frame number accumulation can be started, and the number of frame images with too small number of moving block seeds is accumulated to obtain the number of still picture frames. When the number of still picture frames is greater than the preset still frame number threshold, it indicates that there is no moving object in the picture for a period of time. Preferably, the still frame number threshold can be about 120 frames, which can be set according to actual needs in practical applications. At this time, the brightness adjustment stage can be exited, and the brightness of the frame image can be increased. The initial picture image captured by the camera is continuously monitored. When it is detected that the number of moving block seeds is greater than or equal to the number threshold, the picture fill light adjustment stage is re-entered. Through this embodiment, the intelligent infrared fill light stage can be automatically exited when there is no moving exposed object in the picture, and the brightness can be restored to avoid the situation where the picture is always dark due to the presence of static reflective objects (pillars, light sources, etc.), and other key moving objects can be better focused.
[0082] This embodiment also provides a preferred embodiment of a camera dynamic fill light method. Figure 3 The figure is a flow chart of the dynamic fill light method for a camera in a preferred embodiment. In practical application, when the camera device switches to the infrared mode, the overexposure prevention logic will start to run, and when the infrared fill light is turned on, the overexposure prevention algorithm logic in this application will be officially entered.
[0083] Step S310, the fill light is just turned on stage. This stage is entered only when the infrared fill light is turned on for the first time. At this time, the anti-overexposure algorithm logic has not yet run, and it is necessary to wait for a certain number of frames to wait for the fill light to stabilize before entering the anti-overexposure algorithm logic to avoid the fill light fluctuating the image brightness adjustment.
[0084] Step S320, picture stabilization stage. At this time, the anti-overexposure algorithm logic operates normally. When no moving object is detected, the picture brightness adjustment is guided by the global average brightness. Preferably, in actual application, the image brightness adjustment can be completed by a preset AE module (Automatic Exposure). When a moving object is detected, step S330 is entered.
[0085] Step S330, dynamic detection brightness adjustment stage. After detecting the presence of a moving overexposed object in the picture, the brightness of the moving object area is used to guide the adjustment of the picture brightness, which specifically includes the following contents:
[0086] Step S331 enters the image jitter detection module to determine whether the current camera is shaking or whether there are reflective objects blocking the camera. If the image jitter detection module determines that the camera is shaking or there is an abnormality, it will directly enter the brightness recovery stage S350. When it is determined that the camera is not shaking or there is no abnormality around, it will start marking the moving blocks.
[0087] Step S332, determine the number of moving block seeds in the frame image. When the number of moving block seeds is greater than or equal to the preset number threshold, mark the current frame image as a moving picture frame, and accumulate the number of moving picture frames. When the number of moving picture frames in a sequence of several frame images is less than the frame number threshold, enter S340, the brightness waiting adjustment stage; and if the number of moving picture frames is greater than or equal to the frame number threshold, enter the moving over-exposure area detection module. Detect and determine the area where the moving block seeds are located, that is, the area where the moving over-exposed object is located, and calculate the final target adjustment brightness based on the brightness of all the moving over-exposed object areas in the acquired moving picture frame. In this embodiment, there is no restriction on the calculation of the target adjustment brightness. The target adjustment brightness can be calculated based on the average brightness of each moving seed area and the neighborhood sub-area, or it can be calculated based on the weighted average of each moving seed area in the moving frame. Finally, after obtaining the target adjustment brightness, the moving picture frame is adjusted for fill light according to the target adjustment brightness.
[0088] Step S333, exposure limiting stage, in order to avoid the situation that the brightness of the picture is too dark due to excessive overexposure of objects in the above-mentioned dynamic detection brightness adjustment stage, in the process of the dynamic detection brightness adjustment stage, an exposure limiting stage is also set in the present application. First, the global brightness of the picture is obtained, and the ratio value obtained by dividing the global brightness by the preset brightness parameter is calculated, that is, the picture brightness situation, and the picture brightness situation is subjected to sliding average filtering to avoid the global brightness fluctuation being too large and causing the limiting ratio to be adjusted too quickly. When it is detected that the picture brightness situation is less than the brightness parameter threshold, no additional exposure limiting operation is required. When it is detected that the picture brightness is greater than or equal to the brightness parameter threshold, it means that the global brightness is lower than the preset brightness parameter. At this time, the picture brightness situation is multiplied by the gain brightness to increase the base of the picture brightness and avoid the picture from being too dark. In actual applications, when the picture brightness is greater than or equal to the brightness parameter threshold, the parameter strengths of the modules such as digital wide dynamic, contrast, and gamma will be linked at the same time. The larger the value, the stronger the brightness strength, so that the brightness of the dark area image is stretched to a brighter optimal effect.
[0089] Step S340, brightness waiting adjustment stage, if the number of mobile block seeds in the dynamic detection brightness adjustment stage is less than the preset number threshold, then the historical block area where the mobile block seeds are located in the previous frame is taken, and the brightness adjustment of the picture is guided according to the brightness value of the area corresponding to the historical block area in the current frame image. At the same time, the frame accumulation counting is performed, and the frame number of the frame image in which the number of mobile block seeds is less than the number threshold is accumulated to obtain the number of still picture frames. When it is detected that the number of still picture frames exceeds the still frame number threshold, it means that there is no moving object in the monitoring picture for a period of time. At this time, the brightness waiting adjustment stage is exited and the next stage is entered, wherein the above-mentioned still frame number threshold can be set by relevant technical personnel according to actual needs. Similarly, if the number of mobile block seeds in the frame picture exceeds the number threshold again, the frame accumulation is restarted, and the picture brightness is adjusted according to the content in the dynamic detection brightness adjustment stage.
[0090] Step S350, brightness recovery stage. This stage mainly uses the average brightness of the picture to guide the brightness adjustment, and stabilizes for a period of time to wait for the picture brightness to be restored to stability, and then enters the image stabilization stage. It should be noted that there are mainly two situations in which the brightness recovery stage is entered: one is that when there is no moving object in the picture for a period of time during the dynamic detection brightness adjustment stage, the brightness recovery stage will be entered to increase the picture brightness to avoid static reflective objects in the picture continuously dimming the picture brightness; the other is that when the picture jitter detection module detects that the camera is shaking or abnormal, it will directly enter the brightness recovery stage to avoid abnormal darkening of the image effect and affect the monitoring picture quality. Similarly, after the brightness recovery stage ends, the above-mentioned picture stabilization stage will be entered to wait for the next detection of a moving object.
[0091] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0092] Based on the same inventive concept, the embodiment of the present application also provides a camera dynamic fill light device for implementing the camera dynamic fill light method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more camera dynamic fill light device embodiments provided below can refer to the limitations of the camera dynamic fill light method above, and will not be repeated here.
[0093] In one embodiment, Figure 4 As shown, a camera dynamic fill light device is provided, including: an acquisition module 41 and a calculation module 42, wherein:
[0094] The acquisition module 41 is used to calculate the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in a plurality of frame image sequences; and determine the moving block seed in the current frame image according to the pixel difference;
[0095] The calculation module 42 is used to mark the current frame image as a moving picture frame when it is detected that the number of moving block seeds of the current frame image is greater than or equal to a preset number threshold, and after completing the marking of all moving picture frames of the image sequence, determine whether the frame number of all moving picture frames of the image sequence is greater than a preset frame number threshold;
[0096] The calculation module 42 is also used to determine the neighborhood sub-region corresponding to the moving block seed in each moving picture frame, determine the target adjustment brightness according to the moving block seed and the neighborhood sub-region of each moving picture frame, and perform fill light adjustment on each moving picture frame according to the target adjustment brightness.
[0097] Specifically, the acquisition module 41 calculates the pixel difference between each sub-region of the current frame image and the sub-region corresponding to the historical frame image in a sequence of several frame images, determines the moving block seeds in the current frame image according to the pixel difference, and sends the division result of the moving block seeds to the calculation module 42. When the calculation module 42 detects that the number of moving block seeds of the current frame image is greater than or equal to the number threshold, the current frame image is marked as a moving picture frame, and after completing the marking of all moving picture frames in the above image sequence, it is determined whether the frame number of all moving picture frames in the image sequence is greater than the frame number threshold. If so, the neighborhood sub-region corresponding to the moving block seed is determined in each moving picture frame, the target adjustment brightness is determined according to the moving block seeds and the neighborhood sub-region of each moving picture frame, and the fill light adjustment is performed on each moving picture frame according to the target adjustment brightness.
[0098] Each module in the above-mentioned dynamic fill light device for a camera can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0099] In one embodiment, a camera system is provided, the camera system includes an overexposure prevention module, and the overexposure prevention module also includes a jitter detection module:
[0100] The jitter detection module is used to obtain multiple frames of adjacent initial screen images, and detect whether the camera system has jitter through the initial screen images; after detecting that the camera system does not have jitter, the collected initial screen images are sent to the anti-overexposure module;
[0101] The overexposure prevention module is used to execute the camera dynamic fill light method as described in any one of the above texts based on the initial screen image.
[0102] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to a camera dynamic fill light method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera dynamic fill light method is implemented.
[0103] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0104] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0106] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A camera dynamic fill light method, characterized in that: The method comprises: Calculating pixel differences between each sub-region of a current frame image and a corresponding sub-region of at least one historical frame image in a sequence of multiple frame images; Determining the moving block seed in the current frame image according to the pixel difference, including: calculating a first pixel difference between a sub-region of the current frame image and a sub-region of a previous frame image, determining an image sub-region where the first pixel difference is greater than a preset first pixel threshold as the moving block seed, taking the region where the moving block seed is located as a first moving block region, and calculating a pixel difference between the first moving block region of the current frame image and the first moving block region of the previous frame image to obtain first moving block data; Calculating a second pixel difference between a sub-region of the current frame image and a sub-region of the previous frame image, determining an image sub-region whose second pixel difference is greater than a preset second pixel threshold as a second moving block region, and calculating a pixel difference between the second moving block region of the current frame image and the second moving block region of the previous frame image to obtain second moving block data; Calculate the difference between the first mobile block data and the second mobile block data to obtain interference data, and remove the interference data; When it is detected that the number of the moving block seeds of the current frame image is greater than or equal to a preset number threshold, marking the current frame image as a moving picture frame, and after completing the marking of all the moving picture frames of the image sequence, determining whether the frame number of all the moving picture frames of the image sequence is greater than a preset frame number threshold; If so, a neighborhood sub-region corresponding to the moving block seed is determined in each of the moving picture frames, a target adjustment brightness is determined based on the moving block seed and the neighborhood sub-region of each of the moving picture frames, and fill light adjustment is performed on each of the moving picture frames based on the target adjustment brightness.
2. The method according to claim 1, characterized in that Before calculating the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in the plurality of frame image sequences, the method further comprises: Acquire at least two adjacent frames of initial screen images captured by the camera, and determine the shaking sub-regions in the two adjacent frames of the initial screen images; When it is detected that the number of the jitter sub-areas in the initial screen image is greater than or equal to a preset jitter area threshold, the brightness of the image captured by the camera is increased, and the initial screen image captured by the camera is continuously monitored; When it is detected that the number of jitter sub-areas in the initial screen image is less than the jitter area threshold, the pixel difference between each sub-area of the current frame image and the corresponding sub-area of at least one historical frame image in the sequence of several frame images is calculated, wherein the jitter area threshold is greater than the number threshold.
3. The method according to claim 1, characterized in that The determining of the neighborhood sub-region corresponding to the mobile block seed in each of the moving picture frames comprises: The initial sub-neighborhoods adjacent to each of the moving block seeds in the moving picture frame are retrieved in turn, the brightness values of the initial sub-neighborhoods are compared with the brightness values of the corresponding moving block seeds, and the initial sub-neighborhoods whose comparison result similarity is greater than a preset brightness threshold are used as the neighborhood sub-areas.
4. The method according to claim 1, characterized in that: The step of adjusting the fill light of each of the moving picture frames according to the target brightness adjustment includes: Acquire the global brightness of the moving picture frame, and obtain the picture brightness condition based on the global brightness and a preset brightness parameter; When it is detected that the picture brightness is greater than or equal to a preset brightness parameter threshold, the picture brightness is adjusted based on a preset gain brightness, wherein the gain brightness is proportional to the picture brightness.
5. The method according to claim 1, characterized in that The method further comprises: When it is detected that the number of the mobile block seeds in the current frame image is less than the number threshold, the historical block areas where all the mobile block seeds in the previous frame image are stored are obtained, and based on the brightness values of the areas corresponding to all the historical block areas in the current frame image, fill light adjustment is performed on the picture image taken by the camera.
6. The method according to claim 5, characterized in that When it is detected that the number of the mobile block seeds in the current frame image is less than the number threshold, the method further includes: The frame images whose number of moving block seeds is less than the number threshold are accumulated to obtain the still picture frame number. When it is detected that the still picture frame number is greater than the preset still frame number threshold, the brightness of the frame image is increased, and the initial picture image captured by the camera is continuously monitored.
7. A dynamic fill light device for a camera, characterized in that: The device comprises: An acquisition module is used to calculate the pixel difference between each sub-region of the current frame image and the corresponding sub-region of at least one historical frame image in a sequence of several frame images; determine the moving block seed in the current frame image according to the pixel difference, including: calculating the first pixel difference between the sub-region of the current frame image and the sub-region of the previous frame image, determining the image sub-region where the first pixel difference is greater than a preset first pixel threshold as the moving block seed, taking the region where the moving block seed is located as the first moving block region, and calculating the pixel difference between the first moving block region of the current frame image and the first moving block region of the previous frame image to obtain first moving block data; calculating the second pixel difference between the sub-region of the current frame image and the sub-region of the previous frame image, determining the image sub-region where the second pixel difference is greater than a preset second pixel threshold as the second moving block region, and calculating the pixel difference between the second moving block region of the current frame image and the second moving block region of the previous frame image to obtain second moving block data; calculating the difference between the first moving block data and the second moving block data to obtain interference data, and eliminating the interference data; a calculation module, configured to mark the current frame image as a moving picture frame when it is detected that the number of the moving block seeds of the current frame image is greater than or equal to a preset number threshold, and after completing the marking of all the moving picture frames of the image sequence, determine whether the frame number of all the moving picture frames of the image sequence is greater than a preset frame number threshold; The calculation module is also used to determine, if yes, a neighborhood sub-region corresponding to the mobile block seed in each of the moving picture frames, determine a target adjustment brightness according to the mobile block seed and the neighborhood sub-region of each of the moving picture frames, and perform fill light adjustment on each of the moving picture frames according to the target adjustment brightness.
8. A camera system, characterized in that: The camera system includes an anti-overexposure module, and the anti-overexposure module includes a jitter detection module; The jitter detection module is used to obtain multiple adjacent frames of initial screen images, and detect whether the camera system has a jitter phenomenon through the initial screen images; After detecting that the camera system does not have a shaking phenomenon, sending the collected initial screen image to the anti-overexposure module; The anti-overexposure module is used to execute the camera dynamic fill light method according to any one of claims 1 to 6 based on the initial screen image.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
