CN118233756A - Image detection method, device and readable storage medium - Google Patents

Image detection method, device and readable storage medium Download PDF

Info

Publication number
CN118233756A
CN118233756A CN202211641351.1A CN202211641351A CN118233756A CN 118233756 A CN118233756 A CN 118233756A CN 202211641351 A CN202211641351 A CN 202211641351A CN 118233756 A CN118233756 A CN 118233756A
Authority
CN
China
Prior art keywords
flicker
detection result
image
mark
input image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211641351.1A
Other languages
Chinese (zh)
Inventor
饶青
张乐
杨作兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen MicroBT Electronics Technology Co Ltd
Original Assignee
Shenzhen MicroBT Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen MicroBT Electronics Technology Co Ltd filed Critical Shenzhen MicroBT Electronics Technology Co Ltd
Priority to CN202211641351.1A priority Critical patent/CN118233756A/en
Publication of CN118233756A publication Critical patent/CN118233756A/en
Pending legal-status Critical Current

Links

Landscapes

  • Picture Signal Circuits (AREA)

Abstract

The embodiment of the invention provides an image detection method, an image detection device and a readable storage medium. The method comprises the following steps: acquiring a current group of input images; the input image comprises two frames of non-high dynamic images; performing flicker detection on the input image to obtain a flicker detection result, wherein the flicker detection result is used for identifying whether a flicker phenomenon is detected or not; performing motion detection on the input image to obtain a motion detection result, wherein the motion detection result is used for identifying whether a moving target is detected or not; and determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result. The embodiment of the invention can improve the accuracy of flicker detection in the high-dynamic imaging process, determine corresponding processing operation according to a more accurate flicker detection result, and improve the quality of the output video image.

Description

Image detection method, device and readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image detection method, an image detection device, and a readable storage medium.
Background
The image sensor mostly adopts a rolling shutter (Rolling Shutter) to control exposure, and the exposure of the whole image is completed in a line-by-line exposure mode. The exposure time period is the same for different rows on the image, but the start and end times of the exposure are not identical. When the energy of the light received by different rows of the image is different, a Flicker (Flicker) phenomenon appears on the collected image, which is usually represented by a periodically changing bright and dark stripe on the image. In some complex light source environments, for example, when there are multiple light sources in a picture or there are plane shielding, reflection, etc., the mutual interference of the multiple light sources can cause the flicker expression form to be more changeable, and it is difficult to accurately detect. In addition, the exposure time of short frames is typically shorter and flicker is more likely to occur when high dynamic (HIGH DYNAMIC RANGE, HDR) image acquisition is performed.
The presence of flicker causes a significant degradation in the quality of video imaging, and the processing of flicker relies on the accurate detection of flicker.
Disclosure of Invention
The embodiment of the invention provides an image detection method, an image detection device and a readable storage medium, which can improve the accuracy of flicker detection in a high-dynamic imaging process, thereby improving the quality of an output video image.
In a first aspect, an embodiment of the present invention discloses an image detection method, which is applied to an image acquisition device, and the method includes:
acquiring a current group of input images; the input image comprises two frames of non-high dynamic images;
Performing flicker detection on the input image to obtain a flicker detection result, wherein the flicker detection result is used for identifying whether a flicker phenomenon is detected or not;
performing motion detection on the input image to obtain a motion detection result, wherein the motion detection result is used for identifying whether a moving target is detected or not;
And determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result.
Optionally, the determining, according to the flicker detection result and the motion detection result, a flicker detection flag corresponding to the input image includes:
If the flicker detection result mark does not detect the flicker phenomenon, determining a flicker detection mark corresponding to the input image as a first mark;
If the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target, determining a flicker detection mark corresponding to the input image as a second mark;
And if the flicker detection result identifier detects a flicker phenomenon and the motion detection result identifier detects a motion target, determining a flicker detection mark corresponding to the input image as a third mark.
Optionally, the method further comprises:
setting an initial flicker processing mark;
when a preset period arrives, determining whether a flicker detection mark of a history input image in the preset period meets an updating condition;
If the flicker detection mark of the history input image in the preset period is determined to meet the updating condition, updating the flicker processing mark according to the flicker detection mark of the history input image in the preset period;
And determining a flicker processing mode according to the updated flicker processing mark.
Optionally, the acquiring the input image of the current group includes:
acquiring a group of input images in an original format, which are acquired in real time by the image acquisition equipment;
Converting the input image in the original format into a brightness space format;
And carrying out brightness alignment on the two frames of non-high dynamic images in the brightness space format to obtain a current group of input images.
Optionally, the performing flicker detection on the input image to obtain a flicker detection result includes:
performing differential calculation on the two frames of non-high dynamic images to obtain a differential result;
performing binarization processing on the differential result to obtain a binarization result;
morphological filtering treatment is carried out on the binarization result to obtain a filtering result;
And determining a flicker detection result according to the duty ratio of the pixel points with the pixel values being preset values in the filtering result.
Optionally, the performing motion detection on the input image to obtain a motion detection result includes:
acquiring a binarization result corresponding to the input image of the current group, and acquiring a binarization result corresponding to the input image of the previous group of the current group;
Determining the superposition area of the binarization result corresponding to the current group of input images and the binarization result corresponding to the previous group of input images;
and determining a motion detection result according to the overlapping region.
Optionally, the two frames of non-high dynamic images include a long exposure frame image and a short exposure frame image; the two frames of non-high dynamic images comprise any two frames of multi-frame non-high dynamic images.
In a second aspect, an embodiment of the present invention discloses an image detection apparatus, applied to an image acquisition device, the apparatus including:
The data acquisition module is used for acquiring the input image of the current group; the input image comprises two frames of non-high dynamic images;
The flicker detection module is used for performing flicker detection on the input image to obtain a flicker detection result, and the flicker detection result is used for identifying whether a flicker phenomenon is detected or not;
The motion detection module is used for performing motion detection on the input image to obtain a motion detection result, and the motion detection result is used for identifying whether a moving target is detected or not;
and the result determining module is used for determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result.
Optionally, the result determining module includes:
The first determining submodule is used for determining a flicker detection mark corresponding to the input image as a first mark if the flicker phenomenon is not detected according to the flicker detection result mark;
The second determining submodule is used for determining that the flicker detection mark corresponding to the input image is a second mark if the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target;
And the third determining submodule is used for determining that the flicker detection mark corresponding to the input image is a third mark if the flicker detection result mark detects the flicker phenomenon and the motion detection result mark detects the motion target.
Optionally, the apparatus further comprises:
The initial setting module is used for setting an initial flicker processing mark;
the condition judging module is used for determining whether a flicker detection mark of a history input image in a preset period meets an updating condition or not when the preset period is reached;
The mark updating module is used for updating the flicker processing mark according to the flicker detection mark of the history input image in the preset period if the flicker detection mark of the history input image in the preset period is determined to meet the updating condition;
and the operation determining module is used for determining a flicker processing mode according to the updated flicker processing mark.
Optionally, the data acquisition module includes:
The original data acquisition sub-module is used for acquiring a group of original format input images acquired by the image acquisition equipment in real time;
A format conversion sub-module, configured to convert the input image in the original format into a luminance spatial format;
And the brightness alignment sub-module is used for carrying out brightness alignment on the two frames of non-high dynamic images in the brightness space format to obtain a current group of input images.
Optionally, the flicker detection module includes:
the differential calculation sub-module is used for carrying out differential calculation on the two frames of non-high dynamic images to obtain a differential result;
The binarization processing sub-module is used for carrying out binarization processing on the differential result to obtain a binarization result;
the filtering processing sub-module is used for carrying out morphological filtering processing on the binarization result to obtain a filtering result;
And the flicker result determining submodule is used for determining a flicker detection result according to the duty ratio of the pixel points with the pixel values being preset values in the filtering result.
Optionally, the motion detection module includes:
the result acquisition sub-module is used for acquiring a binarization result corresponding to the input image of the current group and acquiring a binarization result corresponding to the input image of the previous group of the current group;
The result comparison sub-module is used for determining the superposition area of the binarization result corresponding to the current group of input images and the binarization result corresponding to the previous group of input images;
and the motion result determining submodule is used for determining a motion detection result according to the overlapping region.
Optionally, the two frames of non-high dynamic images include a long exposure frame image and a short exposure frame image; the two frames of non-high dynamic images comprise any two frames of multi-frame non-high dynamic images.
In a third aspect, embodiments of the present invention disclose a machine-readable medium having instructions stored thereon, which when executed by one or more processors of an apparatus, cause the apparatus to perform an image detection method as described in one or more of the preceding.
The embodiment of the invention has the following advantages:
The image detection method provided by the embodiment of the invention can detect whether the flicker phenomenon exists in the high-dynamic imaging process, and motion detection is added in the flicker detection process, so that the flicker detection result and the motion detection result are combined to obtain a final detection result, and a flicker detection mark is set, thereby reducing interference caused by a moving target and improving accuracy of flicker detection. More accurate flicker processing operation can be determined according to the flicker detection flag, and the quality of the output video image can be improved. In addition, the image detection method provided by the embodiment of the invention does not use imaging characteristics under a single light source aiming at the single light source, so that the embodiment of the invention can be suitable for single light source scenes or scenes with complex light sources such as multiple light sources. Furthermore, the image detection method provided by the embodiment of the invention can improve the accuracy of flicker detection on the basis of low complexity without adding additional input data.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of an embodiment of an image detection method of the present invention;
FIG. 2 is a schematic diagram of converting a RAW format into a luminance space format according to the present invention;
Fig. 3 is a block diagram showing the structure of an embodiment of an image detection apparatus of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present invention may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, the term "and/or" as used in the specification and claims to describe an association of associated objects means that there may be three relationships, e.g., a and/or B, may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The term "plurality" in embodiments of the present invention means two or more, and other adjectives are similar.
Referring to fig. 1, there is shown a flow chart of steps of an embodiment of an image detection method of the present invention, the method being applicable to an image acquisition device, the method may comprise the steps of:
Step 101, acquiring a current group of input images; the input image comprises two frames of non-high dynamic images;
102, performing flicker detection on the input image to obtain a flicker detection result, wherein the flicker detection result is used for identifying whether a flicker phenomenon is detected or not;
step 103, performing motion detection on the input image to obtain a motion detection result, wherein the motion detection result is used for identifying whether a moving target is detected or not;
step 104, determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result.
The image detection method provided by the embodiment of the invention can be applied to image acquisition equipment, and the image acquisition equipment can be electronic equipment with an image acquisition function. The electronic device includes, but is not limited to: headphones, recording pens, home intelligent terminals (including air conditioners, refrigerators, electric cookers, water heaters, etc.), business intelligent terminals (including video phones, conference desktop intelligent terminals, etc.), wearable devices (including smart watches, smart glasses, etc.), financial intelligent terminals, and smart phones, tablet computers, personal digital assistants (Personal DIGITAL ASSISTANT, PDA), vehicle-mounted devices, servers, etc.
The image detection method provided by the embodiment of the invention can accurately detect whether the flicker phenomenon exists in the image when the image acquisition device acquires the high-dynamic (HDR) video image, and can adopt more proper flicker processing operation according to the detection result, thereby improving the quality of the video image output by the image acquisition device.
In HDR video, each frame is generated from a plurality of captured images, each captured image having a different brightness. The exposure refers to the total amount of light received by the photosensitive element during the exposure time. The exposure determines the brightness of the image, and the larger the exposure is, the brighter the image is; the smaller the exposure, the darker the image. The exposure amount can be changed by changing the exposure time, thereby changing the brightness of the captured image. For example, exposure time may be reduced by reducing the length of time light is incident on the image sensor (e.g., by increasing the speed at which the image sensor is scanned in a "rolling shutter" capture), thereby reducing the amount of exposure and thus the brightness of the image.
The image detection method provided by the embodiment of the invention does not need to add extra input data, and only needs to use the input data acquired by conventional high-dynamic imaging. In the embodiment of the present invention, a group of input images may include two frames of non-High Dynamic (HDR) images, hereinafter, the non-high dynamic images are simply referred to as non-HDR images, and one frame of HDR image to be output may be obtained after the two frames of non-HDR images are synthesized.
Alternatively, the two frames of non-high dynamic images may include one frame of long exposure frame image and one frame of short exposure frame image. In a specific implementation, the image acquisition device may acquire images in a DOL-HDR (Digital Overlap HDR, line-interleaved HDR) manner, and may obtain long-exposure frame images (denoted as RawL) and short-exposure frame images (denoted as RawS) by adjusting the exposure time.
Where long exposure frame images refer to images captured with longer exposure times, then more sensitive to details in dark areas of the image, but overexposure may occur in bright areas of the image; short exposure frame images refer to images captured with a shorter exposure time, then being more sensitive to detail in bright areas of the image, but showing loss of detail in dark areas of the image. Therefore, the HDR frame image can be formed by combining the long exposure frame image and the short exposure frame image, so that the bright area is not overexposed, and the dark area has details, thereby improving the image quality.
It should be noted that, in step 101, the current group of input images is acquired, and the input images after format conversion obtained by preprocessing the input data in the original format are acquired. The preprocessing may include at least one of format conversion, downsampling, brightness alignment, and denoising.
The original format refers to a RAW format, and an image in the RAW format is original data of converting a captured light source signal into a digital signal by an image sensor. The RAW format is lossless, containing the original color information of the object, etc. The RAW format generally adopts Bayer arrangement. The RAW format cannot be directly processed, and needs to be further processed after preprocessing operations such as format conversion.
In an alternative embodiment of the present invention, the acquiring the input image of the current group in step 101 may include:
step S11, acquiring a group of input images in an original format, which are acquired in real time by the image acquisition equipment;
Step S12, converting the input image in the original format into a brightness space format;
and S13, carrying out brightness alignment on the two frames of non-high dynamic images in the brightness space format to obtain a current group of input images.
After the image acquisition device acquires a group of input images in an original format in real time, the embodiment of the invention converts the input images in the original format into a brightness space format. The luminance space format refers to YUV format. Y in YUV format denotes brightness (Luma) and UV denotes chromaticity (Chroma). The YUV format separates the luminance information (Y) from the color information (UV), and the complete image can be represented without UV information, which is a black-and-white gray-scale image.
The embodiment of the invention converts the input image in the original format into a luminance space format and only retains luminance information (Y) and not color information (UV). The embodiment of the invention performs flicker detection in the Y space, can avoid interference caused by different brightness of different colors, and can improve the accuracy of flicker detection.
The RAW format generally adopts a Bayer arrangement format, and common Bayer arrangement formats include the following four types: GRBG, RGGB, BGGR, and GBRG. The embodiment of the invention can convert the Bayer arrangement format into the Y space through the following formula.
Y = R*weight_r + G1*weight_g1 + G2*weight_g2 + B*weight_b (1)
Wherein R, G, G2, and B represent pixel values corresponding to four pixel points. weight_r, weight_g1, weight_g2, and weight_b represent weights respectively corresponding to four pixel transitions to Y space, and weight_r+weight_g1+weight_g2+weight_b=1.
Referring to fig. 2, there is shown a schematic diagram of converting a RAW format into a luminance space format, and as shown in fig. 2, the converted image size is 1/4 of the image size before conversion (each width and height is reduced by 1/2).
Further, after the input image in the original format is converted into the luminance space format, the converted image can be downsampled, and the data volume can be reduced without affecting the detection accuracy. The embodiment of the invention does not limit the size of the downsampled image, and can set the sampling rate according to the actual requirement and the size of the image supported by hardware resources.
In the embodiment of the present invention, the two frames of non-high dynamic images may include a frame of long exposure frame image and a frame of short exposure frame image, and alignment compensation needs to be performed on the long exposure frame image and the short exposure frame image in the luminance space (Y). Illustratively, the embodiment of the present invention aligns the luminance space of the short exposure frame image to the luminance space of the long exposure frame image with reference to the luminance space of the long exposure frame image.
In the embodiment of the present invention, the long exposure frame image is denoted as RawL, the short exposure frame image is denoted as RawS, and the brightness alignment can be performed by the following formula.
RawS' = (RawS - blc) * ratio + blc (2)
Wherein RawS' is the short exposure frame image after brightness alignment, and ratio is the exposure time ratio of the long exposure frame image and the short exposure frame image, such as the exposure time of the long exposure frame image/the exposure time of the short exposure frame image. blc is a calibrated value of black level.
If ISO (sensitivity) is adjusted while exposure is performed, the exposure time ratio of the long exposure frame image and the short exposure frame image is: (exposure time of long exposure frame image. ISO of long exposure frame image)/(exposure time of short exposure frame image. ISO of short exposure frame image).
Further, after the brightness alignment is performed on the two frames of non-high dynamic images, noise reduction processing may be performed. Since the exposure time of the short exposure frame image is generally shorter, the short exposure frame image has more noise than the long exposure frame image, and may interfere with subsequent flicker detection, which affects the accuracy of flicker detection. Therefore, the embodiment of the invention carries out noise reduction processing on the two frames of non-high dynamic images with aligned brightness so as to reduce the interference of noise on detection and improve the accuracy of flicker detection. The method for noise reduction processing is not limited in the embodiment of the invention, and the noise reduction processing can be performed in an average filtering manner by way of example.
In practical application, if a moving object exists in an image, the luminance of partial areas of a long exposure frame image and a short exposure frame image is inconsistent when the moving object moves, and the characteristic has a certain similarity with a flicker phenomenon and is easy to be detected as the flicker phenomenon by mistake. Therefore, in order to avoid false detection of the motion characteristics as a flicker phenomenon, the embodiment of the invention increases the motion detection in the flicker detection process, combines the flicker detection result and the motion detection result, can reduce the interference caused by a moving target, determines a more accurate flicker detection result, and improves the quality of the output video image.
In an optional embodiment of the present invention, the performing flicker detection on the input image in step 102 to obtain a flicker detection result may include:
s21, carrying out differential calculation on the two frames of non-high dynamic images to obtain a differential result;
s22, performing binarization processing on the differential result to obtain a binarization result;
s23, morphological filtering processing is carried out on the binarization result to obtain a filtering result;
and step S24, determining a flicker detection result according to the duty ratio of the pixel points with the pixel values of the filtering result being preset values.
After the input image of the current group is acquired, the embodiment of the invention firstly carries out flicker detection on the input image of the current group to obtain a flicker detection result. The flicker detection is preliminary flicker detection, the obtained flicker detection result is not the final detection result, and the final detection result needs to be determined by combining the motion detection result.
Because the exposure time of the long exposure frame image is different from that of the short exposure frame image, when flicker exists, the long exposure frame image and the short exposure frame image have stripe-shaped periodic difference in brightness, so the embodiment of the invention performs preliminary flicker detection by performing differential calculation on two frames of non-high dynamic images.
Specifically, the differential calculation can be expressed as follows:
diff = abs(RawL – RawS') (3)
the above formula (3) shows that the difference is calculated for the pixel values at the corresponding positions in the long exposure frame image and the short exposure frame image, and the difference result diff is obtained. Where abs denotes the calculated absolute value.
And then, carrying out binarization processing on the differential result to obtain a binarization result. The differential calculation can be expressed as follows:
Smap = binarythreshold(diff) (4)
wherein Smap is a binarization result, binarythreshold is a binarization operation, and diff is a difference result calculated in step S21. Binarization can convert a gray image into a binary image, i.e., the gray value of a pixel point on the image is set to 0 or 255, so that the whole image exhibits a visual effect of only black and white. In a specific implementation, each pixel point in the binary image may be represented by 0 or 1 after binarization. Illustratively, a pixel value of 0 represents a pixel (black pixel) having a gray value of 0, and a pixel value of 1 represents a pixel (white pixel) having a gray value of 255. Thus, each pixel only needs to occupy 1bit of memory space.
And then, morphological filtering processing is carried out on the binarization result to obtain a filtering result. Morphological filtering is a mathematical tool that analyzes images based on morphological structural elements. The basic idea of morphological filtering is to measure and extract the corresponding shape in the image with structural elements having a certain morphology for the purpose of image analysis and recognition. The basic operation of morphological filtering includes the following 4 types: expansion, corrosion, open operation and closed operation. The embodiment of the invention carries out morphological filtering processing on the binarization result, can remove isolated noise points in the binarization image, and only keeps continuous large-area areas so as to reduce interference caused by noise.
And finally, determining a flicker detection result according to the duty ratio of the pixel points with the pixel values of the filtering result being the preset value. The pixel point with the pixel value being a preset value refers to a pixel point (white pixel point) with a gray value of 255, and the preset value may be 1.
In the embodiment of the invention, if the duty ratio of the pixel point with the pixel value being the preset value in the filtering result exceeds the preset proportion, flicker is considered to exist; and if the duty ratio of the pixel points with the pixel values being the preset values in the filtering result is smaller than the preset proportion, the flicker is considered to be absent. It should be noted that, the scintillation detection result is a preliminary detection result, and the embodiment of the invention fuses the preliminary detection result with the motion detection result to determine, so as to obtain a final detection result.
It may be appreciated that, in the embodiment of the present invention, the value of the preset proportion is not limited, the preset proportion may be set according to actual requirements, and the preset proportion may be an empirical value.
In an optional embodiment of the present invention, the performing motion detection on the input image in step 103 to obtain a motion detection result may include:
Step S31, obtaining a binarization result corresponding to the input image of the current group, and obtaining a binarization result corresponding to the input image of the previous group of the current group;
step S32, determining the overlapping area of the binarization result corresponding to the current group of input images and the binarization result corresponding to the previous group of input images;
and step S33, determining a motion detection result according to the overlapping region.
After flicker detection is performed on the input image of the current group, the embodiment of the present invention performs motion detection on the input image of the current group. Of course, in the implementation, the motion detection may be performed on the input image of the current group first, and then the flicker detection may be performed on the input image of the current group. The order of steps 102 and 103 is not limited by the embodiment of the present invention.
In the process that the image acquisition equipment starts to acquire the video image, the embodiment of the invention carries out flicker detection on each group of input images acquired in real time, and stores a binarization result Smap corresponding to each group of input images calculated in the flicker detection process.
When motion detection is performed on the input image of the current group, a binarization result corresponding to the input image of the current group and a binarization result corresponding to the input image of the previous group can be compared, and a motion detection result is determined according to the comparison result.
Illustratively, assume that the binarization result corresponding to the input image of the current group is denoted Smap _t, and the binarization result corresponding to the input image of the previous group of the current group is denoted Smap _t-1. By comparing Smap _t and Smap _t-1, the overlapping area of the two can be obtained, and the motion detection result of the input image of the current group can be determined according to the overlapping area.
Further, the overlapping area refers to an overlapping area of pixels with gray values of 255 (i.e., pixels with pixel values of a preset value). In the above example, by comparing Smap _t and Smap _t-1, a region of overlap with a gray value of 255 of pixels in the input image of the previous group can be determined, and if the area of the region of overlap exceeds a preset threshold, a moving object is considered to exist in the input image of the current group; if the area of the overlapping region is smaller than the preset threshold value, the moving object is considered to be absent in the input image of the current group.
It should be noted that, in the embodiment of the present invention, the value of the preset threshold is not limited, the preset threshold may be set according to actual needs, and the preset threshold may be an empirical value.
In an optional embodiment of the present invention, determining, in step 104, a flicker detection flag corresponding to the input image according to the flicker detection result and the motion detection result may include:
Step S41, if the flicker detection result mark does not detect the flicker phenomenon, determining a flicker detection mark corresponding to the input image as a first mark;
Step S42, if the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target, determining a flicker detection mark corresponding to the input image as a second mark;
Step S43, if the flicker detection result identifier detects a flicker phenomenon and the motion detection result identifier detects a moving target, determining that a flicker detection mark corresponding to the input image is a third mark.
In the embodiment of the present invention, the scintillation detection result obtained in step 102 is a preliminary detection result. The embodiment of the invention combines the flicker detection result with the motion detection result, determines the final detection result, and sets the corresponding flicker detection mark according to the final detection result.
Specifically, if the flicker detection result obtained in step 102 identifies that the flicker phenomenon is not detected, it is determined that the flicker detection flag corresponding to the input image is the first flag. Illustratively, the first flag is set to res=0, and is used to identify that the final detection result is that there is no flicker.
If the flicker detection result obtained in step 102 indicates that a flicker phenomenon is detected, and the motion detection result obtained in step 103 indicates that a moving object is not detected, it is determined that the flicker detection flag corresponding to the input image is a second flag. Illustratively, the second flag is set to res=1, and is used to identify that the final detection result is that there is flicker.
If the flicker detection result identifier obtained in step 102 detects a flicker phenomenon, and the motion detection result identifier obtained in step 103 detects a moving object, it is difficult to distinguish the flicker phenomenon from the moving object at this time, and in order to avoid misregarding the moving object as the flicker phenomenon, the flicker detection flag corresponding to the input image is determined to be a third flag. Illustratively, a third flag is set to res= -1, the third flag being used to identify that the detection result is invalid.
Depending on the flicker detection flag, an adaptive processing operation may be performed. For example, when the flicker detection flag is the first flag, it is indicated that there is no flicker, and the flicker elimination processing operation is not performed. When the flicker detection flag is the second flag, indicating that flicker is present, a flicker removal processing operation is performed. When the flicker detection flag is the third flag, it is indicated that the detection result is invalid, and at this time, a default processing operation may be set, such as setting the default processing operation to not execute the flicker elimination processing operation or setting the default processing operation to execute the flicker elimination processing operation.
According to the embodiment of the invention, the motion detection is added in the flicker detection process, the flicker detection result is combined with the motion detection result, so that a more accurate flicker detection result is obtained, the interference caused by a moving target can be reduced, the accuracy of flicker detection is improved, the corresponding processing operation is determined according to the more accurate flicker detection result, and the quality of an output video image can be improved.
However, in practical applications, if the flow of the flicker processing operation is updated in real time according to the flicker detection flag of each group of input images, the final imaging effect may jump back and forth due to the jump of the detection result, which affects the effect of the output video image. To solve this problem, the embodiment of the present invention continuously monitors the detection results of the continuous plural sets of input images, and periodically determines whether the flow of the blinking operation processing needs to be switched.
In an alternative embodiment of the present invention, the method may further include:
step S51, setting an initial flicker processing mark;
Step S52, when a preset period arrives, determining whether a flicker detection mark of a history input image in the preset period meets an updating condition;
step S53, if it is determined that the flicker detection mark of the history input image in the preset period meets the update condition, updating the flicker processing mark according to the flicker detection mark of the history input image in the preset period;
Step S54, determining a flicker processing mode according to the updated flicker processing mark.
The flicker processing flag may be used to indicate a flicker operation processing procedure employed by the image capture device. Illustratively, the flicker processing flag is marked as a flag, and the value of the flag may be 0 or 1. If flag=0, it indicates that the flicker operation processing flow is not to execute flicker elimination processing; if flag=1, it indicates that the flicker operation processing flow is to execute flicker elimination processing.
After the image capturing device is turned on, an initial flicker processing flag may be set, for example, the initial flicker processing flag is set to flag=0. Of course, the initial flicker processing flag may be set to flag=1.
In the process that the image acquisition device starts to acquire video images, the embodiment of the invention executes steps 102 to 104 on each group of input images acquired in real time, and stores the flicker detection mark corresponding to each group of input images.
When a preset period arrives, determining whether a flicker detection mark of a history input image in the preset period meets an updating condition. The preset period may refer to the collection of video images for a preset duration or the collection of a preset number of video image frames.
Optionally, the determining that the flicker detection flag of the history input image in the preset period meets the update condition may include: and if the valid same flicker detection marks exceed the preset quantity in the flicker detection marks of the history input images in the preset period, determining that the flicker detection marks of the history input images in the preset period meet the updating condition.
Wherein the valid flicker detection flags include a first flag (res=0) and a second flag (res=1). The preset period and the preset number can be set according to actual needs. Illustratively, assuming that the preset period is 4s, the flicker detection flag of 100 sets of input images is held in the preset period. If the number of first flags (res=0) of the 100 flicker detection flags exceeds a preset number (e.g. 80), and the current flicker processing flag is not 0, the flicker processing flag is updated to flag=0. If the number of second flags (res=1) in the 100 flicker detection flags exceeds a preset number (e.g. 80), and the current flicker processing flag is not 1, the flicker processing flag is updated to flag=1.
After the two frames of non-HDR images are subjected to the flicker processing operation flow, one frame of HDR image can be synthesized and output. According to the embodiment of the invention, the detection results of the continuous multiple groups of input images in time sequence are continuously monitored, whether the flicker operation processing flow needs to be switched is periodically judged, so that the stability of a flicker detection conclusion can be improved, the back-and-forth jump of a final imaging effect caused by the back-and-forth jump of the detection results is avoided, and the quality of the output video image can be further improved.
The image detection method of the embodiment of the invention can be applied to a scene of two frames of HDR, wherein the two frames of HDR refer to one frame of HDR image synthesized by two frames of non-HDR images. Further, the image detection method of the embodiment of the present invention may be also applicable to a scene of a plurality of frames HDR (where a plurality of frames refer to more than two frames), where a plurality of frames HDR refers to that one frame of HDR image is synthesized from a plurality of frames of non-HDR images.
In an alternative embodiment of the present invention, the two frames of the non-HDR image included in the current set of input images described in step 101 may be any two frames of a multi-frame non-HDR image.
For example, taking a 3 frame HDR scene as an example, the image capturing device may capture images in DOL3-HDR mode, where the input image captured by the image capturing device includes 3 frames of non-HDR images, such as input0, input1, and input2. The 3 frames of non-HDR images input0, input1, and input2 may be synthesized to output one frame of HDR image.
The DOL2-HDR approach refers to: an image sensor (sensor) completes one frame exposure, the sensor generates two frames of non-HDR images, the two frames of non-HDR images are transmitted to an Image Signal Processing (ISP), and the ISP synthesizes the two frames of non-HDR images into one frame of HDR image.
The DOL3-HDR approach refers to: the sensor completes one frame exposure, the sensor generates 3 frames of non-HDR images, the 3 frames of non-HDR images are transmitted to the ISP, and the ISP synthesizes the 3 frames of non-HDR images into one frame of HDR image.
In the embodiment of the present invention, any two frames of non-HDR images may be selected from the 3 frames of non-HDR images as the input image of the current group to be processed in step 101. In the 3-frame HDR scene, the selected current group of input images includes a frame of long exposure frame image and a frame of short exposure frame image. Alternatively, in a multi-frame HDR scenario, the first and last frames of non-HDR images in the multi-frame non-HDR image may be selected as the input images of the current set. For example, in the 3-frame HDR scenario described above, input0 and input2 may be selected as the current set of input images, performing the operations of steps 102-104. Likewise, for the next set of 3 frames of non-HDR images (e.g., input4, input5, and input 6) acquired by the image acquisition device, input4 and input6 may be selected as the current set of input images, and the operations of steps 102-104 are performed. And so on.
Alternatively, in a multi-frame HDR scenario, the operations of steps 102 to 104 may be performed on a multi-frame non-HDR image, two by two, and then one target flicker detection flag may be determined from the calculated flicker detection flags. For example, in the 3-frame HDR scenario described above, input0 and input1 are selected as the current group of input images, and the operations of steps 102 to 104 are performed, resulting in corresponding flicker detection flags. Input0 and input2 are selected as the current group of input images, and the operations of steps 102 to 104 are performed to obtain corresponding flicker detection flags. Input1 and input2 are selected as the current group of input images, and the operations of steps 102 to 104 are performed to obtain corresponding flicker detection marks. Then, a target flicker detection flag is determined from the three calculated flicker detection flags. For example, if two flicker detection markers in the three calculated flicker detection markers are the first markers, it may be determined that the target flicker detection markers corresponding to the input images input0, input1, and input2 are the first markers.
It should be noted that, in the embodiment of the present invention, two frames of HDR and three frames of HDR are mainly used as examples for description, and the detection method of the embodiment of the present invention may be applicable to any multi-frame HDR scene, and the operation processes are similar and may be mutually referred to.
In a specific implementation, the image acquisition device may include a flicker elimination operation module, where the flicker elimination operation module may periodically read a flicker processing flag, and execute a corresponding flicker operation processing procedure according to the current flicker processing flag. For example, when the current flicker processing flag is flag=1, the flicker elimination operation module performs a flicker elimination processing operation on the currently acquired input image; when the current flicker processing flag is flag=0, the flicker elimination operation module does not perform a flicker elimination processing operation on the currently acquired input image.
In summary, the image detection method of the embodiment of the invention can detect whether the flicker phenomenon exists in the high dynamic imaging process, and motion detection is added in the flicker detection process, and the flicker detection result and the motion detection result are combined to obtain a final detection result, and a flicker detection mark is set, so that the interference caused by a moving target can be reduced, and the accuracy of flicker detection is improved. More accurate flicker processing operation can be determined according to the flicker detection flag, and the quality of the output video image can be improved. In addition, the image detection method provided by the embodiment of the invention does not use imaging characteristics under a single light source aiming at the single light source, so that the embodiment of the invention can be suitable for single light source scenes or scenes with complex light sources such as multiple light sources. Furthermore, the image detection method provided by the embodiment of the invention can improve the accuracy of flicker detection on the basis of low complexity without adding additional input data.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 3, there is shown a block diagram of an embodiment of an image detection apparatus of the present invention, which is applicable to a video capture device, and which may include:
a data acquisition module 301, configured to acquire a current group of input images; the input image comprises two frames of non-high dynamic images;
the flicker detection module 302 is configured to perform flicker detection on the input image to obtain a flicker detection result, where the flicker detection result is used to identify whether a flicker phenomenon is detected;
a motion detection module 303, configured to perform motion detection on the input image to obtain a motion detection result, where the motion detection result is used to identify whether a moving target is detected;
And a result determining module 304, configured to determine a flicker detection flag corresponding to the input image according to the flicker detection result and the motion detection result.
Optionally, the result determining module includes:
The first determining submodule is used for determining a flicker detection mark corresponding to the input image as a first mark if the flicker phenomenon is not detected according to the flicker detection result mark;
The second determining submodule is used for determining that the flicker detection mark corresponding to the input image is a second mark if the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target;
And the third determining submodule is used for determining that the flicker detection mark corresponding to the input image is a third mark if the flicker detection result mark detects the flicker phenomenon and the motion detection result mark detects the motion target.
Optionally, the apparatus further comprises:
The initial setting module is used for setting an initial flicker processing mark;
the condition judging module is used for determining whether a flicker detection mark of a history input image in a preset period meets an updating condition or not when the preset period is reached;
The mark updating module is used for updating the flicker processing mark according to the flicker detection mark of the history input image in the preset period if the flicker detection mark of the history input image in the preset period is determined to meet the updating condition;
and the operation determining module is used for determining a flicker processing mode according to the updated flicker processing mark.
Optionally, the data acquisition module includes:
The original data acquisition sub-module is used for acquiring a group of original format input images acquired by the image acquisition equipment in real time;
A format conversion sub-module, configured to convert the input image in the original format into a luminance spatial format;
And the brightness alignment sub-module is used for carrying out brightness alignment on the two frames of non-high dynamic images in the brightness space format to obtain a current group of input images.
Optionally, the flicker detection module includes:
the differential calculation sub-module is used for carrying out differential calculation on the two frames of non-high dynamic images to obtain a differential result;
The binarization processing sub-module is used for carrying out binarization processing on the differential result to obtain a binarization result;
the filtering processing sub-module is used for carrying out morphological filtering processing on the binarization result to obtain a filtering result;
And the flicker result determining submodule is used for determining a flicker detection result according to the duty ratio of the pixel points with the pixel values being preset values in the filtering result.
Optionally, the motion detection module includes:
the result acquisition sub-module is used for acquiring a binarization result corresponding to the input image of the current group and acquiring a binarization result corresponding to the input image of the previous group of the current group;
The result comparison sub-module is used for determining the superposition area of the binarization result corresponding to the current group of input images and the binarization result corresponding to the previous group of input images;
and the motion result determining submodule is used for determining a motion detection result according to the overlapping region.
Optionally, the two frames of non-high dynamic images include a long exposure frame image and a short exposure frame image; the two frames of non-high dynamic images comprise any two frames of multi-frame non-high dynamic images.
The image detection device provided by the embodiment of the invention can detect whether the flicker phenomenon exists in the high-dynamic imaging process, and motion detection is added in the flicker detection process, so that the flicker detection result and the motion detection result are combined to obtain a final detection result, a flicker detection mark is set, interference caused by a moving target can be reduced, and the accuracy of flicker detection is improved. More accurate flicker processing operation can be determined according to the flicker detection flag, and the quality of the output video image can be improved. In addition, the image detection device of the embodiment of the invention does not use imaging characteristics under a single light source aiming at the single light source, so the embodiment of the invention can be suitable for single light source scenes or scenes with complex light sources such as multiple light sources. Furthermore, the image detection device of the embodiment of the invention can improve the accuracy of flicker detection on the basis of low complexity without adding additional input data.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The embodiment of the present application further provides a non-transitory computer readable storage medium, where the instructions in the storage medium are executed by a processor of an apparatus (server or terminal) to enable the apparatus to perform the description of the image detection method in the embodiment corresponding to fig. 1, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments according to the present application, reference is made to the description of the method embodiments according to the present application.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.
The foregoing has described in detail the methods, apparatus and machine-readable storage medium for image detection provided by the present invention, and specific examples have been presented herein to illustrate the principles and embodiments of the present invention, the above examples being provided only to assist in understanding the methods and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. An image detection method, characterized by being applied to an image acquisition device, the method comprising:
acquiring a current group of input images; the input image comprises two frames of non-high dynamic images;
Performing flicker detection on the input image to obtain a flicker detection result, wherein the flicker detection result is used for identifying whether a flicker phenomenon is detected or not;
performing motion detection on the input image to obtain a motion detection result, wherein the motion detection result is used for identifying whether a moving target is detected or not;
And determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result.
2. The method according to claim 1, wherein determining a flicker detection flag corresponding to the input image based on the flicker detection result and the motion detection result comprises:
If the flicker detection result mark does not detect the flicker phenomenon, determining a flicker detection mark corresponding to the input image as a first mark;
If the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target, determining a flicker detection mark corresponding to the input image as a second mark;
And if the flicker detection result identifier detects a flicker phenomenon and the motion detection result identifier detects a motion target, determining a flicker detection mark corresponding to the input image as a third mark.
3. The method according to claim 1, wherein the method further comprises:
setting an initial flicker processing mark;
when a preset period arrives, determining whether a flicker detection mark of a history input image in the preset period meets an updating condition;
If the flicker detection mark of the history input image in the preset period is determined to meet the updating condition, updating the flicker processing mark according to the flicker detection mark of the history input image in the preset period;
And determining a flicker processing mode according to the updated flicker processing mark.
4. The method of claim 1, wherein the acquiring the current set of input images comprises:
acquiring a group of input images in an original format, which are acquired in real time by the image acquisition equipment;
Converting the input image in the original format into a brightness space format;
And carrying out brightness alignment on the two frames of non-high dynamic images in the brightness space format to obtain a current group of input images.
5. The method according to claim 1, wherein said performing flicker detection on said input image to obtain a flicker detection result comprises:
performing differential calculation on the two frames of non-high dynamic images to obtain a differential result;
performing binarization processing on the differential result to obtain a binarization result;
morphological filtering treatment is carried out on the binarization result to obtain a filtering result;
And determining a flicker detection result according to the duty ratio of the pixel points with the pixel values being preset values in the filtering result.
6. The method of claim 5, wherein the performing motion detection on the input image to obtain a motion detection result comprises:
acquiring a binarization result corresponding to the input image of the current group, and acquiring a binarization result corresponding to the input image of the previous group of the current group;
Determining the superposition area of the binarization result corresponding to the current group of input images and the binarization result corresponding to the previous group of input images;
and determining a motion detection result according to the overlapping region.
7. The method according to any one of claims 1 to 6, wherein the two frames of non-high dynamic images include a long exposure frame image and a short exposure frame image; the two frames of non-high dynamic images comprise any two frames of multi-frame non-high dynamic images.
8. An image detection apparatus, characterized by being applied to an image acquisition device, the apparatus comprising:
The data acquisition module is used for acquiring the input image of the current group; the input image comprises two frames of non-high dynamic images;
The flicker detection module is used for performing flicker detection on the input image to obtain a flicker detection result, and the flicker detection result is used for identifying whether a flicker phenomenon is detected or not;
The motion detection module is used for performing motion detection on the input image to obtain a motion detection result, and the motion detection result is used for identifying whether a moving target is detected or not;
and the result determining module is used for determining a flicker detection mark corresponding to the input image according to the flicker detection result and the motion detection result.
9. The apparatus of claim 8, wherein the result determination module comprises:
The first determining submodule is used for determining a flicker detection mark corresponding to the input image as a first mark if the flicker phenomenon is not detected according to the flicker detection result mark;
The second determining submodule is used for determining that the flicker detection mark corresponding to the input image is a second mark if the flicker detection result mark detects a flicker phenomenon and the motion detection result mark does not detect a moving target;
And the third determining submodule is used for determining that the flicker detection mark corresponding to the input image is a third mark if the flicker detection result mark detects the flicker phenomenon and the motion detection result mark detects the motion target.
10. A machine readable storage medium having instructions stored thereon, which when executed by one or more processors of an apparatus, cause the apparatus to perform the image detection method of any of claims 1 to 7.
CN202211641351.1A 2022-12-20 2022-12-20 Image detection method, device and readable storage medium Pending CN118233756A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211641351.1A CN118233756A (en) 2022-12-20 2022-12-20 Image detection method, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211641351.1A CN118233756A (en) 2022-12-20 2022-12-20 Image detection method, device and readable storage medium

Publications (1)

Publication Number Publication Date
CN118233756A true CN118233756A (en) 2024-06-21

Family

ID=91507981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211641351.1A Pending CN118233756A (en) 2022-12-20 2022-12-20 Image detection method, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN118233756A (en)

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN109040609B (en) Exposure control method, exposure control device, electronic equipment and computer-readable storage medium
CN110022469B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110766621B (en) Image processing method, image processing device, storage medium and electronic equipment
US8520094B2 (en) Flicker detecting circuit and method in image sensor
CN110033418B (en) Image processing method, image processing device, storage medium and electronic equipment
CN107680056B (en) Image processing method and device
CN110445988A (en) Image processing method, device, storage medium and electronic equipment
CN110519485B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110349163B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
US8749699B2 (en) Method and device for video processing using a neighboring frame to calculate motion information
CN108322651B (en) Photographing method and device, electronic equipment and computer readable storage medium
CN109155052A (en) Image real time transfer for multiple-exposure wide dynamic range image data
CN110445989A (en) Image processing method, device, storage medium and electronic equipment
CN110443766B (en) Image processing method and device, electronic equipment and readable storage medium
CN110728705B (en) Image processing method, image processing device, storage medium and electronic equipment
CN113163127B (en) Image processing method, device, electronic equipment and storage medium
CN110047060B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110740266B (en) Image frame selection method and device, storage medium and electronic equipment
US20210125318A1 (en) Image processing method and apparatus
CN110266965B (en) Image processing method, image processing device, storage medium and electronic equipment
CN117218039A (en) Image processing method, device, computer equipment and storage medium
CN118233756A (en) Image detection method, device and readable storage medium
US11153467B2 (en) Image processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination