EP-3879814-B1 - METHOD AND APPARATUS FOR AUTOMATICALLY DETECTING AND SUPPRESSING FRINGES, ELECTRONIC DEVICE AND COMPUTER-READABLE STORAGE MEDIUM
Inventors
- ZHAO, JIAN
- XU, QIONG
- ZHANG, WENPING
Dates
- Publication Date
- 20260506
- Application Date
- 20190403
Claims (13)
- A method for automatically detecting and suppressing fringes, comprising: acquiring (210) an image shot by a camera and shot in a multi-frame synthesis manner, recognizing a fringe of the image, calculating a pixel point YUV value and determining feature information; characterized in that , the method further comprises: if it is determined that the fringe exists in the image, acquiring (220), among shooting parameters of the camera, the following as the fringe action parameters: a shortest frame selection brightness threshold, and a shortest frame brightness adjustment parameter; increasing (230) a value of the shortest frame selection brightness threshold according to a first ratio to reduce a probability of selecting a shortest frame image in a multi-frame synthesis process; and adjusting (240) the shortest frame brightness adjustment parameter to reduce a brightness value of the shortest frame image; wherein acquiring the image shot by the camera, and recognizing the fringe of the image comprises: acquiring the image shot by the camera, and constructing a feature matrix matched with a detection area according to the feature information of each pixel point within the detection area in the image; wherein, the feature information is chrominance information of the pixel point, a matrix value of a pixel point in the feature matrix associated with the fringe is a first numerical value, and a matrix value of a pixel point in the feature matrix not associated with the fringe is a second numerical value; performing a convolution operation on the feature matrix and a preset fringe feature matrix; and determining that the fringe exists in the image based on a determination result that a convolution operation result satisfies a preset numerical condition; wherein before constructing the feature matrix matched with the detection area according to the feature information of the each pixel point within the detection area in the image, the method further comprises: acquiring an RGB value of the each pixel point within the detection area in the image, and converting the RGB value into a corresponding YUV value; and using a V value of the each pixel point as the feature information of the each pixel point.
- The method of claim 1, wherein constructing the feature matrix matched with the detection area according to the feature information of the each pixel point within the detection area in the image comprises: calculating an average intensity of the feature information according to an image resolution of the detection area and the feature information of the each pixel point; constructing a standard feature matrix according to the image resolution of the detection area; acquiring one matrix element position of the standard feature matrix as a target matrix position; setting an element value of the target matrix position as the first numerical value based on a determination result that feature information of a pixel point corresponding to the target matrix position is greater than the average intensity; and setting the element value of the target matrix position as the second numerical value based on a determination result that the feature information of the pixel point corresponding to the target matrix position is less than or equal to the average intensity.
- The method of claim 1, wherein the shortest frame brightness adjustment parameter comprises an exposure ratio of the camera; adjusting the shortest frame brightness adjustment parameter to reduce the brightness value of the shortest frame image comprises: calculating an average brightness value of the shortest frame image according to at least two frame images shot by the camera; calculating an exposure ratio increase amplitude according to the average brightness value and a preset incremental correspondence; wherein in the incremental correspondence, the average brightness value is positively correlated with the exposure ratio increase amplitude; and keeping longest frame shutter time unchanged, and increasing the exposure ratio of the camera according to the exposure ratio increase amplitude to reduce the brightness value of the shortest frame image.
- The method of claim 1, wherein acquiring the image shot by the camera, and recognizing the fringe of the image further comprises: acquiring a brightness recognition parameter of a current shooting environment of the camera; and acquiring the image shot by the camera and recognizing the fringe of the image based on a determination result that a brightness of the current shooting environment satisfies a fringe recognition condition according to the brightness recognition parameter.
- The method of claim 4, after acquiring the brightness recognition parameter of the current shooting environment of the camera, the method further comprises: controlling the camera to continue to shoot images according to a default configuration parameter matched with the current shooting environment based on a determination result that the brightness of the current shooting environment does not satisfy the fringe recognition condition according to the brightness recognition parameter.
- The method of claim 1, wherein the method further comprises: acquiring a brightness recognition parameter matched with a current shooting environment of the camera; and controlling the camera to continue to shoot images according to a default configuration parameter matched with the current shooting environment based on a determination result that a brightness of the current shooting environment satisfies a configuration recovery condition according to the brightness recognition parameter.
- An apparatus for automatically detecting and suppressing fringes, comprising: a fringe recognition module (510), which is configured to acquire an image shot by a camera and shot in a multi-frame synthesis manner, recognize a fringe of the image, calculate a pixel point YUV value and determining feature information; characterized in that , the apparatus further comprises: a fringe action parameter acquisition module (520), which is configured to: if it is determined that the fringe exists in the image, acquire the following fringe action parameters among shooting parameters of the camera based on a recognition result obtained by recognizing the fringe of the image: a shortest frame selection brightness threshold, and a shortest frame brightness adjustment parameter; and a fringe suppression module (530), which is configured to perform: increasing a value of the shortest frame selection brightness threshold according to a first ratio to reduce a probability of selecting a shortest frame image in a multi-frame synthesis process; and adjusting the shortest frame brightness adjustment parameter to reduce a brightness value of the shortest frame image; wherein the fringe recognition module comprises: a feature matrix construction unit, which is configured to acquire the image shot by the camera, and construct a feature matrix matched with a detection area according to the feature information of each pixel point within the detection area in the image; wherein, the feature information is chrominance information of the pixel point, a matrix value of a pixel point in the feature matrix associated with the fringe is a first numerical value, and a matrix value of a pixel point in the feature matrix not associated with the fringe is a second numerical value; a convolution operation unit, which is configured to perform a convolution operation on the feature matrix and a preset fringe feature matrix; and a fringe determination unit, which is configured to determine that the fringe exists in the image based on a determination result that a convolution operation result satisfies a preset numerical condition; wherein the fringe recognition module further comprises: a pixel point YUV value calculation unit, which is configured to acquire a RGB value of the each pixel point within the detection area in the image, and convert the RGB value into a corresponding YUV value; and a feature information determination unit, which is configured to use a V value of the each pixel point as the feature information of the each pixel point.
- The apparatus of claim 7, wherein the shortest frame brightness adjustment parameter comprises an exposure ratio of the camera, and the fringe suppression module is configured to: calculate an average brightness value of the shortest frame image according to at least two frame images shot by the camera; calculate an exposure ratio increase amplitude according to the average brightness value and a preset incremental correspondence; wherein in the incremental correspondence, the average brightness value is positively correlated with the exposure ratio increase amplitude; and keep longest frame shutter time unchanged, and increase the exposure ratio of the camera according to the exposure ratio increase amplitude to reduce the brightness value of the shortest frame image.
- The apparatus of claim 7, wherein the feature matrix construction unit comprises: an average intensity calculation subunit, which is configured to calculate an average intensity of the feature information according to an image resolution of the detection area and the feature information of the each pixel point; a standard feature matrix construction subunit, which is configured to construct a standard feature matrix according to the image resolution of the detection area; a target matrix position acquisition subunit, which is configured to acquire one matrix element position of the standard feature matrix as a target matrix position; a first element value setting subunit, which is configured to set an element value of the target matrix position as the first numerical value based on a determination result that feature information of a pixel point corresponding to the target matrix position is greater than the average intensity; and a second element value setting subunit, which is configured to set the element value of the target matrix position as the second numerical value based on a determination result that the feature information of the pixel point corresponding to the target matrix position is less than or equal to the average intensity.
- The apparatus of claim 7, wherein the fringe recognition module comprises: a brightness recognition parameter acquisition unit, which is configured to acquire a brightness recognition parameter of a current shooting environment of the camera; and a fringe recognition unit, which is configured to acquire the image shot by the camera and recognize the fringe of the image based on a determination result that a brightness of the current shooting environment satisfies a fringe recognition condition according to the brightness recognition parameter.
- The apparatus of claim 7, further comprising: a brightness recognition parameter acquisition unit, which is configured to acquire a brightness recognition parameter matched with a current shooting environment of the camera; and a configuration recovery module, which is configured to control the camera to continue to shoot images according to a default configuration parameter matched with the current shooting environment based on a determination result that a brightness of the current shooting environment satisfies a configuration recovery condition according to the brightness recognition parameter.
- An electronic device, comprising: at least one processor; and a memory, which is configured to store at least one program, wherein the at least one program, when executed by the at least one processor, causes the at least one processor to implement the method of any one of claims 1 to 6.
- A computer-readable storage medium, storing computer programs, wherein the computer programs, when executed by a processor, implement the method for automatically detecting and suppressing fringes of any one of claims 1 to 6.
Description
TECHNICAL FIELD The present application relates to image processing technology, for example, a method and apparatus for automatically detecting and suppressing fringes, an electronic device and a computer-readable storage medium. BACKGROUND With the increasing demand of the current society for security and protection, various organizations, enterprises or individuals may choose to configure various cameras in indoor or outdoor environments for environmental monitoring. When a light emitting diode (LED) is adopted as a light source in an environment (especially, an indoor environment), since a LED lamp flickers at a frequency of an alternating current (typically, the frequency of the alternating current is 50Hz or 60 Hz), although human eyes cannot see this flicker phenomenon, some cameras may capture the above flicker to enable fringes to appear in a shot picture. A main reason for the above-described fringes is that: since an electronic shutter of a camera usually scans line by line to collect data, a condition that a brightness of the LED lamp is bright when one line is scanned, and the brightness of the LED lamp is dark when a next line is scanned is appeared. Moreover, since a scanning speed of a progressive electronic shutter and a frequency of an LED stroboscopic are stable, whereby a picture shot by the camera may present fringes with bright and dark intervals. In the related art, no effective scheme is provided for the fringes generated by the above reasons existing in the picture shot by the camera, and the requirements of people on the definition and the accuracy of the pictures shot by the camera cannot be satisfied. Further relevant technologies are also known from US 2006/054783 A1 which relates to imager flicker compensation systems and methods, US 2018/041684 A1 which relates to a system and method for processing video data to detect and eliminate flickering light sources through dynamic exposure control, US 2014/089365 A1 which relates to an object detection method, object detector and object detection computer program, and US 2007/263264 A1 which relates to low noise color correction matrix function in digital image capture systems and methods. SUMMARY Embodiments of the present application provide a method and apparatus for automatically detecting and suppressing fringes, an electronic device and a computer-readable storage medium, so that fringes in an image shot by a camera can be effectively suppressed. The invention is set out in the appended set of claims. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a flowchart of a method for automatically detecting and suppressing fringes in embodiment one of the present application;FIG. 2 is a flowchart of a method for automatically detecting and suppressing fringes in embodiment two of the present application;FIG. 3 is a flowchart of a method for automatically detecting and suppressing fringes in embodiment three of the present application;FIG. 4 is a flowchart of a method for automatically detecting and suppressing fringes in embodiment four of the present application;FIG. 5 is a schematic structural diagram of an apparatus for automatically detecting and suppressing fringes in embodiment five of the present application; andFIG. 6 is a schematic structural diagram of a computer device in embodiment six of the present application. DETAILED DESCRIPTION The present application provides a method for automatically detecting and suppressing fringes. The method includes the following steps: an image shot by a camera is acquired, and a fringe of the image is recognized; at least one fringe action parameter is acquired among shooting parameters of the camera based on a recognition result obtained by recognizing the fringe of the image; and a parameter adjustment is performed on the acquired fringe action parameter by adopting a parameter adjustment strategy matched with the acquired fringe action parameter, to perform fringe suppression on the image shot by the camera. According to the claimed invention, the step in which the image shot by the camera is acquired, and the fringe of the image is recognized includes the following steps: the image shot by the camera is acquired, and a feature matrix matched with a detection area is constructed according to feature information of each pixel point within the detection area in the image, where, a matrix value of a pixel point in the feature matrix associated with the fringe is a first numerical value, and a matrix value of a pixel point in the feature matrix not associated with the fringe is a second numerical value; a convolution operation is performed on the feature matrix and a preset fringe feature matrix; and a presence of a fringe in the image is determined based on a determination result that a convolution operation result satisfies a preset numerical condition. According to the claimed invention, the feature information is chrominance information of a pixel point. Before the feature matrix matched with the d