Image quality detection method and related device

By extracting the target object area in image quality detection and weighting processing, the problem of inaccurate detection results in the prior art is solved, and a more accurate image quality evaluation is achieved, which meets user expectations.

CN119273614APending Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410108649.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-25
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing deep learning-based image quality detection method cannot fully consider the impact of the target object when detecting image quality, resulting in inaccurate detection results and inability to meet user expectations.

Method used

By extracting some or all areas of the target object in the image, using the image quality evaluation network to perform quality detection on these areas, and weighting the detection results, considering the impact of the brightness and characteristics of the target object on image quality, the final detection is obtained result.

Benefits of technology

The accuracy of image detection results is improved, making the detection results more in line with user expectations, and improving the attention to the target object and the accuracy of quality evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273614A_ABST
    Figure CN119273614A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image quality detection method and a related device, and relates to the technical field of terminals. The method comprises the following steps: acquiring an image; detecting the quality of the image to obtain a first detection result; under the condition that the image comprises the target object, feature extraction is conducted on the target object in the image, N first images are obtained, any first image comprises a preset feature of the target object, and N is an integer larger than 0; detecting the quality of the N first images to obtain N second detection results; and weighting the first detection result and the N second detection results to obtain a detection result of the image. Therefore, weighting processing can be performed on the quality of the area corresponding to the target object and the overall quality of the image, the influence of the target object on the quality is improved, the attention on the target object is improved, and a detection result after weighting processing meets the expectation of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an image quality detection method and related devices. Background Art

[0002] Mobile phones and other electronic devices have camera functions to facilitate users to record their lives, etc. Many factors may affect the quality of images taken by cameras in electronic devices, such as scene lighting conditions, human movement, camera parameters, and the position of the camera when shooting, resulting in uneven image quality.

[0003] At present, although there are some quality detection methods based on deep learning to detect image quality, the image quality detection results may be inaccurate. Summary of the invention

[0004] The embodiment of the present application provides an image quality detection method and related devices, which are applied to the field of terminal technology. Part or all of the area of ​​the target object can be extracted from the image, and the image detection result is weighted by the image quality detection result corresponding to the area to obtain the final detection result. In this way, when performing quality detection on the image, the influence of the target object can be taken into account, so that the detection result meets the user's expectations for the image quality of the image containing the target object.

[0005] In the first aspect, the embodiment of the present application proposes an image quality detection method and related device. The method includes: acquiring an image; detecting the quality of the image to obtain a first detection result; when the image includes a target object, extracting features of the target object in the image to obtain N first images, any of which includes a preset feature of the target object, where N is an integer greater than 0; detecting the quality of the N first images to obtain N second detection results; and performing weighted processing on the first detection result and the N second detection results to obtain a detection result of the image.

[0006] In this way, the quality of the image in the area corresponding to the target object and the quality of the entire image can be weighted, thereby increasing the impact of the target object on the quality and the attention paid to the target object, so that the detection results after weighted processing meet user expectations.

[0007] In one possible implementation, when weighted processing is performed on the first detection result and N second detection results, the N second detection results have their own weights. For any second detection result among the N second detection results, the weight of any second detection result is positively correlated with the impact of preset features included in the target image on the quality of the image. The target image is the first image corresponding to any second detection result among the N first images.

[0008] It is understandable that the greater the impact of the preset features included in the target image on the quality of the image, the greater the weight corresponding to the detection result of the target image. In this way, the impact of the detection result of the target image on the image detection result can be taken into account, so that the image detection result is more in line with the user's expectations for the quality of the image, and the accuracy of the detection result is improved.

[0009] In a possible implementation, detecting the quality of N first images to obtain N second detection results includes: detecting the quality of the N first images by using a pre-trained image quality assessment network to obtain N second detection results.

[0010] In this way, the quality evaluation of the first image is achieved through the image quality evaluation network, which is convenient, fast and easy to implement.

[0011] In a possible implementation, the quality of N first images is detected by a pre-trained image quality evaluation network to obtain N second detection results, including: expanding the N first images to obtain N expanded first images, the size of each expanded first image is greater than or equal to a preset size; and the quality of each expanded first image is detected by a pre-trained image quality evaluation network to obtain N second detection results.

[0012] In this way, before quality detection is performed on the first image, expansion processing is performed so that the expanded first image can meet the size requirement of image quality detection, and then the image quality evaluation network can detect the first image.

[0013] In one possible implementation, when the image includes a target object, a brightness detection result of the target object is also obtained; the first detection result and the N second detection results are weighted to obtain a detection result of the image, including: weighted processing of the brightness detection result, the first detection result and the N second detection results to obtain a detection result of the image.

[0014] In this way, the influence of the brightness of the target object on the quality of the image is taken into account. The brightness detection result of the target object, the quality of the area corresponding to the target object and the quality of the overall image are weighted to enhance the influence of the target object on the quality. The influence of various factors of the target object on the quality of the image is comprehensively considered, so that the detection result after weighted processing meets the user's expectations.

[0015] In a possible implementation, the weight of the brightness detection result is positively correlated with the impact of the brightness of the target object on the quality of the image.

[0016] It is understandable that the greater the impact of the brightness of the target image on the image quality, the greater the weight corresponding to the brightness detection result. In this way, the impact of the brightness detection result on the image detection result can be taken into account, so that the image detection result is more in line with the user's expectations for the image quality and the accuracy of the detection result is improved.

[0017] In a possible implementation, N is 1, and the detection result of the image satisfies: the detection result of the image = the first detection result * (the first weight coefficient * the first value + the second weight coefficient * the second value); the first weight coefficient satisfies: The second weight coefficient satisfies: The first value is positively correlated with the influence of the preset features included in the first image on the quality of the image; the second value is positively correlated with the influence of the brightness of the target object on the quality of the image.

[0018] In this way, the brightness of the target object and the influence of the quality of a partial area of ​​the target object on the quality of the image are taken into consideration.

[0019] In a possible implementation, the method further includes: when the image includes the target object, extracting features of the target object in the image by using an image segmentation algorithm to obtain a second image; and detecting the brightness of the second image to obtain a brightness detection result.

[0020] In this way, the target object is segmented from the image, making it easier to perform brightness detection on the target image.

[0021] In a possible implementation, extracting features of a target object in an image by using an image segmentation algorithm to obtain a second image includes: extracting features of a target object in an image by using an image segmentation algorithm and taking a margin expansion approach to obtain a second image.

[0022] In this way, when segmenting an image, the boundary filling method is used to retain more information of the target object, improve the integrity of the target object, and improve the detection effect of the target object.

[0023] In one possible implementation, the brightness detection result is related to the brightness mean, which is the average value of the brightness of each pixel in the second image; the quality of the second image indicated by the brightness detection result is positively correlated with a fourth value, which is the absolute value of the difference between the brightness mean and the brightness threshold.

[0024] In this way, by performing brightness detection through the average brightness, the overall brightness of the target object can be better evaluated and the accuracy of the brightness detection result can be improved.

[0025] In a possible implementation, the brightness threshold is 127, and the brightness detection result includes: a first score, the quality of the second image indicated by the first score is positively correlated with the first score; In the case of Positive correlation: In the case of Positive correlation; is the mean brightness.

[0026] In this way, the closer the brightness mean value is to the brightness threshold, the higher the quality of the second image indicated by the brightness detection result, and the better the quality of the target object.

[0027] In a possible implementation manner, the value range of the first detection result, the value range of the N second detection results, and the value range of the brightness detection result are the same.

[0028] It is understandable that when the value ranges of the test results are different, the test results can be normalized and then weighted.

[0029] In this way, the value range of each test result is the same, which facilitates weighted processing.

[0030] In a possible implementation, after obtaining the detection result of the image, the method further includes: displaying the detection result of the image, and / or optimizing the image based on the detection result to obtain an optimized image.

[0031] In this way, the user can be prompted and guided, or the image can be optimized according to the detection results. The detection results are applicable to a variety of scenarios and are practical.

[0032] In one possible implementation, before acquiring the image, the method also includes: in response to a photo-taking operation, displaying a first interface, the first interface including: a thumbnail of the image; displaying the detection result of the image, including: displaying a second interface, the second interface including: a thumbnail of the image and the detection result of the image.

[0033] In this way, after taking a photo, the image quality detection can be triggered and the detection result of the image can be displayed.

[0034] In a possible implementation, before obtaining the first detection result, the method further includes: displaying an interface of a gallery application, the interface displaying an image and a first control; acquiring the image, including: acquiring the image in response to a trigger operation on the first control.

[0035] In this way, image quality detection can be triggered in the gallery application, or image optimization can be performed based on the image quality detection result.

[0036] In a possible implementation, acquiring the image includes: acquiring the image when the electronic device is in an idle scene.

[0037] It is understandable that the electronic device can confirm whether it is in an idle scene by a preset time period or any method (for example, load usage, power usage, etc.). The preset time period can be from 24:00 to 6:00 or any time period, which is not specifically limited here.

[0038] Exemplarily, when the electronic device detects that the screen is off for a preset time, it confirms that the electronic device is in an idle scene. Alternatively, when the electronic device detects a preset time period and the electronic device is connected to a charger, it confirms that the electronic device is in an idle scene. The screen-off state can be understood as the display screen being powered off. Powering off can be understood as the current of the display screen being less than a preset current value. In a possible implementation, the method also includes: when the image does not include the target object, the first detection result is the detection result of the image.

[0039] In this way, when the target object is not included, the first detection result is output.

[0040] In a second aspect, an embodiment of the present application provides an image quality detection device, which may be an electronic device, or a chip or chip system in an electronic device. The image quality detection device may include a display unit and a processing unit. When the image quality detection device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements an image quality detection method described in the first aspect or any possible implementation of the first aspect. When the image quality detection device is an electronic device, the processing unit may be a processor. The image quality detection device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements an image quality detection method described in the first aspect or any possible implementation of the first aspect. When the image quality detection device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements an image quality detection method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, a register, a cache, etc.), or a storage unit within the electronic device that is located outside the chip (eg, a read-only memory, a random access memory, etc.).

[0041] Exemplarily, a display unit is used to display an interface.

[0042] A processing unit is used to acquire an image; the processing unit is also used to detect the quality of the image to obtain a first detection result; when the image includes a target object, feature extraction is performed on the target object in the image to obtain N first images, any one of the first images includes a preset feature of the target object, and N is an integer greater than 0; the processing unit is also used to detect the quality of the N first images to obtain N second detection results; the processing unit is also used to perform weighted processing on the first detection result and the N second detection results to obtain a detection result for the image.

[0043] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.

[0045] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.

[0046] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.

[0047] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).

[0048] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1A schematic diagram of an interface of an electronic device provided in an embodiment of the present application;

[0050] Figure 2 A schematic diagram of an interface of another electronic device provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of an interface of another electronic device provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0053] Figure 5 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0054] Figure 6 A flowchart of an image quality detection method provided in an embodiment of the present application;

[0055] Figure 7 A schematic diagram of a process of image quality detection provided in an embodiment of the present application;

[0056] Figure 8 A flowchart of an image quality detection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0058] 1. Grayscale: refers to the number of color levels represented by each pixel in the image. Grayscale can also be called gray value, grayscale value, etc.

[0059] In the embodiment of the present application, when the color level corresponding to the image is 8 bits, the grayscale value may range from 0 to 255. Among them, the value 0 is black and the value 255 is white. When the color level corresponding to the image is 8 bits, the grayscale value may range from 0 to 65535. The embodiment of the present application does not specifically limit the range of the grayscale level.

[0060] 2. Pixel: refers to the smallest image unit. Each image consists of multiple pixels. For example, taking an image of 500 pixels * 338 pixels as an example, the image is composed of a 500 * 338 pixel matrix. The length of the image is 500 pixels and the width is 338 pixels.

[0061] 3. Other terms

[0062] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0063] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0064] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.

[0065] 4. Electronic equipment

[0066] The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with image quality detection functions. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile Internet devices (MID), wearable devices (e.g., smart watches, smart glasses, smart bracelets or smart jewelry, etc.), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, terminal devices in Internet of Things (IoT) systems, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), and wireless terminals in smart cities. assistant, PDA), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, vehicle-mounted devices, terminal devices in a 5G network, or terminal devices in a future evolved public land mobile communication network (public land mobile network, PLMN), etc., and the embodiments of the present application are not limited to this.

[0067] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

[0068] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0069] Mobile phones and other electronic devices have camera functions to facilitate users to record their lives, etc. Many factors may affect the quality of images taken by cameras in electronic devices, such as scene lighting conditions, human motion, camera parameters, and camera position when shooting.

[0070] At present, the quality detection method based on deep learning usually detects the quality of the entire image. However, users may pay more attention to the target object in the image, making the detection result obtained by this method inaccurate and inconsistent with the image quality detection result expected by the user.

[0071] For example, taking an image containing a face as an example, when the brightness of the face area is low or the details of the face are unclear, the user thinks that the quality of the image is poor. However, the quality of other image contents except the face area in the image is good, and the detection result obtained by the quality detection method based on deep learning indicates that the quality of the image is good, and the detection result does not match the quality of the image expected by the user.

[0072] In view of this, an embodiment of the present application provides an image quality detection method, in which a part or all of the area of ​​the target object can be extracted from the image, and the detection result of the quality corresponding to the area is weighted to the detection result of the entire image to obtain the final detection result. In this way, when performing image quality detection on the image, the impact of the target object on the quality of the image can be taken into account, so that the detection result is consistent with the detection result expected by the user.

[0073] In the embodiment of the present application, the target object may be a living being such as a person or an animal, or a non-living being such as a vehicle, or a part of a living being (e.g., a face, eyes, eyebrows, nose, etc.) or a part of a non-living being. No specific limitation is made here.

[0074] For example, taking the target object as a human face, Figure 1A schematic diagram of an interface of an electronic device provided in an embodiment of the present application.

[0075] When electronic devices are Figure 1 In the main interface shown in a of FIG. 1 , when a trigger operation (eg, a click operation) for the gallery application 101 is received, the electronic device can enter the Figure 1 The gallery interface shown in b in FIG. The gallery interface may include at least one thumbnail. The at least one thumbnail may be a thumbnail of an image or a thumbnail of a video, which is not specifically limited here.

[0076] When the electronic device receives a trigger operation (eg, a click operation) for the image thumbnail 102, the electronic device enters a state such as Figure 1 The image interface shown in c in FIG. The image interface includes: an image 103 corresponding to the thumbnail 102 and setting items. The setting items include but are not limited to: share, collect, edit, delete, more 104 or other types of editing options.

[0077] When the electronic device receives a trigger operation (eg, a click operation) for more 104, the electronic device displays more editing items and enters Figure 1 The interface shown in d in FIG. The interface displays editing items such as quality detection 105, image optimization 106, and details.

[0078] In some embodiments, the “quality detection 105” and / or the “image optimization 106” may also be set in Figure 1 In this way, it is convenient for users to check prompt information or optimize images, which makes the operation more convenient and improves the user experience.

[0079] When the electronic device receives a trigger operation (e.g., a click operation) for quality detection 105, the electronic device detects the quality of the image 103 using the image quality detection method provided in the embodiment of the present application, and enters Figure 1 The interface shown in e in FIG. The interface displays the detection result 107.

[0080] The detection result is used to indicate the quality of the image. The detection result can be a score corresponding to the image (e.g., 7.58, etc.), or a grade corresponding to the image (e.g., good, etc.), or any form of detection result. In some embodiments, the detection result can also include: prompt information. The prompt information is used to guide the user to take pictures. For example, the prompt information can guide the user to adjust the light for taking pictures, the light and shadow of the face, the choice of background, and the composition of the picture.

[0081] For example, the test result may include a score and prompt information. Figure 1As shown in e in FIG. 1 , the detection result 107 may be “7.58, the face is darker.” The present embodiment of the application does not specifically limit the detection result displayed by the electronic device.

[0082] In some embodiments, when the electronic device receives a trigger operation (e.g., a click operation) for image optimization 106, the electronic device detects the quality of the image 103 using the image quality detection method provided in the embodiment of the present application, and optimizes the image 103 according to the detection result, and enters Figure 1 The interface shown in e. Figure 1 The image after the interface optimization is shown in e.

[0083] For example, Figure 2 A schematic diagram of an interface of another electronic device provided in an embodiment of the present application.

[0084] When electronic devices are Figure 2 In the main interface shown in a of FIG. 1 , when receiving the operation of the user opening the camera application 201, the electronic device can enter the Figure 2 The interface shown in b in FIG. The interface may include: a preview area 202, a photo control 203, a thumbnail area 204, and a shooting mode selection item. The preview area 202 displays a preview image in real time. The photo control 203 is used to trigger the camera to take a photo. The thumbnail area 204 displays a thumbnail of the image taken by the camera. The shooting mode selection items include, but are not limited to: portrait, photo, video, professional or more, which are not specifically limited here.

[0085] When electronic devices are Figure 2 When the interface shown in b detects a trigger operation (eg, a click operation) for the photo control 203, the electronic device captures an image and enters Figure 2 The interface shown in c in FIG. The interface includes: a preview area 202, a photo control 203, and a thumbnail area 204. The thumbnail area 204 displays a thumbnail of the captured image 205.

[0086] When electronic devices are Figure 2 When the interface shown in c detects a trigger operation on the thumbnail area 204, the electronic device enters Figure 2 The interface shown in d in FIG. 1 displays image 205 .

[0087] When electronic devices are Figure 2 When the interface shown in d detects a trigger operation for image 205, the electronic device enters Figure 2 The interface shown in e in FIG. 1 shows an image 205 and setting items. The setting items include but are not limited to: share, favorite, edit, delete, more 206 or other types of editing options.

[0088] When the electronic device receives a trigger operation (eg, a click operation) for more 206, the electronic device displays more editing items and enters Figure 2 The interface shown in f in FIG. The interface displays editing items such as quality detection 207, image optimization 208, and details.

[0089] In some embodiments, "quality detection 207" and / or "image optimization 208" may also be set in Figure 2 In this way, it is convenient for users to check prompt information or optimize images, which makes the operation more convenient and improves the user experience.

[0090] When the electronic device receives a trigger operation (e.g., a click operation) for quality detection 207, the electronic device performs image quality detection on image 205 using the image quality detection method provided in the embodiment of the present application and displays the detection result. The detection result can refer to the above corresponding description and will not be repeated here.

[0091] When the electronic device receives a trigger operation (for example, a click operation) for image optimization 208, the electronic device performs image quality detection on image 205 using the image quality detection method provided in an embodiment of the present application, and optimizes image 205 based on the detection result, and displays the optimized image.

[0092] In some embodiments, when the electronic device triggers image editing (for example, detecting a Figure 2 When the "Edit" control in the interface shown in e is triggered, the electronic device performs image quality detection on the image through the image quality detection method provided in the embodiment of the present application and displays the detection result.

[0093] It is understandable that the above Figure 1 and Figure 2 In the scenes shown, the prompt information is triggered and displayed by user operation. In other embodiments, the electronic device may also display the detection result (such as Figure 3 to facilitate users to make adjustments when taking photos.

[0094] It is understandable that the above Figure 1 and Figure 2 In the scenes shown, image optimization is achieved through user operation. In other embodiments, the electronic device can also detect the quality of the image by the image quality detection method provided in the embodiment of the present application when it is in an idle scene, and optimize the image according to the detection result. The electronic device can save the optimized image separately in the gallery, or replace the image before optimization in the gallery with the optimized image.

[0095] Exemplarily, the electronic device can confirm whether it is in an idle scene by a preset time period or any method (for example, load usage, power usage, etc.). The preset time period can be from 24:00 to 6:00 or any time period, which is not specifically limited here. The embodiment of the present application does not specifically limit the application scenario of the image quality detection method.

[0096] In order to better understand the embodiments of the present application, the structure of the electronic device of the embodiments of the present application is introduced below. Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0097] The electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0098] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0099] The processor 110 may include one or more processing units. Among them, different processing units may be independent devices or integrated into one or more processors. A memory may also be provided in the processor 110 for storing instructions and data. For example, the processor 110 is used to store instructions and data involved in the image quality detection method provided in the embodiment of the present application.

[0100] For example, in the embodiment of the present application, after the electronic device detects a trigger operation through the touch sensor 180K, the display screen of the electronic device can realize Figures 1 to 3 Switching display of the corresponding interface in. When the electronic device can detect a trigger operation for "quality detection" through the touch sensor 180K, the processor can implement image quality detection through the image quality detection method provided in the embodiment of the present application, and display the image detection result. When the electronic device can detect a trigger operation for "image optimization" through the touch sensor 180K, the processor 110 can implement image quality detection through the image quality detection method provided in the embodiment of the present application, and optimize the image based on the image detection result.

[0101] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture, etc., which will not be elaborated here.

[0102] For example, Figure 5 The software structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown,

[0103] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0104] The application layer can include a series of application packages. Figure 5 As shown, the application package may include camera, gallery, video, SMS, and image processing plug-ins, etc.

[0105] The image processing plug-in may include: an image quality detection module, an image optimization module, etc. Among them, the image quality detection module can detect the quality of the image (image quality) by the image quality detection method provided in the embodiment of the present application to obtain the detection result. The image optimization module can optimize the image according to the detection result.

[0106] For example, Figure 5 As shown, the image quality detection module may include: a feature extraction module, an image quality assessment (IQA) network module, a weighting module, etc.

[0107] Taking image A as an example, the feature extraction module is used to extract features from image A to obtain image B corresponding to the target object, and image B includes at least one preset feature of the target object. The image quality assessment network module is used to detect the overall quality of image A and output detection result A. The image quality assessment network module is also used to detect the quality of image B and output detection result B. The weighting module is used to perform weighted processing on detection result A and detection result B to obtain the final detection result of image A.

[0108] In this way, considering the influence of the quality of the target object on the overall quality of image A, the overall quality of image A is adjusted based on the quality of the target object, so that the final detection result is consistent with the image quality expected by the user.

[0109] In some embodiments, the image quality detection module may further include: a brightness detection module (not shown in the figure). The feature extraction module may perform feature extraction on image A to obtain image C corresponding to the target object. The brightness detection module may obtain a brightness detection result corresponding to image C. The weighting module may perform weighted processing on detection result A, detection result B and brightness detection result to obtain a final detection result of image A.

[0110] In this way, considering the influence of the brightness of the target object on the overall quality of image A, the overall quality of image A is adjusted based on the brightness of the target object, so that the final detection result is consistent with the image quality expected by the user.

[0111] The image optimization module is used to optimize the image according to the detection result of the image. For example, taking the above-mentioned image A as an example, when the quality of the image indicated by the detection result B is less than the quality of the image indicated by the detection result A, the image enhancement processing can be performed on the area corresponding to the image B in the image A. When the quality of the image indicated by the brightness detection result is less than the quality of the image indicated by the detection result A, the brightness of the area corresponding to the image C can be adjusted.

[0112] In the embodiment of the present application, the image optimization module may include one or more modules provided in the embodiment of the present application: a brightness adjustment module, an image enhancement module, etc. The brightness adjustment module may be used to brighten the image or reduce the brightness of the image. The image enhancement module may perform image enhancement processing on the image.

[0113] In the embodiment of the present application, image enhancement processing is used to improve image quality (for example, improve clarity), enrich information (for example, improve texture details, etc.), etc. Image enhancement processing can be implemented by frequency domain method, space domain method, etc.

[0114] The frequency domain method refers to the signal enhancement of the image based on the two-dimensional Fourier transform. Specifically, the low-pass filtering method (that is, only allowing low-frequency signals to pass) can remove the noise in the image; the high-pass filtering method can enhance high-frequency signals such as edges to make the blurred image clear.

[0115] The spatial domain method can be used to remove or reduce noise. Exemplarily, the spatial domain method includes: local averaging method and median filtering (taking the middle pixel value in the local neighborhood) method, etc. No specific limitation is made here.

[0116] The structure of the above-mentioned image processing plug-in is only an example, and the image processing plug-in may also include more or fewer modules, which is not specifically limited here.

[0117] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 5 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0118] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0119] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0120] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0121] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

[0122] The kernel layer is a layer between hardware and software. The kernel layer is used to drive the hardware to make the hardware work. The kernel layer at least includes display driver, audio driver, camera driver, sensor driver, and graphics processing unit (GPU) driver, etc., which are not limited in the embodiments of the present application.

[0123] The following is an illustrative description of the workflow of electronic device software and hardware in conjunction with the interface of the electronic device.

[0124] When the touch sensor in the electronic device receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events (including touch coordinates, touch force, timestamp of touch operation, etc.). The raw input events are stored in the kernel layer. The application framework layer obtains the raw input events from the kernel layer and identifies the control corresponding to the input event.

[0125] Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as a control for indicating quality detection, the gallery application calls the image processing plug-in, and detects the quality of the image through the image quality detection module to obtain the detection result. The gallery application calls the view system of the application framework layer, and calls the image rendering library in the system library to draw and render the image, so as to display the interface of the gallery application on the screen (display), and the interface displays the detection result.

[0126] Alternatively, taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as a control for indicating image optimization, the gallery application calls the image processing plug-in, and detects the quality of the image through the image quality detection module to obtain the detection result, and performs image enhancement processing and / or brightness adjustment processing according to the detection result through the image optimization module to obtain an optimized image. The gallery application calls the view system of the application framework layer, and calls the image rendering library in the system library to draw and render the image, so as to display the interface of the gallery application on the screen (display), and the interface displays the optimized image.

[0127] In some embodiments, the electronic device may also call the image processing plug-in to optimize the image in the gallery application when it detects that the electronic device is in an idle scene (for example, the load is small). The specific optimization process can refer to the optimization process corresponding to the above touch operation, and is not specifically limited here. The judgment of the idle scene can refer to the above corresponding description, which will not be repeated here.

[0128] Combine the following Figures 6 to 8 The image quality detection method provided in the embodiment of the present application is described.

[0129] For example, Figure 6 The following is a flow chart of an image quality detection method provided in an embodiment of the present application. Assume that the target object is a human face and image A is an image to be subjected to image quality detection. Figure 6 As shown, the method includes:

[0130] S601: Acquire image A.

[0131] Image A may be any image, for example, an image saved in a gallery application or an image captured by a camera.

[0132] In some embodiments, in response to a photographing operation, a camera in the electronic device photographs an image, and the electronic device uses the image photographed by the camera as image A to perform image quality detection and execute S602-S610.

[0133] In some other embodiments, when the electronic device detects that it is in an idle scene, the electronic device obtains image A from the gallery application to perform image quality detection and executes S602-S610. Image A is any image in the gallery application that has not undergone image quality detection.

[0134] In some other embodiments, in response to a trigger operation for "quality detection" or "image optimization", the electronic device uses the image displayed on the display screen as image A to perform image quality detection and execute S602-S610. Figure 1 Taking the interface shown in d in FIG. 1 as an example, when the electronic device detects the trigger operation for “quality detection 105”, it performs image quality detection on image 103 as image A and executes S602-S610.

[0135] For example, Figure 5 Taking the software structure shown as an example, the image processing plug-in in the application layer obtains image A. Exemplarily, after the camera in the electronic device captures the image, the image processing plug-in performs image quality detection on the image captured by the camera and executes S602-S610; when the electronic device detects that it is in an idle scene, the image processing plug-in can obtain image A from the gallery application for image quality detection and execute S602-S610; when the electronic device responds to the trigger operation for "quality detection" or "image optimization", the image processing plug-in performs image quality detection on the image displayed on the display screen and executes S602-S610.

[0136] S602: Input image A into IQA network a to obtain a basic image quality score.

[0137] IQA network a is used to perform image quality detection on the entire image A and evaluate the overall quality of image A (degree of image distortion). The basic image quality score is used to indicate the overall quality of image A. In an embodiment of the present application, IQA network a may be: a blindly assess image quality in the wildguided by a self-adaptive hyper network (hyperIQA) network or any type of image quality assessment network. Any type of image quality assessment network may be an attention-based hybrid image quality assessment network (AHIQ), a convolutional neural network (CNN), etc., which are not specifically limited here.

[0138] For example, taking IQA network a as a hyperIQA network, IQA network a may include: ResNet50 network 61, hypernetwork 62, and quality prediction network 63. ResNet50 network 61 is used to extract semantic features; hypernetwork 62 is used to formulate quality perception rules based on semantic features; and quality prediction network 63 is used to predict image quality. Alternatively, it can be understood that ResNet50 network 61 is a ResNet50 network used for content understanding, hypernetwork 62 is used for perceptual rule learning, and quality prediction network 63 is used for image quality prediction.

[0139] Specifically, the hyperIQA network extracts semantic features from the image through the ResNet50 network 61, and inputs the semantic features into the hypernetwork 62 to adjust the weights of each parameter in the quality prediction network. The quality prediction network 63 determines the weights of each parameter and then evaluates the quality of the image.

[0140] In this way, the hyperIQA network can separate image quality prediction from image content understanding to simulate how humans perceive image quality and achieve image quality assessment of images input into the hyperIQA network.

[0141] In the embodiment of the present application, the IQA network a may be trained using images of various categories.

[0142] In this way, the accuracy of the IQA network a in evaluating the overall quality of image A can be improved, and the accuracy of the basic image quality score can be improved. In addition, the trained IQA network a has good generalization ability and can perform image quality detection on various categories of images.

[0143] In some embodiments, after the electronic device inputs image A into the IQA network a, the IQA network a outputs a value A, where the value A is a basic image quality score of image A.

[0144] In other embodiments, after the electronic device inputs image A into IQA network a, IQA network a outputs value A; the electronic device adjusts value A based on the maximum value that can be output by IQA network a to obtain value B, which is the basic image quality score of image A.

[0145] The value B satisfies: In this way, the basic image quality score of image A can be adjusted within a preset value range, which is convenient for subsequent weighted calculation with the brightness score and detail score.

[0146] The preset value range may be 0 to 1, or 0 to 10, or any range, and the preset value range is not specifically limited here.

[0147] Exemplarily, taking the preset value range of 0 to 1 as an example, the value B may be the ratio of the value A to the maximum value that can be output by the IQA network a.

[0148] For example, taking the maximum value that can be output by IQA network a as 100 and the preset value range as 0 to 10, if value A is 80, then value B is 8.

[0149] It is understandable that the basic image quality score is a way of expressing the detection result, which is only an example, and the basic image quality score can also be replaced by other types of expressions, such as basic image quality rating (e.g., excellent, good, etc.). No specific limitation is made here. IQA network a is a way to obtain the basic image quality score, and the basic image quality score can also be obtained by any method, which is not specifically limited here.

[0150] For example, Figure 5 Taking the software structure shown in FIG. 1 as an example, the image quality assessment network module in the image processing plug-in includes: IQA network a. The image processing plug-in inputs image A into the IQA network a to obtain a basic image quality score.

[0151] S603: Perform facial key point detection on image A to confirm whether image A includes a face.

[0152] Facial key point detection refers to locating the key points of the face of an image, for example, locating the points of eyebrows, eyes, nose, mouth, and facial contour areas. When the electronic device detects the facial key points, it is confirmed that image A includes a face; when the electronic device does not detect the facial key points, it is confirmed that image A does not include a face.

[0153] For example, taking the facial key points corresponding to the 68 feature points of the face as an example, the electronic device can perform face detection on image A through the 68 feature points (68_face_landmarks) of the face. When the electronic device detects the 68 feature points, it is confirmed that image A includes a face; when the electronic device does not detect the 68 feature points, it is confirmed that image A does not include a face.

[0154] For example, Figure 5 Taking the software structure shown as an example, the feature extraction module in the image quality detection module detects the key points of the face in image A to confirm whether image A includes a face.

[0155] If the electronic device does not detect a human face, the electronic device outputs the basic image quality score in S602. If the electronic device detects a human face, the electronic device executes S604-S612.

[0156] S604: When a face is detected, extract features of the face region in the image to obtain an image a corresponding to the face region.

[0157] In the embodiment of the present application, features can be extracted from the image by an image segmentation algorithm or any other method to obtain an image a corresponding to the face region. For example, the face region in image A can be segmented by an image segmentation algorithm implemented based on Pytorch (e.g., DeepLabv3 algorithm) to obtain an image a corresponding to the face region.

[0158] In some embodiments, a margin expansion strategy is used to segment the face region in image A. Margin expansion may include: expanding the edge of the face region outward. In this way, more face information can be retained, and the integrity of the face in image A can be improved.

[0159] For example, Figure 5 Taking the software structure shown as an example, the feature extraction module extracts features from the face area in image A to obtain image a corresponding to the face area.

[0160] S605: Perform brightness detection on image a to obtain a brightness score.

[0161] The brightness score is used to indicate the quality of image a, and can also be understood as the brightness score is used to indicate the quality of the face area, or the quality of the brightness indication of the face area, etc. It can be understood that the brightness score is a representation of the detection result, which is only an example, and the brightness score can also be replaced by other types of representations, such as brightness rating (e.g., excellent, good, etc.), etc. No specific limitation is made here.

[0162] In an embodiment of the present application, the brightness of image a can be detected by the brightness mean of image a, the median of the grayscale values ​​of the brightness of all pixels in image a, or any parameter related to brightness to obtain a brightness score. The brightness mean can reflect the average brightness of image a. Exemplarily, the brightness mean may include: the average value of the grayscale values ​​corresponding to the brightness of all pixels in image a. In some embodiments, the brightness score is obtained by the brightness mean and the brightness threshold. The brightness threshold can be 127, 128, or any value, which is not specifically limited here. In this way, the brightness mean can reflect the average brightness of image a and the overall brightness of the face area. The brightness score obtained by the brightness mean can better reflect the quality of image a.

[0163] It is understandable that the brightness of image a can be represented by a grayscale value. The following takes the case where the brightness is represented by a grayscale value and the grayscale value corresponding to image A ranges from 0 to 255 as an example to illustrate the calculation of the brightness score.

[0164] In possible implementation manner 1, the closer the brightness mean is to the brightness threshold, the higher the brightness score is, and the higher the quality of the image indicated by the brightness score is.

[0165] For example, taking the brightness score value range as 0-10 and the brightness threshold as 127, the brightness score S1 satisfies: in, is the mean brightness of image a.

[0166] In possible implementation manner 2, the closer the brightness mean is to the brightness threshold, the lower the brightness score is, and the higher the quality of the image indicated by the brightness score is.

[0167] For example, taking the brightness score in the range of 0-10 and the brightness thresholds of 0 and 255 as an example, the brightness score S1 satisfies: in, is the mean brightness of image a.

[0168] It is understandable that if the value range of the brightness score changes, the formula satisfied by the brightness score S1 may also change accordingly. No specific limitation is made here.

[0169] In some other embodiments, the median of the grayscale value can be obtained by counting the grayscale value of each pixel in the image a. The brightness score can be obtained by the median of the grayscale value and the brightness threshold.

[0170] For example, taking the brightness score range of 0-10 and the brightness threshold of 127 as an example, the brightness score S1 satisfies: Wherein, X is the median of the grayscale value of each pixel in image a.

[0171] In some embodiments, the value range of the brightness score is the same as the preset value range. In this way, the value range of the brightness score is the same as the preset value range, which facilitates the subsequent weighted calculation with the detail score and the basic image quality score.

[0172] If the preset value range is changed, the formula satisfied by the brightness score S1 will be changed accordingly. The embodiment of the present application does not specifically limit the deformation of the formula.

[0173] For example, Figure 5 Taking the software structure shown as an example, the image quality detection module (or brightness detection module) detects the brightness of image a to obtain a brightness score.

[0174] S606: Perform weighted calculation on the brightness score and the basic image quality score to obtain a brightness weight coefficient.

[0175] In the embodiment of the present application, the brightness weight coefficient is used to indicate the relationship between the quality of image a (face area) and the quality of the overall image of image A. Exemplarily, when the brightness weight coefficient is greater than 1, it indicates that the quality of image a is higher than the quality of the overall image of image A; when the brightness weight coefficient is less than 1, it indicates that the quality of image a is lower than the quality of the overall image of image A.

[0176] In some embodiments, the brightness weight coefficient Sa satisfies: Wherein, S1 is the brightness score of image a, base is the basic image quality score of image A, and the reciprocal of M is the weight corresponding to the basic image quality score. The reciprocal of M can be any value less than 1, for example, 0.5, 0.3, etc., which is not specifically limited here.

[0177] In this way, the basic image quality score is set with a certain weight, which can reduce the situation where the brightness score is too small, resulting in the subsequent image A's comprehensive score being too small, and improve the accuracy of the comprehensive score of image A.

[0178] For example, taking M as 2, the brightness weight coefficient Sa satisfies: Among them, S1 is the brightness score of image a, and base is the basic image quality score of image A.

[0179] In this way, the weight corresponding to the basic image quality score is 0.5, which reduces the situation where the overall score is too small due to the brightness score or detail score being too small.

[0180] For example, Figure 5 Taking the software structure shown as an example, the weighted module calculates the brightness score and the basic image quality score to obtain the brightness weight coefficient Sa.

[0181] S607: Extract features from the detail area of ​​the face in image a to obtain image b corresponding to the detail area.

[0182] In the embodiment of the present application, the detail area may be an area corresponding to one or more parts of the face. Adaptively, the image b may correspond to one or more parts of the face. Exemplarily, the image b may include one part of the face, such as the eye; the image b may also include two parts: eyebrows and eyes. The embodiment of the present application does not specifically limit the number of images b, the parts included, etc.

[0183] It is understandable that the image b may be one or more images. When there are multiple images b, each image b corresponds to a different part of the face. The following takes an image b as an example to illustrate the image quality detection detail scoring.

[0184] In the embodiment of the present application, the features of the face area in the image can be extracted by any method such as image segmentation algorithm, image segmentation model, etc., to obtain the image b corresponding to the detail area. For example, the detail area in image a can be segmented by DeepLabv3 to obtain the image b corresponding to the detail area.

[0185] In some embodiments, feature extraction may also be performed on the detail region of the face in the image A to obtain an image b corresponding to the detail region, which is not specifically limited here.

[0186] For example, Figure 5 Taking the software structure shown as an example, the feature extraction module extracts features from the detail area of ​​the face in image a to obtain image b corresponding to the detail area.

[0187] S608: Input image b into IQA network b to obtain detail scores.

[0188] IQA network b performs image quality detection on image b and evaluates the quality of the image (the degree of image distortion). The detail score is used to indicate the quality of image b, and can also be understood as the detail score being used to indicate the quality of the detail area. IQA network b can be the same as IQA network a or different from IQA network a. No specific limitation is made here.

[0189] In some embodiments, after the electronic device inputs the image b into the IQA network b, the IQA network b outputs a value C, where the value C is a detail score of the image b.

[0190] In other embodiments, after the electronic device inputs image b into IQA network b, IQA network b outputs value C; the electronic device adjusts value C based on the maximum value that can be output by IQA network b to obtain value D, which is the detail score of image b.

[0191] The value D satisfies: In this way, the detail score of image b can be adjusted within a preset value range, which is convenient for subsequent weighted calculation with the brightness score and the basic image quality score.

[0192] The preset value range can refer to the above corresponding description, which will not be repeated here.

[0193] Exemplarily, taking the preset value range of 0 to 1 as an example, the value D may be the ratio of the value C to the maximum value that can be output by the IQA network b.

[0194] Exemplarily, taking the maximum value that can be output by the IQA network b as 100 and the preset value range as 0 to 10, if the value C is 80, the value D is 8.

[0195] In some embodiments, before inputting the image b into the IQA network b, the image b is also expanded, and the expanded image b is input into the IQA network b to obtain a detail score. The expansion may include: copying and arranging the image b, for example, forming an expanded image b by arranging 4 images b in 2 rows and 2 columns; forming an expanded image b by arranging 9 images b in 3 rows and 3 columns. In this way, the expanded image b can meet the image size requirements of the IQA network b, and facilitate the image quality detection (quality evaluation) of the image b.

[0196] For example, taking the IQA network b's requirement for an image size of 24 cm*24 cm as an example, if the size of image b is 2 cm*3 cm, image b may be copied and arranged so that the size of the expanded image b is greater than or equal to 24 cm*24 cm.

[0197] In some embodiments, when performing image quality detection on image b through IQA network b, IQA network b may perform downsampling processing on image b or expanded image b to meet the size requirement of IQA network b. IQA network b may also perform image quality detection on image b or expanded image b by sampling a fixed central area. In this way, the phenomenon of inaccurate detail scoring caused by random sampling of image content can be reduced, and the accuracy of detail scoring can be improved.

[0198] For example, Figure 5 Taking the software structure shown in FIG. 1 as an example, the image quality assessment network module includes: IQA network b. The image processing plug-in inputs image b into IQA network b to obtain a detail score.

[0199] S609: Calculate the detail score and the basic image quality score to obtain a detail weight coefficient.

[0200] In the embodiment of the present application, the detail weight coefficient is used to indicate the relationship between the quality of image b (the detail area of ​​the face) and the quality of the overall image of image A. Specifically, when the detail weight coefficient is greater than 1, it indicates that the quality of image b is higher than the quality of the overall image of image A; when the detail weight coefficient is less than 1, it indicates that the quality of image b is lower than the quality of the overall image of image A.

[0201] In some embodiments, the detail weight coefficient Sb satisfies: Wherein, S2 is the detail score of image a, base is the basic image quality score of image A, and the reciprocal of M is the weight corresponding to the basic image quality score. The reciprocal of M can be any value less than 1, for example, 0.5, 0.3, etc., which is not specifically limited here.

[0202] In this way, the basic image quality score is set with a certain weight, which can reduce the situation where the detail score is too small, resulting in the comprehensive score of image A being too small, and improve the accuracy of the comprehensive score of image A.

[0203] For example, taking N as 2, the detail weight coefficient Sb satisfies: Among them, S2 is the detail score of image b, and base is the basic image quality score of image A.

[0204] For example, Figure 5 Taking the software structure shown as an example, the weighted module calculates the brightness score and the basic image quality score to obtain the detail weight coefficient.

[0205] S610, calculate the brightness score weight coefficient, detail score weight coefficient, basic image quality score, and the fusion weight corresponding to each weight coefficient to obtain a comprehensive score of image A.

[0206] The comprehensive score is used to indicate the image quality of detecting the target object and the image A as a whole.

[0207] In the embodiment of the present application, the comprehensive score R of image A satisfies: Among them, base is the basic image quality score of image A, Sa is the brightness score weight coefficient, Ha is the fusion weight corresponding to the brightness score weight coefficient, Sb is the detail score weight coefficient, and Hb is the fusion weight corresponding to the detail score weight coefficient.

[0208] For example, the fusion weight corresponding to the brightness score weight coefficient is The fusion weight corresponding to the detail score weight coefficient is: For example, the comprehensive score R of image A satisfies:

[0209] In the embodiment of the present application, the fusion weight corresponding to each weight coefficient can be determined by the Pearson coefficient or in any other way.

[0210] It should be noted that the Pearson coefficient can measure the correlation (linear correlation) between two variables (for example, X and Y). The Pearson coefficient can be called the Pearson correlation coefficient (Pearson correlation coefficient), or the Pearson product-moment correlation coefficient (Pearson product-moment correlation coefficient, PPMCC or PCCs). The Pearson coefficient is usually between -1 and 1.

[0211] For example, taking the case where the consistency between the brightness factor and the expert evaluation score is 80% and the consistency between the detail factor and the expert evaluation score is 70%, the fusion weight corresponding to the brightness score weight coefficient is The fusion weight corresponding to the detail score weight coefficient is:

[0212] For example, Figure 5 Taking the software structure shown as an example, the weighted module calculates the brightness score weight coefficient, detail score weight coefficient, basic image quality score, and the fusion weight corresponding to each weight coefficient to obtain a comprehensive score of image A.

[0213] In summary, the impact of the target object on the image is taken into account, and the quality of the overall image is adjusted based on the quality of the target object, so that the comprehensive score of the image is consistent with the user's expectations of the image quality.

[0214] In the above embodiment, the weighted calculation of brightness score, basic image quality score, and detail score is achieved through multi-step calculation (for example, S606, S609, and S610). In some embodiments, the comprehensive score can also be obtained by directly calculating the brightness score, basic image quality score, and detail score. The calculation of the comprehensive score can also be achieved through more steps, which are not specifically limited here.

[0215] For example, taking the weighted calculation of brightness score, basic image quality score, and detail score implemented in one step as an example, the comprehensive score R satisfies: Among them, base is the basic image quality score of image A, is the weight corresponding to the basic image quality score, S1 is the brightness score, S2 is the detail score, Ha is the fusion weight corresponding to the brightness score, and Hb is the fusion weight corresponding to the detail score.

[0216] Above Figure 6In the illustrated embodiment, the electronic device may not calculate the brightness score (i.e., not execute S604-S606), and obtain a comprehensive score by weighted calculation of the basic image quality score and the detail score. The electronic device may not calculate the detail score (i.e., not execute S607-S609), and obtain a comprehensive score by weighted calculation of the basic image quality score and the brightness score.

[0217] Based on the above embodiment, the electronic device may further display the comprehensive score corresponding to image A after S610.

[0218] Exemplarily, the image processing plug-in transmits the comprehensive score of image A to the gallery application or the camera application. When the gallery application or the camera application displays image A, it displays the comprehensive score. In some embodiments, in addition to the comprehensive score, the electronic device may also display prompt information based on the basic image quality score, the comprehensive score, the brightness score, the detail score, etc. The prompt information is used to guide the user to take pictures. For details, please refer to the above Figure 1 For example, when the brightness score is less than the basic image quality score, the prompt information may be "the face brightness is darker".

[0219] Based on the above embodiment, the electronic device can also display brightness rating, basic image quality rating, detail rating, etc. In this way, the user can be prompted to confirm the editing of the image. For example, when the brightness rating is less than the basic image quality rating, the user can increase the brightness of the target object.

[0220] Based on the above embodiments, the electronic device can also perform image optimization processing according to the basic image quality score, comprehensive score, brightness score, detail score, etc.

[0221] Exemplarily, taking the image optimization processing including: image enhancement processing and brightness adjustment processing as an example, when the comprehensive score of image A is greater than or equal to the basic image quality score, image A is not optimized. When the comprehensive score of image A is less than the basic image quality score, it is confirmed whether the brightness score or detail score is less than the basic image quality score. When the detail score is less than the basic image quality score, image enhancement processing is performed on the detail area. When the brightness score is less than the basic image quality score, brightness adjustment is performed on the face area. For image enhancement processing, please refer to the corresponding description above, which will not be repeated here.

[0222] In some embodiments, the judgment of whether to perform image enhancement processing can also be achieved through the brightness weight coefficient Sa, detail weight coefficient Sb, etc. Specifically, when the brightness weight coefficient is greater than or equal to 1, it means that the brightness factor has an improvement effect on the image quality of the Base, and the brightness of the face area is not adjusted; when the brightness weight coefficient is less than 1, it means that the current evaluation factor is less than the image quality of the entire image, and the brightness of the face area is adjusted. When the detail weight coefficient is less than 1, image enhancement processing is performed on the detail area, and when the detail weight coefficient is greater than or equal to 1, image enhancement processing is not performed on the detail area.

[0223] For example, Figure 7 A schematic diagram of a process of image quality detection provided in an embodiment of the present application is provided, taking an image shot in a night scene mode and an image shot in a high dynamic range imaging (HDR) mode as examples.

[0224] like Figure 7 As shown, image A1 is an image captured in night scene mode. After the electronic device captured image A1 in night scene mode, it performed image quality detection on image A1 and obtained a basic image quality score of 7.33; image A1 includes a face, and the electronic device performs feature extraction on the face area to obtain image a1. The electronic device performs brightness detection on image a1 and obtains a brightness score of 7.59; the electronic device performs feature extraction on the detail area of ​​the face to obtain image b1, and performs image quality detection on image b1 and obtains a detail score of 8.42. By weighted calculation of the brightness score, detail score and basic image quality score, the comprehensive score of image A1 is 7.65.

[0225] like Figure 7 As shown, image A2 is an image captured in HDR mode. After the electronic device captures image A2 in HDR mode, it performs image quality detection on image A2 and obtains a basic image quality score of 7.38. Image A2 includes a face, and the electronic device extracts features from the face area to obtain image a2. The electronic device performs brightness detection on image a2 and obtains a brightness score of 6.12; the electronic device extracts features from the detail area of ​​the face to obtain image b1, and performs image quality detection on image b1 and obtains a detail score of 8.11. By weighted calculation of the brightness score, detail score and basic image quality score, the comprehensive score of image A2 is 7.21.

[0226] from Figure 7It can be seen that for night scenes and HDR scenes, the scores after passing through IQA network a are 7.33 and 7.38 respectively. After evaluating the face area and detail area, the scores of these two images are finally corrected to 7.65 and 7.21. Electronic devices can detect the quality of images by combining the specific structural information of the face and the focus of the face detail area, making the image quality evaluation in the portrait scene more refined and in line with the user's expectations for image evaluation.

[0227] It is understandable that the above embodiment takes the target object as a human face as an example to illustrate the image quality detection containing the target object. The human face can also be replaced by any target object, such as a vehicle, a plant, etc., which is not specifically limited here.

[0228] For example, Figure 8 A flow chart of an image quality detection method provided in an embodiment of the present application. Figure 8 As shown, the method includes:

[0229] S801. Acquire an image.

[0230] S801 may refer to the corresponding description of S601 above, which will not be repeated here.

[0231] S802: Detect image quality to obtain a first detection result.

[0232] The first detection result is used to indicate the quality of the entire image. The first detection result can be a score corresponding to the entire image (e.g., 7.58, etc.), or a grade corresponding to the entire image (e.g., good, etc.), or any form of detection result. No specific limitation is made here. Exemplarily, the first detection result can correspond to the basic image quality score mentioned above.

[0233] In the embodiment of the present application, the quality of the image can be detected by any method such as an image quality evaluation network, an algorithm for image quality evaluation, etc., which is not specifically limited here.

[0234] S803: When the image includes the target object, extract features of the target object in the image to obtain N first images, any one of which includes a preset feature of the target object, where N is an integer greater than 0.

[0235] The target object may be a living being such as a person or an animal, or an inanimate object such as a vehicle, or a part of a living being (e.g., a face, eyes, eyebrows, nose, etc.) or a part of an inanimate object. No specific limitation is made here.

[0236] The preset feature may be a feature corresponding to a part of the target object. For example, taking the target object as a face, the preset feature may be a feature corresponding to a detail area such as eyes and eyebrows.

[0237] In the embodiments of the present application, feature extraction can be performed through a convolutional network, a feature extraction model, or any other method, which is not specifically limited here.

[0238] S804: Detect the qualities of N first images to obtain N second detection results.

[0239] The second detection result is used to indicate the quality of a partial area of ​​the target object. The second detection result can be a score corresponding to the entire image (e.g., 7.58, etc.), or a grade corresponding to the entire image (e.g., good, etc.), or any form of detection result. No specific limitation is made here. Exemplarily, the second detection result can correspond to the detail score above.

[0240] In the embodiment of the present application, the quality of the first image can be detected by any method such as an image quality evaluation network, an algorithm for image quality evaluation, etc., which is not specifically limited here.

[0241] S805 . Perform weighted processing on the first detection result and the N second detection results to obtain a detection result of the image.

[0242] In the embodiment of the present application, the weights corresponding to the N second detection results may be the same or different, and are not specifically limited here.

[0243] It can be understood that the detection result of the image can be weighted by multiple weightings or one weighting.

[0244] In some embodiments, when there are multiple N second detection results, the N second detection results may be weighted first to obtain a third detection result, and then the third detection result and the first detection result may be weighted.

[0245] Exemplarily, the first detection result is 7, the N second detection results are 4 and 5 respectively, and the corresponding weights are 0.6 and 0.4 respectively; the weights corresponding to the third detection result and the first detection result are 0.5 and 0.5. For example, the third detection result is 4.4, and the detection result of the image is 5.7.

[0246] In other embodiments, weighted processing can be achieved through the first detection result, N second detection results, the weight of the first detection result, and the weight of each second detection result. For example, if the first detection result is 7, the N second detection results are 4 and 5, and the corresponding weights are 0.3 and 0.2 respectively; if the weight of the first detection result is 0.5, the detection result of the image is 5.7.

[0247] In the embodiment of the present application, weighted processing of the first detection result and the N second detection results can be achieved in any manner, which is not specifically limited here.

[0248] In this way, the quality of the area corresponding to the target object and the quality of the entire image can be weighted, thereby increasing the impact of the target object on the quality and the attention paid to the target object, so that the detection results after weighted processing meet user expectations.

[0249] In one possible implementation, when weighted processing is performed on the first detection result and N second detection results, the N second detection results have their own weights. For any second detection result among the N second detection results, the weight of any second detection result is positively correlated with the impact of preset features included in the target image on the quality of the image. The target image is the first image corresponding to any second detection result among the N first images.

[0250] It is understandable that the greater the impact of the preset features included in the target image on the quality of the image, the greater the weight corresponding to the detection result of the target image. In this way, the impact of the detection result of the target image on the image detection result can be taken into account, so that the image detection result is more in line with the user's expectations for the quality of the image, and the accuracy of the detection result is improved.

[0251] The influence of the preset features included in the target image on the image quality can be quantitatively determined by the Pearson coefficient or any other method. For example, taking the influence of the eye and eyebrow parts on the image quality through expert evaluation as an example, if the consistency between the eye and the expert evaluation score is 80%, and the consistency between the eyebrow and the expert evaluation score is 70%, then the weight of the image corresponding to the eye area is 100%. is proportional to, then the weight of the image corresponding to the eyebrow area is Directly proportional.

[0252] In a possible implementation, detecting the quality of N first images to obtain N second detection results includes: detecting the quality of the N first images by using a pre-trained image quality assessment network to obtain N second detection results.

[0253] The pre-trained image quality assessment network may correspond to the IQA network b mentioned above.

[0254] In this way, the image quality detection (evaluation) of the first image is realized through the image quality evaluation network, which is convenient, fast and easy to implement.

[0255] In a possible implementation, the quality of N first images is detected by a pre-trained image quality evaluation network to obtain N second detection results, including: expanding the N first images to obtain N expanded first images, and the size of each expanded first image is greater than or equal to a preset size; and the quality of each expanded first image is detected by a pre-trained image quality evaluation network to obtain N second detection results.

[0256] The preset size may be any size, for example, 224 mm*224 mm, 24 cm*24 cm, etc. No specific limitation is made here.

[0257] In this way, before performing quality detection on the first image, expansion processing is performed so that the expanded first image can meet the size requirement of image quality detection, and then the image quality evaluation network can detect the first image.

[0258] In one possible implementation, when the image includes a target object, a brightness detection result of the target object is also obtained; the first detection result and the N second detection results are weighted to obtain a detection result of the image, including: weighted processing of the brightness detection result, the first detection result and the N second detection results to obtain a detection result of the image.

[0259] The brightness detection result can refer to the above corresponding description, which will not be repeated here. In the embodiment of the present application, the brightness detection of the target object can be achieved by any method such as an algorithm, a model, a formula, etc. to obtain the brightness detection result, which will not be repeated here.

[0260] In this way, the influence of the brightness of the target object on the quality of the image is taken into account. The brightness detection result of the target object, the quality of the area corresponding to the target object and the quality of the overall image are weighted to enhance the influence of the target object on the quality. The influence of various factors of the target object on the quality of the image is comprehensively considered, so that the detection result after weighted processing meets the user's expectations.

[0261] In a possible implementation, the weight of the brightness detection result is positively correlated with the impact of the brightness of the target object on the quality of the image.

[0262] It is understandable that the greater the impact of the brightness of the target image on the image quality, the greater the weight corresponding to the brightness detection result. In this way, the impact of the brightness detection result on the image detection result can be taken into account, so that the image detection result is more in line with the user's expectations for the image quality and the accuracy of the detection result is improved.

[0263] The influence of brightness on the quality of the image can be quantitatively determined by the Pearson coefficient or any other method. The specific confirmation method is similar to the influence of the preset features included in the above target image on the quality of the image, or can refer to the confirmation process of the above fusion weight, which will not be described here.

[0264] In a possible implementation, N is 1, and the detection result of the image satisfies: the detection result of the image = the first detection result * (the first weight coefficient * the first value + the second weight coefficient * the second value); the first weight coefficient satisfies: The second weight coefficient satisfies: The first value is positively correlated with the influence of the preset features included in the first image on the quality of the image; the second value is positively correlated with the influence of the brightness of the target object on the quality of the image.

[0265] The first weight coefficient may correspond to the detail score weight coefficient mentioned above, the second weight coefficient may correspond to the brightness score weight coefficient mentioned above, the first value may correspond to the fusion weight corresponding to the detail score coefficient mentioned above, and the second value may correspond to the fusion weight corresponding to the brightness score coefficient mentioned above.

[0266] In this way, the brightness of the target object and the influence of the quality of a partial area of ​​the target object on the quality of the image are taken into consideration.

[0267] In a possible implementation, the method further includes: when the image includes the target object, extracting features of the target object in the image by using an image segmentation algorithm to obtain a second image; and detecting the brightness of the second image to obtain a brightness detection result.

[0268] In this way, the target object is segmented from the image, making it easier to perform brightness detection on the target image.

[0269] In a possible implementation, extracting features of a target object in an image by using an image segmentation algorithm to obtain a second image includes: extracting features of a target object in an image by using an image segmentation algorithm and taking a margin expansion approach to obtain a second image.

[0270] In this way, when segmenting an image, the boundary filling method is used to retain more information of the target object, improve the integrity of the target object, and improve the detection effect of the target object.

[0271] In one possible implementation, the brightness detection result is related to the brightness mean, which is the average value of the brightness of each pixel in the second image; the quality of the second image indicated by the brightness detection result is positively correlated with a fourth value, which is the absolute value of the difference between the brightness mean and the brightness threshold.

[0272] In this way, by performing brightness detection through the average brightness, the overall brightness of the target object can be better evaluated and the accuracy of the brightness detection result can be improved.

[0273] In a possible implementation, the brightness threshold is 127, and the brightness detection result includes: a first score, the quality of the second image indicated by the first score is positively correlated with the first score; In the case of Positive correlation: In the case of Positive correlation; is the mean brightness.

[0274] In this way, the closer the brightness mean value is to the brightness threshold, the higher the quality of the second image indicated by the brightness detection result, and the better the quality of the target object.

[0275] In a possible implementation manner, the value range of the first detection result, the value range of the N second detection results, and the value range of the brightness detection result are the same.

[0276] It is understandable that when the value ranges of the test results are different, the test results can be normalized and then weighted.

[0277] In this way, the value range of each test result is the same, which facilitates weighted processing.

[0278] In a possible implementation, after obtaining the detection result of the image, the method further includes: displaying the detection result of the image, and / or optimizing the image based on the detection result to obtain an optimized image.

[0279] The electronic device may display the detection result of the image to prompt and / or guide the user. The displayed detection result can refer to the above corresponding description, which will not be repeated here. The electronic device may optimize the image based on the detection result. Exemplarily, when the quality indicated by the detection result is less than the quality indicated by the first detection result, the target object is subjected to image enhancement, brightness adjustment and other processing.

[0280] It is understandable that the electronic device may also display the first detection result, the brightness detection result, etc. The present application embodiment does not specifically limit the content displayed on the interface. In some embodiments, the content displayed on the interface may include one or more of the following: comprehensive score, brightness score, detail score, etc.

[0281] In this way, the user can be prompted and guided, or the image can be optimized according to the detection results. The detection results are applicable to a variety of scenarios and are practical.

[0282] In one possible implementation, before acquiring the image, the method also includes: in response to a photo-taking operation, displaying a first interface, the first interface including: a thumbnail of the image; displaying the detection result of the image, including: displaying a second interface, the second interface including: a thumbnail of the image and the detection result of the image.

[0283] The first interface may correspond to the Figure 2 The interface shown in c in the above text may correspond to the second interface Figure 3 The interface shown.

[0284] In this way, after taking a photo, the image quality detection can be triggered and the detection result of the image can be displayed.

[0285] In a possible implementation, before obtaining the first detection result, the method further includes: displaying an interface of a gallery application, the interface displaying an image and a first control; acquiring the image, including: acquiring the image in response to a trigger operation on the first control.

[0286] The first control may correspond to the quality detection 105, image optimization 106, quality detection 207 or image optimization 208 mentioned above. Figure 1 The interface shown in d or Figure 2 The first control can also be located at Figure 1 The interface shown in c or Figure 2 The interface shown in e in FIG. is not specifically limited here.

[0287] In this way, image quality detection can be triggered in the gallery application, or image optimization can be performed based on the image quality detection result.

[0288] In a possible implementation, acquiring the image includes: acquiring the image when the electronic device is in an idle scene.

[0289] The electronic device can confirm whether it is in an idle scene by a preset time period or any method (for example, load usage, power usage, etc.). The preset time period can be from 24:00 to 6:00 or any time period, which is not specifically limited here.

[0290] In a possible implementation manner, the method further includes: when the image does not include the target object, the first detection result is a detection result of the image.

[0291] In this way, when the target object is not included, the first detection result is output.

[0292] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.

[0293] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0294] The image quality detection method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above method.

[0295] The image quality detection method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.

[0296] An embodiment of the present application provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the above method.

[0297] The embodiment of the present application provides a chip or chip system. The chip or chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the electronic device to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments, and will not be repeated here.

[0298] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the above method. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0299] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.

[0300] An embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program code is executed, the computer executes the above method.

[0301] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0302] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.

Claims

1. An image quality detection method, characterized in that: include: Get the image; Detecting the quality of the image to obtain a first detection result; In the case where the image includes a target object, extracting features of the target object in the image to obtain N first images, any one of the first images includes a preset feature of the target object, where N is an integer greater than 0; Detecting the qualities of the N first images to obtain N second detection results; The first detection result and the N second detection results are weighted to obtain a detection result of the image.

2. The method according to claim 1, characterized in that When weighted processing is performed on the first detection result and the N second detection results, the N second detection results have their own weights. For any one of the N second detection results, the weight of any one of the second detection results is positively correlated with the influence of preset features included in the target image on the quality of the image. The target image is the first image corresponding to any one of the second detection results among the N first images.

3. The method according to claim 1 or 2, characterized in that: Detecting the quality of the N first images to obtain N second detection results includes: The quality of the N first images is detected by a pre-trained image quality assessment network to obtain N second detection results.

4. The method according to claim 3, characterized in that The method of detecting the quality of the N first images by using a pre-trained image quality evaluation network to obtain N second detection results includes: Performing expansion processing on the N first images to obtain N expanded first images, wherein the size of each of the expanded first images is greater than or equal to a preset size; The quality of each of the expanded first images is detected by a pre-trained image quality assessment network to obtain the N second detection results.

5. The method according to any one of claims 1 to 4, characterized in that: In the case where the image includes a target object, a brightness detection result of the target object is also obtained; The weighted processing of the first detection result and the N second detection results to obtain the detection result of the image includes: The brightness detection result, the first detection result and the N second detection results are weighted to obtain a detection result of the image.

6. The method according to claim 5, characterized in that The weight of the brightness detection result is positively correlated with the influence of the brightness of the target object on the quality of the image.

7. The method according to claim 6, characterized in that The N is 1, The detection result of the image satisfies: the detection result of the image=the first detection result*(first weight coefficient*first value+second weight coefficient*second value); The first weight coefficient satisfies: The second weight coefficient satisfies: The first value is positively correlated with the influence of the preset features included in the first image on the quality of the image; and the second value is positively correlated with the influence of the brightness of the target object on the quality of the image.

8. The method according to any one of claims 5 to 7, characterized in that: The method further comprises: In the case where the image includes a target object, extracting features of the target object in the image by an image segmentation algorithm to obtain a second image; The brightness of the second image is detected to obtain the brightness detection result.

9. The method according to claim 8, characterized in that The step of extracting features of the target object in the image by using an image segmentation algorithm to obtain a second image includes: The second image is obtained by extracting features of the target object in the image through the image segmentation algorithm and by adopting a margin expansion method.

10. The method according to claim 8 or 9, characterized in that: The brightness detection result is related to a brightness mean, and the brightness mean is an average value of the brightness of each pixel in the second image; The quality of the second image indicated by the brightness detection result is positively correlated with a fourth value, and the fourth value is the absolute value of the difference between the brightness mean value and a brightness threshold value.

11. The method according to claim 10, characterized in that The brightness threshold is 127, and the brightness detection result includes: a first score, and the quality of the second image indicated by the first score is positively correlated with the first score; exist In the case of Positive correlation: In the case of Positive correlation is the brightness mean.

12. The method according to any one of claims 1 to 11, characterized in that: The value range of the first detection result, the value range of the N second detection results, and the value range of the brightness detection result are the same.

13. The method according to any one of claims 1 to 12, characterized in that: After obtaining the detection result of the image, the method further includes: The detection result of the image is displayed, and / or the image is optimized based on the detection result to obtain an optimized image.

14. The method according to claim 13, characterized in that Before acquiring the image, the method further includes: In response to the photo-taking operation, displaying a first interface, the first interface including: a thumbnail of the image; The displaying of the detection result of the image includes: A second interface is displayed, wherein the second interface includes: a thumbnail of the image and a detection result of the image.

15. The method according to any one of claims 1 to 14, characterized in that: Before obtaining the first detection result, the method further includes: Displaying an interface of a gallery application, wherein the interface displays the image and a first control; The acquiring of the image includes: acquiring the image in response to a triggering operation on the first control.

16. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 15.

17. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes any one of the methods described in claims 1 to 15.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method as claimed in any one of claims 1 to 15.

19. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Image quality evaluation method and device, storage medium and electronic equipment

    CN111401324A

  • Image quality evaluation method and device, equipment and storage medium

    CN113724196A

  • Medical image quality control method and device and electronic device

    CN116012324A

  • Image quality detection method and related device, electronic equipment and storage medium

    CN116630237A

  • Quality assessment of a video

    US20200226740A1