Image processing method, image processing device, electronic equipment and storage medium
By filling the light on the camera module on the display screen of the electronic device and dividing the image area, the light leakage problem caused by the display light entering the camera module is solved, and the imaging quality is improved.
Patent Information
- Application Number
- CN202310693513.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
When electronic devices on the market acquire images, light on the display screen may enter the camera module, resulting in light leakage in the images captured by the camera module, affecting the imaging quality.
By replenishing the camera module when the display screen is turned on, it is divided into an area where there is light leakage and an area where there is no light leakage, and then a second image is obtained when the display screen is turned off, according to both Extract the target image to avoid the influence of display light.
Effectively eliminate light leakage in the images captured by the camera module and ensure the image quality.
Smart Images

Figure CN119136036A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, an image processing device, an electronic device and a storage medium. Background Art
[0002] In recent years, with the continuous development of electronic devices such as mobile phones and cameras, people's demand for images has continued to grow, and their pursuit of high-quality visual experience has become increasingly high. At present, when electronic devices on the market acquire images, the light on the display may enter the camera module, causing light leakage in the images captured by the camera module, thus affecting the image quality. Summary of the invention
[0003] Embodiments of the present application provide an image processing method, an image processing device, an electronic device, and a storage medium.
[0004] The image processing method of the embodiment of the present application includes: when the display screen is turned on to fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the camera module acquires a first image; the first image is divided into a first area and a second area, the first area is an area with light leakage, and the second area is an area without light leakage; when the display screen is turned off to fill light for the camera module, the camera module acquires a second image; based on the first area, a third area in the second image is extracted; and a target image is obtained based on the second area and the third area.
[0005] The image processing device of the embodiment of the present application includes an imaging module, a division module, an extraction module and an acquisition module. When the display screen is turned on to fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the imaging module is used to acquire a first image. The division module is used to divide the first image into a first area and a second area, the first area being an area where light leakage exists, and the second area being an area where no light leakage exists. When the display screen is turned off to fill light for the camera module, the imaging module is also used to acquire a second image. The extraction module is used to extract a third area in the second image based on the first area. The acquisition module is used to obtain a target image based on the second area and the third area.
[0006] The electronic device of the embodiment of the present application includes a camera module and one or more processors. One or more processors are used to execute the image processing method of the embodiment of the present application. The image processing method includes: when the display screen is turned on to fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the camera module obtains a first image; divides the first image into a first area and a second area, the first area is an area with light leakage, and the second area is an area without light leakage; when the display screen is turned off to fill light for the camera module, the camera module obtains a second image; according to the first area, extracts a third area in the second image; and obtains a target image according to the second area and the third area.
[0007] The storage medium of the embodiment of the present application stores a computer program thereon, and when the program is executed by a processor, an image processing method of the embodiment of the present application is implemented. The image processing method comprises: when the display screen is turned on to fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the camera module acquires a first image; divides the first image into a first area and a second area, the first area is an area with light leakage, and the second area is an area without light leakage; when the display screen is turned off to fill light for the camera module, the camera module acquires a second image; according to the first area, extracts a third area in the second image; and obtains a target image according to the second area and the third area.
[0008] In the image processing method, image processing device, electronic device and storage medium of the implementation mode of the present application, when the display screen is turned on to fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the camera module obtains a first image and divides the first image into a first area with light leakage and a second area with no light leakage. When the display screen is turned off to fill light for the camera module, the camera module obtains a second image, extracts a third area in the second image based on the first area, and obtains a target image based on the second area and the third area. Since the target image integrates the second area without light leakage, the light emitted by the display screen is avoided from affecting the camera module, thereby eliminating the light leakage phenomenon in the image captured by the camera module, thereby ensuring the imaging quality of the camera module.
[0009] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0011] Figure 1 is a flowchart of an image processing method of certain embodiments of the present application;
[0012] Figure 2 is a schematic diagram of the structure of an image processing device in some embodiments of the present application;
[0013] Figure 3 is a schematic diagram of the structure of an electronic device according to some embodiments of the present application;
[0014] Figure 4 is a schematic diagram of a scene of an image processing method in some embodiments of the present application;
[0015] Figure 5 is a flowchart of an image processing method of certain embodiments of the present application;
[0016] Figure 6 is a flowchart of an image processing method of certain embodiments of the present application;
[0017] Figure 7 is a flowchart of an image processing method of certain embodiments of the present application;
[0018] Figure 8 is a flowchart of an image processing method of certain embodiments of the present application;
[0019] Fig. 9 It is a schematic diagram of the principle of the image processing method of certain embodiments of the present application;
[0020] Fig.10 is a flowchart of an image processing method of certain embodiments of the present application;
[0021] Fig.11 is a flowchart of an image processing method of certain embodiments of the present application;
[0022] Fig.12 is a flowchart of an image processing method of certain embodiments of the present application;
[0023] Fig.13 is a flowchart of an image processing method of certain embodiments of the present application;
[0024] Fig.14 It is a schematic diagram of the principle of the image processing method of certain embodiments of the present application;
[0025] Fig.15 is a flowchart of an image processing method of certain embodiments of the present application;
[0026] Fig.16 is a flowchart of an image processing method of certain embodiments of the present application;
[0027] Fig.17 is a flowchart of an image processing method of certain embodiments of the present application;
[0028] Fig.18 It is a schematic diagram of the connection status between the storage medium and the processor in certain embodiments of the present application.
[0029] Description of main component symbols:
[0030] Electronic device 100; storage medium 200; computer program 210;
[0031] Image processing device 10, analysis module 11, imaging module 12, division module 13, extraction module 14, acquisition module 15, alignment module 16, determination module 17, adding module 18;
[0032] Main body 20; camera module 30; processor 40; display screen 50. DETAILED DESCRIPTION
[0033] The following is a further description of the embodiments of the present application in conjunction with the accompanying drawings. The same or similar reference numerals in the accompanying drawings represent the same or similar elements or elements with the same or similar functions from beginning to end. In addition, the embodiments of the present application described below in conjunction with the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the present application.
[0034] In recent years, with the continuous development of electronic devices such as mobile phones and cameras, people's demand for images has continued to grow, and the pursuit of high-quality visual experience has become increasingly high. At present, when electronic devices on the market acquire images, light on the display screen may enter the camera module, resulting in light leakage in the image captured by the camera module, thereby affecting the image quality. In order to solve this problem, the embodiment of the present application provides an image processing method ( Figure 1 As shown), the image processing device 10 ( Figure 2 As shown), electronic device 100 ( Figure 3 ) and storage medium 200 ( Fig.18 shown).
[0035] See also Figure 1 , Figure 3 , Fig. 9 and Fig.14 , the image processing method of the embodiment of the present application includes:
[0036] 02: When the display screen 50 is turned on to provide fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, the camera module 30 acquires a first image;
[0037] 03: Divide the first image into a first area S1 and a second area S2, where the first area S1 is an area where light leakage exists, and the second area S2 is an area where no light leakage exists;
[0038] 04: When the display screen 50 is turned off to provide fill light to the camera module 30, the camera module 30 acquires a second image;
[0039] 05: extracting a third area S3 in the second image according to the first area S1; and
[0040] 06: Obtain a target image according to the second area S2 and the third area S3.
[0041] Please combine Figure 2 , the above-mentioned image processing method can be applied to an image processing device 10. The image processing device 10 of the embodiment of the present application includes an imaging module 12, a division module 13, an extraction module 14 and an acquisition module 15. When the display screen 50 is turned on to fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, the imaging module 12 is used to acquire the first image. The division module 13 is used to divide the first image into a first area S1 and a second area S2, the first area S1 is an area with light leakage, and the second area S2 is an area without light leakage. When the display screen 50 is turned off to fill light for the camera module 30, the imaging module 12 is also used to acquire the second image. The extraction module 14 is used to extract the third area S3 in the second image according to the first area S1. The acquisition module 15 is used to obtain the target image according to the second area S2 and the third area S3. It should be noted that in some embodiments, the imaging module 12 may be the camera module 30.
[0042] Please combine Figure 3, the above-mentioned image processing method can be applied to an electronic device 100. An electronic device 100 of one embodiment of the present application includes a body 20, a camera module 30 and one or more processors 40. Among them, the camera module 30 is installed on the body 20. One or more processors 40 are used to execute the image processing methods in 02, 03, 04, 05 and 06. That is, one or more processors 40 are used to: when the display screen 50 is turned on to fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, control the camera module 30 to obtain a first image; divide the first image into a first area S1 and a second area S2, the first area S1 is an area with light leakage, and the second area S2 is an area without light leakage; when the display screen 50 is turned off to fill light for the camera module 30, control the camera module 30 to obtain a second image; extract the third area S3 in the second image according to the first area S1; and obtain the target image according to the second area S2 and the third area S3.
[0043] An electronic device 100 according to another embodiment of the present application may include a body 20 and an image processing device 10 according to an embodiment of the present application, and the image processing device 10 is installed in the body 20 .
[0044] The electronic device 100 of the embodiment of the present application includes but is not limited to a mobile phone, a tablet computer, a camera, a video camera, a personal digital assistant, a wearable device, an intelligent robot, an intelligent vehicle, etc. The wearable device includes a smart bracelet, a smart watch, smart glasses, etc.
[0045] In some embodiments, when the camera module 30 captures an image in a low-brightness environment (insufficient light), in order to ensure the image quality obtained by the camera module 30, the camera module 30 can automatically adjust the exposure time and gain, but the adjustment of the exposure time and gain by the camera module 30 may cause problems such as increased noise and blurred images. Therefore, when the camera module 30 captures an image in a low-light environment, the camera module 30 can be filled with light to prevent the increase of image noise and ensure image quality. In some embodiments, the electronic device 100 can fill light to the camera module 30 through a fill light device (not shown), that is, when the camera module 30 captures an image in a low-light environment, the fill light device is turned on to fill light to the camera module 30, thereby improving the image quality. In other embodiments, the electronic device 100 can use the display screen 50 to emit light to fill light to the camera module 30, that is, when the camera module 30 captures an image in a low-light environment, at least a portion of the area on the display screen 50 can emit light to fill light to the camera module 30, thereby improving the image quality. In the embodiment of the present application, the use of the display screen 50 to provide fill light to the camera module 30 is taken as an example for explanation.
[0046] The light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, that is, when the display screen 50 is turned on to fill the light for the camera module 30, if the light emitted by the display screen 50 directly shines on the horn or lens of the camera module 30, and enters the image sensor of the camera module 30 under conditions of reflection, refraction and scattering, that is to say, the light emitted by the display screen 50 is not focused and distributed by components such as lenses and apertures, but directly shines on the image sensor. In this case, the light emitted by the display screen 50 will leave traces on the image sensor, causing the image captured by the camera module 30 to be partially or entirely too bright or abnormal in color, that is, causing light leakage in the image captured by the camera module 30. Specifically, please combine Figure 4 In some embodiments, when the display screen 50 is turned on to provide fill light for the camera module 30, and the light emitted by the display screen 50 does not cause light leakage in the image captured by the camera module 30, the image captured by the camera module 30 is as follows: Figure 4 As shown in the left figure in FIG, there is no light leakage area in the image captured by the camera module 30. When the display screen 50 is turned on to fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, the image captured by the camera module 30 is as shown in FIG. Figure 4 As shown in the right figure in FIG. , there is a light leakage area ( Figure 4 lower left area in the right image).
[0047] In some embodiments, the electronic device 100 can directly obtain the first image and the second image through its own camera module 30. The first image is obtained when the camera module 30 of the electronic device 100 turns on the display screen 50 to fill in the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30; the second image is obtained when the camera module 30 of the electronic device 100 turns off the display screen 50 to fill in the camera module 30. In other embodiments, the electronic device 100 can obtain the first image and the second image from other devices (such as other electronic devices). The first image is obtained when the camera module of other electronic devices turns on the display screen to fill in the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module; the second image is obtained when the camera module of other electronic devices turns off the display screen to fill in the camera module.
[0048] In the image processing method of the embodiment of the present application, when the display screen 50 is turned on to fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, a first image is acquired and the first image is divided into a first area S1 with light leakage and a second area S2 with no light leakage; when the display screen 50 is turned off to fill light for the camera module 30, a second image is acquired, and based on the first area S1, the third area S3 in the second image is extracted, and a target image is obtained based on the second area S2 and the third area S3. Since the target image incorporates the second area S2 without light leakage, the light emitted by the display screen 50 is avoided from affecting the camera module 30, thereby eliminating the light leakage phenomenon in the image captured by the camera module 30, thereby ensuring the imaging quality of the camera module 30.
[0049] See also Figure 5 In some embodiments, the image processing method further comprises:
[0050] 01: Analyze whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0051] Please combine Figure 2 The above image processing method can be applied to the image processing device 10. The image processing device 10 of the embodiment of the present application further includes an analysis module 11. The analysis module 11 is used to analyze whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0052] Please combine Figure 3 The above image processing method can be applied to the electronic device 100, and one or more processors 40 are used to execute the image processing method in 01. That is, the one or more processors 40 are used to analyze whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0053] In certain embodiments, when the display screen 50 is turned on to provide fill light for the camera module 30, the processor 40 can analyze whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. If the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, the processor 40 can continue to perform the image processing in the embodiments of the present application on the first image and the second image acquired by the camera module 30 to eliminate the influence of light leakage on the image and ensure the imaging quality. If the light emitted by the display screen 50 causes no light leakage in the image captured by the camera module 30, the processor 40 does not need to perform the image processing in the embodiments of the present application on the image acquired by the camera module 30. At this time, the image acquired by the camera module 30 can be directly output as the target image, thereby reducing the image processing steps and improving the efficiency of image output.
[0054] See also Figure 6 In some embodiments, 01: analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, including:
[0055] 011: Obtaining the ambient light brightness of the environment where the electronic device 100 is located; and
[0056] 013: When the ambient light brightness is less than a preset first threshold, it is confirmed that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30 .
[0057] Please combine Figure 2 The analysis module 11 is also used to: obtain the ambient light brightness of the environment in which the electronic device 100 is located; and when the ambient light brightness is less than a preset first threshold, confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0058] Please combine Figure 3 , the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing method in 011 and 013. That is, one or more processors 40 are used to obtain the ambient light brightness of the environment in which the electronic device 100 is located; and when the ambient light brightness is less than a preset first threshold, confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0059] If the ambient light brightness of the environment in which the electronic device 100 is located is high, the ambient light can disperse the light emitted by the display screen 50, that is, the ambient light with a higher brightness can reduce the influence of the light emitted by the display screen 50 on the image captured by the camera module 30, and prevent the image captured by the camera module 30 from leaking light; and if the ambient light brightness of the environment in which the electronic device 100 is located is low, the ambient light cannot affect the light emitted by the display screen 50, that is, the light emitted by the display screen 50 can affect the image captured by the camera module 30, resulting in light leakage in the image captured by the camera module 30. Therefore, in the present application, it can be determined by the ambient light brightness of the electronic device 100 whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. Specifically, in some embodiments, the electronic device 100 can be provided with a photosensitive element sensor (not shown in the figure), which can detect the ambient light brightness, and the analysis module 11 or the processor 40 can obtain the ambient light brightness detected by the photosensitive element sensor. In other embodiments, the electronic device 100 may first capture an image using the camera module 30 , and then analyze the image captured by the camera module 30 using a software algorithm to obtain the ambient light brightness of the environment in which the electronic device 100 is located.
[0060] The preset first threshold value may be a critical value for analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. The preset first threshold value may be known data, which may be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input by a user when the electronic device 100 is used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory.
[0061] Specifically, when the ambient light brightness is less than a preset first threshold, the processor 40 can confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. For example, the preset first threshold may be 100 lux, and when the ambient light brightness is less than 100 lux, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0062] See also Figure 7 In some embodiments, 01: analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, including:
[0063] 015: Obtaining the ambient light brightness of the environment where the electronic device 100 is located;
[0064] 017: When the ambient light brightness is less than a preset first threshold, obtaining an analog gain and / or a digital gain when the camera module 30 acquires an image; and
[0065] 019: When the analog gain is greater than the preset second threshold value, and / or the digital gain is greater than the preset third threshold value, it is confirmed that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0066] Please combine Figure 2 The analysis module 11 is also used to: obtain the ambient light brightness of the environment in which the electronic device 100 is located; when the ambient light brightness is less than a preset first threshold, obtain the analog gain and / or digital gain of the camera module 30 when acquiring an image; and when the analog gain is greater than a preset second threshold, and / or the digital gain is greater than a preset third threshold, confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0067] Please combine Figure 3, the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing methods in 015, 017 and 019. That is, one or more processors 40 are used to obtain the ambient light brightness of the environment in which the electronic device 100 is located; when the ambient light brightness is less than a preset first threshold, obtain the analog gain and / or digital gain of the camera module 30 when acquiring the image; and when the analog gain is greater than a preset second threshold, and / or the digital gain is greater than a preset third threshold, confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0068] Because when the brightness of the ambient light in the environment where the electronic device 100 is located is high, that is, the brightness of the ambient light in the environment where the electronic device 100 is located is greater than or equal to the preset first threshold, the ambient light may also enter the image sensor of the camera module 30 under the conditions of reflection, refraction and scattering, resulting in light leakage in the image. Therefore, if the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30 only when the brightness of the ambient light is less than the preset first threshold, the accuracy of the analysis by the processor 40 is poor. In addition, since the camera module 30 can automatically adjust the exposure time and gain (including analog gain and digital gain) to ensure the image quality when capturing images in a low-light environment, in the present application, when the ambient light brightness is less than a preset first threshold, the processor 40 can also obtain the analog gain and / or digital gain of the camera module 30 when acquiring the image, and when the analog gain is greater than a preset second threshold, and / or the digital gain is greater than a preset third threshold, it is confirmed that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, thereby improving the accuracy of the analysis of the processor 40 and ensuring the image quality obtained by the camera module 30.
[0069] It should be noted that the camera module 30 adjusts the analog gain to amplify the analog signal collected by the image sensor. Specifically, when the image sensor or the camera module 30 collects images, the optical signal is converted into an analog electrical signal, and the analog electrical signal is processed and amplified by an analog circuit, thereby increasing the signal strength to obtain a clearer and brighter image. The camera module 30 adjusts the digital gain to amplify the analog electrical signal to obtain a digital signal after analog-to-digital conversion. Specifically, in the process of the image sensor or the camera module 30 collecting images, the analog electrical signal can be converted into a digital signal, and the image brightness can be adjusted by digital signal processing technology (digital gain). Therefore, the camera module 30 can improve the image quality obtained by the camera module 30 in a low-light environment by adjusting the analog gain and digital gain, thereby ensuring the user's visual experience.
[0070] Among them, the preset second threshold value can be a critical value for analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. The preset second threshold value can be known data, which can be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is considered to be used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory. Similarly, the preset third threshold value can be a critical value for analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. The preset third threshold value can be known data, which can be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is considered to be used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory.
[0071] In some embodiments, analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30 may include: obtaining the ambient light brightness of the environment in which the electronic device 100 is located; when the ambient light brightness is less than a preset first threshold, obtaining the analog gain of the camera module 30 when acquiring the image; and when the analog gain is greater than a preset second threshold, confirming that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0072] Specifically, when the ambient light brightness is less than a preset first threshold value, and the analog gain is greater than a preset second threshold value, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. For example, the preset first threshold value may be 100 lux. Then, when the ambient light brightness is less than 100 lux, and the analog gain is greater than the preset second threshold value, the processor 40 can confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. It should be noted that, in some embodiments, when the ambient light brightness is less than the preset first threshold value, the processor 40 can obtain the analog gain when the camera module 30 acquires the image, and when the analog gain is greater than the preset second threshold value, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. Or when the ambient light brightness is less than a preset first threshold, the processor 40 is able to obtain the analog gain and digital gain of the camera module 30 when acquiring an image, and the processor 40 only analyzes whether the analog gain is greater than a preset second threshold. When the analog gain is greater than the preset second threshold, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0073] In other embodiments, analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30 may include: obtaining the ambient light brightness of the environment in which the electronic device 100 is located; when the ambient light brightness is less than a preset first threshold, obtaining the digital gain of the camera module 30 when acquiring the image; and when the digital gain is greater than a preset third threshold, confirming that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0074] Specifically, when the ambient light brightness is less than the preset first threshold value, and the digital gain is greater than the preset third threshold value, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. For example, the preset first threshold value may be 100 lux, and the preset third threshold value may be 2. Then, when the ambient light brightness is less than 100 lux, and the digital gain is greater than 2, the processor 40 can confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. It should be noted that, in some embodiments, when the ambient light brightness is less than the preset first threshold value, the processor 40 can obtain the digital gain when the camera module 30 acquires the image, and when the digital gain is greater than the preset third threshold value, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. Or when the ambient light brightness is less than a preset first threshold, the processor 40 is able to obtain the analog gain and digital gain of the camera module 30 when acquiring an image, and the processor 40 only analyzes whether the digital gain is greater than a preset third threshold. When the digital gain is greater than the preset third threshold, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0075] In some further embodiments, analyzing whether the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30 may include: obtaining the ambient light brightness of the environment in which the electronic device 100 is located; when the ambient light brightness is less than a preset first threshold, obtaining the analog gain and digital gain of the camera module 30 when acquiring the image; and when the analog gain is greater than a preset second threshold and the digital gain is greater than a preset third threshold, confirming that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30.
[0076] Specifically, when the ambient light brightness is less than a preset first threshold, the analog gain is greater than a preset second threshold, and the digital gain is greater than a preset third threshold, the processor 40 can confirm that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30. For example, the preset first threshold may be 100 lux, and the preset third threshold may be 2. Then, when the ambient light brightness is less than 100 lux, the analog gain is greater than the preset second threshold, and the digital gain is greater than 2, the processor 40 confirms that the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, thereby improving the accuracy of detecting whether there is light leakage.
[0077] See also Figure 8 In some embodiments, 03: dividing the first image into a first area S1 and a second area S2, comprising:
[0078] 031: Divide the first image into a plurality of regions; and
[0079] 033: Divide the plurality of regions into a first region S1 and a second region S2 according to brightness differences.
[0080] Please combine Figure 2 The division module 13 is further used for: dividing the first image into a plurality of regions; and dividing the plurality of regions into a first region S1 and a second region S2 according to brightness differences.
[0081] Please combine Figure 3 The program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing method in 031 and 033. That is, the one or more processors 40 are used to divide the first image into multiple regions; and divide the multiple regions into the first region S1 and the second region S2 according to the brightness difference.
[0082] Please combine Fig. 9 , when the light emitted by the display screen 50 causes light leakage in the captured image of the camera module 30, the light emitted by the display screen 50 will leave traces on the image sensor, resulting in partial or overall overbrightness or color abnormality of the image. Therefore, after the first image is divided into a plurality of regions, the plurality of regions can be divided according to the brightness difference to obtain a first region S1 and a second region S2. Among them, the first region S1 is an area where light leakage exists, and the second region S2 is an area where no light leakage exists. It should be noted that in some embodiments, the first image can be divided into a plurality of regions in a fixed size partitioning manner, and each region includes one or more pixel points.
[0083] For further information, see Fig.10 In some embodiments, 033: dividing the plurality of regions into a first region S1 and a second region S2 according to brightness differences, comprising:
[0084] 0331: Get the gray value of each area;
[0085] 0333: Obtain a first average grayscale value of the first image; and
[0086] 0335: All regions whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value are taken as the first region S1, and all regions whose grayscale values are less than a predetermined multiple of the first average grayscale value are taken as the second region S2.
[0087] Please combine Figure 2 The division module 13 is also used to: obtain the grayscale value of each area; obtain the first average grayscale value of the first image; and take all areas whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value as the first area S1, and take all areas whose grayscale values are less than a predetermined multiple of the first average grayscale value as the second area S2.
[0088] Please combine Figure 3 , the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing methods in 0331, 0333 and 0335. That is, the one or more processors 40 are used to obtain the gray value of each area; obtain the first average gray value of the first image; and take all areas whose gray values are greater than or equal to a predetermined multiple of the first average gray value as the first area S1, and take all areas whose gray values are less than a predetermined multiple of the first average gray value as the second area S2.
[0089] Specifically, please combine Fig. 9In some embodiments, after the first image is divided into multiple regions, the grayscale value L of each region can be obtained, and then the first average grayscale value L' of the first image can be obtained, and all regions with grayscale values L greater than or equal to a predetermined multiple of the first average grayscale value L' are taken as the first region S1, and all regions with grayscale values L less than a predetermined multiple of the first average grayscale value L' are taken as the second region S2. For example, the first image is equally divided into four regions, the grayscale values L1, L2, L3 and L4 of the four regions are obtained, and then the first average grayscale value L' of the first image is obtained, that is, the average grayscale value of the four regions is obtained (L1+L2+L3+L4) / 4, in other words, the first average grayscale value L'=(L1+L2+L3+L4) / 4, and the grayscale values of the four regions (L1, L2, L3 and L4) are compared and analyzed with the first average grayscale value L', and all regions with grayscale values greater than or equal to a predetermined multiple of the first average grayscale value L' are taken as the first region S1, and all regions with grayscale values less than a predetermined multiple of the first average grayscale value L' are taken as the second region S2. For example, if L3 is greater than a predetermined multiple of the first average grayscale value L', and L1, L2 and L4 are less than a predetermined multiple of the first average grayscale value L', the region with the grayscale value L3 is the first region S1, and the region with the grayscale values L1, L2 and L4 is the second region S2.
[0090] In some embodiments, the grayscale value of each region may be obtained by using an average method or a weighted average method, etc., which is not limited here. For example, when the grayscale value of each region is obtained by using the average method, assuming that there is only one pixel in one region and the RGB value of the pixel is (R1, G1, B1), the grayscale value of the region may be (R1+G1+B1) / 3.
[0091] The preset multiple may be a critical value for dividing a plurality of regions into a first region S1 and a second region S2 according to the brightness difference. The preset multiple may be known data, which may be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory. For example, the preset multiple may be 1.3, then the gray value L of each region and the first average gray value L' of the first image are obtained, and all regions with gray values L greater than or equal to 1.3 times the first average gray value L' are taken as the first region S1, and all regions with gray values L less than 1.3 times the first average gray value L' are taken as the second region S2.
[0092] See also Fig. 9 and Fig.11 In some embodiments, 03: dividing the first image into a first area S1 and a second area S2, comprising:
[0093] 035: Divide the first image into a plurality of regions, each region including one or more pixel points; and
[0094] 037: Divide the multiple regions into a first region S1 and a second region S2 according to brightness differences and characteristic attributes of key pixels.
[0095] Please combine Figure 2 The division module 13 is also used to: divide the first image into multiple regions, each region contains one or more pixels; and divide the multiple regions into a first region S1 and a second region S2 according to brightness differences and characteristic attributes of key pixels.
[0096] Please combine Figure 3 , the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing method in 035 and 037. That is, one or more processors 40 are used to divide the first image into multiple regions, each region contains one or more pixels; and divide the multiple regions into a first region S1 and a second region S2 according to the brightness difference and the characteristic attributes of the key pixels.
[0097] When the camera module 30 captures an image, if there is a relatively bright area in the scene captured by the camera module 30, there will also be a relatively bright area in the image captured by the camera module 30. Therefore, if the multiple areas are divided into the first area S1 and the second area S2 only based on the brightness difference, it is possible that the area in the image where there is no light leakage (the area corresponding to the relatively bright area in the captured scene) is also divided into the first area S1, resulting in poor accuracy of the processor 40. Therefore, in the present application, the multiple areas are divided into the first area S1 and the second area S2 according to the brightness difference and the characteristic attributes of the key pixel points, so as to improve the accuracy of the processing result of the processor 40 and further ensure the image quality.
[0098] For further information, see Fig. 9 and Fig.12 In some embodiments, 037: dividing the plurality of regions into a first region S1 and / or a second region S2 according to brightness differences and characteristic attributes of key pixels, including:
[0099] 0371: Get the gray value of each area;
[0100] 0373: Obtain a first average grayscale value of the first image;
[0101] 0375: Obtain the characteristic attributes of key pixels in each area; and
[0102] 0377: All areas whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value and whose characteristic attributes of key pixels meet preset conditions are taken as the first area S1, and all areas whose grayscale values are less than a predetermined multiple of the first average grayscale value or whose characteristic attributes of key pixels do not meet preset conditions are taken as the second area S2.
[0103] Please combine Figure 2 The division module 13 is also used to: obtain the grayscale value of each area; obtain the first average grayscale value of the first image; obtain the characteristic attributes of the key pixels in each area; and take all areas whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value and whose characteristic attributes of the key pixels meet the preset conditions as the first area S1, and take all areas whose grayscale values are less than a predetermined multiple of the first average grayscale value or whose characteristic attributes of the key pixels do not meet the preset conditions as the second area S2.
[0104] Please combine Figure 3 , the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing methods in 0371, 0373, 0375 and 0377. That is, one or more processors 40 are used to obtain the gray value of each area; obtain the first average gray value of the first image; obtain the characteristic attribute of the key pixel in each area; and take all areas whose gray value is greater than or equal to the predetermined multiple of the first average gray value and the characteristic attribute of the key pixel meets the preset conditions as the first area S1, and take all areas whose gray value is less than the predetermined multiple of the first average gray value or the characteristic attribute of the key pixel does not meet the preset conditions as the second area S2.
[0105] Specifically, after the first image acquired by the camera module 30 is divided into a plurality of regions, the processor 40 can obtain the grayscale value of each region, the first average grayscale value of the first image, and the characteristic attributes of the key pixel points in each region, and take all regions whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value and whose characteristic attributes of the key pixel points meet the preset conditions as the first region S1, and take all regions whose grayscale values are less than a predetermined multiple of the first average grayscale value or whose characteristic attributes of the key pixel points do not meet the preset conditions as the second region S2. For example, the preset multiple can be 1.3, then the grayscale value L of each region, the first average grayscale value of the first image, and the characteristic attributes of the key pixel points in each region are obtained, and take all regions whose grayscale values L are greater than or equal to 1.3 times of the first average grayscale value L' and whose characteristic attributes of the key pixel points meet the preset conditions as the first region S1, and take all regions whose grayscale values L are less than 1.3 times of the first average grayscale value L' or whose characteristic attributes of the key pixel points do not meet the preset conditions as the second region S2.
[0106] In some embodiments, characteristic attributes may include, but are not limited to, brightness gradient, color mutation, fogging, and different colors at corners. Among them, brightness gradient refers to the brightness change caused by uneven lighting or insufficient exposure in the area. Color mutation refers to the situation where the color boundary in the area is too obvious, resulting in a fault or unnatural transition in the area. Fogging is a problem of visual blur caused by the presence of a large number of particles that scatter and absorb light in the area. Different colors at corners refer to the pixel colors around the area being different from the central area, with a clear color boundary.
[0107] Specifically, in some embodiments, the characteristic attribute of the key pixel point meeting the preset condition may include: the rate of change of the brightness value of the key pixel point is greater than the preset brightness change threshold. Specifically, when the gray value of a certain area is greater than or equal to a predetermined multiple of the first average gray value, and the rate of change of the brightness value of the key pixel point is greater than the preset brightness change threshold, the area is regarded as the first area S1; when the gray value of a certain area is less than the predetermined multiple of the first average gray value, or the rate of change of the brightness value of the key pixel point is less than the preset brightness change threshold, the area is regarded as the second area S2.
[0108] The preset brightness change threshold value may be a critical value for analyzing whether the characteristic attribute of the key pixel point meets the preset condition. The preset brightness change threshold value may be known data, which may be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory.
[0109] In other embodiments, the characteristic attributes of the key pixel points meeting the preset conditions may include: the rate of change of the pixel value of the green channel of the key pixel point is greater than a preset threshold. Specifically, when the grayscale value of a certain area is greater than or equal to a predetermined multiple of the first average grayscale value, and the rate of change of the pixel value of the green channel of the key pixel point is greater than the preset threshold, the area is taken as the first area S1; when the grayscale value of a certain area is less than a predetermined multiple of the first average grayscale value, or the rate of change of the pixel value of the green channel of the key pixel point is less than the preset threshold, the area is taken as the second area S2. It should be noted that in some embodiments, by analyzing whether the rate of change of the pixel value of the green channel of the key pixel point is greater than the preset threshold, it can be used to determine whether a color mutation occurs in the area corresponding to the key pixel point, that is, to determine whether the color boundary line in the area is too obvious.
[0110] The preset threshold value may be a critical value for analyzing whether the characteristic attribute of the key pixel point meets the preset condition. The preset threshold value may be known data, which may be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory.
[0111] In some further embodiments, the characteristic attribute of the key pixel point meeting the preset condition may include: the key pixel point is fogged. Specifically, when the grayscale value of a certain area is greater than or equal to a predetermined multiple of the first average grayscale value, and the key pixel point is fogged, the area is taken as the first area S1; when the grayscale value of a certain area is less than the predetermined multiple of the first average grayscale value, or the key pixel point is fogged, the area is taken as the second area S2.
[0112] In some other embodiments, the characteristic attributes of the key pixel points meeting the preset conditions may include: the color value of the key pixel points located at the edge of the region exceeds the preset color value. Specifically, when the grayscale value of a certain region is greater than or equal to a predetermined multiple of the first average grayscale value, and the color value of the key pixel points located at the edge of the region exceeds the preset color value, the region is regarded as the first region S1; when the grayscale value of a certain region is less than the predetermined multiple of the first average grayscale value, or the color value of the key pixel points located at the edge of the region does not exceed the preset color value, the region is regarded as the second region S2.
[0113] The preset color value may be a critical value for analyzing whether the characteristic attribute of the key pixel point meets the preset condition. The preset color value may be known data, which may be an empirical value obtained before the electronic device 100 leaves the factory, or a set value input when the electronic device 100 is used after the electronic device 100 leaves the factory, or an empirical value obtained by the processor 40 processing historical data after the electronic device 100 leaves the factory.
[0114] It should be noted that, in the implementation manner of the present application, the characteristic attributes of the key pixel points meeting the preset conditions may include at least one of the above-mentioned implementation manners, that is, the characteristic attributes of the key pixel points meeting the preset conditions may include: the rate of change of the brightness value of the key pixel point is greater than a preset brightness change threshold, the rate of change of the pixel value of the green channel of the key pixel point is greater than a preset threshold, there is fog at the key pixel point, and the color value of the key pixel point located at the edge of the area exceeds at least one of the preset color values.
[0115] See also Fig.13 and Fig.14 In some embodiments, 05: extracting a third region S3 in the second image according to the first region S1, comprising:
[0116] 051: Obtaining a corresponding area in the second image corresponding to the coordinates of the first area S1; and
[0117] 053: The corresponding area is used as the third area S3.
[0118] Please combine Figure 2 The extraction module 14 is further used to: obtain a corresponding area in the second image corresponding to the coordinates of the first area S1; and use the corresponding area as the third area S3.
[0119] Please combine Figure 3 The program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing method in 051 and 053. That is, one or more processors 40 are used to obtain the corresponding area corresponding to the coordinates of the first area S1 in the second image; and use the corresponding area as the third area S3.
[0120] Specifically, in some embodiments, the first image and the second image have the same size and substantially the same captured content. After dividing the first image into the first area S1 and the second area S2, the processor 40 can obtain the coordinates of the first area S1, find a corresponding area in the second image corresponding to the coordinates of the first area S1, and use the corresponding area as the third area S3.
[0121] See also Fig.14 and Fig.15 In some embodiments, 06: obtaining a target image according to the second area S2 and the third area S3, comprising:
[0122] 061: Obtain a second average grayscale value of all second regions S2 according to the grayscale value of each second region S2;
[0123] 063: enhancing the gray value of the third region S3 by using the second average gray value to obtain a fourth region S4; and
[0124] 065: Merge the second area S2 and the fourth area S4 to generate a target image.
[0125] Please combine Figure 2 The acquisition module 15 is also used for: acquiring the second average grayscale value of all the second regions S2 according to the grayscale value of each second region S2; enhancing the grayscale value of the third region S3 by using the second average grayscale value to obtain the fourth region S4; and fusing the second region S2 and the fourth region S4 to generate a target image.
[0126] Please combine Figure 3, the program in the electronic device 100 of the embodiment of the present application is also used to execute the image processing methods in 061, 063 and 065. That is, the one or more processors 40 are used to obtain the second average grayscale value of all second regions S2 according to the grayscale value of each second region S2; enhance the grayscale value of the third region S3 by using the second average grayscale value to obtain the fourth region S4; and merge the second region S2 and the fourth region S4 to generate a target image.
[0127] Specifically, please combine Fig. 9 In some embodiments, it is assumed that the first image is divided into 4 regions, and the grayscale values corresponding to the 4 regions are L1, L2, L3 and L4 respectively, and the regions with grayscale values of L1, L2 and L4 are the second regions S2. Therefore, the second average grayscale value L″ of all second regions S2 is (L1+L2+L4) / 3, and the processor 40 can use the second average grayscale value L″ to enhance the grayscale value of the third region S3, and use the third region S3 after the enhanced grayscale value as the fourth region S4, and finally fuse the second region S2 and the fourth region S4 to generate a target image. Compared with directly processing the image, the image processing in the present application in a fusion manner can improve the authenticity of the generated target image and ensure the imaging quality.
[0128] See also Fig.16 and Fig.17 In some embodiments, the image processing method further comprises:
[0129] 07: Align the first image with the database image in the database;
[0130] 08: Determine whether the key pixel point in the first image is an unknown key pixel point according to the distance between the first vector of the key pixel point in the first image and the second vector of the corresponding key pixel point in the database image; and
[0131] 09: When the distance is greater than a preset distance threshold, determine that the key point in the first image is an unknown key pixel point, and add the first image to the database.
[0132] Please combine Figure 2, the above-mentioned image processing method can be applied to the image processing device 10, and the image processing device 10 of the embodiment of the present application also includes an alignment module 16, a determination module 17 and an adding module 18. The alignment module 16 is used to align the first image with the database image in the database. The determination module 17 is used to determine whether the key pixel point in the first image is an unknown key pixel point based on the distance between the first vector of the key pixel point in the first image and the second vector of the corresponding key pixel point in the database image. The adding module 18 is used to determine that the key point in the first image is an unknown key pixel point when the distance is greater than a preset distance threshold, and add the first image to the database.
[0133] Please combine Figure 3 , the above image processing method can be applied to the electronic device 100, and the one or more processors 40 are also used to execute the image processing methods in 07, 08 and 09. That is, the one or more processors 40 are used to: align the first image with the database image in the database; determine whether the key pixel point in the first image is an unknown key pixel point according to the distance between the first vector of the key pixel point in the first image and the second vector of the corresponding key pixel point in the database image; and determine that the key point in the first image is an unknown key pixel point when the distance is greater than a preset distance threshold, and add the first image to the database.
[0134] Specifically, in some embodiments, aligning the first image with the database image in the database can be: obtaining the transformation matrix between the first image and the database image, and calculating the coordinates of the key pixel points in the first image in the database image according to the transformation matrix to achieve the alignment operation. Calculate the first vector of the key pixel points in the first image, and calculate the second vector of the pixel points corresponding to the key pixel points in the database image, and calculate the distance between the first vector and the second vector. If the distance is greater than the preset distance threshold, it indicates that there are no pixels corresponding to the key pixel points in the first image in the database image, so the processor 40 can determine that the key points in the first image are unknown key pixel points, and add the first image to the database; if the distance is less than the preset distance threshold, it indicates that there are pixels corresponding to the key pixel points in the first image in the database image, so the processor 40 can determine that the key points in the first image are not unknown key pixel points, and there is no need to add the first image to the database. Therefore, the processor 40 can continuously optimize and expand the database by executing the above-mentioned image processing method, thereby continuously improving the image processing effect. Moreover, if there are pixel points corresponding to the key pixel points in the first image in the database, the database image can assist in completing the image processing method in the embodiment of the present application, thereby not only improving the image processing effect, but also improving the image processing effect.
[0135] See also Fig.18 The present application also provides a storage medium 200 on which a computer program 210 is stored. When the computer program 210 is executed by one or more processors 40, the image processing method of any embodiment described above is implemented.
[0136] For example, when program 210 is executed by processor 40, please combine Figure 1 , implement the following image processing methods:
[0137] 02: When the display screen 50 is turned on to provide fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, the camera module 30 acquires a first image;
[0138] 03: Divide the first image into a first area S1 and a second area S2, where the first area S1 is an area where light leakage exists, and the second area S2 is an area where no light leakage exists;
[0139] 04: When the display screen 50 is turned off to provide fill light to the camera module 30, the camera module 30 acquires a second image;
[0140] 05: extracting a third area S3 in the second image according to the first area S1; and
[0141] 06: Obtain a target image according to the second area S2 and the third area S3.
[0142] For another example, when program 210 is executed by processor 40, it can also implement the image processing methods in 01, 011, 013, 015, 017, 019, 031, 033, 0331, 0333, 0335, 035, 037, 0371, 0373, 0375, 0377, 051, 053, 061, 063, 065, 07, 08 and 09.
[0143] It should be noted that the explanations of the image processing method and the image processing device 10 in the aforementioned embodiments are also applicable to the storage medium 200 in the embodiments of the present application, and will not be elaborated here.
[0144] In the storage medium 200 in the present application, when the display screen 50 is turned on to fill light for the camera module 30, and the light emitted by the display screen 50 causes light leakage in the image captured by the camera module 30, a first image is acquired and the first image is divided into a first area S1 with light leakage and a second area S2 without light leakage; when the display screen 50 is turned off to fill light for the camera module 30, a second image is acquired, and based on the first area S1, the third area S3 in the second image is extracted, and the target image is obtained based on the second area S2 and the third area S3, thereby avoiding the light emitted by the display screen 50 from affecting the camera module 30, resulting in the existence of a light leakage area in the obtained image, thereby ensuring the imaging quality of the camera module 30.
[0145] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0146] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0147] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a storage medium can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of storage media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the storage medium may even be paper or other suitable medium on which the program is printed, since the program can be obtained electronically, for example by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in the computer memory.
[0148] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0149] A person of ordinary skill in the art will appreciate that all or part of the steps carried by the method for implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program, and the program can be stored in a storage medium, which, when executed, includes one or a combination of the steps of the method embodiment. In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.
[0150] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application. The scope of the present application is defined by the claims and their equivalents.
Claims
1. An image processing method, characterized in that: include: When the display screen is turned on to provide fill light for the camera module, and the light emitted by the display screen causes light leakage in the image captured by the camera module, the camera module acquires a first image; Dividing the first image into a first area and a second area, the first area is an area where light leakage exists, and the second area is an area where light leakage does not exist; When the display screen is turned off to provide fill light to the camera module, the camera module acquires a second image; extracting a third area in the second image according to the first area; and A target image is obtained according to the second area and the third area.
2. The image processing method according to claim 1, characterized in that: Also includes: Analyze whether the light emitted by the display screen causes light leakage in the image captured by the camera module.
3. The image processing method according to claim 2, characterized in that: The analyzing whether the light emitted by the display screen causes light leakage in the image captured by the camera module includes: Obtaining the ambient light brightness of the environment where the electronic device is located; and When the ambient light brightness is less than a preset first threshold, it is confirmed that the light emitted by the display screen causes light leakage in the image captured by the camera module.
4. The image processing method according to claim 2, characterized in that: The analyzing whether the light emitted by the display screen causes light leakage in the image captured by the camera module includes: Obtain the ambient light brightness of the environment where the electronic device is located; When the ambient light brightness is less than a preset first threshold, obtaining an analog gain and / or a digital gain when the camera module acquires an image; and When the analog gain is greater than a preset second threshold value, and / or the digital gain is greater than a preset third threshold value, it is confirmed that the light emitted by the display screen causes light leakage in the image captured by the camera module.
5. The image processing method according to claim 1, characterized in that: The dividing the first image into a first area and a second area comprises: dividing the first image into a plurality of regions; and The plurality of regions are divided into the first region and the second region according to brightness difference.
6. The image processing method according to claim 5, characterized in that: The step of dividing the plurality of regions into the first region and the second region according to the brightness difference comprises: Obtaining the grayscale value of each of the regions; Acquire a first average grayscale value of the first image; and All the regions whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value are taken as the first regions, and all the regions whose grayscale values are less than a predetermined multiple of the first average grayscale value are taken as the second regions.
7. The image processing method according to claim 1, characterized in that: The dividing the first image into a first area and a second area comprises: Dividing the first image into a plurality of regions, each of the regions containing one or more pixels; and The multiple regions are divided into the first region and the second region according to brightness differences and characteristic attributes of key pixels.
8. The image processing method according to claim 7, characterized in that: The dividing the multiple regions into the first region and / or the second region according to the brightness difference and the characteristic attributes of the key pixel points includes: Obtaining the grayscale value of each of the regions; Acquire a first average grayscale value of the first image; Obtaining characteristic attributes of key pixels in each of the regions; and All the areas whose grayscale values are greater than or equal to a predetermined multiple of the first average grayscale value and whose characteristic attributes of the key pixel points meet the preset conditions are taken as the first areas, and all the areas whose grayscale values are less than a predetermined multiple of the first average grayscale value or whose characteristic attributes of the key pixel points do not meet the preset conditions are taken as the second areas.
9. The image processing method according to claim 8, characterized in that: The characteristic attributes of the key pixel points meet the preset conditions, including: The change rate of the brightness value of the key pixel point is greater than a preset brightness change threshold; and / or The change rate of the pixel value of the green channel of the key pixel point is greater than a preset threshold; and / or The key pixel point is fogged; and / or The color value of the key pixel point located at the edge of the area exceeds a preset color value.
10. The image processing method according to claim 1, characterized in that: The step of extracting a third area in the second image according to the first area includes: Acquire a corresponding area in the second image corresponding to the coordinates of the first area; and The corresponding area is used as the third area.
11. The image processing method according to claim 1, characterized in that: The obtaining of a target image according to the second area and the third area comprises: Acquire a second average grayscale value of all the second regions according to the grayscale value of each of the second regions; enhancing the gray value of the third region by using the second average gray value to obtain a fourth region; and The second region and the fourth region are fused to generate the target image.
12. The image processing method according to claim 1, characterized in that: The image processing method further comprises: aligning the first image with a database image in a database; determining whether the key pixel in the first image is an unknown key pixel according to the distance between the first vector of the key pixel in the first image and the second vector of the corresponding key pixel in the database image; and When the distance is greater than a preset distance threshold, the key point in the first image is determined to be the unknown key pixel point, and the first image is added to the database.
13. An image processing device, characterized in that: include: An imaging module, for acquiring a first image when the display screen is turned on to provide fill light for the camera module and the light emitted by the display screen causes light leakage in the image captured by the camera module; a division module, the division module being used to divide the first image into a first area and a second area, the first area being an area where light leakage exists, and the second area being an area where light leakage does not exist; When the display screen is turned off to provide fill light to the camera module, the imaging module is further used to obtain a second image; an extraction module, the extraction module being configured to extract a third area in the second image based on the first area; and An acquisition module is used to obtain a target image according to the second area and the third area.
14. An electronic device, characterized in that: include: Camera module; and One or more processors, wherein the one or more processors are used to execute the image processing method according to any one of claims 1 to 12.
15. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image processing method described in any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Method for eliminating dazzle light and electronic equipment
CN110557575A
Image shooting method and device, equipment and storage medium
CN111064898A
Fingerprint acquisition method, electronic device and storage medium
CN111414810A
Shooting method and device, electronic equipment and storage medium
CN111654636A
Processing method, electronic equipment and storage medium
CN112884774A
