CN113573045A - Stray light detection method and stray light detection device - Google Patents

Stray light detection method and stray light detection device Download PDF

Info

Publication number
CN113573045A
CN113573045A CN202110681501.0A CN202110681501A CN113573045A CN 113573045 A CN113573045 A CN 113573045A CN 202110681501 A CN202110681501 A CN 202110681501A CN 113573045 A CN113573045 A CN 113573045A
Authority
CN
China
Prior art keywords
image
light source
veiling glare
value
brightness
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.)
Granted
Application number
CN202110681501.0A
Other languages
Chinese (zh)
Other versions
CN113573045B (en
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 Glory Intelligent Machine Co ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110681501.0A priority Critical patent/CN113573045B/en
Publication of CN113573045A publication Critical patent/CN113573045A/en
Application granted granted Critical
Publication of CN113573045B publication Critical patent/CN113573045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

A stray light detection method and a stray light detection device are provided, the stray light detection method comprises the following steps: acquiring a light source image shot by a camera module to be detected; performing image segmentation processing on the light source image to obtain N image blocks, wherein N is an integer greater than or equal to 2; and determining whether a first area exists in the light source image according to the brightness value of each of the N image blocks, wherein the brightness value of the image block is an average value of the brightness values of all pixels included in the image block, and the first area is an image low-quality area in the light source image. Based on the technical method, the image stray light detection precision can be improved to a certain extent.

Description

Stray light detection method and stray light detection device
Technical Field
The present application relates to the field of terminal devices, and in particular, to a stray light detection method and a stray light detection apparatus.
Background
With the development of digital technology, a camera of a terminal device has also been regarded as a main component of the terminal device. The performance of the camera directly influences the shooting effect of the terminal equipment; therefore, manufacturers of terminal equipment have increasingly high requirements on the performance of cameras in the terminal equipment. In order to enable a camera in the terminal equipment to meet better performance, the camera needs to be detected through specific simulation equipment after the production design is finished; at present, the characteristics of a camera are generally studied by illuminating the camera of a terminal device, so as to determine whether the performance of the designed camera can meet the use requirements of a user. However, the existing stray light detection method of the camera has the problem of low precision.
Therefore, how to improve the accuracy of the stray light detection of the terminal equipment camera module becomes a technical problem which needs to be solved urgently.
Disclosure of Invention
The application provides a stray light detection method and a stray light detection device, which can improve the precision of image stray light detection to a certain extent.
In a first aspect, a method for detecting stray light is provided, including: acquiring a light source image shot by a camera module to be detected; performing image segmentation processing on the light source image to obtain N image blocks, wherein N is an integer greater than or equal to 2; and determining whether a first area exists in the light source image according to the brightness value of each image block in the N image blocks, wherein the brightness value of the image block is the average value of the brightness values of all pixels included in the image block, and the first area is an image low-quality area in the light source image.
In the embodiment of the application, a light source image is obtained through a camera, and image segmentation processing is carried out on the light source image to obtain N image blocks; determining the average brightness value of pixel points included in each image block in the N image blocks as the brightness value of the image block; and determining whether the first area exists in the light source image according to the brightness value of each image block in the N image blocks. In the method, the light source image is divided, the brightness value of each image block is determined, and the stray light detection is performed on the image, so that the precision of the stray light detection of the image can be improved to a certain extent.
It should be understood that the image segmentation process may refer to segmenting the complete image into several regions; for example, the complete image is segmented into a plurality of different image regions.
It is understood that veiling glare can cause low quality regions in the image; the image low-quality area can be an abnormal area existing in the image due to stray light generated by the camera module under the light source; the stray light can cause the problems of reduced contrast and signal-to-noise ratio of the image, deteriorated definition, color distortion, limitation of high dynamic range imaging and the like; veiling glare may include, but is not limited to, glare, ghosting, abnormal light spots, and image areas that differ from normal image areas.
With reference to the first aspect, in certain implementations of the first aspect, the determining whether a first area exists in the light source image according to the luminance value of each of the N image blocks includes:
determining that the first region exists in the light source image in a case where the number of first peaks is greater than or equal to 2; wherein the first peak refers to a peak of luminance values of image blocks included in each row or each column in the light source image.
With reference to the first aspect, in certain implementations of the first aspect, the determining whether a first area exists in the light source image according to the luminance value of each of the N image blocks includes:
under the condition that the number of first peak values is less than 2, if the distance difference value between the positions of the first peak values and the positions of the second peak values is greater than or equal to a first threshold value, determining that the first area exists in the light source image; the first peak value refers to a peak value of a brightness value of an image block included in each row or each column in the light source image, and the second peak value refers to a peak value of a brightness value in the light source image.
With reference to the first aspect, in certain implementations of the first aspect, the light source image refers to an image after light source matting processing, where the light source matting processing refers to replacing a brightness value of a light source region in the light source image with a minimum brightness value in the light source image, and the method further includes:
and under the condition that the first area exists in the light source image, determining the veiling glare grade of the light source image according to the brightness value of each image block in the N image blocks, wherein the veiling glare grade is used for representing the veiling glare degree in the light source image.
With reference to the first aspect, in certain implementations of the first aspect, the determining a veiling glare level of the light source image according to a luminance value of each image block of the N image blocks includes:
and determining the veiling glare grade according to the ratio of the N image blocks in different brightness value intervals, wherein the ratio is used for representing the ratio of the number of the image blocks in the different brightness value intervals to N.
With reference to the first aspect, in certain implementations of the first aspect, the determining the veiling glare level according to the ratio of the N image blocks in different luminance value intervals includes:
determining the veiling glare grade to be a first grade under the condition that the brightness value of each image block in the N image blocks is greater than or equal to a first brightness threshold; determining the veiling glare grade as a first grade under the condition that the proportion value of the first brightness value interval is greater than a first proportion threshold value; determining the veiling glare grade as a second grade under the condition that the proportion value of the first brightness value interval is larger than a second proportion threshold and smaller than a first proportion threshold; determining the veiling glare grade as a second grade under the condition that the proportion value of the second brightness value interval is greater than a third proportion threshold value; determining the veiling glare grade as a third grade under the condition that the duty ratio of the second brightness value interval is greater than a fourth duty ratio threshold and less than a third duty ratio threshold;
wherein the first level of veiling glare is greater than the second level; the second level has a greater degree of veiling glare than the third level; the first brightness value interval refers to a set of brightness values which are greater than the second brightness threshold value and less than the first brightness threshold value; the second brightness value interval refers to a set of brightness values which are greater than a third brightness threshold and less than a second brightness threshold; the first ratio threshold, the third ratio threshold and the first brightness threshold are in inverse proportion relation; the second duty threshold, the fourth duty threshold and the second brightness threshold are in inverse proportion relation.
In a second aspect, there is provided a veiling glare detection system comprising: a module to be detected and control equipment; the module to be detected is used for receiving a control instruction sent by the control equipment, and the control instruction is used for instructing the module to be detected to shoot a light source to obtain a light source image; the control device is configured to execute any one of the stray light detection methods of the first aspect.
In a third aspect, there is provided a veiling glare detection apparatus comprising means for performing any one of the veiling glare detection methods of the first aspect. The stray light detection device can be a terminal device or a chip in the terminal device. The veiling glare detection apparatus may include an input unit and a processing unit.
When the veiling glare detection apparatus is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may further comprise a memory for storing computer program code which, when executed by the processor, causes the terminal device to perform any of the veiling glare detection methods of the first aspect.
When the stray light detection device is a chip in the terminal equipment, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin, a circuit, or the like; the chip may also include a memory, which may be a memory within the chip (e.g., registers, cache, etc.) or a memory external to the chip (e.g., read-only memory, random access memory, etc.); the memory is configured to store computer program code, which, when executed by the processor, causes the chip to perform any of the stray light detection methods of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, which stores computer program code, which, when executed by a veiling glare detection apparatus, causes the apparatus to perform any of the methods of the first or second aspects.
In a fifth aspect, there is provided a computer program product comprising: computer program code which, when run by a veiling glare detection apparatus, causes the apparatus to perform any of the methods of the first or second aspects.
Drawings
Fig. 1 is a schematic diagram of lens flare generation provided in an embodiment of the present application.
Fig. 2 is an application scenario schematic diagram of a veiling glare detection method provided in an embodiment of the present application
Fig. 3 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a software structure of a terminal device according to an embodiment of the present application.
Fig. 5 is a schematic flowchart of a veiling glare detection method provided in an embodiment of the present application.
Fig. 6 is a schematic flowchart of a veiling glare detection method provided in an embodiment of the present application.
Fig. 7 is a schematic view of a veiling glare detection apparatus provided in an embodiment of the present application.
Fig. 8 is a schematic diagram of an electronic device for detecting veiling glare according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships; for example, a and/or B may represent: a is present alone; both A and B are present; there are three cases of B alone.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
First, terms referred to in the embodiments of the present application will be explained.
Lens Flare (Flare) generally refers to glare or ghost image formed by light rays imaged on a Complementary Metal-Oxide Semiconductor (CMOS)/Charge Coupled Device (CCD) image sensor through a lens when a point light source is much brighter than the ambient environment. Generally, the positions of the point light sources in the field of view of the lens are different, and the glare phenomenon formed after the light is reflected in the camera module is different.
Illustratively, fig. 1 is a schematic diagram illustrating the generation of lens flare. The line 1 indicates that regular light directly reaches the imaging surface through a normal track, and the line 3 indicates that brighter light is finally scattered at different positions on the imaging surface through reflection when passing through the lens. As shown in fig. 1, when the aperture is reduced, a portion of the light is reflected, which may cause a more significant glare phenomenon on the image plane, thereby affecting the picture quality of the image.
For example, when a user takes a picture at night or in the sun, stray light formed after a picture outside a light source is reflected by a lens in a lens interferes with a normal picture, so that the rest positions of the picture are unclear or ghost images.
After the camera of the terminal device is assembled, stray light may be generated under the light source after the camera is assembled due to the feasibility of mutual matching of the components of the terminal device, and the influence of factors such as the assembly flow or precision. The stray light can bring the problems of reduced image contrast and signal-to-noise ratio, deteriorated definition, color distortion, limitation of high dynamic range imaging and the like, so the method is particularly important for detecting the stray light. At present, a camera of a terminal device needs to be subjected to specific simulation detection after production design is completed, so as to determine whether the performance of the designed camera can meet the use requirement of a user. However, the existing stray light detection method of the camera has the problem of low precision.
In view of this, in the embodiment of the present application, a light source image is acquired by a to-be-detected camera module, and an image segmentation process is performed on the light source image to obtain N image blocks; determining the average brightness value of pixel points included in each image block in the N image blocks as the brightness value of the image block; and determining whether the first area exists in the light source image according to the brightness value of each image block in the N image blocks. In the method, the light source image is divided, the brightness value of each image block is determined, and the stray light detection is performed on the image, so that the precision of the stray light detection of the image can be improved to a certain extent.
An application scenario of the flare detection method proposed in the embodiment of the present application is described below with reference to fig. 2.
Fig. 2 is a schematic view of an application scenario of the veiling glare detection method provided in the embodiment of the present application. As shown in fig. 2, the detection system 100 may include a light source 110, a detection platform 120, a camera 130 of a terminal device, and a control device 140; wherein, the light source 110 is used for providing a light source for the camera 130; the detection platform 120 is used for moving the camera 130 in different directions; the control device 140 is used for controlling the detection platform 120 to move and controlling the camera 130 to acquire the image of the light source 110.
Illustratively, the camera 130 may be placed on the inspection platform 120; the control device 140 can control the detection platform 120 to rotate along two horizontal axes, or can control the detection platform 120 to translate up and down along a vertical axis. Further, by moving to a certain orientation, the control device 140 may control the camera 130 to acquire an associated image of the light source 110.
It should be noted that the veiling glare detection method of the embodiment of the present application may be executed by the control device 140 or executed by a chip configured in the control device 140.
It should be understood that one light source is illustrated in FIG. 2; one or more light sources may be included in the detection system, and the number of light sources is not limited in the embodiments of the present application.
It should also be understood that when multiple light sources may be included in the detection system, only one light source may be operated at a time during the detection process, and the number of light sources supported by the system is not limited in this embodiment.
The structure of the terminal device is described in detail in conjunction with fig. 3; it should be understood that the embodiments of the present application mainly relate to the stray light detection of the camera 293 of the terminal device.
As shown in fig. 3, the terminal device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display 294, a Subscriber Identity Module (SIM) card interface 295, and the like. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation to the terminal device 200. In other embodiments of the present application, terminal device 200 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Illustratively, the processor 210 shown in fig. 3 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be a neural center and a command center of the terminal device 200, among others. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that have just been used or recycled by processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
In some embodiments, the I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). Processor 210 may include multiple sets of I2C buses. The processor 210 may be coupled to the touch sensor 280K, the charger, the flash, the camera 293, etc. through different I2C bus interfaces. For example, the processor 210 may be coupled to the touch sensor 280K through an I2C interface, such that the processor 210 and the touch sensor 280K communicate through an I2C bus interface to implement the touch function of the terminal device 200.
In some embodiments, the I2S interface may be used for audio communications. Processor 210 may include multiple sets of I2S buses. Processor 210 may be coupled to audio module 270 via an I2S bus to enable communication between processor 210 and audio module 270.
In some embodiments, the audio module 270 may communicate audio signals to the wireless communication module 260 via the I2S interface, enabling answering of calls via a bluetooth headset.
In some embodiments, the PCM interface may also be used for audio communication, sampling, quantizing, and encoding analog signals. Audio module 270 and wireless communication module 260 may be coupled by a PCM bus interface.
In some embodiments, the audio module 270 may also transmit audio signals to the wireless communication module 260 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
In some embodiments, the UART interface is a universal serial data bus for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. A UART interface is generally used to connect the processor 210 with the wireless communication module 260. For example, the processor 210 communicates with a bluetooth module in the wireless communication module 260 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 270 may transmit the audio signal to the wireless communication module 260 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
In some embodiments, a MIPI interface may be used to connect processor 210 with peripheral devices such as display screen 294, camera 293, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. The processor 210 and the camera 293 communicate via a CSI interface, and implement the shooting function of the terminal apparatus 200. The processor 210 and the display screen 294 communicate through the DSI interface, and implement a display function of the terminal device 200.
In some embodiments, the GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. The GPIO interface may be used to connect the processor 210 with the camera 293, the display screen 294, the wireless communication module 260, the audio module 270, the sensor module 280, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
Illustratively, the USB interface 230 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the terminal device 200, and may also be used to transmit data between the terminal device 200 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is only an exemplary illustration, and does not constitute a limitation on the structure of the terminal device 200. In other embodiments of the present application, the terminal device 200 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charge management module 240 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from a wired charger via the USB interface 230. In some wireless charging embodiments, the charging management module 240 may receive a wireless charging input through a wireless charging coil of the terminal device 200. The charging management module 240 may also supply power to the terminal device through the power management module 241 while charging the battery 242.
The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240, and provides power to the processor 210, the internal memory 221, the external memory, the display 294, the camera 293, and the wireless communication module 260. The power management module 241 may also be used to monitor parameters such as battery capacity, battery cycle number, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 241 may also be disposed in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be disposed in the same device.
The wireless communication function of the terminal device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in terminal device 200 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 250 may provide a solution for wireless communication applied on the terminal device 200, such as at least one of the following: a second generation (2th generation, 2G) mobile communication solution, a third generation (3th generation, 3G) mobile communication solution, a fourth generation (4th generation, 5G) mobile communication solution, and a fifth generation (5th generation, 5G) mobile communication solution. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 250 may receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and then transmit the electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 may also amplify the signal modulated by the modem processor, and the amplified signal is converted into electromagnetic wave by the antenna 1 to be radiated. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 210.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays images or video through the display screen 294. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be separate from the processor 210, and may be disposed in the same device as the mobile communication module 250 or other functional modules.
The wireless communication module 260 may provide a solution for wireless communication applied to the terminal device 200, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 may also receive a signal to be transmitted from the processor 210, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of terminal device 200 is coupled to mobile communication module 250 and antenna 2 is coupled to wireless communication module 260, such that terminal device 200 may communicate with networks and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The terminal device 200 implements a display function through the GPU, the display screen 294, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 294 is used to display images, video, and the like. The display screen 294 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, terminal device 200 may include 1 or N display screens 294, N being a positive integer greater than 1.
The terminal device 200 may implement a shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294, the application processor, and the like.
The ISP is used to process the data fed back by the camera 293. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 293.
The camera 293 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the terminal device 200 may include 1 or N cameras 293, where N is a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the terminal device 200 selects a frequency point, the digital signal processor is used to perform fourier transform or the like on the frequency point energy.
Video codecs are used to compress or decompress digital video. The terminal device 200 may support one or more video codecs. In this way, the terminal device 200 can play or record video in a plurality of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU can implement applications such as intelligent recognition of the terminal device 200, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the terminal device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes various functional applications of the terminal device 200 and data processing by executing instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, a phonebook, etc.) created during use of the terminal device 200, and the like. In addition, the internal memory 221 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The terminal device 200 may implement an audio function through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D, the application processor, and the like. Such as music playing, recording, etc.
Audio module 270 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be disposed in the processor 210, or some functional modules of the audio module 270 may be disposed in the processor 210.
The speaker 270A, also called a "horn", is used to convert an audio electrical signal into an acoustic signal. The terminal device 200 can listen to music through the speaker 270A or listen to a handsfree call.
The receiver 270B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the terminal apparatus 200 receives a call or voice information, it is possible to receive voice by bringing the receiver 270B close to the human ear.
The microphone 270C, also referred to as a "microphone," is used to convert acoustic signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 270C by speaking the user's mouth near the microphone 270C. The terminal device 200 may be provided with at least one microphone 270C. In other embodiments, the terminal device 200 may be provided with two microphones 270C, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the terminal device 200 may further include three, four, or more microphones 270C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
The headphone interface 270D is used to connect wired headphones. The headset interface 270D may be the USB interface 230, or may be an open mobile electronic device platform (OMTP) standard interface of 3.5mm, or a Cellular Telecommunications Industry Association (CTIA) standard interface.
The pressure sensor 280A is used to sense a pressure signal, which can be converted into an electrical signal. In some embodiments, the pressure sensor 280A may be disposed on the display screen 294. The pressure sensor 280A can be of a wide variety of types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 280A, the capacitance between the electrodes changes. The terminal device 200 determines the intensity of the pressure from the change in the capacitance. When a touch operation is applied to the display screen 294, the terminal device 200 detects the intensity of the touch operation based on the pressure sensor 280A. The terminal device 200 can also calculate the touched position from the detection signal of the pressure sensor 280A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example, when a touch operation having a touch operation intensity smaller than a first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 280B may be used to determine the motion attitude of the terminal device 200. In some embodiments, the angular velocity of terminal device 200 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 280B. The gyro sensor 280B may be used for photographing anti-shake. Illustratively, when the shutter is pressed, the gyro sensor 280B detects the shake angle of the terminal device 200, calculates the distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the terminal device 200 by a reverse movement, thereby achieving anti-shake. The gyro sensor 280B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 280C is used to measure air pressure. In some embodiments, the terminal device 200 calculates altitude, aiding positioning and navigation, from the barometric pressure value measured by the barometric pressure sensor 280C.
The magnetic sensor 280D includes a hall sensor. The terminal device 200 may detect the opening and closing of the flip holster using the magnetic sensor 280D. In some embodiments, when the terminal device 200 is a folder, the terminal device 200 may detect the opening and closing of the folder according to the magnetic sensor 280D; and according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover and other characteristics are set.
The acceleration sensor 280E can detect the magnitude of acceleration of the terminal device 200 in various directions (generally, three axes). The magnitude and direction of gravity can be detected when the terminal device 200 is stationary. The method can also be used for recognizing the posture of the terminal equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The distance sensor 280F is used to measure distance. The terminal device 200 may measure the distance by infrared or laser. In some embodiments, shooting a scene, the terminal device 200 may range using the distance sensor 280F to achieve fast focus.
The proximity light sensor 280G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 200 emits infrared light to the outside through the light emitting diode. The terminal device 200 detects infrared reflected light from a nearby object using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 200. When insufficient reflected light is detected, the terminal device 200 can determine that there is no object near the terminal device 200. The terminal device 200 can utilize the proximity light sensor 280G to detect that the user holds the terminal device 200 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 280G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 280L is used to sense the ambient light level. The terminal device 200 may adaptively adjust the brightness of the display screen 294 according to the perceived ambient light level. The ambient light sensor 280L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 280L may also cooperate with the proximity light sensor 280G to detect whether the terminal device 200 is in a pocket for protection against accidental touches.
The fingerprint sensor 280H is used to collect a fingerprint. The terminal device 200 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access to an application lock, fingerprint photographing, fingerprint incoming call answering and the like.
The temperature sensor 280J is used to detect temperature. In some embodiments, the terminal device 200 executes a temperature processing strategy using the temperature detected by the temperature sensor 280J. For example, when the temperature reported by the temperature sensor 280J exceeds the threshold, the terminal device 200 performs a reduction in performance of a processor located near the temperature sensor 280J, so as to reduce power consumption and implement thermal protection. In other embodiments, terminal device 200 heats battery 242 when the temperature is below another threshold to avoid a low temperature causing abnormal shutdown of terminal device 200. In other embodiments, when the temperature is below a further threshold, the terminal device 200 performs boosting of the output voltage of the battery 242 to avoid abnormal shutdown due to low temperature.
The touch sensor 280K is also referred to as a "touch panel". The touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, which is also called a "touch screen". The touch sensor 280K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display screen 294. In other embodiments, the touch sensor 280K may be disposed on the surface of the terminal device 200, different from the position of the display screen 294.
The bone conduction sensor 280M may acquire a vibration signal. In some embodiments, the bone conduction sensor 280M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 280M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 280M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 270 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 280M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal acquired by the bone conduction sensor 280M, so as to realize a heart rate detection function.
The keys 290 include a power-on key, a volume key, etc. The keys 290 may be mechanical keys. Or may be touch keys. The terminal device 200 may receive a key input, and generate a key signal input related to user setting and function control of the terminal device 200.
The motor 291 may generate a vibration cue. The motor 291 can be used for both incoming call vibration prompting and touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 291 may also respond to different vibration feedback effects for touch operations on different areas of the display 294. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 292 may be an indicator light that may be used to indicate a state of charge, a change in charge, or may be used to indicate a message, missed call, notification, etc.
The SIM card interface 295 is used to connect a SIM card. The SIM card can be attached to and detached from the terminal device 200 by being inserted into the SIM card interface 295 or being pulled out from the SIM card interface 295. The terminal device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. Multiple cards can be inserted into the same SIM card interface 295 at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 295 may also be compatible with different types of SIM cards. The SIM card interface 295 may also be compatible with external memory cards. The terminal device 200 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the terminal device 200 employs eSIM, namely: an embedded SIM card. The eSIM card may be embedded in the terminal apparatus 200 and cannot be separated from the terminal apparatus 200.
The software system of the terminal device 200 may adopt a hierarchical architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example, and exemplifies a software structure of a terminal device.
Fig. 4 is a block diagram of a software configuration of a terminal device according to an embodiment of the present application. The layered architecture divides the software into a plurality of layers, and each layer has clear roles and division of labor; the layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, which are an application layer, an application framework layer, an Android runtime (Android runtime) and system library and a kernel layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 4, the application package may include Applications (APPs) such as camera, gallery, music, contacts, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 4, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The telephone manager is used for providing a communication function of the terminal equipment. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. Such as surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, composition, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing. The kernel layer is a layer between hardware and software; the core layer includes at least a sensor driver, a camera driver, a display driver, and the like.
It should be noted that fig. 3 listed above is a possible structure diagram of a terminal device, and the present application does not limit the structure of the terminal device at all.
The method for detecting veiling glare according to the embodiment of the present application is described in detail below with reference to fig. 5 and 6. The stray light detection method provided by the embodiment of the application can detect whether stray light exists in the camera module; further, in the case where there is veiling glare in the image, the veiling glare detection method according to the embodiment of the present application can also detect the level of veiling glare in the image, that is, the severity of veiling glare in the image.
Fig. 5 is a schematic flowchart of a veiling glare detection method provided in an embodiment of the present application. The method illustrated in FIG. 5 may be performed in the scenario illustrated in FIG. 2; the method 300 shown in fig. 5 may include steps S301 to S309, which are described in detail below.
Step S301, an image (one example of a light source image) is acquired.
For example, the control device 140 controls the camera 130 to acquire the image of the light source 110 as shown in fig. 2.
And step S302, dividing the image, determining the brightness mean value of each image block and carrying out normalization processing on the image.
It should be understood that segmenting an image may refer to an image segmentation process, which may refer to segmenting the complete image into several regions.
Illustratively, the image may be divided into L ﹡ H image blocks according to the length and width of the image; and calculates the luminance mean value of each image block. For example, the acquired image may be divided into 100 image blocks of 10 ﹡ 10.
It should be understood that the above is for illustration, and the present solution does not limit the number of blocks of the image segmentation.
It should be further understood that the luminance value of each image block may refer to a mean luminance value of a plurality of pixel points included in the image block. For example, if a certain image block includes 40 pixels, the average value of the luminance values corresponding to the 40 pixels is the luminance average value of the image block.
Step S303, determining whether the number of luminance peaks per row or column (an example of a first peak) is greater than or equal to 2; judging whether the number of the brightness peak values of each row or each column in the segmented image is more than or equal to 2; if yes, go to step S304; if not, go to step S305.
In a possible implementation manner, if there is one light source in the scene shown in fig. 2, it may be determined whether the number of peak values of the luminance values of each row of image blocks in the image is greater than or equal to 2; or judging whether the number of peak values of the brightness values of each column of image blocks in the image is greater than or equal to 2.
It should be understood that if a light source is provided in the detection system, the brightness value of each row or column in the acquired image of the light source should have only one peak value; when the number of the peak values is greater than or equal to 2, the fact that the stray light exists in the image is indicated; meanwhile, it can be shown that certain problems exist in the performance of the camera for acquiring images.
Step S304, the image has stray light.
For example, determining that veiling glare is present in the image may refer to determining that a first region is present in the image, which may refer to an image low quality region in the light source image.
It is understood that veiling glare can cause low quality regions in the image; the image low-quality area can be an abnormal area existing in the image due to stray light generated by the camera module under the light source; the stray light can cause the problems of reduced contrast and signal-to-noise ratio of the image, deteriorated definition, color distortion, limitation of high dynamic range imaging and the like; veiling glare may include, but is not limited to, glare, ghosting, abnormal light spots, and image areas that differ from normal image areas.
Step S305, judging whether the number of the brightness peak values of each row or each column is more than or equal to 1; if yes, go to step S307; if not, go to step S306.
For example, if there is one light source, it may be determined whether the number of peak values of the luminance values of each row of image blocks in the image is greater than or equal to 1; or judging whether the number of peak values of the brightness values of each column of image blocks in the image is greater than or equal to 1.
Step S306, the image is normal; i.e. to determine that the image is normal.
It should be understood that determining that the image is normal may indicate that stray light is not present in the image; alternatively, the portion of the stray light present in the image is not sufficient to have a visual impact on the user, and the portion of the stray light is negligible. At this time, it is explained that the performance of the camera acquiring the image is good.
In step S307, it is determined whether the difference in the distance between the image brightness peak and the brightest peak (an example of the second peak) is smaller than a threshold. If yes, go to step S308; if not, go to step S309.
For example, it may be determined whether the difference between the position distances of the brightness peak value and the brightest peak value of each row in the image is smaller than a threshold; or judging whether the position distance difference between the brightness peak value and the brightest peak value of each column in the image is smaller than a threshold value.
Step S308, the image is normal; i.e. to determine that the image is normal.
Step S309, stray light exists in the image; i.e. determining that the image is veiling glare.
In the embodiment of the application, gridding processing is carried out on an image acquired by a camera to obtain N image blocks; determining the average brightness value of pixel points included in each image block in the N image blocks as the brightness value of the image block; further, the number of peaks of the luminance values of the image blocks of each row or each column in the image and the difference in the distance between the two luminance peaks are determined to determine whether the image has veiling glare. In the method and the device, the image is subjected to gridding processing and brightness value of each image block is determined so as to perform stray light detection on the image, so that the precision of the stray light detection of the image can be improved to a certain extent.
The stray light in the image can be detected by the stray light detection method shown in the above-mentioned fig. 5; in addition, the method for detecting veiling glare provided by the present application can also detect the degree of veiling glare in an image, which is described in detail below with reference to fig. 6.
Fig. 6 is a schematic flowchart of a veiling glare detection method provided in an embodiment of the present application. The method shown in FIG. 6 may be performed in the scenario shown in FIG. 2; the method 400 shown in fig. 6 may include steps S401 to S421, which are described in detail below.
Step S401, an image (one example of a light source image) is acquired.
For example, an image of the light source is acquired by the camera shown in fig. 2.
Step S402, judging whether stray light exists, namely judging whether stray light exists in the acquired image; determining that there is no veiling glare in the image, executing step S403; if it is determined that flare exists in the image, step S404 is performed.
It should be noted that, the specific determination process of step S402 can be shown in fig. 5, and is not described herein again.
Step S403, the image is normal.
It should be understood that determining that the image is normal may indicate that stray light is not present in the image; alternatively, the portion of the stray light present in the image is not sufficient to have a visual impact on the user, and the portion of the stray light is negligible. At this time, it is explained that the performance of the camera acquiring the image is good.
And S404, replacing the light source brightness with the minimum brightness value in the image, and matting out the light source area.
It should be understood that the minimum luminance value in the image may refer to the smallest luminance value among luminance values corresponding to a plurality of pixel points included in the image.
Step S405, determining whether the luminance value of each image block is less than a threshold 1 (one example of a first luminance threshold); if yes, go to step S407; if not, go to step S406.
Step S406, outputting the first-level stray light.
The first level of veiling glare, i.e. the veiling glare in the image, is severe.
Illustratively, the first level of veiling glare may refer to poor picture quality of an image, and the veiling glare present in the image seriously affects the visual experience of a user.
Step S407, determining whether the luminance value of each image block is greater than a threshold 2 (one example of a second luminance threshold) and less than a threshold 1 (one example of a first luminance threshold); if yes, go to step S408; if not, executing step S409.
Step S408, counting the number A of the image blocks; i.e. the number of image blocks having a luminance value between the threshold 2 and the threshold 1 is counted.
Step S409, determining whether the luminance value of each image block is greater than a threshold 3 (an example of a third luminance threshold) and less than a threshold 2; if yes, go to step S410; if not, go to step S411.
S410, counting the number B of the image blocks; i.e. the number of image blocks having a luminance value between the threshold 3 and the threshold 2 is counted.
And step S411, judging whether the circulation traversal of each image block in the image is finished. If yes, go to step S412; if not, the step S405 is executed again.
Step S412, calculating a proportion a and a proportion b; wherein, the proportion a refers to the ratio of the number A of the image blocks to the total number of the image blocks; the proportion B refers to the ratio of the number B of the image blocks to the total number of the image blocks; the total number of image blocks is the total number of image blocks after the image is subjected to gridding processing.
It should be understood that the ratio a and the ratio b are calculated to determine the influence of the image blocks of a certain luminance value interval on the whole image picture.
Step S413, determining whether a is greater than an occupancy threshold 1 (one example of a first occupancy threshold); if the ratio is greater than the ratio threshold value 1, executing step S414; if the ratio is less than or equal to the ratio threshold 1, step S415 is executed.
And step S414, outputting the first-grade stray light.
Step S415, determining whether a is greater than a duty threshold 2 (an example of a second duty threshold) and less than a duty threshold 1; if yes, go to step S416; if not, go to step S417.
And step S416, outputting the second-level stray light.
The second-level veiling glare, i.e. the veiling glare degree in the image, is moderate.
By way of example, moderate may mean that the picture quality of the image has a certain improvement compared to severe veiling glare, which still has a certain impact on the visual experience of the user.
Step S417, determining whether b is greater than an occupancy threshold 3 (an example of a third occupancy threshold); if yes, go to step S418; if not, go to step S419.
And step S418, outputting the second-level stray light.
The second-level veiling glare, i.e. the veiling glare degree in the image, is moderate.
Step S419 of determining whether b is greater than an occupancy threshold 4 (an example of a fourth occupancy threshold) and less than an occupancy threshold 3; if yes, go to step S420; if not, go to step S421.
And step S420, outputting the third-level stray light.
The second-level flare, i.e., the flare level in the image, is light.
By way of example, mild may mean that the picture quality of the image is further improved compared to moderate, the veiling glare present in the image having less impact on the visual experience of the user.
Step S421, the output image is normal.
It should be understood that determining that the image is normal may indicate that stray light is not present in the image; alternatively, the portion of the stray light present in the image is not sufficient to have a visual impact on the user, and the portion of the stray light is negligible. At this time, it is explained that the performance of the camera acquiring the image is good.
The ratio threshold 1, the ratio threshold 3 and the luminance threshold 1 are in inverse proportion, the luminance threshold 1 is increased, and the ratio thresholds 1 and 3 are decreased; the ratio threshold value 2, the ratio threshold value 4 and the brightness threshold value 2 are in inverse proportion, the brightness threshold value 2 is increased, and the ratio threshold values 2 and 4 are decreased; the occupancy thresholds 3, 4 have no correlation with the occupancy thresholds 1, 2.
In the embodiment of the application, N image blocks are obtained by gridding the acquired image; determining the average brightness value of pixel points included in each image block in the N image blocks as the brightness value of the image block; further, the number of peaks of the luminance values of the image blocks of each row or each column in the image and the difference in the distance between the two luminance peaks are determined to determine whether the image has veiling glare. Further, in the case where there is veiling glare in the image, the veiling glare in the image may be graded; for example, the first level, the second level and the third level can determine the severity of the veiling glare more intuitively when the presence of the veiling glare in the image is determined.
Examples of the veiling glare detection methods provided herein are described in detail above. It is understood that the corresponding apparatus contains hardware structures and/or software modules corresponding to the respective functions for implementing the functions described above. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The functional units of the stray light detection device can be divided according to the method example, for example, each function can be divided into each functional unit, or two or more functions can be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the units in the present application is schematic, and is only one division of logic functions, and there may be another division manner in actual implementation.
Fig. 7 is a schematic block diagram of a veiling glare detection apparatus provided herein.
It should be understood that the veiling glare detection apparatus 500 may perform the veiling glare detection method illustrated in fig. 5 and 6; the stray light detecting apparatus 500 includes: an acquisition unit 510 and a processing unit 520.
In an example, the obtaining unit 510 is configured to obtain a light source image captured by a camera module to be detected; the processing unit 520 is configured to perform image segmentation on the light source image to obtain N image blocks, where N is an integer greater than or equal to 2; and determining whether a first area exists in the light source image according to the brightness value of each image block in the N image blocks, wherein the brightness value of the image block is the average value of the brightness values of all pixels included in the image block, and the first area is an image low-quality area in the light source image.
Optionally, as an embodiment, the processing unit 520 is specifically configured to:
determining that the first region exists in the light source image in a case where the number of first peaks is greater than or equal to 2; wherein the first peak refers to a peak of luminance values of image blocks included in each row or each column in the light source image.
Optionally, as an embodiment, the processing unit 520 is specifically configured to:
under the condition that the number of first peak values is less than 2, if the distance difference value between the positions of the first peak values and the positions of the second peak values is greater than or equal to a first threshold value, determining that the first area exists in the light source image;
the first peak value refers to a peak value of a brightness value of an image block included in each row or each column in the light source image, and the second peak value refers to a peak value of a brightness value in the light source image.
Optionally, as an embodiment, the light source image refers to an image after a light source matting process, the light source matting process refers to replacing a brightness value of a light source region in the light source image with a minimum brightness value in the light source image, and the processing unit 520 is further configured to:
and under the condition that the first area exists in the light source image, determining the veiling glare grade of the light source image according to the brightness value of each image block in the N image blocks, wherein the veiling glare grade is used for representing the veiling glare degree in the light source image.
Optionally, as an embodiment, the processing unit 520 is specifically configured to:
and determining the veiling glare grade according to the ratio of the N image blocks in different brightness value intervals, wherein the ratio is used for representing the ratio of the number of the image blocks in the different brightness value intervals to N.
Optionally, as an embodiment, the processing unit 520 is specifically configured to:
determining the veiling glare grade to be a first grade under the condition that the brightness value of each image block in the N image blocks is greater than or equal to a first brightness threshold;
determining the veiling glare grade as a first grade under the condition that the proportion value of the first brightness value interval is greater than a first proportion threshold value;
determining the veiling glare grade as a second grade under the condition that the proportion value of the first brightness value interval is larger than a second proportion threshold and smaller than a first proportion threshold;
determining the veiling glare grade as a second grade under the condition that the proportion value of the second brightness value interval is greater than a third proportion threshold value;
determining the veiling glare grade as a third grade under the condition that the duty ratio of the second brightness value interval is greater than a fourth duty ratio threshold and less than a third duty ratio threshold;
wherein the first level of veiling glare is greater than the second level; the second level has a greater degree of veiling glare than the third level; the first brightness value interval refers to a set of brightness values which are greater than the second brightness threshold value and less than the first brightness threshold value; the second brightness value interval refers to a set of brightness values which are greater than a third brightness threshold and less than a second brightness threshold; the first ratio threshold, the third ratio threshold and the first brightness threshold are in inverse proportion relation; the second duty threshold, the fourth duty threshold and the second brightness threshold are in inverse proportion relation.
In an example, the obtaining unit 510 is configured to receive a control instruction of a control device, where the control instruction is used to instruct a to-be-detected camera module to capture a light source image; the processing unit 520 is configured to send the light source image to the control device, so that the control device determines whether a first region exists in the light source image, where the first region is used to represent an image low-quality region existing in the light source image.
The flare detecting apparatus 500 is embodied as a functional unit. The term "unit" herein may be implemented in software and/or hardware, and is not particularly limited thereto.
For example, a "unit" may be a software program, a hardware circuit, or a combination of both that implement the above-described functions. The hardware circuitry may include an Application Specific Integrated Circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group of processors) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that support the described functionality.
Accordingly, the units of the respective examples described in the embodiments of the present application can be realized in electronic hardware, or a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Fig. 8 shows a schematic structural diagram of an electronic device provided in the present application. The dashed lines in fig. 8 indicate that the unit or the module is optional. The electronic device 600 may be used to implement the veiling glare detection method described in the above method embodiments.
The electronic device 600 includes one or more processors 601, and the one or more processors 601 may support the electronic device 600 to implement the veiling glare detection method in the method embodiments. The processor 601 may be a general purpose processor or a special purpose processor. For example, the processor 601 may be a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic device, such as a discrete gate, a transistor logic device, or discrete hardware components.
The processor 601 may be used to control the electronic device 600, execute software programs, and process data of the software programs. The electronic device 600 may further include a communication unit 605 to enable input (reception) and output (transmission) of signals.
For example, the electronic device 600 may be a chip and the communication unit 605 may be an input and/or output circuit of the chip, or the communication unit 605 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.
Also for example, the electronic device 600 may be a terminal device and the communication unit 605 may be a transceiver of the terminal device, or the communication unit 605 may be a transceiver circuit of the terminal device.
The electronic device 600 may comprise one or more memories 602, on which programs 604 are stored, and the programs 604 may be executed by the processor 601 to generate instructions 603, so that the processor 601 executes the stray light detection method described in the above method embodiments according to the instructions 603.
Optionally, data may also be stored in the memory 602. Alternatively, the processor 601 may also read data stored in the memory 602, the data may be stored at the same memory address as the program 604, and the data may be stored at a different memory address from the program 604.
The processor 601 and the memory 602 may be provided separately or integrated together; for example, on a System On Chip (SOC) of the terminal device.
Exemplarily, the memory 602 may be configured to store a related program 604 of the veiling glare detection method provided in this embodiment, and the processor 601 may be configured to call the related program 604 of the veiling glare detection method stored in the memory 602 when performing veiling glare detection on the camera module of the terminal device, and execute the veiling glare detection method of this embodiment, that is, obtain a light source image captured by the camera module to be detected; performing image segmentation processing on the light source image to obtain N image blocks, wherein N is an integer greater than or equal to 2; and determining whether a first area exists in the light source image according to the brightness value of each image block in the N image blocks, wherein the brightness value of the image block is the average value of the brightness values of all pixels included in the image block, and the first area is an image low-quality area in the light source image.
The present application further provides a computer program product, which when executed by the processor 601, implements the veiling glare detection method according to any of the method embodiments of the present application.
The computer program product may be stored in the memory 602, for example, as a program 604, and the program 604 is finally converted into an executable object file capable of being executed by the processor 601 through preprocessing, compiling, assembling, linking and the like.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a computer, implements the method of any of the method embodiments of the present application. The computer program may be a high-level language program or an executable object program.
Such as memory 602. The memory 602 may be either volatile memory or nonvolatile memory, or the memory 602 may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
The present application further provides a stray light detection system, including: a module to be detected and control equipment; the module to be detected is used for receiving a control instruction sent by the control equipment, and the control instruction is used for instructing the module to be detected to shoot a light source to obtain a light source image; the control device is used for executing the stray light detection method in any method embodiment of the application.
In the present application, "at least one" means one or more, "a plurality" means two or more. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A stray light detecting method is characterized by comprising the following steps:
acquiring a light source image shot by a camera module to be detected;
performing image segmentation processing on the light source image to obtain N image blocks, wherein N is an integer greater than or equal to 2;
and determining whether a first area exists in the light source image according to the brightness value of each image block in the N image blocks, wherein the brightness value of the image block is the average value of the brightness values of all pixels included in the image block, and the first area is an image low-quality area in the light source image.
2. The veiling glare detection method of claim 1, wherein the determining whether the first area exists in the light source image according to the brightness value of each of the N image blocks comprises:
determining that the first region exists in the light source image in a case where the number of first peaks is greater than or equal to 2;
wherein the first peak refers to a peak of luminance values of image blocks included in each row or each column in the light source image.
3. The veiling glare detection method of claim 1, wherein the determining whether the first area exists in the light source image according to the brightness value of each of the N image blocks comprises:
under the condition that the number of first peak values is less than 2, if the distance difference value between the positions of the first peak values and the positions of the second peak values is greater than or equal to a first threshold value, determining that the first area exists in the light source image;
the first peak value refers to a peak value of a brightness value of an image block included in each row or each column in the light source image, and the second peak value refers to a peak value of a brightness value in the light source image.
4. A veiling glare detection method according to any one of claims 1 to 3, wherein the light source image is an image after a light source matting process, the light source matting process being a process of replacing a brightness value of a light source region in the light source image with a minimum brightness value in the light source image, further comprising:
and under the condition that the first area exists in the light source image, determining the veiling glare grade of the light source image according to the brightness value of each image block in the N image blocks, wherein the veiling glare grade is used for representing the veiling glare degree in the light source image.
5. The veiling glare detection method of claim 4, wherein the determining the veiling glare level of the light source image according to the luminance value of each of the N image blocks comprises:
and determining the veiling glare grade according to the ratio of the N image blocks in different brightness value intervals, wherein the ratio is used for representing the ratio of the number of the image blocks in the different brightness value intervals to N.
6. The veiling glare detection method according to claim 5, wherein the determining the veiling glare level according to the ratio of the N image blocks in different luminance value intervals comprises:
determining the veiling glare grade to be a first grade under the condition that the brightness value of each image block in the N image blocks is greater than or equal to a first brightness threshold;
determining the veiling glare grade as a first grade under the condition that the proportion value of the first brightness value interval is greater than a first proportion threshold value;
determining the veiling glare grade as a second grade under the condition that the proportion value of the first brightness value interval is larger than a second proportion threshold and smaller than a first proportion threshold;
determining the veiling glare grade as a second grade under the condition that the proportion value of the second brightness value interval is greater than a third proportion threshold value;
determining the veiling glare grade as a third grade under the condition that the duty ratio of the second brightness value interval is greater than a fourth duty ratio threshold and less than a third duty ratio threshold;
wherein the first level of veiling glare is greater than the second level; the second level has a greater degree of veiling glare than the third level; the first brightness value interval refers to a set of brightness values which are greater than the second brightness threshold value and less than the first brightness threshold value; the second brightness value interval refers to a set of brightness values which are greater than a third brightness threshold and less than a second brightness threshold; the first ratio threshold, the third ratio threshold and the first brightness threshold are in inverse proportion relation; the second duty threshold, the fourth duty threshold and the second brightness threshold are in inverse proportion relation.
7. A veiling glare detection system, comprising:
a module to be detected and control equipment;
the module to be detected is used for receiving a control instruction sent by the control equipment, and the control instruction is used for instructing the module to be detected to shoot a light source to obtain a light source image;
the control device is configured to perform the veiling glare detection method of any one of claims 1 to 6.
8. A veiling glare detection apparatus, characterized in that the veiling glare detection apparatus comprises a processor and a memory, the memory being configured to store a computer program, the processor being configured to invoke and run the computer program from the memory, such that the veiling glare detection apparatus performs the veiling glare detection method of any of claims 1 to 6.
9. A chip comprising a processor that, when executing instructions, performs the veiling glare detection method of any of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to perform the veiling glare detection method of any of claims 1 to 6.
11. A computer program product, the computer program product comprising: computer program code which, when executed by a processor, causes the processor to perform the veiling glare detection method of any of claims 1 to 6.
CN202110681501.0A 2021-06-18 2021-06-18 Stray light detection method and stray light detection device Active CN113573045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110681501.0A CN113573045B (en) 2021-06-18 2021-06-18 Stray light detection method and stray light detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110681501.0A CN113573045B (en) 2021-06-18 2021-06-18 Stray light detection method and stray light detection device

Publications (2)

Publication Number Publication Date
CN113573045A true CN113573045A (en) 2021-10-29
CN113573045B CN113573045B (en) 2022-06-10

Family

ID=78162296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110681501.0A Active CN113573045B (en) 2021-06-18 2021-06-18 Stray light detection method and stray light detection device

Country Status (1)

Country Link
CN (1) CN113573045B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348440A (en) * 2022-08-09 2022-11-15 苏州艾微视图像科技有限公司 Testing device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534841A (en) * 2016-11-10 2017-03-22 宁波舜宇车载光学技术有限公司 Lens detection method and device
CN109741307A (en) * 2018-12-27 2019-05-10 宁波舜宇光电信息有限公司 Veiling glare detection method, veiling glare detection device and the veiling glare detection system of camera module
CN112218070A (en) * 2020-10-10 2021-01-12 Oppo(重庆)智能科技有限公司 Stray light detection method and device, storage medium and electronic equipment
CN112862795A (en) * 2021-02-22 2021-05-28 南昌欧菲光电技术有限公司 Stray light detection method and device, electronic equipment and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534841A (en) * 2016-11-10 2017-03-22 宁波舜宇车载光学技术有限公司 Lens detection method and device
CN109741307A (en) * 2018-12-27 2019-05-10 宁波舜宇光电信息有限公司 Veiling glare detection method, veiling glare detection device and the veiling glare detection system of camera module
CN112218070A (en) * 2020-10-10 2021-01-12 Oppo(重庆)智能科技有限公司 Stray light detection method and device, storage medium and electronic equipment
CN112862795A (en) * 2021-02-22 2021-05-28 南昌欧菲光电技术有限公司 Stray light detection method and device, electronic equipment and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348440A (en) * 2022-08-09 2022-11-15 苏州艾微视图像科技有限公司 Testing device

Also Published As

Publication number Publication date
CN113573045B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN111095723B (en) Wireless charging method and electronic equipment
CN114119758B (en) Method for acquiring vehicle pose, electronic device and computer-readable storage medium
CN113573390B (en) Antenna power adjusting method, terminal device and storage medium
CN113542580B (en) Method and device for removing light spots of glasses and electronic equipment
CN113810603B (en) Point light source image detection method and electronic equipment
CN114466107A (en) Sound effect control method and device, electronic equipment and computer readable storage medium
CN112700377A (en) Image floodlight processing method and device and storage medium
CN110138999B (en) Certificate scanning method and device for mobile terminal
CN114727220A (en) Equipment searching method and electronic equipment
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN112637477A (en) Image processing method and electronic equipment
CN113573045B (en) Stray light detection method and stray light detection device
CN111249728B (en) Image processing method, device and storage medium
CN110286975B (en) Display method of foreground elements and electronic equipment
CN115032640B (en) Gesture recognition method and terminal equipment
CN115641867B (en) Voice processing method and terminal equipment
CN112541861A (en) Image processing method, device, equipment and computer storage medium
CN117009005A (en) Display method, automobile and electronic equipment
CN115964231A (en) Load model-based assessment method and device
CN111982037B (en) Height measuring method and electronic equipment
CN114445522A (en) Brush effect graph generation method, image editing method, device and storage medium
CN114812381A (en) Electronic equipment positioning method and electronic equipment
CN116703741B (en) Image contrast generation method and device and electronic equipment
CN115619628B (en) Image processing method and terminal equipment
CN116708751B (en) Method and device for determining photographing duration and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220624

Address after: 518000 floor 5, building B1, glory Intelligent Manufacturing Industrial Park, No. 9, Lanzhu West Road, Zhukeng community, Longtian street, Pingshan District, Shenzhen, Guangdong

Patentee after: Shenzhen glory Intelligent Machine Co.,Ltd.

Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee before: Honor Device Co.,Ltd.