Image stroboscopic detection method, device, electronic device, and storage medium
Through the image stroboscopic detection method, the stroboscopic frequency and intensity value of the image are determined, and the exposure time of the shooting equipment is adjusted, which solves the problem of image stroboscopic under the camera rolling shutter and improves image quality and shooting efficiency.
Patent Information
- Application Number
- CN202210601100.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-05-30
AI Technical Summary
When a camera uses a rolling shutter, images or videos are prone to flickering, resulting in reduced image quality and shooting efficiency.
By determining the horizontal projection results of the image, including the number of black pixels in each row of binary pixels, and performing frequency domain transformation processing, the stroboscopic frequency and intensity values are obtained to determine whether the image has stroboscopic phenomenon, and the exposure time of the shooting device is adjusted according to the stroboscopic frequency.
The image quality and shooting efficiency of the shooting equipment are improved, and the occurrence of stroboscopic phenomenon is reduced.
Smart Images

Figure CN115835028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image stroboscopic detection method, device, electronic device, and storage medium. Background Art
[0002] The shutter of a current camera controls the effective exposure time of the photosensitive film. There are two main types of shutters: global shutter and rolling shutter. The rolling shutter controls the photosensitive film to scan and expose the entire scene line by line, producing an image. Different lines have different exposure times. The camera's background light source has a specific frequency, meaning that the brightness of the background light varies at different times. Therefore, when using a rolling shutter, the captured image or video can easily experience flickering, reducing image or video quality and reducing camera efficiency. Summary of the Invention
[0003] The present application aims to solve one of the technical problems in the related art at least to a certain extent.
[0004] The present application proposes an image stroboscopic detection method to determine the stroboscopic frequency and corresponding intensity value of an image, and then determine whether the image has stroboscopic phenomenon, so as to adjust and process the shooting equipment for shooting the image, improve the quality of the images obtained by subsequent shooting, and improve the shooting efficiency of the shooting equipment.
[0005] The first aspect of the present application provides an image stroboscopic detection method, comprising: determining an image to be processed, and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; performing frequency domain transformation processing on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; and determining whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value.
[0006] The image stroboscopic detection method of the embodiment of the present application determines an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; the horizontal projection result is subjected to frequency domain transformation processing to obtain a stroboscopic frequency and a corresponding intensity value; based on the stroboscopic frequency and the corresponding intensity value, it is determined whether the image has a stroboscopic phenomenon, thereby being able to determine the stroboscopic frequency and the corresponding intensity value of the image, and further determine whether the image has a stroboscopic phenomenon, so as to adjust the shooting equipment for shooting the image, improve the quality of the images subsequently shot, and improve the shooting efficiency of the shooting equipment.
[0007] Optionally, determining the image to be processed and the horizontal projection result of the image includes: determining the image to be processed; binarizing the image to obtain a binarized image corresponding to the image; performing statistical processing on the binarized image to determine the number of black pixels in each row of pixels in the binarized image; and determining the horizontal projection result based on the number of black pixels in each row of pixels in the binarized image.
[0008] Optionally, determining whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value includes: determining that the image has a stroboscopic phenomenon when the intensity value is greater than or equal to an intensity value threshold; and determining that the image does not have a stroboscopic phenomenon when the intensity value is less than the intensity value threshold.
[0009] Optionally, determining the image to be processed and the horizontal projection result of the image includes: determining the image to be processed; performing block processing on the image to obtain at least two image blocks in the image; determining a horizontal projection sub-result of the image block for each of the at least two image blocks; and determining the horizontal projection result of the image based on the horizontal projection sub-results of the at least two image blocks.
[0010] Optionally, performing frequency domain transformation processing on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value includes: for each image block of the at least two image blocks, performing frequency domain transformation processing on the horizontal projection sub-result of the image block to obtain the stroboscopic frequency and the corresponding intensity value in the image block.
[0011] Optionally, determining whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value includes: determining that the image has the stroboscopic phenomenon when a first image block exists in the at least two image blocks; and determining that the image does not have the stroboscopic phenomenon when the first image block does not exist in the at least two image blocks; wherein the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to an intensity value threshold; or, the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to an intensity value threshold, and the attribute information of the first image block meets the corresponding conditions.
[0012] Optionally, the method further includes: when there is a stroboscopic phenomenon in the image, determining a shooting device that shoots the image; determining a stroboscopic period according to the stroboscopic frequency; and adjusting the exposure duration to an even multiple of the stroboscopic period.
[0013] The second aspect of the present application provides an image stroboscopic detection device, comprising: a first determination module for determining an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; a processing module for performing frequency domain transformation processing on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; and a second determination module for determining whether there is a stroboscopic phenomenon in the image based on the stroboscopic frequency and the corresponding intensity value.
[0014] The image stroboscopic detection device of the embodiment of the present application determines an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; performs frequency domain transformation processing on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; and determines whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value, thereby being able to determine the stroboscopic frequency and the corresponding intensity value of the image, and further determine whether the image has a stroboscopic phenomenon, so as to adjust the shooting equipment for shooting the image, improve the quality of the images obtained by subsequent shooting, and improve the shooting efficiency of the shooting equipment.
[0015] The third aspect embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image stroboscopic detection method proposed in the first aspect embodiment of the present application.
[0016] The fourth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the image stroboscopic detection method proposed in the first aspect embodiment of the present application.
[0017] The fifth embodiment of the present application proposes a computer program product. When the instruction processor in the computer program product executes, the image stroboscopic detection method proposed in the first embodiment of the present application is executed.
[0018] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0020] Figure 1 This is a flow chart of the image stroboscopic detection method provided in Example 1 of the present application;
[0021] Figure 2 This is a flow chart of the image stroboscopic detection method provided in the second embodiment of the present application;
[0022] Figure 3 This is a flow chart of the image stroboscopic detection method provided in Example 3 of the present application;
[0023] Figure 4 This is a schematic diagram of the image stroboscopic detection and correction process;
[0024] Figure 5 This is a schematic diagram of the structure of the image stroboscopic detection device provided in the fourth embodiment of the present application;
[0025] Figure 6 The figure is a block diagram of an electronic device for an image stroboscopic detection method according to an exemplary embodiment. DETAILED DESCRIPTION
[0026] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0027] The shutter of a current camera controls the effective exposure time of the photosensitive film. There are two main types of shutters: global shutter and rolling shutter. The rolling shutter controls the photosensitive film to scan and expose the entire scene line by line, producing an image. Different lines have different exposure times. The camera's background light source has a specific frequency, meaning that the brightness of the background light varies at different times. Therefore, when using a rolling shutter, the captured image or video can easily experience flickering, reducing image or video quality and reducing camera efficiency.
[0028] To address the above-mentioned issues, the present application proposes an image stroboscopic detection method, device, electronic device, and storage medium.
[0029] Figure 1 This is a flow chart of the image stroboscopic detection method provided in Example 1 of the present application. It should be noted that the image stroboscopic detection method can be applied to an image stroboscopic detection device. The image stroboscopic detection device can be, for example, a hardware device, or software installed in a hardware device. The hardware device can be, for example, a shooting device, or a terminal device or server connected to the shooting device. The shooting device can be, for example, a camera, a webcam, a mobile phone, a robot, etc. that has a shooting function and uses a rolling shutter, which is not limited here.
[0030] like Figure 1 As shown, the image stroboscopic detection method includes the following steps:
[0031] Step 101 : Determine an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels.
[0032] In the embodiment of the present application, the image to be processed may be an image captured by a camera, such as a vehicle monitoring video or a traffic light monitoring video.
[0033] In an embodiment of the present application, the image stroboscopic detection device determines the horizontal projection result of the image to be processed by, for example, determining the image to be processed; binarizing the image to obtain a binarized image corresponding to the image; performing statistical processing on the binarized image to determine the number of black pixels in each row of pixels in the binarized image; and determining the horizontal projection result based on the number of black pixels in each row of pixels in the binarized image.
[0034] In an embodiment of the present application, the values of multiple pixels in a binary image can be represented by an array, where the pixels in the binary image can have two values, for example, 1 or 0. For example, 1 represents a white pixel, and 0 represents a black pixel. Performing a horizontal projection on the image to be processed involves binarizing the image to be processed to obtain a binary array, and then counting the number of black pixels with a value of 0 in each row of the binary array to obtain a horizontal projection result.
[0035] Step 102: Perform frequency domain transformation on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value.
[0036] In an embodiment of the present application, a frequency domain transformation method is used to perform frequency domain transformation on the horizontal projection result to obtain a frequency domain transformation result. The frequency domain transformation result can be represented by a coordinate system in which the independent variable is the stroboscopic frequency, i.e., the horizontal axis is the stroboscopic frequency, and the vertical axis is the signal intensity of the stroboscopic frequency. This coordinate system describes the stroboscopic frequency and the corresponding intensity value. Based on this coordinate system, the stroboscopic frequency and the corresponding intensity value can be determined. The frequency domain transformation method can be a Fourier transform method, a Laplace transform method, a Z transform method, etc., which are not limited here.
[0037] Step 103: Determine whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value.
[0038] In an embodiment of the present application, the process of the image stroboscopic detection device executing step 103 may, for example, be to determine that the image has stroboscopic phenomenon when the intensity value is greater than or equal to the intensity value threshold; and to determine that the image does not have stroboscopic phenomenon when the intensity value is less than the intensity value threshold.
[0039] In summary, the image to be processed and the horizontal projection result of the image are determined; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; the horizontal projection result is subjected to frequency domain transformation processing to obtain the stroboscopic frequency and the corresponding intensity value; according to the stroboscopic frequency and the corresponding intensity value, it is determined whether the image has stroboscopic phenomenon, so that the stroboscopic frequency and the corresponding intensity value of the image can be determined, and then whether the image has stroboscopic phenomenon can be determined, so as to adjust the shooting equipment for shooting the image, improve the quality of the images obtained by subsequent shooting, and improve the shooting efficiency of the shooting equipment.
[0040] Figure 2 This is a flow chart of the image stroboscopic detection method provided in the second embodiment of the present application. Figure 2 As shown, the image stroboscopic detection method includes the following steps:
[0041] Step 201: Determine an image to be processed.
[0042] In the embodiment of the present application, the image to be processed may be an image captured by a camera, such as a vehicle monitoring video or a traffic light monitoring video.
[0043] Step 202: performing block processing on the image to obtain at least two image blocks in the image.
[0044] In the embodiment of the present application, an image to be processed is divided into blocks using an image segmentation method to obtain multiple image blocks. The image segmentation method can be a threshold-based segmentation method, which is not limited here. The size information of the multiple image blocks is consistent.
[0045] Step 203: For each image block of the at least two image blocks, determine a horizontal projection sub-result of the image block.
[0046] In the embodiment of the present application, statistical processing is performed on the binarized sub-image corresponding to each image block to determine the number of black pixels in each row of pixels of the binarized sub-image, thereby more accurately determining the horizontal projection sub-result of each image block.
[0047] Step 204: Determine a horizontal projection result of the image according to the horizontal projection sub-results of at least two image blocks.
[0048] In an embodiment of the present application, the horizontal projection sub-results of multiple image blocks are integrated to obtain the horizontal projection result of the image, so as to obtain a more accurate stroboscopic frequency and the corresponding intensity value, thereby improving the shooting efficiency of the camera.
[0049] Step 205 : Perform frequency domain transformation on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value.
[0050] In an embodiment of the present application, the process of the image stroboscopic detection device executing step 205 may, for example, be to perform frequency domain transformation processing on the horizontal projection sub-result of each image block in at least two image blocks to obtain the stroboscopic frequency and the corresponding intensity value in the image block.
[0051] Step 206 : Determine whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value.
[0052] In an embodiment of the present application, the process of the image stroboscopic detection device executing step 206 may, for example, be: when the first image block exists in at least two image blocks, determining that the image has stroboscopic phenomenon; when the first image block does not exist in at least two image blocks, determining that the image does not have stroboscopic phenomenon; wherein the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold.
[0053] In an embodiment of the present application, the process of the image stroboscopic detection device executing step 206 may, for example, be: when the first image block exists in at least two image blocks, determining that the image has stroboscopic phenomenon; when the first image block does not exist in at least two image blocks, determining that the image does not have stroboscopic phenomenon; wherein, the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold, and the attribute information of the first image block meets the corresponding conditions.
[0054] The attribute information may include information such as the color of the first image block, the brightness of the first image block, and the content of the first image block. The conditions may include, for example, whether the color of the first image block flickers with the colors of surrounding blocks, whether the brightness of the first image block flickers with the brightness of surrounding blocks, and whether the content of the first image block contains a car or a person.
[0055] In summary, the method is as follows: determining an image to be processed; performing block processing on the image to obtain at least two image blocks in the image; determining a horizontal projection sub-result of the image block for each of the at least two image blocks; determining a horizontal projection result of the image based on the horizontal projection sub-results of the at least two image blocks; performing frequency domain transformation processing on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; determining whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value, thereby being able to determine the stroboscopic frequency and the corresponding intensity value of the image, and further determining whether the image has a stroboscopic phenomenon, so as to adjust the shooting equipment for shooting the image, improve the quality of the images subsequently shot, and improve the shooting efficiency of the shooting equipment.
[0056] Figure 3 This is a flow chart of the image stroboscopic detection method provided in the third embodiment of the present application. Figure 3As shown, the image stroboscopic detection method includes the following steps:
[0057] Step 301 : Determine an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels.
[0058] Step 302: Perform frequency domain transformation on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value.
[0059] Step 303: Determine whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value.
[0060] Step 304: When there is a stroboscopic phenomenon in the image, determine the shooting device that shot the image.
[0061] The shooting device may be a camera, a mobile phone, a robot, or any other device with a shooting function and a rolling shutter, and is not limited here.
[0062] Step 305: Determine the stroboscopic period according to the stroboscopic frequency.
[0063] In an embodiment of the present application, the image to be processed is projected horizontally, that is, the image to be processed is binarized, the number of black pixels is counted, the horizontal projection result is determined, and the horizontal projection result is directly transformed into the frequency domain using the frequency domain transformation method to obtain the stroboscopic frequency of the image to be processed.
[0064] In an embodiment of the present application, when the image to be processed is divided into blocks to obtain at least two image blocks, there are multiple image blocks, multiple horizontal projection sub-results, and multiple strobe frequencies. The average value of the multiple strobe frequencies is used as the strobe frequency of the image to be processed, and the strobe period is determined based on the strobe frequency.
[0065] Step 306: Adjust the exposure time to an even multiple of the stroboscopic period.
[0066] In an embodiment of the present application, the exposure time of each row of the rolling shutter in the shooting device for the entire scene is adjusted to an even multiple of the stroboscopic period, so that the brightness of the background light source received by each row of pixels in the image is consistent, thereby avoiding the flicker phenomenon, improving the quality of the image or video captured by the shooting device, and improving the shooting efficiency of the shooting device.
[0067] It should be noted that steps 301 to 303 can be implemented in any of the embodiments of the present application. The embodiments of the present application do not limit this and will not be described in detail.
[0068] For easier understanding, let’s take an example to illustrate the process of image stroboscopic detection and correction. Figure 4The figure below is a schematic diagram of the image stroboscopic detection and correction process. Figure 4 In the method, the image to be processed is divided into blocks to obtain at least two image blocks, each image block is horizontally projected, a horizontal projection sub-result of the image block is determined, the horizontal projection sub-result of the image block is subjected to frequency domain transformation processing, a stroboscopic frequency and a corresponding intensity value in the image block are obtained, and it is determined whether the intensity value corresponding to the stroboscopic frequency is greater than an intensity value threshold value, a corresponding stroboscopic period is determined according to the stroboscopic frequency, and whether correction is required is determined according to other information (brightness, color, image content information) of each image block. If correction is required, the exposure time of the image shooting device is adjusted to correct the flicker phenomenon.
[0069] In summary, by determining the image to be processed and the horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; performing frequency domain transformation processing on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value; determining whether the image has stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value; when the image has stroboscopic phenomenon, determining the shooting device for shooting the image; determining the stroboscopic period according to the stroboscopic frequency; adjusting the exposure time to an even multiple of the stroboscopic period, so as to determine the stroboscopic frequency and the corresponding intensity value of the image, and then determining whether the image has stroboscopic phenomenon, so as to adjust the shooting device for shooting the image, improve the quality of the images obtained by subsequent shooting, and improve the shooting efficiency of the shooting device.
[0070] Figure 5 This is a structural diagram of the image stroboscopic detection device provided in Example 4 of the present application.
[0071] like Figure 5 As shown, the image stroboscopic detection device 1000 includes: a first determination module 1010 , a processing module 1020 , and a second determination module 1030 .
[0072] The first determining module 1010 is configured to determine an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels;
[0073] A processing module 1020 is configured to perform frequency domain transformation on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value;
[0074] The second determining module 1030 is configured to determine whether the image has a stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value.
[0075] As a possible implementation method of an embodiment of the present application, the first determination module 1010 is specifically used to determine the image to be processed; binarize the image to obtain a binarized image corresponding to the image; perform statistical processing on the binarized image to determine the number of black pixels in each row of pixels in the binarized image; and determine the horizontal projection result based on the number of black pixels in each row of pixels in the binarized image.
[0076] As a possible implementation method of an embodiment of the present application, the second determination module 1030 is specifically used to determine that the image has the stroboscopic phenomenon when the intensity value is greater than or equal to the intensity value threshold; and to determine that the image does not have the stroboscopic phenomenon when the intensity value is less than the intensity value threshold.
[0077] As a possible implementation method of an embodiment of the present application, the first determination module 1010 is specifically used to determine the image to be processed; perform block processing on the image to obtain at least two image blocks in the image; determine a horizontal projection sub-result of the image block for each image block of the at least two image blocks; and determine a horizontal projection result of the image based on the horizontal projection sub-results of the at least two image blocks.
[0078] As a possible implementation method of an embodiment of the present application, the processing module 1020 is specifically used to perform frequency domain transformation processing on the horizontal projection sub-result of each image block of the at least two image blocks to obtain the stroboscopic frequency and the corresponding intensity value in the image block.
[0079] As a possible implementation method of an embodiment of the present application, the second determination module 1030 determines that the image has the stroboscopic phenomenon when the first image block exists in the at least two image blocks; and determines that the image does not have the stroboscopic phenomenon when the first image block does not exist in the at least two image blocks; wherein the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold; or, the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold, and the attribute information of the first image block meets the corresponding conditions.
[0080] As a possible implementation method of an embodiment of the present application, the device also includes: a third determination module, a fourth determination module and an adjustment module; the third determination module is used to determine the shooting device that captured the image when there is a stroboscopic phenomenon in the image; the fourth determination module is used to determine the stroboscopic period based on the stroboscopic frequency; the adjustment module is used to adjust the exposure time to an even multiple of the stroboscopic period.
[0081] The image stroboscopic detection device of the embodiment of the present application determines an image to be processed and a horizontal projection result of the image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; performs frequency domain transformation processing on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; and determines whether the image has a stroboscopic phenomenon based on the stroboscopic frequency and the corresponding intensity value, thereby being able to determine the stroboscopic frequency and the corresponding intensity value of the image, and further determine whether the image has a stroboscopic phenomenon, so as to adjust the shooting equipment for shooting the image, improve the quality of the images obtained by subsequent shooting, and improve the shooting efficiency of the shooting equipment.
[0082] In order to implement the above embodiment, the present application also proposes an electronic device, such as Figure 6 As shown, Figure 6 The figure is a block diagram of an electronic device for an image stroboscopic detection method according to an exemplary embodiment.
[0083] like Figure 6 As shown, the electronic device 1100 includes:
[0084] The memory 1110 and the processor 1120, a bus 1130 connecting different components (including the memory 1110 and the processor 1120), the memory 1110 stores a computer program, and when the processor 1120 executes the program, the image stroboscopic detection method described in the embodiment of the present application is implemented.
[0085] Bus 1130 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0086] The electronic device 1100 typically includes a variety of electronic device-readable media, which can be any available media that can be accessed by the electronic device 1100, including volatile and non-volatile media, removable and non-removable media.
[0087] The memory 1110 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1140 and / or cache memory 1150. The electronic device 1100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 1160 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6Not shown, often called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 1130 via one or more data medium interfaces. The memory 1110 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0088] A program / utility 1180 having a set (at least one) of program modules 1170 may be stored, for example, in memory 1110. Such program modules 1170 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 1170 generally implement the functions and / or methods of the embodiments described herein.
[0089] The electronic device 1100 may also communicate with one or more external devices 1190 (e.g., a keyboard, a pointing device, a display 1191, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 1192. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1193. Figure 6 As shown, the network adapter 1193 communicates with other modules of the electronic device 1100 via the bus 1130. Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 1100, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0090] The processor 1120 executes the programs stored in the memory 1110 to perform various functional applications and data processing.
[0091] It should be noted that the implementation process and technical principles of the electronic device of this embodiment can be found in the aforementioned explanation of the image stroboscopic detection method of the embodiment of the present application, and will not be repeated here.
[0092] In order to implement the above embodiment, the present application also proposes a non-transitory computer-readable storage medium storing computer instructions, the computer instructions are used to enable the computer to execute Figures 1 to 4 The image stroboscopic detection method described in the embodiment.
[0093] In order to implement the above embodiment, the present application also provides a computer program product, when the instruction processor in the computer program product executes Figures 1 to 4 The image stroboscopic detection method described in the embodiment.
[0094] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0095] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0096] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0097] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0098] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0099] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0100] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0101] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A method for detecting image stroboscopic light, characterized in that: include: determining an image to be processed; performing binarization processing on the image to obtain a binarized image corresponding to the image; The pixels in the binary image include black pixels and white pixels; Performing statistical processing on the binary image to determine the number of black pixels in each row of pixels of the binary image; Determining a horizontal projection result according to the number of black pixels in each row of pixels of the binary image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; Performing frequency domain transformation on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; Determine whether the image has a stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value.
2. The method according to claim 1, characterized in that Determining whether the image has a stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value includes: When the intensity value is greater than or equal to the intensity value threshold, determining that the image has the stroboscopic phenomenon; When the intensity value is less than the intensity value threshold, it is determined that the image does not have the stroboscopic phenomenon.
3. The method according to claim 1, characterized in that The determining of the image to be processed and the horizontal projection result of the image includes: determining the image to be processed; Performing block processing on the image to obtain at least two image blocks in the image; For each image block of the at least two image blocks, determining a horizontal projection sub-result of the image block; A horizontal projection result of the image is determined according to the horizontal projection sub-results of the at least two image blocks.
4. The method according to claim 3, characterized in that The performing frequency domain transformation processing on the horizontal projection result to obtain the stroboscopic frequency and the corresponding intensity value includes: For each image block of the at least two image blocks, frequency domain transformation processing is performed on the horizontal projection sub-result of the image block to obtain a stroboscopic frequency and a corresponding intensity value in the image block.
5. The method according to claim 4, characterized in that Determining whether the image has a stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value includes: When the first image block exists in the at least two image blocks, determining that the image has the stroboscopic phenomenon; When the first image block does not exist in the at least two image blocks, determining that the image does not have the stroboscopic phenomenon; The intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold; or the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold, and the attribute information of the first image block meets the corresponding conditions.
6. The method according to claim 1, wherein The method further comprises: When there is a stroboscopic phenomenon in the image, determining a photographing device that photographed the image; Determining a stroboscopic period according to the stroboscopic frequency; Adjust the exposure time to an even multiple of the stroboscopic period.
7. An image stroboscopic detection device, characterized in that: include: A first determining module, configured to determine an image to be processed; performing binarization processing on the image to obtain a binarized image corresponding to the image; The pixels in the binary image include black pixels and white pixels; Performing statistical processing on the binary image to determine the number of black pixels in each row of pixels of the binary image; Determining a horizontal projection result according to the number of black pixels in each row of pixels of the binary image; wherein the horizontal projection result includes: the number of black pixels in each row of binary pixels; A processing module, configured to perform frequency domain transformation on the horizontal projection result to obtain a stroboscopic frequency and a corresponding intensity value; The second determining module is configured to determine whether the image has a stroboscopic phenomenon according to the stroboscopic frequency and the corresponding intensity value.
8. The device according to claim 7, characterized in that The second determining module is specifically configured to: When the intensity value is greater than or equal to the intensity value threshold, determining that the image has the stroboscopic phenomenon; When the intensity value is less than the intensity value threshold, it is determined that the image does not have the stroboscopic phenomenon.
9. The device according to claim 7, characterized in that The first determining module is specifically configured to: determining the image to be processed; Performing block processing on the image to obtain at least two image blocks in the image; For each image block of the at least two image blocks, determining a horizontal projection sub-result of the image block; A horizontal projection result of the image is determined according to the horizontal projection sub-results of the at least two image blocks.
10. The device according to claim 9, characterized in that The processing module is specifically used to: For each image block of the at least two image blocks, frequency domain transformation processing is performed on the horizontal projection sub-result of the image block to obtain a stroboscopic frequency and a corresponding intensity value in the image block.
11. The device according to claim 10, characterized in that The second determining module is specifically configured to: When the first image block exists in the at least two image blocks, determining that the image has the stroboscopic phenomenon; When the first image block does not exist in the at least two image blocks, determining that the image does not have the stroboscopic phenomenon; The intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold; or the intensity value corresponding to the stroboscopic frequency in the first image block is greater than or equal to the intensity value threshold, and the attribute information of the first image block meets the corresponding conditions.
12. The device according to claim 7, characterized in that The device further includes: a third determining module, a fourth determining module, and an adjusting module; The third determining module is configured to determine a photographing device that photographed the image when a stroboscopic phenomenon exists in the image; The fourth determining module is configured to determine a stroboscopic period according to the stroboscopic frequency; The adjustment module is used to adjust the exposure duration to an even multiple of the stroboscopic period.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image and video processing method and device
CN103218778A
Video flicker determination method and device, equipment and storage medium
CN114202519A
Stroboflash detection and elimination method and device, camera and storage medium
CN114529729A
Photographing method and apparatus, and electronic device
WO2022042753A1