Method and device for detecting fuzzy degree of camera module and electronic equipment
By acquiring and processing the RAW image parameters of the camera module at different angles, the problem of inaccurate blur detection in the prior art is solved, and in-depth analysis of the impact on the hardware process is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510137995.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-08
AI Technical Summary
The prior art is difficult to accurately detect the degree of blurring of the camera module, and it is impossible to effectively measure the impact of the hardware technology of electronic equipment on the degree of blurring, resulting in poor user experience.
The degree of blur is evaluated by acquiring RAW images of the camera module at different angles, calculating and processing parameters in the image, such as reduction, contrast and brightness, and using this data to measure the impact of the hardware process.
The blurring degree of the camera module is achieved at all-round and multi-angle acquisition, which improves the accuracy of detection, and can deeply analyze the impact of hardware processes on imaging quality, thereby improving user experience.
Smart Images

Figure CN119624942A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of terminal devices, and in particular to a method, device and electronic device for detecting the blurriness of a camera module. Background Art
[0002] The images captured by electronic devices using camera modules may be blurred, resulting in a decrease in image quality. Blur, also known as blurring, may occur in the camera due to the performance of the camera module itself, which in turn causes the captured image to be blurry. In other words, details in the image will be lost, edges will be unclear, etc. This situation is usually caused by performance problems of the camera module itself. In order to solve the problem of camera module blurring, the degree of blurring of the camera module, that is, the degree of blur of the camera module, is usually obtained first. By analyzing the degree of blurring, a basis can be provided for subsequent adjustments, thereby improving the shooting effect of the camera module and improving image quality.
[0003] However, the current test results for determining the blurriness of a camera module are not accurate enough and the test results cannot be used to measure the impact of the hardware process of an electronic device on the blurriness of a camera module, resulting in a poor user experience. Summary of the invention
[0004] In order to solve the above problems, the embodiments of the present application provide a method, device and electronic device for detecting the blur degree of a camera module, which performs calculation and processing based on RAW images at different first angles, and can obtain the blur degree of the camera module in an all-round and multi-angle manner, effectively improving the accuracy of the electronic device in judging the blurriness problem of the camera module. At the same time, the blur degree of the camera module can be used to measure the impact of the hardware process of the electronic device on the blur degree of the camera module, thereby improving the user experience.
[0005] In order to achieve the above-mentioned objectives, in a first aspect, an embodiment of the present application provides a method for detecting the blur degree of a camera module, comprising: obtaining at least one first RAW image by photographing a first test scene at different first angles by the camera module, the first angle being the angle formed by the camera module and the first light source; obtaining a first parameter corresponding to each first RAW image, the first parameter being at least one of the restoration degree, contrast and brightness corresponding to the first RAW image in the LAB color space; determining a first score corresponding to each first parameter, wherein the first score is used to characterize the blur degree of the first RAW image; and determining a comprehensive score based on all the first scores, wherein the comprehensive score is used to characterize the blur degree of the camera module.
[0006] The camera module blur detection method provided in the embodiment of the present application evaluates the blur of the camera module from the perspective of RAW images. This method can measure the impact of the electronic equipment hardware process on the blur of the camera module, and comprehensively obtain the blur of the camera module from different angles. In this way, through multi-angle and multi-dimensional analysis, the accuracy of the electronic device in judging the blur problem of the camera module is effectively improved, thereby further improving the user experience.
[0007] In a feasible implementation, obtaining at least one first RAW image captured by the camera module at different first angles includes: obtaining the target exposure time of the camera module and the sensitivity of the camera module at each first angle; and obtaining the first RAW image at each first angle based on the target exposure time and sensitivity at each first angle. By adopting the above method to obtain the target exposure time and sensitivity at different angles, the exposure control can be optimized to ensure that the first RAW image captured is neither overexposed nor underexposed, thereby avoiding affecting the subsequent analysis of the blur degree of the camera module. In this way, it is possible to better adapt to the changing shooting environment, and perform control variable analysis under the same target exposure time and sensitivity conditions, thereby accurately detecting the blur degree of the camera module.
[0008] In a feasible implementation, the target exposure time of the camera module at each first angle is obtained, including: obtaining the initial exposure time and sensitivity of the camera module at each first angle; determining the exposure of the camera module at each first angle based on the initial exposure time and the sensitivity of the camera module at each first angle; adjusting the exposure of the camera module at each first angle based on the preset brightness to obtain the target exposure of the camera module at each first angle; determining the target exposure time of the camera module at each first angle based on the adjusted target exposure at each first angle. Using the above method, the current exposure is determined by the initial exposure time and sensitivity of the camera module at each first angle, and then the exposure is adjusted by the preset brightness, so as to obtain the target exposure at each first angle, and finally determine the target exposure time. In this way, the brightness of the image is ensured to be stable at different angles and lighting conditions, avoiding overexposure or underexposure. At the same time, the precise adjustment of the exposure time helps to improve the accuracy of blur detection.
[0009] In a feasible implementation, based on the preset brightness, the exposure of the camera module at each first angle is adjusted to obtain the target exposure of the camera module at each first angle, including: based on the exposure at each first angle, obtaining the second RAW image captured by the camera module at each first angle; calculating the second brightness of the second RAW image at each first angle; the second brightness is the brightness corresponding to the grayscale value of the second RAW image; based on the second brightness and the preset brightness at each first angle, adjusting the exposure of the camera module at each first angle to obtain the target exposure of the camera module at each first angle. Using the above method, by calculating the brightness of the second grayscale image at each first angle and comparing it with the preset brightness, the exposure can be accurately adjusted to ensure that the brightness of the captured image meets the expectations. In this way, the consistency of the image is improved, and the adjustment of the exposure is optimized, so that the camera module can adapt to different shooting environments and provide stable image quality. At the same time, the precise adjustment of the exposure helps to improve the accuracy of blur detection.
[0010] In a feasible implementation, the first RAW image includes a target subject; obtaining the first parameter corresponding to each first RAW image includes: segmenting each first RAW image to obtain a first area, a second area, and a third area corresponding to each target subject; obtaining a first degree of restoration corresponding to each first area, a first contrast corresponding to each third area, and a first brightness corresponding to each second area in the LAB color space. By adopting the above-mentioned method, by segmenting the first RAW image and dividing the image into the first area, the second area, and the third area, the characteristics of each area can be analyzed more accurately. In the LAB color space, the degree of restoration, contrast, and brightness of each area are obtained respectively, and the image can be analyzed from multiple dimensions. In this way, by obtaining the corresponding parameters for each area, the accuracy of the image parameters can be improved.
[0011] In a feasible implementation, the first area includes the face area of the target subject; the second area includes the area corresponding to the forehead of the target subject; and the third area includes the area corresponding to the eyes of the target subject. In the above manner, the face, forehead and eyes of the target subject are analyzed as independent areas, so that different parts of the image are processed more carefully and accurately to ensure that the features of each area can be accurately captured.
[0012] In a feasible implementation, each first RAW image is segmented to obtain the first region, the second region and the third region corresponding to each target subject, including: using each first RAW image as an input of a pre-trained neural network model, and using the pre-trained neural network model to obtain the first region, the second region and the third region of each target subject. In the above manner, the first RAW image is automatically segmented by the image segmentation model, so that the image can be quickly and accurately segmented into different regions, especially for complex image analysis tasks, the processing speed can be significantly improved.
[0013] In a feasible implementation, obtaining the first restoration degree corresponding to each first area includes: obtaining a target image, the target image is an image obtained from at least one preset image and having the same preset area as the first area; obtaining the fifth brightness corresponding to each first area; the fifth brightness is the brightness corresponding to the grayscale value in the first area; obtaining the target brightness corresponding to the preset area; the target brightness is the brightness corresponding to the grayscale value in the preset area; based on each fifth brightness and the target brightness, obtaining the first restoration degree corresponding to at least one first area; wherein each fifth brightness corresponds to a first restoration degree corresponding to a first area; a fifth brightness and a target brightness obtain a first restoration degree corresponding to a first area. In the above manner, based on the fifth brightness and the target brightness, the restoration degree between the first area in the first RAW image and the target image is determined, so that targeted optimization adjustments can be made for different first areas to ensure the overall quality of the image.
[0014] In a feasible implementation, based on the first mean of the fifth brightness corresponding to each first area, the second mean of the target brightness and the first constant, determine the first result corresponding to each first area and the second result corresponding to each first area; wherein the first mean corresponds to the first result one-to-one, the first mean corresponds to the second result one-to-one, and a first mean, a second mean and a first constant obtain a first result or a second result; based on the covariance and the second constant between the fifth brightness of each first area and the target brightness, determine the third result corresponding to each first area; based on each first result and each third result, determine the first product corresponding to each first area; wherein the first result , the third result and the first product correspond one-to-one; based on the first variance corresponding to the fifth brightness of each first area, the second variance corresponding to the target brightness and the second constant, determine the fourth result corresponding to each first area; based on each second result and each fourth result, determine the second product corresponding to each first area; wherein the second result and the fourth result correspond one-to-one; a second result and a fourth result obtain a second product; based on the first product corresponding to each first area and the second product corresponding to each first area, obtain the first restoration degree corresponding to at least one first area; wherein the first product corresponds one-to-one to the second product, and a first product and a second product obtain a first restoration degree. Using the above method, the product, variance and covariance between the fifth brightness and the target brightness are calculated, and these statistics are combined to obtain the first restoration degree of the first area. In this way, through the above precise calculation, the first restoration degree can be accurately obtained, the accuracy of the first restoration degree can be significantly improved, and the user experience can be improved.
[0015] In a feasible implementation, obtaining the first degree of restoration corresponding to each first region includes: taking each first region as an input of a pre-trained machine learning model, and using the pre-trained machine learning model to obtain the first degree of restoration corresponding to each first region. In the above manner, by taking each first region as an input of a pre-trained machine learning model, the first degree of restoration of each region can be automatically and efficiently obtained. In this way, the first degree of restoration can be obtained quickly and accurately, significantly improving the processing speed and enhancing the user experience.
[0016] In a feasible implementation, before using each first area as the input of a pre-trained machine learning model and using the pre-trained machine learning model to obtain the first restoration degree corresponding to each first area, it also includes: obtaining a training set, the training set includes at least one sample area image and a target restoration degree corresponding to the sample area image; using at least one sample area image as the input of the machine learning model and at least one target restoration degree as the output of the machine learning model to train the machine learning model. Using the above method, by using specific images and target restoration degrees in the training set, the machine learning model can learn the impact of different brightness, contrast and other factors on image quality. In this way, the model can be customized according to the actual application scenario, which enhances the adaptability of the model, enables it to cope with changing shooting environments, and improves the efficiency and automation of overall image processing.
[0017] In a feasible implementation, obtaining the first contrast corresponding to each third region includes: obtaining the third brightness and fourth brightness of each third region, the fourth brightness being greater than the third brightness; obtaining the first contrast corresponding to at least one third region based on the third brightness and the fourth brightness; wherein each third brightness corresponds to a fourth brightness, and a third brightness and a fourth brightness obtain a first contrast corresponding to a third region. In the above manner, by obtaining the third brightness and fourth brightness of each third region, and calculating the corresponding first contrast based on these two brightnesses, the contrast of the image region can be evaluated more accurately. In this way, the contrast can be determined according to different regions of brightness difference in the image, thereby improving the overall visual effect and user experience.
[0018] In a feasible implementation, determining the first score corresponding to each first parameter includes: determining at least one first ratio based on each first brightness and the first weight; wherein each first brightness corresponds to a first ratio, and a first brightness and the first weight obtain a first ratio; determining at least one second ratio based on each first contrast and the second weight; wherein each first contrast corresponds to a second ratio, and a first contrast and the second weight obtain a second ratio; determining at least one third ratio based on each first restoration degree and the third weight; wherein each first restoration degree corresponds to a third ratio, and a first restoration degree and the third weight obtain a third ratio; determining a first score corresponding to the blur degree of at least one first RAW image based on the first ratio, the second ratio and the third ratio; wherein the first ratio, the second ratio and the third ratio correspond one to one, and a first ratio, a second ratio and a third ratio obtain a first score corresponding to the blur degree of a first RAW image. By adopting the above method, the blur degree of the image is accurately obtained by comprehensively considering multiple factors of brightness, contrast and restoration degree and combining weight adjustment. In this way, the blur degree of the image can be more accurately calculated through this multi-dimensional detection method, thereby effectively improving the user experience.
[0019] In a feasible implementation, before obtaining at least one first RAW image captured by the camera module at different first angles, it also includes: constructing a first test scene, where the first test scene is a scene where the camera module captures a target subject with its back against a first light source. In the above manner, by constructing a first test scene that is completely black except for the first light source, it can help to subsequently detect the accuracy of the blur degree of the camera module and further optimize the user experience.
[0020] In a feasible implementation, constructing at least one first test scene includes: obtaining the first position of the target subject at different first angles; based on the first position at different first angles, determining the second position of the first light source and the third position of the camera module at different first angles; based on the first position, the second position and the third position at different first angles, obtaining at least one first test scene; wherein the first camera module and a first light source correspond to a first angle. Using the above method, by obtaining the position of the target subject at different angles and determining the corresponding positions of the light source and the camera module based on these positions, a highly controllable and repeatable test environment can be created to improve the accuracy of the blur level of subsequent camera modules.
[0021] In a feasible implementation, different first angles include at least one of a first angle formed by the camera module and a vertical line of the first light source, a second angle formed by the camera module and a vertical line of the first light source, a third angle formed by the camera module and a vertical line of the first light source, and a fourth angle formed by the camera module and a horizontal line of the first light source; the second angle is greater than the first angle, the third angle is greater than the second angle, and the fourth angle is greater than the second angle. By adopting the above method and setting different first angles, the performance of the camera module under various lighting conditions can be comprehensively evaluated. In this way, more shooting scenes can be covered, ensuring the comprehensiveness of the test process, and ultimately improving the accuracy of the camera module blur detection.
[0022] In order to achieve the above purpose, in a second aspect, the present application provides a device for detecting the blur degree of a camera module, which has the function of realizing the behavior of the electronic device in the method for detecting the blur degree of a camera module in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0023] In a third aspect, the present application provides an electronic device comprising: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method for detecting the degree of blur of the camera module as provided in the first aspect above.
[0024] In a fourth aspect, the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method for detecting the blur degree of the camera module provided in the first aspect above.
[0025] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the method for detecting the blur degree of the camera module provided in the first aspect above.
[0026] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects provided above can refer to the beneficial effects in the first aspect and any of its optional embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a structural schematic diagram of a mobile phone provided in an embodiment of the present application; Figure 2 This is a schematic diagram of a process of starting a camera application on a mobile phone provided in an embodiment of the present application; Figure 3It is a structural schematic diagram of an electronic device provided in an embodiment of the present application; Figure 4 is a schematic diagram of a layered architecture of a software system of an electronic device provided in this embodiment; Figure 5 This is a first flow chart of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Figure 6 This is a first scene schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Figure 7 This is a first angle schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Figure 8 This is a second scene schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig. 9 This is a second first angle schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.10 is a schematic diagram of a third scenario of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.11 This is a third first angle schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.12 This is a schematic diagram of a fourth scenario of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.13 This is a third first angle schematic diagram of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.14 is a schematic diagram of segmenting a first RAW image provided by an embodiment of the present application; Fig.15 This is a schematic diagram of obtaining a target image provided by an embodiment of the present application; Fig.16 This is a second flow chart of a method for detecting blurriness of a camera module provided in an embodiment of the present application; Fig.17 It is a structural block diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making creative work all belong to the protection scope of the present application.
[0029] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0030] In addition, in the present application, directional terms such as "upper", "lower", "inner" and "outer" are defined relative to the orientation of the components schematically placed in the drawings. It should be understood that these directional terms are relative concepts. They are used for relative description and clarification, and they can change accordingly according to the changes in the orientation of the components placed in the drawings.
[0031] In order to facilitate technical personnel to understand the technical solutions of the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained below.
[0032] Raw image format (RAW image) is an unprocessed or uncompressed image format, usually generated directly by a digital camera or other image acquisition device. Different from standard JPEG or PNG images, RAW images retain more original data, and the grayscale value and color information of RAW images are more accurate, with more room for post-processing.
[0033] Blur, also known as blur, may occur in the camera due to the camera's own performance, resulting in blurred images. In other words, details in the image will be lost and edges will not be clear.
[0034] The International Commission on Illumination (CIE) is an international organization dedicated to promoting the development of lighting, color and vision science, and promoting human understanding and application of light, color and vision. CIE has formulated many international standards and specifications covering various aspects of lighting, such as lighting design, light source evaluation, color measurement, color representation, color temperature, etc. Among them, the CIE 1931 standard colorimetric observer and CIE standard light source have become standards widely used internationally.
[0035] CIE Lab color space is a color space defined by CIE to describe and express the color perceived by human vision. Lab color space is a three-dimensional color space consisting of three channels: L represents brightness (brightness), a represents the axis from red to green, and b represents the axis from yellow to blue.
[0036] Luminance refers to the brightness of each pixel in an image, reflecting the light intensity of the image. In the Lab color space, luminance is represented by the L (Lightness) channel, and the value of L is usually between 0 and 100, where 0 represents the darkest and 100 represents the brightest. In this application, for easy distinction, luminance is represented by "Y".
[0037] Contrast is an important indicator to measure the brightness difference in an image. In the Lab color space, it describes the difference between the light and dark areas in the image, affecting the clarity and detail of the image.
[0038] Restoration Degree is usually used to measure the quality or restoration effect of an image. In the Lab color space, the restoration degree is calculated by comparing the color features of the restored image and the original image.
[0039] Exposure time, also known as shutter time, refers to the length of time that the photosensitive element (such as image sensor or film) of a camera or video device is exposed to light during shooting. The length of exposure time determines the time the photosensitive element is exposed to light, which in turn affects the brightness and clarity of the image.
[0040] Sensitivity (International Organization for Standardization, ISO) refers to the sensitivity to light and is usually expressed by ISO values. The higher the ISO value, the more light the sensor can capture under the same exposure conditions, which is suitable for shooting in low-light environments; the lower the ISO value, the more suitable it is for shooting in well-lit environments, and higher image quality can be obtained.
[0041] Exposure Value (EV) is a parameter that measures the exposure of an image, usually expressed as the total amount of light in the image. It is determined by the exposure time, aperture size, and sensitivity (ISO). The exposure determines the brightness of the image. Too high an exposure will result in an overexposed image, while too low an exposure will result in an underexposed image.
[0042] Light source refers to an object or device that can emit light. In image capture, the light source is a key part that affects important factors such as image brightness, contrast, and clarity. Based on the size of the light source, it can be divided into two categories. One is a point or line light source, such as indoor top light, outdoor street light, etc. The point or line light source is generally smaller than half of the imaging screen of the camera module. The other is a surface light source, such as a backlit scene, and the surface light source is generally larger than half of the imaging screen of the camera module. Among them, in the embodiments of the present application, a surface light source is taken as an example for explanation.
[0043] An 18% gray card usually refers to a gray object with a reflectivity of 18%. Its brightness is visually between black and white, that is, the human eye perceives its brightness as approximately 50%. According to statistical estimates, the reflectivity of most objects in real life is close to 18%. This gray card reflects the standard brightness or exposure benchmark of the camera module. Therefore, under standard exposure conditions, the brightness value of the 18% gray card should be the expected brightness of the image.
[0044] With the development of diversified functions of electronic devices, camera modules can often be set in electronic devices to implement the camera function of the electronic device using the camera module, thereby meeting the usage needs of users.
[0045] Figure 1 It is a structural schematic diagram of a mobile phone provided in an embodiment of the present application.
[0046] like Figure 1 As shown, taking the electronic device as a mobile phone 1 as an example, the mobile phone 1 is usually provided with a camera module 2. In this way, when using the mobile phone 1, the user can take photos, record videos, make video calls, and recognize QR codes. At the same time, based on the portability of the mobile phone 1, the user can take photos anytime and anywhere, meeting the user's needs for socializing, recording, and creation.
[0047] Figure 2 It is a schematic diagram of the process of starting a camera application on a mobile phone provided in an embodiment of the present application.
[0048] like Figure 2 As shown in (a) in FIG. 1 , illustratively, the main interface 10 of the mobile phone 1 may display icons of multiple applications, such as a clock icon, a calendar icon, a gallery icon, a memo icon, a file management icon, an email icon, a music icon, a calculator icon, a video icon, a sports health icon, a weather icon, a browser icon, a smart space icon, a setting icon, a recorder icon, an application store icon, a camera icon 101, an address book icon, a phone icon, and an information icon, etc. In addition, the main interface 10 of the mobile phone 1 may also display a status bar, which may include: one or more signal strength indicators of mobile communication signals, one or more signal strength indicators of Wi-Fi signals, a battery indicator of electronic devices, a time indicator, etc.
[0049] In some embodiments, in response to a user clicking operation 01 on the camera icon 101 in the main interface 10, the mobile phone 1 starts a camera application, and the screen displayed by the mobile phone 1 is changed from Figure 2 The main interface 10 shown in (a) is switched to the Figure 2 The photographing interface 11 shown in (b) of FIG. The photographing interface 11 may include a viewfinder 111 and a photographing button 112, wherein the viewfinder 111 can preview the actual picture currently photographed by the camera module 2 to help the user determine the range and composition of the photographed picture, etc. The photographing button 112 is a button for controlling the camera module 2 to take a picture when the user determines to take a picture. Further, in response to the user clicking the photographing button 112 in the photographing interface 11, an image of the current scene is photographed.
[0050] It is understandable that the user can also start the camera application through other shortcuts or through the setting icon, and this application does not limit the starting of the camera application.
[0051] In the above-mentioned photo-taking scenario, the mobile phone 1 will call the camera module to capture the image of the current scene. The captured image may be unclear, which may be due to the performance of the camera module itself, such as hardware process problems. In order to solve the problem of camera module blurring, the blurring degree of the camera module, that is, the blurring degree of the camera module, is usually obtained first. By analyzing the blurring degree, a basis can be provided for subsequent adjustments, thereby improving the shooting effect of the camera module and improving image quality.
[0052] In one implementation, the electronic device obtains a captured image in a backlit scene, calculates the image contrast based on the average brightness of the face area in the image, the color card in the image, and the information of the grayscale bars displayed in the image to jointly evaluate the shooting effect of the electronic device camera module on the face in the backlit scene. This implementation results in the detection result of the blur degree of the camera module being inaccurate and the detection result cannot be used to measure the impact of the electronic device hardware process on the blur degree of the camera module.
[0053] In another embodiment, the electronic device acquires an image in a backlit scene, detects the face area in the image, acquires the brightness of the face area, and adjusts the brightness based on the preset brightness and the acquired face area to ensure that the final output image has a good effect. It can be seen that the above embodiment aims to adjust the parameters during the shooting process, resulting in the detection result of the blur degree of the camera module being inaccurate and the detection result cannot be used to measure the impact of the electronic device hardware process on the blur degree of the camera module.
[0054] In summary, the current test results for determining the blurriness of the camera module are not accurate enough and the test results cannot be used to measure the impact of the hardware process of the electronic device on the blurriness of the camera module, which in turn affects the subsequent improvement of image quality and results in a poor user experience.
[0055] In order to solve the above problems, an embodiment of the present application provides a method for detecting the blur degree of a camera module, which can be used to measure the impact of the hardware process of an electronic device on the blur degree of a camera module, and can also obtain the blur degree of the camera module in an all-round and multi-angle manner, thereby effectively improving the accuracy of electronic devices in judging camera module blurriness problems, thereby improving user experience.
[0056] The image display method provided in this embodiment can be applied to electronic devices. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.
[0057] For example, Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, wherein a mobile phone is taken as an example of the electronic device.
[0058] like Figure 3 As shown, the mobile phone may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a sensor module 380, a display screen 393, a subscriber identification module (SIM) card interface 394, and a camera 395, etc. Among them, the sensor module 380 may include a pressure sensor 380A, a fingerprint sensor 380B, an ambient light sensor 380C, a gyroscope sensor 380D, a temperature sensor 380E, etc.
[0059] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (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. Different processing units may be independent devices or integrated into one or more processors.
[0060] The controller can be the nerve center and command center of the mobile phone. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0061] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0062] In some embodiments, processor 310 may include one or more interfaces.
[0063] The external memory interface 320 can be used to connect to an external non-volatile memory to expand the storage capacity of the mobile phone. The external non-volatile memory communicates with the processor 310 through the external memory interface 320 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0064] The internal memory 321 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0065] The charging management module 340 is used to receive charging input from a power supply device (such as a charger, a laptop power supply, etc.). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 340 can receive charging input from a wired charger through the USB interface 330. In some wireless charging embodiments, the charging management module 340 can receive wireless charging input through a wireless charging coil of the mobile phone.
[0066] While charging management module 340 is charging battery 342, it can also power the mobile phone through power management module 341. Battery 342 can be composed of multiple batteries connected in series. Power management module 341 is used to connect battery 342, charging management module 340 and processor 310.
[0067] The power management module 341 is used to connect the battery 342, the charging management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, and supplies power to the processor 310, the internal memory 321, the display screen 393, the camera 395, and the wireless communication module 360. The power management module 341 can also be used to monitor parameters such as the battery voltage, current, battery cycle number, and battery health status (leakage, impedance). In some other embodiments, the power management module 341 can also be set in the processor 310.
[0068] The wireless communication function of the mobile phone can be realized through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem and baseband processor.
[0069] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
[0070] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on mobile phones. The mobile communication module 350 can receive electromagnetic waves through the antenna 1, and filter, amplify and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the same device as at least some of the modules of the processor 310.
[0071] The wireless communication module 360 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to mobile phones. The wireless communication module 360 can be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 360 can also receive the signal to be sent from the processor 310, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through antenna 2.
[0072] The electronic device can implement audio functions such as music playing and recording through the audio module 370, the speaker 370A, the receiver 370B, the microphone 370C, the headphone jack 370D, and the application processor.
[0073] The audio module 370 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 370 can also be used to encode and decode audio signals. In some embodiments, the audio module 370 can be arranged in the processor 310, or some functional modules of the audio module 370 can be arranged in the processor 310.
[0074] The speaker 370A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 370A. In the embodiment of the present application, the speaker 370A is used to play the sound of the media.
[0075] The receiver 370B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 370B close to the human ear.
[0076] Microphone 370C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to the microphone 370C to input the sound signal into the microphone 370C. The electronic device can be provided with at least one microphone 370C. In other embodiments, the electronic device can be provided with two microphones 370C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 370C to realize the collection of sound signals, noise reduction, identification of sound sources, and realization of directional recording function, etc.
[0077] In some embodiments, the sensor module 380 may include a pressure sensor 380A, a fingerprint sensor 380B, an ambient light sensor 380C, a gyroscope sensor 380D, a temperature sensor 380E, and the like.
[0078] Among them, the pressure sensor 380A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 380A can be set on the display screen 393. There are many types of pressure sensors 380A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 380A, the capacitance between the electrodes changes. The mobile phone determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 393, the mobile phone detects the intensity of the touch operation based on the pressure sensor 380A. The mobile phone can also calculate the position of the touch based on the detection signal of the pressure sensor 380A. In an embodiment of the present application, the pressure sensor 380A can be used to detect the user's operation on the camera icon 101.
[0079] The fingerprint sensor 380B is used to collect fingerprints. The mobile phone can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint payment, etc.
[0080] The ambient light sensor 380C is used to sense the brightness of the ambient light. The ambient light sensor 380C can also cooperate with the proximity light sensor to detect whether the electronic device is in the pocket to prevent accidental touch.
[0081] The gyro sensor 380D can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 380D. The gyro sensor 380D can be used for anti-shake shooting.
[0082] The temperature sensor 380E is used to detect temperature. In some embodiments, the mobile phone uses the temperature detected by the temperature sensor 380E to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 380E exceeds a threshold, the mobile phone reduces the performance of the processor located near the temperature sensor 380E to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone heats the battery 342 to avoid abnormal shutdown of the mobile phone due to low temperature. In other embodiments, when the temperature is lower than another threshold, the mobile phone performs a boost on the output voltage of the battery 342 to avoid abnormal shutdown due to low temperature.
[0083] In some embodiments, the mobile phone may include 1 or N cameras 395, where N is a positive integer greater than 1. The type of camera 395 can be distinguished according to hardware configuration and physical location. In the embodiment of the present application, the camera can be used to obtain RAW images.
[0084] The mobile phone realizes the display function through the GPU, the display screen 393, and the application processor. The GPU is a microprocessor for image editing, connecting the display screen 393 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.
[0085] The mobile phone can realize the shooting function through the ISP, the camera 395, the video codec, the GPU, the display screen 393 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or change display information.
[0086] The ISP is used to process the data fed back by the camera 395. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 395. The camera 395 is used to capture static images or videos. In an embodiment of the present application, the ISP can be used to adjust the parameters in the shooting scene.
[0087] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when a mobile phone selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0088] The display screen 393 is used to display images, videos, etc. The display screen 393 includes a display panel. In some embodiments, the mobile phone may include 1 or N display screens 393, where N is a positive integer greater than 1. In the embodiment of the present application, the display screen 393 may be used to display pages required by the mobile phone (e.g., a shooting interface, etc.).
[0089] The SIM card interface 394 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone by inserting it into or removing it from the SIM card interface 394. The mobile phone can support one or more SIM card interfaces. The SIM card interface 394 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 394 at the same time. The SIM card interface 394 is also compatible with external memory cards. The mobile phone interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.
[0090] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the mobile phone. In other embodiments of the present application, the mobile phone may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0091] Of course, it is understandable that the above Figure 3 The electronic device shown is only an exemplary description of the form of a mobile phone. If the electronic device is a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet) or other device forms, the structure of the electronic device may include more Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.
[0092] It is understandable that, in general, the realization of electronic device functions requires not only hardware support but also software cooperation. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android® system with a layered architecture as an example to illustrate the software structure of the electronic device.
[0093] Figure 4 It is a schematic diagram of the layered architecture of the software system of the electronic device provided in this embodiment.
[0094] In some examples, reference Figure 4As shown, in the embodiment of the present application, the software of the electronic device is divided into five layers, from top to bottom, namely, the application layer, the framework layer (or called the application framework layer), the system library and the Android runtime (android runtime), the HAL layer (hardware abstraction layer, hardware abstraction layer) and the driver layer (or called the kernel layer). Among them, the system library and the Android runtime can also be called the local framework layer or the native layer.
[0095] The application layer can include a series of applications. Figure 4 As shown, the application layer may include applications (APP) such as camera, gallery, calendar, map, WLAN, music, short message, call, video, etc.
[0096] The framework layer provides application programming interface (API) and programming framework for applications in the application layer.
[0097] The application framework layer includes some predefined functions or services. For example, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a camera service, an audio judgment module, etc., and the present application embodiment does not impose any restrictions on this.
[0098] The system library can include multiple functional modules. For example: surface manager, media library, 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 playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0099] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer provides a standard interface to display device hardware functions to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as: mute control module, camera HAL camera HAL (also called camera HAL or camera hardware abstraction module), where the camera HAL includes thumbnail corresponding image processing module and image processing module, sensors HAL sensor module (or isensor service, sensor service).
[0100] The driver layer is the layer between hardware and software. The driver layer at least includes display driver, camera driver, audio driver, sensor driver, battery driver, etc., which are not limited in this application.
[0101] The hardware layer includes displays, audio digital processors, power amplifiers, speakers, etc.
[0102] The following is a further description of the method for detecting the blur degree of the camera module provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0103] When electronic devices are blurred, it is more obvious in scenes with light sources or backlight. Therefore, the following will take the backlight scene as an example to demonstrate how to detect the blurriness of the camera module.
[0104] Figure 5 This is the first flow chart of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0105] Combination Figure 5 As shown, the method for detecting the blur degree of the camera module may include the following steps: Step S1: construct at least one first test scene, where the first test scene is a scene in which a camera module shoots a target subject with its back against a first light source.
[0106] Each first test scene may include a target subject, a first light source, and a camera module, and the angle between the camera module and the first light source in each first test scene is different.
[0107] Step S1 includes steps S11 to S13.
[0108] Step S11: Acquire the first position of the target subject at different first angles.
[0109] Among them, the first angle is the angle formed by the camera module and the first light source.
[0110] In one embodiment, when the first angle is a first angle formed by the camera module and a vertical line of the first light source, a first position of the target subject at the first angle is acquired.
[0111] Figure 6 This is a first scene diagram of a method for detecting the blurriness of a camera module provided in an embodiment of the present application.
[0112] Figure 7 This is a first angle schematic diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0113] like Figure 6 and Figure 7 As shown, when the first test scene is a test scene in which the first angle formed by the camera module and the vertical line of the first light source is 0 degrees, the first light source in the first test scene occupies most of the imaging field of view, that is, more than one-half, and the first test scene is a positive backlight scene. The first angle is 0 degrees, that is, the camera module, the target subject and the first light source are on the same straight line. The straight line is the vertical line of the first light source.
[0114] Exemplarily, when the first angle formed by the camera module and the vertical line of the first light source is 0 degree, the first position A of the target body 61 is determined.
[0115] In another embodiment, when the first angle is a second angle formed by the camera module and a vertical line of the first light source, the first position of the target subject at the first angle is acquired.
[0116] Figure 8 This is a second scenario diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0117] Fig. 9 This is a second first angle schematic diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0118] like Figure 8 and Fig. 9 As shown, when the first test scene is a test scene in which the second angle formed by the camera module and the vertical line of the first light source is 45 degrees, the first light source in the first test scene occupies most of the imaging field of view, that is, more than one-half, and the first test scene is a side backlight scene. The second angle is 45 degrees, that is, the target subject and the first light source are on the same straight line, and the camera module is not on the straight line.
[0119] Exemplarily, when the second angle formed by the camera module and the vertical line of the first light source is 45 degrees, the first position B of the target subject 71 is determined.
[0120] In yet another embodiment, when the first angle is a third angle formed by the camera module and a vertical line of the first light source, the first position of the target subject at the first angle is acquired.
[0121] Fig.10 This is a third scenario diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0122] Fig.11 This is a third first angle schematic diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0123] like Fig.10 and Fig.11 As shown, when the first test scene is a test scene in which the third angle formed by the camera module and the vertical line of the first light source is 70 degrees, the first light source in the first test scene occupies a small part of the imaging field of view, that is, less than one-half, and the first test scene is a side-light scene. The third angle is 70 degrees, that is, the target subject and the first light source are on the same straight line, and the camera module is not on the straight line.
[0124] Exemplarily, when the third angle formed by the camera module and the vertical line of the first light source is 70 degrees, the first position C of the target subject 81 is determined.
[0125] In still another embodiment, when the first angle is a fourth angle formed by the camera module and a horizontal line of the first light source, the first position of the target subject at the first angle is acquired.
[0126] Fig.12 This is a fourth scenario diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0127] Fig.13 This is a third first angle schematic diagram of a method for detecting the blur degree of a camera module provided in an embodiment of the present application.
[0128] like Fig.12 and Fig.13 As shown, when the first test scene is a test scene in which the fourth angle formed by the camera module and the horizontal line of the first light source is 70 degrees, the first light source in the first test scene occupies a small area of the imaging field of view, that is, less than one-half, and the first test scene is a top light scene. The fourth angle is 70 degrees, that is, the target subject and the camera module are on the same straight line, and the first light source is not on the straight line.
[0129] Exemplarily, when the fourth angle formed by the camera module and the horizontal line of the first light source is 70 degrees, the first position D of the target subject 91 is determined.
[0130] It should be noted that there can be two, three, etc. first angles. If there are two first angles, it is only necessary to ensure that the second angle is greater than the first angle. If there are three first angles, it is necessary to ensure that the second angle is greater than the first angle, and it is necessary to ensure that the third angle is greater than the second angle. No specific limitation is made here.
[0131] The above provides four embodiments for obtaining the first position of the target subject at the first angles. The following will continue to provide exemplary descriptions in combination with the four first angles.
[0132] Step S12: Based on the first positions at different first angles, determine the second positions of the first light source and the third positions of the camera module at different first angles.
[0133] In one embodiment, based on the first position of the target subject, a first distance between the target subject and the first light source is obtained, and a second distance between the target subject and the camera module is obtained; based on the first distance, the second position of the first light source is determined; based on the second distance, the third position of the camera module is determined.
[0134] Combination Figure 6 and Figure 7 In the above example shown, in a positive backlight scene, that is, the first angle (first included angle) is 0 degrees, based on the first position A of the target subject 61, the first distance L between the target subject 61 and the first light source 62 is determined. A , based on the first distance L A , determine the second position A' of the first light source 62; based on the first position A of the target subject 61, determine the second distance L between the target subject 61 and the camera module 63 A ', based on the second distance L A ', determine the third position A'' of the camera module 63. Exemplarily, determine the first distance L between the target subject 61 and the first light source 62 A is 100 cm, and the second distance L between the target subject 61 and the camera module 63 is A ' is 50cm.
[0135] Continue to combine Figure 8 and Fig. 9 In the above example shown, in a side backlight scene, that is, the first angle (second angle) is 45 degrees, based on the first position B of the target subject 71, the first distance L between the target subject 71 and the first light source 72 is determined. B , based on the first distance L B, determine the second position B' of the first light source 72; based on the first position B of the target subject 71, determine the second distance L between the target subject 71 and the camera module 73 B ', based on the second distance L B ', determine the third position B'' of the camera module. Exemplarily, determine the first distance L between the target subject 71 and the first light source 72 B is 100 cm, and the second distance L between the target subject 71 and the camera module 73 is B ' is 50cm.
[0136] Continue to combine Fig.10 and Fig.11 In the above example shown, in a side light scene, that is, the first angle (third angle) is 70 degrees, based on the first position C of the target subject 81, the first distance L between the target subject 81 and the first light source 82 is determined. C , based on the first distance L C , determine the second position C' of the first light source 82; based on the first position C of the target subject 81, determine the second distance L between the target subject 81 and the camera module 83 C ', based on the second distance L C ', determine the third position C'' of the camera module. Exemplarily, determine the first distance L between the target subject 81 and the first light source 82 C is 100 cm, and the second distance L between the target subject 81 and the camera module 83 is C ' is 50cm.
[0137] Continue to combine Fig. 9 In the above example shown, in the top light scene, that is, the first angle (fourth angle) is 70 degrees, based on the first position D of the target subject 91, the first distance L between the target subject 91 and the first light source 92 is determined. D , based on the first distance L D , determine the second position D' of the first light source 92; based on the first position D of the target subject 91, determine the second distance L between the target subject 91 and the camera module 93 D ', based on the second distance L D ', determine the third position D'' of the camera module. Exemplarily, determine the first distance L between the target subject 91 and the first light source 92 D is 100 cm, and the second distance L between the target subject 91 and the camera module 93 is D ' is 50cm.
[0138] It should be noted that the first distance and the second distance are determined according to user needs and are not the only limitation here. At the same time, the field of view angles of camera modules of different electronic devices are different and will be appropriately adjusted.
[0139] Step S13: Based on the first position, the second position and the third position at different first angles, at least one first test scene is obtained; wherein the first camera module and a light source correspond to a first angle.
[0140] Continue to combine Figure 6 and Figure 7 In the above example shown, in a direct backlighting scene, that is, the first angle (first included angle) is 0 degrees, a first test scene including a target subject 61, a first light source 62 and a camera module 63 is constructed.
[0141] Continue to combine Figure 8 and Fig. 9 In the above example shown, in a side backlighting scene, the first angle (second angle) is 45 degrees, and a first test scene including a target subject 71 , a first light source 72 and a camera module 73 is constructed.
[0142] Continue to combine Fig.10 and Fig.11 In the above example shown, in the side-light scene, the first angle (third angle) is 70 degrees, and a first test scene including a target subject 81, a first light source 82 and a camera module 83 is constructed.
[0143] Continue to combine Fig.12 and Fig.13 In the above example shown, in the top light scene, the first angle (fourth angle) is 70 degrees, and a first test scene including a target subject 91, a first light source 92 and a camera module 93 is constructed.
[0144] It should be noted that, in order to control variables, the color temperature and light intensity of the first light source in the first test scenes corresponding to the above four first angles are the same. Exemplarily, the color temperature of the first light source is set to 6500 Kelvin (K), and the light intensity is set to 15270 lux.
[0145] Step S2: obtaining at least one first RAW image obtained by photographing a first test scene with a camera module at different first angles, where the first angle is an angle formed by the camera module and the first light source.
[0146] Wherein, a first angle corresponds to a first RAW image.
[0147] In one embodiment, the camera module may be a camera module that supports RAW format data processing, which means that the camera module can directly output unprocessed raw images.
[0148] Continuing with the above example, the camera module is acquired to shoot the first test scene at the above four first angles to obtain four first RAW images.
[0149] In another embodiment, the camera module can shoot the first test scene at a first angle to obtain a captured image, and further process the captured image to obtain a RAW image.
[0150] Continuing with the above example, the camera module is acquired to shoot the first test scene at the above four first angles to obtain four captured images, and RAW data is extracted from each captured image to obtain four first RAW images.
[0151] The specific implementation of acquiring the first RAW image is exemplarily described below, where step S2 includes steps S21 and S22.
[0152] Step S21: obtaining the target exposure time of the camera module and the sensitivity of the camera module at each first angle.
[0153] In order to ensure the exposure accuracy of the image, a target exposure can be set, and the exposure time can be adjusted based on the target exposure. Therefore, the target exposure can be set according to actual needs.
[0154] It should be noted that in the scenario of detecting the blurriness of camera modules in multiple electronic devices, there may be differences in the camera modules of different electronic devices. In the scenario of detecting the blurriness of camera modules in multiple electronic devices, it is necessary to make settings based on the camera modules of multiple electronic devices, that is, to control the target exposure amounts of corresponding camera modules in multiple electronic devices to be the same.
[0155] The following continues to explain using a camera module of an electronic device as an example.
[0156] In one implementation, step S21 includes steps S211 to S214.
[0157] Step S211: obtaining the initial exposure time of the camera module and the sensitivity of the camera module at each first angle.
[0158] Continue to combine Figure 6 and Figure 7 In the above example shown, in the positive backlight scene, that is, the first angle (first included angle) is 0 degrees, since the default exposure time and the minimum sensitivity of the camera module are known parameter information in the camera module, the default exposure time and the minimum sensitivity in the camera module can be directly obtained, and the default exposure time is used as the initial exposure time of the camera module. , take the minimum sensitivity as the sensitivity of the camera module .
[0159] In different scenes corresponding to the other three first angles, the initial exposure time of the camera module and the sensitivity of the camera module are obtained, which is similar to the above example in the direct and backlight scenes and will not be repeated here.
[0160] Step S212: Determine the exposure amount of the camera module at each first angle based on the initial exposure time at each first angle and the sensitivity of the camera module at each first angle.
[0161] Continuing with the above example, in a backlit scene, that is, the first angle (first included angle) is 0 degrees, after obtaining the initial exposure time and sensitivity Determine the exposure of the camera module in the case of .
[0162] For example, the exposure can be determined by referring to the following formula (1): Formula (1); in, is the exposure; is the aperture, ; is the exposure time, It is the sensitivity of the camera module.
[0163] Exemplarily, the exposure of the camera module is determined based on formula (1): .
[0164] In different scenes corresponding to the other three first angles, determining the exposure amount of the camera module is similar to the above example in the direct and backlight scenes, and will not be repeated here.
[0165] Step S213: Based on the preset brightness, adjust the exposure of the camera module at each first angle to obtain the target exposure of the camera module at each first angle.
[0166] Among them, the preset brightness is set based on an 18% gray card, which is a standard exposure reference, that is, its reflectivity is close to the average reflectivity of common objects in many natural scenes.
[0167] In one embodiment, step S213 includes steps S2131 to S2133.
[0168] Step S2131: Based on the exposure at each first angle, a second RAW image captured by the camera module at each first angle is obtained.
[0169] Continuing with the above example, in a backlit scene, that is, the first angle (first included angle) is 0 degrees, the exposure When the first angle is 0 degrees, a second RAW image is obtained.
[0170] In different scenes corresponding to the other three first angles, it is determined that the second RAW images corresponding to the three first angles are respectively the second RAW image, the second RAW image, and the second RAW image, which is similar to the above example in the direct and backlight scenes and will not be repeated here.
[0171] Step S2132: calculating the second brightness of the second RAW image at each first angle; the second brightness is the brightness corresponding to the grayscale value of the second RAW image.
[0172] The grayscale value refers to the value of each pixel in the image, usually represented by a number (such as 0 to 255). The higher the grayscale value, the higher the brightness of the pixel, and the closer it is to white; the lower the grayscale value, the lower the brightness of the pixel, and the closer it is to black.
[0173] In one implementation, the RAW data of the second RAW image may be read by a dedicated parsing library or tool (such as libraw, etc.), and the brightness may be calculated based on the RAW data, wherein the RAW data includes the pixel width and pixel height of the RAW image, and the brightness corresponding to each pixel.
[0174] For example, the brightness of the RAW image may be determined in combination with formula (2).
[0175] Formula (2); in, is the total number of pixels of the RAW image, Equal to the product of pixel width and pixel height; For the The brightness of the pixel value, For the The brightness value of each pixel ranges from 1 to Add it up.
[0176] Following the above Figure 6 and Figure 7 In the example shown, the second brightness corresponding to the second RAW image is calculated in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees. In the other three different scenes corresponding to the first angles, it is determined that the second brightness corresponding to the second RAW images corresponding to the three first angles is respectively the second brightness , Second Brightness and the second brightness .
[0177] Step S2133: Based on the second brightness and the preset brightness at each first angle, adjust the exposure of the camera module at each first angle to obtain the target exposure of the camera module at each first angle.
[0178] In one example, it is determined whether the second brightness corresponding to the second RAW image at each first angle is the same as the preset brightness. If they are the same, the exposure corresponding to the second RAW image at this time is determined to be the target exposure. If they are not the same, the exposure of the camera module at each first angle is adjusted until the second brightness corresponding to the second RAW image is the same as the preset brightness, and the exposure corresponding to the second RAW image at this time is determined to be the target exposure.
[0179] For example, adjusting the exposure of the camera module at each first angle can be to ensure the sensitivity of the camera module. Under the condition that the initial exposure time remains unchanged, the exposure time is adjusted, that is, the initial exposure time is adjusted to the first exposure time, a first exposure amount is determined based on the first exposure time, a second RAW image corresponding to the first exposure amount is obtained based on the first exposure amount, and a second brightness of the second RAW image corresponding to the first exposure amount is compared with a preset brightness. If they are the same, it is determined that the first exposure amount at this time is the target exposure amount; if they are different, the above operation is repeated (the exposure time is continuously adjusted) until the second brightness corresponding to the second RAW image is the same as the preset brightness, and the exposure amount corresponding to the second RAW image at this time is determined to be the target exposure amount.
[0180] Following the example of step S2132 above, in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, if the second brightness corresponding to the second RAW image and preset brightness Y 预 Same as the exposure of the second RAW image is the target exposure. As target exposure .
[0181] In the different scenes corresponding to the other three first angles, the target exposures corresponding to the three first angles are determined to be , and , which is similar to the above example in the positive backlight scene, and will not be repeated here.
[0182] Step S214: Determine the target exposure time of the camera module at each first angle based on the target exposure amount of the camera module at each first angle.
[0183] Following the above example, the target exposure time of the camera module at each first angle is determined by using the inverse operation of formula (1). And formula (1) to determine the target exposure time in the positive backlight scene, that is, when the first angle (first included angle) is 0 degrees In the different scenes corresponding to the other three first angles, the target exposures corresponding to the three first angles are determined to be , and , which is similar to the above example in the positive backlight scene, and will not be described in detail here.
[0184] Step S22: acquiring a first RAW image at each first angle based on the target exposure time and sensitivity at each first angle.
[0185] Continuing with the above example, in a direct backlighting scene, that is, the first RAW image I1 when the first angle (first included angle) is 0 degrees, in a side backlighting scene, the first RAW image I2 when the first angle (second included angle) is 45 degrees, in a side light scene, the first RAW image I3 when the first angle (third included angle) is 70 degrees, and in a top light scene, the first RAW image I4 when the first angle (fourth included angle) is 70 degrees.
[0186] Step S3: obtaining a first parameter corresponding to each first RAW image, where the first parameter is at least one of a restoration degree, a contrast, and a brightness corresponding to the first RAW image in a LAB color space.
[0187] The first RAW image is an image with light and dark color difference. For example, the first RAW image includes a target subject, and the target subject includes an area with different brightness.
[0188] Step S3 includes step S31 - step S32.
[0189] Step S31: segment each first RAW image to obtain a first region, a second region and a third region corresponding to each target subject.
[0190] The first RAW image includes the target subject.
[0191] Fig.14 It is a schematic diagram of segmenting a first RAW image provided in an embodiment of the present application.
[0192] Combination Fig.14 As shown, the first area includes the face area of the target subject; the second area includes the area corresponding to the forehead part of the target subject; and the third area includes the area corresponding to the eye part of the target subject.
[0193] It should be noted that the above-mentioned first area can be an area corresponding to a human face, an area corresponding to an animal face, or other specific areas containing a large amount of detailed information; the second area can be an area corresponding to the forehead of a human face, or other relatively smooth areas; the third area can be the above-mentioned eye area including the eyeball and the white of the eye, or an area including a black and white picture card, or other areas with brightness difference, which are not specifically limited here.
[0194] The following is an exemplary description of taking a target subject as a person, segmenting the first RAW image, obtaining a first area corresponding to the target subject as a face area, a second area corresponding to the target subject as a forehead area, and an eye area corresponding to the target subject as a third area.
[0195] There are various implementation methods for segmenting the first RAW image, and one of the embodiments is used as an example for description below.
[0196] In one embodiment, each first RAW image is used as an input of a pre-trained neural network model, and the neural network model is used to obtain the first region, the second region, and the third region of each target subject.
[0197] The pre-trained neural network model may be a pre-trained image segmentation model, or other neural network models, which are not specifically limited here.
[0198] A pre-trained neural network model refers to a neural network model that has been trained on a large-scale data set before use. In order to ensure the generalization ability of the neural network model, it is necessary to train the neural network model based on a large amount of training data.
[0199] In one implementation, a method for training a neural network model is described.
[0200] First, a training set is obtained. The training set includes at least one first RAW training image including a training target subject, and a first target area, a second target area, and a third target area corresponding to the first RAW training image. The first target area includes an area in the training target subject that contains a large amount of detail information, that is, an area with more content elements, the second target area includes an area in the training target subject that has relatively uniform brightness, and the third target area includes an area in the training target subject that has relatively obvious differences in brightness.
[0201] Exemplarily, the first target area includes the face area of the training target subject; the second target area includes the area corresponding to the forehead portion of the training target subject; and the third target area includes the area corresponding to the eye portion of the training target subject.
[0202] Secondly, the neural network model is trained by taking at least one first RAW training grayscale image as input of the neural network model, and taking at least one first target area, at least one second target area and at least one third target area as outputs of the neural network model.
[0203] It should be noted that, in order to increase the generalization ability of the neural network model, a large number of training sets are generally used to train the neural network model. The following takes a first RAW training grayscale image to train the neural network model as an example for explanation.
[0204] The first RAW training grayscale image is input into the neural network model to obtain the first prediction area, the second prediction area and the third prediction area corresponding to the first RAW training image, and the preset loss function is used to determine the first loss value between the first prediction area and the first target area, the second loss value between the second prediction area and the second target area, and the third loss value between the third prediction area and the third target area. Based on the first loss value, the second loss value and the third loss value, the neural network model is continuously adjusted. When the above loss values are all less than the preset threshold value, it means that the training of the neural network model is completed at this time, and a trained neural network model is obtained.
[0205] After the neural network model is trained, the first RAW image is segmented using the neural network model. That is, the first RAW image is input into the neural network model, and the first region, the second region, and the third region are output. Continuing with the above example, the first RAW image acquired at different first angles is segmented to obtain the first region, the second region, and the third region at different first angles. For example, in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, the first region I of the first RAW image I1 11 , Second Area I 12 and the third region I 13 In a side backlight scene, the first area I of the first RAW image I2 when the first angle (second angle) is 45 degrees 21 , Second Area I 22 and the third region I 23 In the side-light scene, the first area I of the first RAW image I3 when the first angle (third angle) is 70 degrees 31 , Second Area I 32 and the third region I 33 and the first region I of the first RAW image I4 when the first angle (fourth angle) is 70 degrees in the top light scene. 41 , Second Area I 42 and the third region I 43 .
[0206] Step S32: Obtain a first restoration degree corresponding to each first area, a first contrast corresponding to each third area, and a first brightness corresponding to each second area in the LAB color space.
[0207] Step S32 includes steps S321 to S323.
[0208] Step S321: Obtain a first restoration degree corresponding to each first region in the LAB color space.
[0209] For the sake of convenience, the following takes the first area I of the first RAW image I1 when the first angle (first included angle) is 0 degrees.11 , Second Area I 12 and the third region I 13 Provide explanation.
[0210] In one example, step S321 includes steps S3211 to S3214.
[0211] Step S3211: Acquire a target image, where the target image is an image acquired from at least one preset image and has the same preset area as the first area I1.
[0212] The target image is a standard RAW image used to measure the degree of restoration. The target image is usually a high-quality original image used as a comparison benchmark to evaluate whether the first RAW image restores the details, colors and other visual characteristics of the target image. At least one preset image is a large number of standard RAW images collected from different standard scenes.
[0213] For example, in combination Fig.15 As shown, if there are three preset images, namely II1, II2, and II3, a preset image whose first area is the same as the preset area in the three preset images is obtained, and the preset image is used as the target image, that is, II2 is the target image.
[0214] Step S3212: Obtain the fifth brightness corresponding to each first region; the fifth brightness is the brightness corresponding to the grayscale value in the first region.
[0215] The specific content of step S3212 can be determined by referring to the above formula (2), which will not be described in detail here.
[0216] For example, in combination with formula (2), the fifth brightness can be obtained: .
[0217] Step S3213: Obtain the target brightness corresponding to the preset area; the target brightness is the brightness corresponding to the grayscale value in the preset area.
[0218] The specific content of step S3213 can be determined by referring to the above formula (2), which will not be described in detail here.
[0219] For example, in combination with formula (2), the fifth brightness can be obtained: .
[0220] Step S3214: Based on each fifth brightness and the target brightness, obtain a first restoration degree corresponding to at least one first area; wherein each fifth brightness corresponds to a first restoration degree corresponding to a first area; a fifth brightness and a target brightness obtain a first restoration degree corresponding to a first area.
[0221] In one implementation, the restoration degree of two images may be determined by using a structural similarity index (SSIM) to evaluate the difference between the two images, or other methods may be used, which are not specifically limited herein.
[0222] The following is an illustrative description using the SSIM evaluation method as an example.
[0223] Specifically, the first degree of restoration of the first area can be determined by: determining the first result corresponding to each first area and the second result corresponding to each first area based on the first mean of the fifth brightness corresponding to each first area, the second mean of the target brightness and the first constant; wherein the first mean corresponds to the first result one-to-one, the first mean corresponds to the second result one-to-one, and a first mean, a second mean and a first constant obtain a first result or a second result; determining the third result corresponding to each first area based on the covariance and the second constant between the fifth brightness of each first area and the target brightness; determining the first product corresponding to each first area based on each first result and each third result; wherein In the embodiment, the first result, the third result and the first product correspond one-to-one; based on the first variance corresponding to the fifth brightness of each first area, the second variance corresponding to the target brightness and the second constant, the fourth result corresponding to each first area is determined; based on each second result and each fourth result, the second product corresponding to each first area is determined; wherein the second result and the fourth result correspond one-to-one; a second result and a fourth result obtain a second product; based on the first product corresponding to each first area and the second product corresponding to each first area, a first restoration degree corresponding to at least one first area is obtained; wherein the first product corresponds one-to-one to the second product, and a first product and a second product obtain a first restoration degree.
[0224] Exemplarily, the first reduction degree is determined by combining formula (3): Formula (3); in, is the brightness of the first area, is the brightness of the target area, and express and The mean of and express and The variance of express and The covariance between , represents a constant, , , and is the default coefficient, such as , , is the pixel range of the image, , is the bit depth of the image, which indicates how many bits are used to store data per pixel.
[0225] Following the above examples of different first angles, combined with formula (3), in the positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, the first restoration degree of the first area is obtained: In the side backlight scene, when the first angle (second angle) is 45 degrees, the first restoration degree of the first area is obtained. In the side-lit scene, when the first angle (third angle) is 70 degrees, the first restoration degree of the first area is obtained. In the top light scene, when the first angle (fourth angle) is 70 degrees, the first restoration degree of the first area is obtained. .
[0226] In one example, step S321 includes step S3215.
[0227] Step S3215: Take each first region as the input of the pre-trained machine learning model, and use the pre-trained machine learning model to obtain the first degree of restoration corresponding to each first region.
[0228] Among them, a pre-trained machine learning model refers to a machine learning model that has been trained on a large-scale data set before use. In order to ensure the generalization ability of the machine learning model, it is necessary to train the machine learning model based on a large amount of training data.
[0229] In one embodiment, a method for training a machine learning model is described.
[0230] First, a training set is obtained, where the training set includes at least one sample region image and a target restoration degree corresponding to the sample region image.
[0231] The sample area image may include a face area image or other specific area images.
[0232] Then, the machine learning model is trained by taking at least one sample area image as input of the machine learning model and taking at least one target restoration degree as output of the machine learning model.
[0233] It should be noted that in order to increase the generalization ability of the machine learning model, a large number of training sets are generally used to train the machine learning model. The following takes a sample area image to train the machine learning model as an example.
[0234] The sample area image is input into the machine learning model to obtain the predicted restoration degree corresponding to the sample area image. Based on the preset loss function, the loss values of the preset restoration degree and the target restoration degree are determined. Based on the loss values, the parameters of the machine learning model are continuously adjusted. When the above loss values are all less than the preset thresholds, it means that the machine learning model training is completed at this time.
[0235] It should be noted that the above-mentioned machine learning model is trained using a regression loss function, and other implementation methods may also be used, such as a contrast loss function, etc., which are not specifically limited here.
[0236] Following the above examples of different first angles, using the machine learning model, in the positive and negative light scene, that is, when the first angle (first included angle) is 0 degrees, the first restoration degree of the first area is obtained. In the side backlight scene, when the first angle (second angle) is 45 degrees, the first restoration degree of the first area is obtained. In the side-lit scene, when the first angle (third angle) is 70 degrees, the first restoration degree of the first area is obtained. In the top light scene, when the first angle (fourth angle) is 70 degrees, the first restoration degree of the first area is obtained. .
[0237] Step S322: Obtain a first contrast corresponding to each third region in the LAB color space.
[0238] In one implementation, step S322 includes step S3221 - step S3222.
[0239] Step S3221: Obtain the third brightness and fourth brightness of each third area, where the fourth brightness is greater than the third brightness.
[0240] Taking the human eye region as an example, the third area has a third brightness corresponding to the eyeball in the human eye region, and the fourth brightness corresponding to the white of the eye in the human eye region.
[0241] The specific content of step S3221 can refer to the specific content of step S2132, which will not be repeated here.
[0242] Following the above examples of different first angles, using the machine learning model, in the positive and negative light scene, that is, when the first angle (first included angle) is 0 degrees, the third brightness of the third area is obtained. and the fourth brightness In the side backlight scene, when the first angle (second angle) is 45 degrees, the third brightness of the third area is obtained. and the fourth brightness In the side-lit scene, the first angle (third angle) is 70 degrees, and the third brightness of the third area is obtained. and the fourth brightness In the top light scene, when the first angle (fourth angle) is 70 degrees, the third brightness of the third area is obtained. and the fourth brightness .
[0243] Step S3222: Based on the third brightness and the fourth brightness, obtain a first contrast corresponding to at least one third area; wherein each third brightness corresponds to a fourth brightness, and a third brightness and a fourth brightness obtain a first contrast corresponding to a third area.
[0244] In one implementation, a first difference and a first sum of the third brightness and the fourth brightness of each third region are determined; and a first contrast corresponding to at least one third region is determined based on each first difference and each first sum.
[0245] Exemplarily, the first contrast is determined by combining formula (4): Formula (4); in, is the first contrast, is the third brightness, The fourth brightness.
[0246] Following the above examples of different first angles, in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, the first contrast of the third area is obtained as ; In the side backlight scene, when the first angle (second angle) is 45 degrees, the first contrast of the third area is ; In the side-light scene, the first angle (third angle) is 70 degrees, and the first contrast of the third area is In the top light scene, when the first angle (fourth angle) is 70 degrees, the first contrast of the third area is .
[0247] Step S323: Obtain the first brightness corresponding to each second area in the LAB color space.
[0248] The specific content of step S323 can refer to the specific content of step S2132, which will not be repeated here.
[0249] Following the above examples of different first angles, in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, the first brightness corresponding to the second area is obtained. ; In the side backlight scene, when the first angle (second angle) is 45 degrees, the first brightness corresponding to the second area is obtained ; In the side-light scene, the first angle (third angle) is 70 degrees, and the first brightness corresponding to the second area is obtained ; In the top light scene, when the first angle (fourth angle) is 70 degrees, the first brightness corresponding to the second area is obtained .
[0250] Step S4: determining a first score corresponding to each first parameter, wherein the first score is used to characterize the blur degree of the first RAW image.
[0251] In one embodiment, at least one first ratio is determined based on each first brightness and a first weight; wherein each first brightness corresponds to a first ratio, and a first brightness and a first weight obtain a first ratio; at least one second ratio is determined based on each first contrast and a second weight; wherein each first contrast corresponds to a second ratio, and a first contrast and a second weight obtain a second ratio; at least one third ratio is determined based on each first restoration degree and a third weight; wherein each first restoration degree corresponds to a third ratio, and a first restoration degree and a third weight obtain a third ratio; based on the first ratio, the second ratio and the third ratio, a first score corresponding to the blurriness of at least one first RAW image is determined; wherein the first ratio, the second ratio and the third ratio correspond one-to-one, and a first ratio, a second ratio and a third ratio obtain a first score corresponding to the blurriness of a first RAW image.
[0252] Among them, the second weight is greater than the first weight, and the third weight is greater than the first weight.
[0253] It should be noted that the first weight, the second weight and the third weight are specifically set according to the actual scenario and are not specifically limited here.
[0254] Exemplarily, the first score is determined by combining formula (5): Formula (5); in, For the first score, is the first weight, is the second weight, The third weight.
[0255] Following the above examples of different first angles, in a positive backlight scene, that is, when the first angle (first included angle) is 0 degrees, the first score corresponding to the first RAW image is ; In the side backlight scene, when the first angle (second angle) is 45 degrees, the first score corresponding to the first RAW image is ; In the side-lit scene, the first angle (third angle) is 70 degrees, and the first score corresponding to the first RAW image is ; In the top light scene, when the first angle (fourth angle) is 70 degrees, the first score corresponding to the first RAW image is .
[0256] S5: Determine a comprehensive score based on all the first scores, wherein the comprehensive score is used to characterize the blur degree of the camera module.
[0257] There are various ways to determine the comprehensive score, and two embodiments are used as examples to illustrate below.
[0258] In one example, a composite score is determined based on all first scores and the average weight.
[0259] For example, the comprehensive score is determined by combining formula (6): Formula (6); in, is the comprehensive score, is the average weight.
[0260] Following the above four examples of the first angle, the four first scores are , , ,and ,if is 0.8, is 0.6, is 0.5, is 0.7, the average weight is 0.05, and based on formula (5), the comprehensive score is determined to be 0.13.
[0261] In another example, all first scores are averaged to obtain a composite score.
[0262] For example, the comprehensive score is determined by combining formula (7): Formula (7); in, is the total number of first scores, For the comprehensive score.
[0263] Following the above four first angle examples, the four first scores are , , ,and ,if is 0.8, is 0.6, is 0.5, is 0.7. Based on formula (7), the comprehensive score is determined to be 0.7.
[0264] It should be noted that the above embodiment uses the comprehensive score to characterize the blur degree of the camera module. In order to meet user needs, in actual application scenarios, the brightness, contrast and restoration degree of each area in the first RAW image can also be provided to the user, which will not be described in detail here.
[0265] In summary, by acquiring the first RAW images from different angles, the blur level of the camera module can be comprehensively evaluated to ensure the accuracy of the measurement results. Processing based on the RAW images not only helps to accurately measure the blur level of the camera module, but also can deeply analyze the impact of the hardware process of the electronic equipment on the imaging quality, thereby ensuring and improving the user experience.
[0266] Combine the following Fig.16 An exemplary description is given.
[0267] Fig.16 This is the second flow chart of a method for detecting the blurriness of a camera module provided in an embodiment of the present application.
[0268] like Fig.16 As shown, the method for detecting the blur degree of the camera module includes the following steps: The camera module is used to shoot the first test scene corresponding to different first angles to obtain the corresponding first RAW image. The first RAW image is input into the neural network model for image segmentation, and further, the restoration degree, contrast and brightness of different areas obtained by the image segmentation are determined, and the corresponding first scores are obtained based on the restoration degree, contrast and brightness, and the final comprehensive score is determined based on the first scores of different first angles.
[0269] In summary, by acquiring the first RAW images from different angles, the blur level of the camera module can be comprehensively evaluated to ensure the accuracy of the measurement results. Processing based on the RAW images not only helps to accurately measure the blur level of the camera module, but also can deeply analyze the impact of the hardware process of the electronic equipment on the imaging quality, thereby ensuring and improving the user experience.
[0270] Corresponding to the embodiment of the blur degree method of the aforementioned camera module, the present application also provides an application example of the method in an actual application scenario. Among them, the application examples of the blur degree method of the camera module in actual application scenarios are various. The following takes one of them as an example. For example, the method can be used to compare the blur degree of camera modules in different electronic devices.
[0271] For ease of explanation, the following description takes two camera modules in two electronic devices as an example, namely electronic device M and electronic device N.
[0272] The application example of this method in a practical application scenario includes the following steps: Step S6: Construct at least one first test scenario.
[0273] The specific content of step S6 can refer to the above step S1 and will not be repeated here.
[0274] For example, for the electronic device M, a first test scene S is constructed in which the first angle (first included angle) formed by the camera module and the vertical line of the first light source is 0 degrees. M1 ; The first test scene S in which the first angle (second angle) formed by the camera module and the vertical line of the first light source is 45 degrees M2 ; The first test scene S in which the first angle (third angle) formed by the camera module and the vertical line of the first light source is 70 degrees M3 ; The first test scene S in which the first angle (fourth angle) formed by the camera module and the vertical line of the first light source is 70 degrees M4 For the electronic device N, a first test scene S is constructed in which the first angle (first included angle) formed by the camera module and the vertical line of the first light source is 0 degrees. N1 ; The first test scene S in which the first angle (second angle) formed by the camera module and the vertical line of the first light source is 45 degrees N2 ; The first test scene S in which the first angle (third angle) formed by the camera module and the vertical line of the first light source is 70 degrees N3 ; The first test scene S in which the first angle (fourth angle) formed by the camera module and the vertical line of the first light source is 70 degrees N4 .
[0275] Step S100: obtaining a first test scene shot by camera modules in different electronic devices at different first angles to obtain at least one first RAW image.
[0276] The specific content of step S100 can refer to the above step S2 and will not be repeated here.
[0277] Following the above example, for the electronic device M, the first test scenario S is obtained M1 The corresponding first RAW image I M1 ; Get the first test scene S M1 The corresponding first RAW image I M2 ; Get the first test scene S M1 The corresponding first RAW image I M3 ; Get the first test scene S M1 The corresponding first RAW image I M4 For electronic device N, the first test scenario S is obtained M1The corresponding first RAW image I N1 ; Get the first test scene S M1 The corresponding first RAW image I M2 ; Get the first test scene S M1 The corresponding first RAW image I N3 ; Get the first test scene S M1 The corresponding first RAW image I N4 .
[0278] Step S200: obtaining a first parameter corresponding to each first RAW image, where the first parameter is at least one of a restoration degree, a contrast, and a brightness corresponding to the first RAW image in a LAB color space.
[0279] The specific content of step S200 can refer to the above step S3 and will not be repeated here.
[0280] Following the above example, for the electronic device M, a first RAW image I is obtained. M1 The first restoration degree of the first area ; Get the first RAW image I M2 The first restoration degree of the first area ; Get the first RAW image I M3 The first restoration degree of the first area ; Get the first RAW image I M4 The first restoration degree of the first area . Get the first RAW image I M1 The first contrast of the third area ; Get the first RAW image I M2 The first contrast of the third area ; Get the first RAW image I M3 The first contrast of the third area ; Get the first RAW image I M4 The first contrast of the third area . Get the first RAW image I M1 The first brightness of the second area ; Get the first RAW image I M2 The first brightness of the second area ; Get the first RAW image I M3 The first brightness of the second area ; Get the first RAW image I M4 The first brightness of the second area .
[0281] For the electronic device N, a first RAW image I is obtained. N1The first restoration degree of the first area ; Get the first RAW image I N2 The first restoration degree of the first area Get the first RAW image I N3 The first restoration degree of the first area ; Get the first RAW image I N4 The first restoration degree of the first area . Get the first RAW image I N1 The first contrast of the third area ; Get the first RAW image I N2 The first contrast of the third area ; Get the first RAW image I N3 The first contrast of the third area ; Get the first RAW image I N4 The first contrast of the third area . Get the first RAW image I N1 The first brightness of the second area ; Get the first RAW image I N2 The first brightness of the second area ; Get the first RAW image I N3 The first brightness of the second area ; Get the first RAW image I N4 The first brightness of the second area .
[0282] Step S300: Determine a first score corresponding to each first parameter.
[0283] The specific content of step S300 can refer to the above step S4 and will not be repeated here.
[0284] Following the above example, for the electronic device M, the first RAW image I is determined M1 The corresponding first score is ; Determine the first RAW image I M2 The corresponding first score is ; Determine the first RAW image I M3 The corresponding first score is ; Determine the first RAW image I M4 The corresponding first score is For the electronic device N, the first RAW image I is determined N1 The corresponding first score is ; Determine the first RAW image I N2 The corresponding first score is ; Determine the first RAW image I N3The corresponding first score is ; Determine the first RAW image I N4 The corresponding first score is .
[0285] Step S400: Determine a comprehensive score corresponding to each electronic device based on all first scores corresponding to each electronic device.
[0286] The specific content of step S400 can refer to the above step S5 and will not be repeated here.
[0287] Following the above example, for electronic device M, determine the comprehensive score corresponding to electronic device M For electronic device N, determine the comprehensive score corresponding to electronic device N .
[0288] Step S500: Compare the comprehensive scores corresponding to each electronic device.
[0289] Continuing with the above example, based on the comprehensive score and comprehensive score , determine the blur level of the camera module of the electronic device. For example, if Greater than , indicating that the blur degree of the camera module of electronic device N in the first test scenario is greater than that of electronic device M.
[0290] In another embodiment, the blur degree of the camera module in the electronic device may also be determined based on the comprehensive score and the first restoration degree, first contrast and first brightness of different electronic devices.
[0291] The following is an explanation in conjunction with Table 1.
[0292] Exemplarily, Table 1 is specifically described in combination with the above implementation.
[0293] Table 1 ; That is to say, further analysis can be performed in combination with the blur degree measurement index of the camera module of the electronic device in Table 1.
[0294] It should be noted that the above-mentioned camera modules correspond one-to-one to electronic devices, and there may also be multiple camera modules in the same electronic device, which is not specifically limited here.
[0295] In summary, by comparing the blur levels of camera modules in different electronic devices, we can conduct in-depth analysis of the camera modules in electronic devices and improve user experience.
[0296] Corresponding to the embodiment of the method for detecting blurriness of a camera module described above, the present application also provides an embodiment of a device for detecting blurriness of a camera module. The device comprises: An acquisition module is configured to: acquire at least one first RAW image obtained by shooting a first test scene at different first angles by a camera module, where the first angle is an angle formed by the camera module and the first light source; The acquisition module is further configured to: acquire a first parameter corresponding to each first RAW image, where the first parameter is at least one of a restoration degree, a contrast, and a brightness corresponding to the first RAW image in a LAB color space; A determination module is configured to: determine a first score corresponding to each first parameter, wherein the first score is used to characterize a blur degree of the first RAW image; The determination module is further configured to: determine a comprehensive score based on all the first scores, wherein the comprehensive score is used to characterize the blur degree of the camera module.
[0297] It is understandable that, in order to realize the above functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the steps of an image enhancement method of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or electronic device software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0298] The present application embodiment provides an electronic device, which may include: a display screen (such as a touch screen or a non-touch screen), a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 3 The structure of the electronic device shown.
[0299] Fig.17 It is a structural block diagram of a chip system provided in an embodiment of the present application.
[0300] The present application embodiment also provides a chip system 1700, such as Fig.17As shown, the chip system 1700 includes at least one processor 1701 and at least one interface circuit 1702. The processor 1701 and the interface circuit 1702 can be interconnected through lines. For example, the interface circuit 1702 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1702 can be used to send signals to other devices (such as the processor 1701 or a touch screen of an electronic device). Exemplarily, the interface circuit 1702 can read instructions stored in the memory and send the instructions to the processor 1701. When the instruction is executed by the processor 1701, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0301] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.
[0302] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes each function or step executed by the electronic device in the above method embodiment.
[0303] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0304] It is easy to understand that those skilled in the art can combine, split, reorganize, etc. the embodiments of the present application to obtain other embodiments based on the several embodiments provided in the present application, and these embodiments do not exceed the protection scope of the present application.
[0305] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0306] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0307] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0308] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code. It should be noted that those skilled in the art will easily think of other implementation schemes of the present application after considering the specification and practicing the application disclosed here. The present application is intended to cover any variants, uses or adaptive changes of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the technical field that are not disclosed in the present application. It is intended that the specification and examples be considered as exemplary only, with the true scope of the application being indicated by the claims.
[0309] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for detecting blurriness of a camera module, characterized in that: include: Acquire at least one first RAW image obtained by photographing a first test scene by the camera module at different first angles, where the first angle is an angle formed by the camera module and a first light source; Acquire a first parameter corresponding to each of the first RAW images, where the first parameter is at least one of a restoration degree, a contrast, and a brightness corresponding to the first RAW image in a LAB color space; Determine a first score corresponding to each of the first parameters, wherein the first score is used to represent a blur degree of the first RAW image; Based on all of the first scores, a comprehensive score is determined, wherein the comprehensive score is used to characterize the blur degree of the camera module.
2. The method for detecting blurriness of a camera module according to claim 1, characterized in that: The acquiring at least one first RAW image captured by the camera module at different first angles includes: Obtaining a target exposure time of the camera module and a sensitivity of the camera module at each of the first angles; Based on the target exposure time and the sensitivity at each first angle, the first RAW image at each first angle is acquired.
3. The method for detecting blurriness of a camera module according to claim 2, characterized in that: The obtaining the target exposure time of the camera module at each of the first angles includes: Acquire the initial exposure time of the camera module and the sensitivity of the camera module at each of the first angles; Determine the exposure amount of the camera module at each first angle based on the initial exposure time at each first angle and the sensitivity of the camera module at each first angle; Based on a preset brightness, adjusting the exposure of the camera module at each of the first angles to obtain a target exposure of the camera module at each of the first angles; Based on the target exposure amount of the camera module at each of the first angles, the target exposure time of the camera module at each of the first angles is determined.
4. The method for detecting blurriness of a camera module according to claim 3, characterized in that: The step of adjusting the exposure of the camera module at each of the first angles based on the preset brightness to obtain a target exposure of the camera module at each of the first angles includes: Based on the exposure at each of the first angles, obtaining a second RAW image captured by the camera module at each of the first angles; Calculating a second brightness of the second RAW image at each of the first angles; the second brightness is the brightness corresponding to the grayscale value of the second RAW image; Based on the second brightness and the preset brightness at each of the first angles, the exposure of the camera module at each of the first angles is adjusted to obtain the target exposure of the camera module at each of the first angles.
5. The method for detecting blurriness of a camera module according to claim 1, characterized in that: The first RAW image includes a target subject; The acquiring the first parameter corresponding to each of the first RAW images includes: Segmenting each of the first RAW images to obtain a first region, a second region, and a third region corresponding to each of the target subjects; Obtain a first restoration degree corresponding to each of the first regions, a first brightness corresponding to each of the second regions, and a first contrast corresponding to each of the third regions in the LAB color space.
6. The method for detecting blurriness of a camera module according to claim 5, characterized in that: The first area includes the face area of the target subject; the second area includes the area corresponding to the forehead of the target subject; and the third area includes the area corresponding to the eyes of the target subject.
7. The method for detecting blurriness of a camera module according to claim 5 or 6, characterized in that: The step of segmenting each of the first RAW images to obtain a first region, a second region, and a third region corresponding to each of the target subjects includes: Each of the first RAW images is used as an input of a pre-trained neural network model, and the pre-trained neural network model is used to obtain the first region, the second region and the third region of each of the target subjects.
8. The method for detecting blurriness of a camera module according to claim 5, characterized in that: The obtaining of the first restoration degree corresponding to each of the first regions includes: Acquire a target image, where the target image is an image acquired from at least one preset image and has the same preset area as the first area; Obtaining a fifth brightness corresponding to each of the first regions; the fifth brightness is the brightness corresponding to the grayscale value in the first region; Obtaining a target brightness corresponding to the preset area, wherein the target brightness is the brightness corresponding to the grayscale value in the preset area; Based on each of the fifth brightness and the target brightness, the first restoration degree corresponding to at least one of the first areas is obtained; wherein each of the fifth brightness corresponds to the first restoration degree corresponding to the first area; one of the fifth brightness and one of the target brightness obtains the first restoration degree corresponding to the first area.
9. The method for detecting blurriness of a camera module according to claim 8, characterized in that: The obtaining, based on the fifth brightness and the target brightness, a first restoration degree corresponding to at least one of the first regions, comprises: Based on the first mean of the fifth brightness corresponding to each of the first areas, the second mean of the target brightness and a first constant, determine a first result corresponding to each of the first areas and a second result corresponding to each of the first areas; wherein the first mean corresponds to the first result one-to-one, the first mean corresponds to the second result one-to-one, and one first mean, one second mean and one first constant obtain one first result or one second result; Determine a third result corresponding to each of the first regions based on a covariance between the fifth brightness of each of the first regions and the target brightness and a second constant; Based on each of the first results and each of the third results, determine a first product corresponding to each of the first regions; wherein the first results, the third results and the first products correspond one to one; determining a fourth result corresponding to each of the first regions based on a first variance corresponding to the fifth brightness of each of the first regions, a second variance corresponding to the target brightness, and the second constant; Based on each of the second results and each of the fourth results, determine a second product corresponding to each of the first regions; wherein the second results and the fourth results correspond one to one; and one second result and one fourth result generate one second product; Based on the first product corresponding to each of the first regions and the second product corresponding to each of the first regions, a first restoration degree corresponding to at least one of the first regions is obtained; wherein the first products correspond one to one with the second products, and one first product and one second product obtain one first restoration degree.
10. The method for detecting blurriness of a camera module according to claim 5, characterized in that: The obtaining of the first restoration degree corresponding to each of the first regions includes: Each of the first regions is used as an input of a pre-trained machine learning model, and the pre-trained machine learning model is used to obtain the first degree of restoration corresponding to each of the first regions.
11. The method for detecting blurriness of a camera module according to claim 10, characterized in that: Before taking each of the first regions as an input of a pre-trained machine learning model and obtaining the first degree of restoration corresponding to each of the first regions by using the pre-trained machine learning model, the method further includes: Acquire a training set, wherein the training set includes at least one sample region image and a target restoration degree corresponding to the sample region image; The machine learning model is trained by taking at least one of the sample area images as input of the machine learning model and taking at least one of the target restoration degrees as output of the machine learning model.
12. The method for detecting blurriness of a camera module according to claim 5, characterized in that: The obtaining of the first contrast corresponding to each of the third regions includes: Acquire a third brightness and a fourth brightness of each of the third areas, wherein the fourth brightness is greater than the third brightness; Based on the third brightness and the fourth brightness, the first contrast corresponding to at least one of the third regions is obtained; wherein each of the third brightnesses corresponds to one of the fourth brightnesses, and one of the third brightnesses and one of the fourth brightnesses obtains the first contrast corresponding to one of the third regions.
13. The method for detecting blurriness of a camera module according to claim 5, characterized in that: The determining a first score corresponding to each of the first parameters comprises: Based on each of the first brightness and the first weight, determining at least one first ratio; wherein each of the first brightness corresponds to one first ratio, and one first brightness and the first weight obtain one first ratio; Based on each of the first contrasts and the second weights, at least one second ratio is determined; wherein each of the first contrasts corresponds to one second ratio, and one of the first contrasts and the second weights results in one second ratio; Based on each of the first restoration degrees and the third weight, at least one third ratio is determined; wherein each of the first restoration degrees corresponds to one third ratio, and one first restoration degree and the third weight obtain one third ratio; Based on the first ratio, the second ratio and the third ratio, the first score corresponding to the blur degree of at least one of the first RAW images is determined; wherein the first ratio, the second ratio and the third ratio correspond one-to-one, and one first ratio, one second ratio and one third ratio obtain the first score corresponding to the blur degree of the first RAW image.
14. The method for detecting blurriness of a camera module according to claim 1, characterized in that: Before obtaining at least one first RAW image obtained by photographing the first test scene at different first angles by the camera module, the method further includes: Construct at least one of the first test scenes, where the first test scene is a scene in which the camera module shoots a target subject with its back against the first light source.
15. The method for detecting blurriness of a camera module according to claim 14, characterized in that: The constructing at least one of the first test scenarios comprises: Acquire the first position of the target subject at different first angles; Based on the first positions at different first angles, determining the second positions of the first light source and the third positions of the camera module at different first angles; Based on the first position, the second position and the third position at different first angles, at least one first test scene is obtained; wherein, one camera module and one first light source correspond to one first angle.
16. The method for detecting blurriness of a camera module according to claim 1, characterized in that: The different first angles include at least one of a first angle formed by the camera module and a vertical line of the first light source, a second angle formed by the camera module and a vertical line of the first light source, a third angle formed by the camera module and a vertical line of the first light source, and a fourth angle formed by the camera module and a horizontal line of the first light source; the second angle is greater than the first angle, the third angle is greater than the second angle, and the fourth angle is greater than the second angle.
17. A device for detecting blurriness of a camera module, characterized in that: include: An acquisition module is configured to: acquire at least one first RAW image captured by the camera module at different first angles, where the first angle is an angle formed by the camera module and a first light source; The acquisition module is further configured to: acquire a first parameter corresponding to each of the first RAW images, wherein the first parameter is at least one of brightness, contrast, and restoration degree corresponding to the first RAW image in the color space LAB after the first RAW image is converted into the color space LAB; A determination module is configured to: determine a first score corresponding to each of the first parameters, wherein the first score is used to represent a blur degree of the first RAW image; The determination module is further configured to determine a comprehensive score based on all of the first scores, wherein the comprehensive score is used to characterize the blur degree of the camera module.
18. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method for detecting the blur degree of the camera module as described in any one of claims 1-16.
19. A computer-readable storage medium, characterized in that: It includes computer instructions, which, when executed electronically, enable the electronic device to execute the method for detecting the blur degree of the camera module as described in any one of claims 1 to 16.
20. A computer program product, characterized in that When the computer program product runs on a computer, the computer executes the method for detecting the blur degree of the camera module as described in any one of claims 1 to 16.
Citation Information
Patent Citations
Ambiguity detection method, electronic equipment and storage medium
CN111953964A
Apparatus and method for blur detection, and apparatus and method for blur correction
US20080170124A1
Image processing method and photographing apparatus using the same
US20110242367A1