Method and device for analyzing image quality abnormity and electronic equipment
Through deep learning technology combined with traditional algorithms, the obstruction, screen, blurred and light and dark areas in the camera image are identified and judged, which solves the problem of poor image quality detection effect under changing background environments in the prior art, and achieves high accuracy and Easy-to-deploy image quality detection.
Patent Information
- Application Number
- CN202410913068.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing image quality detection methods cannot maintain high-quality detection effects when facing a changing background environment, resulting in difficult time discovering and processing camera image quality problems.
Deep learning technology combined with traditional algorithms, by obtaining pictures of open scenes, calculating overdark values and overdark values, and inputting the pictures into the deep learning detection network for identification, using feature extraction networks and classification networks to judge occlusion, screens, blur and light and dark Area, combined with weighting processing, output image quality judgment results.
Maintaining high-quality detection results in a changing background environment improves the accuracy and generalization of image quality detection, simplifies device deployment, and enhances applicability and promotion in edge scenarios.
Smart Images

Figure CN118887518A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a method, device and electronic device for analyzing image quality abnormalities. Background Art
[0002] In open scenarios, cameras are deployed in a wide range and in large numbers. Once there is a problem with the image quality, it means that the point cannot be monitored normally. If we simply rely on manual repeated daily checks to see if the cameras are normal, it will take a lot of time to manually check a large number of cameras. Secondly, the image quality problems of cameras are often irregular and sudden. Manual inspections are unable to detect camera problems and deal with them in a timely manner, which may cause the cameras to be in an abnormal state for a long time.
[0003] Open scenes are scenes with complex environments and diverse backgrounds. Image quality detection is a way to improve camera utilization. In recent years, with the rapid development of smart cameras and smart systems, camera image inspection has gradually evolved from manual inspection to smart monitoring and smart alarms, and alarms are triggered when abnormal images are detected. This method can quickly and efficiently cover a variety of development scenarios at the same time.
[0004] At present, the main methods of image quality detection are mainly based on the traditional algorithm to calculate the change of pixel value: the pixel calculation method, by manually setting the threshold, and then calculating the average pixel value of the entire image to determine whether it is too dark or too bright. Or separate the chromaticity diagram of the image and analyze the histogram distribution of the chromaticity diagram to determine whether it is blurred or distorted. Occlusion is determined by the size of the black connected area of the image. However, the existing image quality detection methods cannot maintain high-quality detection results when facing an environment with a changing background. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device and electronic device for analyzing image quality abnormalities, so as to solve the problem that the existing image quality detection method cannot maintain high-quality detection effect when facing an environment with a changing background.
[0006] In a first aspect, the present invention provides a method for analyzing image quality abnormality, comprising:
[0007] Get an image of an open scene;
[0008] Calculating an overly dark value and an overly bright value for the image;
[0009] Input the image into a deep learning detection network to identify the occluded area in the image; input the occluded area into a feature extraction network to extract features; compare the extracted features with the occlusion database to obtain an occluded area judgment result;
[0010] The image is input into a deep learning detection network to identify the distorted screen area and the blurred area in the image; the distorted screen area and the blurred area are input into a classification network for judgment to obtain judgment results of the distorted screen area and the blurred area;
[0011] Input the image into a deep learning detection network to identify overly dark areas and overly bright areas in the image; input the overly dark areas and overly bright areas into a classification network for judgment to obtain overly dark areas and overly bright areas judgment results; perform weighted processing on the overly dark areas and overly bright areas judgment results with overly dark values and overly bright values, respectively, to obtain final overly dark areas and overly bright areas judgment results;
[0012] The image quality judgment result of the current picture is output according to the judgment result of the blocked area, the judgment result of the flowery screen area and the blurred area, and the final judgment result of the too dark area and the too bright area.
[0013] Further, the image is input into a deep learning detection network to identify the occluded area in the image; the occluded area is input into a feature extraction network to extract features; the extracted features are compared with the occlusion database to obtain the occluded area judgment result, including:
[0014] Input the image into a deep learning detection network to detect and return the position of occluders in the image;
[0015] According to the detection and position returned results, intercept the occlusion image;
[0016] Calculating the area of the occlusion image;
[0017] Determining whether the area of the obstruction image is greater than a preset area threshold;
[0018] If the area of the occlusion image is greater than a preset area threshold, inputting the occlusion area into a feature extraction network for feature extraction;
[0019] Compare the extracted features with the occlusion database and calculate the similarity between the extracted features and the features in the occlusion database;
[0020] Determining whether the similarity is greater than a preset similarity threshold;
[0021] If the similarity is greater than a preset similarity threshold, the occlusion area determination result is outputted as the camera is being occluded.
[0022] Further, the image is input into a deep learning detection network to identify the distorted screen area and the blurred area in the image; the distorted screen area and the blurred area are input into a classification network for judgment, and the judgment results of the distorted screen area and the blurred area are obtained, including:
[0023] Decomposing the image into an HSV image;
[0024] According to the HSV diagram, a DFT spectrum diagram is obtained for the chrominance component H;
[0025] Obtaining the number of abnormal bright spots according to the DFT spectrum diagram;
[0026] Determine whether the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold;
[0027] If the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold, the outputted result of the flowery screen area determination is that a flowery screen occurs.
[0028] Further, the image is input into a deep learning detection network to identify the distorted screen area and the blurred area in the image; the distorted screen area and the blurred area are input into a classification network for judgment to obtain the judgment results of the distorted screen area and the blurred area, and further includes:
[0029] dividing the image into a plurality of regions;
[0030] Calculate the contrast of each area using the formula: contrast = (max-min) / max, where max is the maximum pixel value and min is the minimum pixel value;
[0031] Calculate the average value of contrast in all regions as blur ratio;
[0032] Determining whether the blur rate is greater than a preset blur rate threshold;
[0033] If the blur rate is greater than a preset blur rate threshold, a blur region determination result is output as blurring.
[0034] Further, the image is input into a deep learning detection network to identify overly dark areas and overly bright areas in the image; the overly dark areas and overly bright areas are input into a classification network for judgment to obtain overly dark areas and overly bright areas judgment results; the overly dark areas and overly bright areas judgment results are weighted with overly dark values and overly bright values respectively to obtain final overly dark areas and overly bright areas judgment results, including:
[0035] Use the YOLOv8 deep learning detection network to detect the dark and bright areas in the image respectively;
[0036] Respectively cropping the overly dark area and the overly bright area in the image;
[0037] Use the ResNet18 classification network to classify the cropped area and obtain the probability of the area;
[0038] The probability, the too dark value and the too bright value are weighted to calculate a comprehensive value;
[0039] Determine whether the comprehensive value is greater than a preset comprehensive value threshold;
[0040] If the comprehensive value is greater than the preset comprehensive value threshold, the final judgment result of the too dark area and the too bright area is output.
[0041] Furthermore, the method further comprises:
[0042] Determine whether a certain abnormal image category information appears in N consecutive frames, where N is a positive integer;
[0043] If a certain abnormal image category information appears in N consecutive frames, determine whether the interval alarm time has been reached;
[0044] If the interval alarm time is reached, an abnormal image quality alarm will be issued.
[0045] In a second aspect, the present invention provides a device for analyzing image quality abnormalities, comprising:
[0046] An acquisition unit, used to acquire pictures of open scenes;
[0047] A calculation unit, used for calculating an over-darkness value and an over-brightness value for the image;
[0048] The first judgment unit is used to input the image into a deep learning detection network to identify the occluded area in the image; input the occluded area into a feature extraction network to extract features; compare the extracted features with the occlusion database to obtain an occluded area judgment result;
[0049] The second judgment unit is used to input the picture into a deep learning detection network to identify the distorted screen area and the blurred area in the picture; input the distorted screen area and the blurred area into a classification network for judgment to obtain the judgment results of the distorted screen area and the blurred area;
[0050] The third judgment unit is used to input the image into the deep learning detection network to identify the too dark area and the too bright area in the image; input the too dark area and the too bright area into the classification network for judgment to obtain the judgment results of the too dark area and the too bright area; and perform weighted processing on the judgment results of the too dark area and the too bright area with the too dark value and the too bright value respectively to obtain the final judgment results of the too dark area and the too bright area;
[0051] The output unit is used to output the image quality judgment result of the current picture according to the judgment result of the occluded area, the judgment result of the flower screen area and the blurred area, and the final judgment result of the too dark area and the too bright area.
[0052] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0053] Beneficial effects of the present invention: The method, device and electronic device for analyzing abnormal image quality provided by the present invention obtain a picture of an open scene; calculate the too dark value and the too bright value of the picture; input the picture into a deep learning detection network to identify the occluded area in the picture; input the occluded area into a feature extraction network for feature extraction; compare the extracted features with the occlusion database to obtain the occlusion area judgment result; input the picture into a deep learning detection network to identify the flower screen area and the blurred area in the picture; input the flower screen area and the blurred area into a classification network for judgment, and obtain the flower screen area and the blurred area judgment result; input the picture into a deep learning The detection network identifies the overly dark and overly bright areas in the image; the overly dark and overly bright areas are input into the classification network for judgment to obtain the judgment results of the overly dark and overly bright areas; the judgment results of the overly dark and overly bright areas are weighted with the overly dark value and the overly bright value respectively to obtain the final judgment results of the overly dark and overly bright areas; according to the judgment results of the occluded area, the judgment results of the flowery screen area and the blurred area, and the final judgment results of the overly dark and overly bright areas, the image quality judgment result of the current image is output; the present invention adopts a strategy of combining deep learning with traditional algorithms, and can still maintain high-quality detection effects when facing an environment with a changing background. Different deep learning methods are used in combination with different anomaly categories to ensure generalization and accuracy in different scenarios. A deep learning method that is easier to deploy is adopted, which is easier to use in edge adaptation and device deployment, and has greater promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings are only provided for reference and illustration and are not intended to limit the present invention.
[0055] In the accompanying drawings,
[0056] Figure 1 A flowchart of a method for analyzing image quality abnormalities according to the present invention;
[0057] Figure 2 is a flow chart of an exemplary implementation of S103;
[0058] Figure 3 is a flowchart of an exemplary implementation of S104;
[0059] Figure 4 A flowchart of another exemplary embodiment of S104
[0060] Figure 5 Schematic diagram of a flower screen scene, where (a) is a schematic diagram of local noise points, and (b) is a schematic diagram of a black screen;
[0061] Figure 6 Schematic diagram of blurry scene, where (a) is a local blur diagram, (b) is a dispersed blur diagram, and (c) is a global blur diagram;
[0062] Figure 7 is a flow chart of an exemplary implementation of S105;
[0063] Figure 8 Schematic diagrams of scenes that are too dark or too bright, where (a) is a schematic diagram of a scene with relatively uniform brightness and darkness, and (b) is a schematic diagram of a scene with a large difference in black and white;
[0064] Fig. 9 Schematic diagram of the dark area detection frame;
[0065] Fig.10 A block diagram of a device for analyzing abnormal image quality according to the present invention;
[0066] Fig.11 It is a block diagram of an electronic device of the present invention. DETAILED DESCRIPTION
[0067] To further illustrate the technical means and effects of the present invention, the following is a detailed description in conjunction with the preferred embodiments of the present invention and the accompanying drawings.
[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0069] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or description". Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0070] See also Figure 1 The embodiment of the present invention provides a method for analyzing image quality abnormality, characterized by comprising:
[0071] S101, obtaining an image of an open scene.
[0072] Specifically, the present invention utilizes a camera in an open scene to collect an image of the current area.
[0073] S102, calculating an over-darkness value and an over-brightness value for the image.
[0074] Specifically, the too dark value of an image refers to the number or proportion of pixels in the image whose brightness value is lower than a certain threshold. This threshold can be set according to actual needs, for example, it can be dynamically adjusted according to the average brightness or maximum brightness of the image. The steps to calculate the too dark value are as follows: Convert the image to a grayscale image. Traverse each pixel in the grayscale image and calculate its brightness value. Compare the brightness value with the set threshold. If it is lower than the threshold, the pixel is considered to belong to the too dark area. Count the number or proportion of pixels in the too dark area.
[0075] Similar to calculating the over-dark value, the over-bright value of an image refers to the number or proportion of pixels in the image whose brightness value is higher than a certain threshold. Similarly, this threshold also needs to be set according to actual needs. The steps for calculating the over-bright value include: Converting the image to a grayscale image. Traversing each pixel in the grayscale image and calculating its brightness value. Comparing the brightness value with the set threshold, if it is higher than the threshold, the pixel is considered to belong to the over-bright area. Counting the number or proportion of pixels in the over-bright area.
[0076] S103, input the image into a deep learning detection network to identify the occluded area in the image; input the occluded area into a feature extraction network to extract features; compare the extracted features with the occlusion database to obtain the occluded area judgment result.
[0077] like Figure 2 As shown, specifically, the image is input into a deep learning detection network to identify the occluded area in the image; the occluded area is input into a feature extraction network to extract features; the extracted features are compared with the occlusion database to obtain the occluded area judgment result, including:
[0078] S1031, inputting the image into a deep learning detection network, detecting the occluders in the image and returning their positions;
[0079] S1032, capturing an image of the obstruction according to the detection and position return results;
[0080] S1033, calculating the area of the blocking object image;
[0081] S1034, determining whether the area of the blocking object image is greater than a preset area threshold;
[0082] S1035, if the area of the occlusion image is greater than a preset area threshold, inputting the occlusion area into a feature extraction network for feature extraction;
[0083] S1036, comparing the extracted features with the occlusion database, and calculating the similarity between the extracted features and the features in the occlusion database;
[0084] S1037, determining whether the similarity is greater than a preset similarity threshold;
[0085] S1038: If the similarity is greater than a preset similarity threshold, output an occlusion area determination result that the camera is being occluded.
[0086] The common method for occlusion is to convert the color image into grayscale, set the darker part as the foreground and the other part as the background, and if the ratio of the foreground object to the background object is greater than the threshold, it is considered an occlusion phenomenon. However, in actual situations, occlusion objects in open scenes are often objects such as telephone poles, billboards, road signs, branches, leaves, etc., not black objects or dark objects, so the generalization is not high.
[0087] The present invention overcomes this problem by using feature comparison technology. First, a large number of common obstructions are collected, and features are extracted and a feature library is established. Second, a detection network is used to detect common objects and return their positions when in use. After deducting the image, it is determined whether the obstruction object reaches a certain area size. If it does, feature extraction is performed and compared with the feature library. If the feature similarity is greater than 0.8, it means that the camera is being obstructed.
[0088] The present invention adopts a series of advanced steps based on deep learning and image processing. First, in step S1031, the image to be processed is input into a carefully trained deep learning detection network. This network uses advanced technologies such as convolutional neural network (CNN) to automatically identify and locate the occluders in the image, and return the precise location information of these occluders. The above steps not only improve the accuracy of detection, but also greatly reduce the burden of manual review. In step S1032, the image of the occluder is accurately intercepted from the original image using the location information obtained from the deep learning detection network. The above process ensures that the object of subsequent analysis is a pure occluder area, avoiding interference from background or other non-related information. In step S1033, the area of the intercepted occluder image is calculated. The calculation of the area is an important indicator for evaluating the degree of influence of the occluder on the field of view. By presetting an area threshold, it is possible to quickly determine in step S1034 whether the occluder is large enough to significantly affect the monitoring effect of the camera. If the area of the occluder exceeds the preset threshold, then in step S1035, the occluded area is further input into a feature extraction network. This network can automatically extract representative and distinguishing features such as shape, texture, edge, etc. from the occluder image. These features will provide key information for subsequent recognition and matching. In step S1036, the features extracted from the occluder image are compared with the features in the pre-established occlusion database. The occlusion database contains feature information of various known occluders. By calculating the similarity, the matching degree between the current occluder and the existing occluders in the database can be evaluated. Finally, in steps S1037 and S1038, a final judgment is made based on the comparison results of the similarity and the preset similarity threshold. If the similarity is greater than the threshold, it means that the current occluder is highly similar to a known occluder in the database, so the output occlusion area judgment result is that the camera is being blocked. The above process not only realizes the automatic detection and recognition of occluders, but also provides a timely alarm function, which is conducive to the rapid response and processing of the monitoring system. By combining deep learning and image processing technology, the present invention can achieve rapid and accurate detection and identification of obstructions, while reducing the need for manual intervention. In addition, the solution is also highly flexible and scalable, and can adapt to changes in different scenarios and needs, providing a strong guarantee for the stable operation of the monitoring system.
[0089] S104, input the image into a deep learning detection network to identify the distorted screen area and the blurred area in the image; input the distorted screen area and the blurred area into a classification network for judgment to obtain judgment results of the distorted screen area and the blurred area.
[0090] like Figure 3As shown, specifically, the picture is input into a deep learning detection network to identify the flower screen area and the blurred area in the picture; the flower screen area and the blurred area are input into a classification network for judgment, and the judgment results of the flower screen area and the blurred area are obtained, including:
[0091] S1041, decomposing the image into an HSV image;
[0092] S1042, obtaining a DFT spectrum diagram for the chrominance component H according to the HSV diagram;
[0093] S1043, obtaining the number of abnormal bright spots according to the DFT spectrum diagram;
[0094] S1044, determining whether the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold;
[0095] S1045: If the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold, a result of determining the distorted screen area is output as distorted screen occurrence.
[0096] In the image processing process, converting the image from the RGB color space to the HSV (Hue, Saturation, Value) color space is an important step. This method facilitates more direct analysis and processing of color-related characteristics, especially the hue component, which is independent of brightness and saturation and can more purely reflect the color information in the image.
[0097] In step S1041, the image is decomposed into an HSV graph. The above conversion process enables the hue, saturation and brightness components of the image to be focused on separately, laying the foundation for the subsequent analysis of hue. Hue is the position of color on the color wheel, which is critical for detecting abnormal changes in color distribution in an image. In step S1042, a discrete Fourier transform (DFT) is performed on the hue component H in the HSV graph to generate a spectrogram. DFT is a powerful mathematical tool that can convert a signal from the time domain or space domain to the frequency domain, thereby revealing the frequency components of the signal. In image processing, the DFT spectrogram can display the distribution of various frequency components in the image, including low frequencies representing the overall structure of the image and high frequencies representing the details and edges of the image. In step S1043, by analyzing the DFT spectrogram, the number of abnormal bright spots can be identified. These abnormal bright spots usually correspond to high-energy or high-contrast areas in the spectrogram, indicating color anomalies or noise in the image. The calculation of the number of abnormal bright spots can be based on criteria such as the number of bright spots in the spectrogram, brightness or energy thresholds. Step S1044 is a judgment process, comparing the calculated number of abnormal bright spots with the preset abnormal bright spot number threshold. This threshold is set according to the actual application scenario and the expected sensitivity, and is used to distinguish normal color changes from possible screen distortion. Finally, in step S1045, if the number of abnormal bright spots is greater than the preset threshold, the system outputs the judgment result of the screen distortion area, indicating that the screen distortion phenomenon has occurred in the image. Screen distortion is a common problem in image display, which may be caused by a variety of reasons, such as signal interference, hardware failure, or transmission error. Through this method, the screen distortion phenomenon can be detected in time, so that corresponding measures can be taken to repair or alarm, ensuring the quality and reliability of image display. The advantage of this scheme is that it combines the advantages of HSV color space analysis and DFT spectrum analysis, and can more accurately detect color anomalies in images. The HSV color space provides direct access to color characteristics, while the DFT spectrum analysis can reveal hidden frequency components and abnormal changes in the image. Through this method, image quality problems such as screen distortion can be effectively identified, and the accuracy and efficiency of image processing can be improved. However, in addition to the abnormal noise type, the screen distortion also includes Figure 5 The local noise and Figure 5 (b) The black screen shown in the figure cannot detect all the above screen distortion phenomena simply by using artificial threshold control.
[0098] Specifically, Figure 4 As shown, the picture is input into a deep learning detection network to identify the flower screen area and the blurred area in the picture; the flower screen area and the blurred area are input into a classification network for judgment to obtain the judgment results of the flower screen area and the blurred area, and also includes:
[0099] S1046, dividing the image into a plurality of regions;
[0100] S1047, calculating the contrast of each area, the formula is: contrast = (max-min) / max, max is the maximum pixel value, min is the minimum pixel value;
[0101] S1048, calculating the average value of the contrast of all regions as the blur ratio;
[0102] S1049, determining whether the blur rate is greater than a preset blur rate threshold;
[0103] S1050: If the blur rate is greater than a preset blur rate threshold, output a blur region determination result as blurring.
[0104] Specifically, fuzzy Figure 6 (a) shows the local blur, Figure 6 (b) shows the scattered blur, Figure 6 The global blur shown in (c) also cannot be controlled using the same threshold.
[0105] In the continuous process of image processing and analysis, step S1046 divides the image into several regions for more detailed evaluation of the local characteristics of the image. By dividing the entire image into several sub-regions, the characteristics of each region can be calculated and analyzed separately, so as to more accurately capture the local changes of the image. In step S1047, contrast is an important indicator for measuring image clarity, which reflects the degree of difference between light and dark regions in the image. The contrast calculation formula used here: contrast = (max-min) / max, where max represents the maximum value of the pixel value in the region and min represents the minimum value, simply and effectively quantifies this difference. The above calculation not only considers the absolute difference in pixel values, but also normalizes it by dividing by the maximum value, so that the contrast value is comparable between regions of different brightness. In step S1048, the average value of the contrast of all regions is calculated as the blur rate, which is an important step to aggregate local features to evaluate the overall image quality. The blur rate directly reflects the clarity of the image, that is, the degree of retention of detail information in the image. A lower blur rate means that the image is clearer overall, while a higher blur rate may indicate that there is significant blur in the image. In step S1049, the calculated blur rate is judged by a preset blur rate threshold, which is a key decision point to distinguish whether the image is blurred. This threshold is usually set according to the needs of the actual application and the expected quality of the image to ensure that the system can accurately identify the blurred image and respond accordingly. In step S1050, if the blur rate is greater than the preset blur rate threshold, the system outputs the blur area judgment result as blurring. The above judgment results are of great significance for a variety of application scenarios. For example, in a video surveillance system, timely discovery and reporting of image blur can prompt maintenance personnel to quickly troubleshoot equipment failures or adjust the camera position. The present invention can more carefully evaluate the local characteristics of the image by dividing the image into regions and calculating the contrast separately, thereby improving the accuracy of blur detection. At the same time, by judging by a preset blur rate threshold, the system can be flexibly adjusted according to different application scenarios and needs.
[0106] S105, input the image into a deep learning detection network to identify overly dark areas and overly bright areas in the image; input the overly dark areas and overly bright areas into a classification network for judgment to obtain overly dark areas and overly bright areas judgment results; weight the overly dark areas and overly bright areas judgment results with the overly dark value and the overly bright value, respectively, to obtain the final overly dark areas and overly bright areas judgment results.
[0107] S106, outputting an image quality judgment result of the current picture according to the occluded area judgment result, the distorted area and the blurred area judgment results, and the overly dark area and the overly bright area final judgment results.
[0108] like Figure 7 As shown, specifically, the image is input into a deep learning detection network to identify overly dark areas and overly bright areas in the image; the overly dark areas and overly bright areas are input into a classification network for judgment to obtain overly dark areas and overly bright areas judgment results; the overly dark areas and overly bright areas judgment results are weighted with overly dark values and overly bright values respectively to obtain overly dark areas and overly bright areas Final judgment results, including:
[0109] S1051, using the YOLOv8 deep learning detection network, detects the dark and bright areas in the image respectively;
[0110] S1052, respectively cropping the too dark area and the too bright area in the image;
[0111] S1053, using the ResNet18 classification network to classify the cropped area and obtain the probability of the area;
[0112] S1054, performing weighted processing on the probability, the too dark value, and the too bright value to calculate a comprehensive value;
[0113] S1055, determining whether the comprehensive value is greater than a preset comprehensive value threshold;
[0114] S1056: If the comprehensive value is greater than a preset comprehensive value threshold, output the final judgment result of the too dark area and the too bright area.
[0115] The current mainstream technology direction is to use traditional algorithms to judge images. For too dark, too bright, blurred, or blocked images, numerical calculation methods or statistical abnormal numerical methods are used to make simple data judgments. This method is not very generalizable. Once the background environment of the scene is changed, the effect will vary greatly. The common method for too dark or too bright is to calculate the mean value, which is more applicable in some scenarios, such as Figure 8 (a) shows a scene with relatively uniform brightness. Figure 8 In the scene with a large difference in black and white as shown in (b), the overall mean value is still lower than the set brightness threshold, resulting in a false alarm.
[0116] This invention adopts a method that combines traditional algorithms and deep learning to compensate for the false alarm problem of uneven light and dark scenes in the image. In this scenario, the detection network YOLOv8 is first used to detect the too dark or too bright areas. Here, an example is taken of an overly dark image. Fig. 9 As shown in the figure, after detecting the too dark area, the detection frame of the area is cropped, and the ResNet18 network is used for classification processing to obtain the probability of the area. Then the traditional algorithm is used to calculate the average pixel value of the image, and the weighted method is used to calculate whether it is an overly dark scene.
[0117] P = α * p_model + β * (p_cal < p_th), where α and β are weighting coefficients, with α defaulting to 0.8 and β to 0.2, and p_model, p_cal, and p_th are the probability of the classification model, the calculated pixel mean, and the pixel threshold respectively. When the comprehensive value P > 0.8, it is determined to be too dark.
[0118] Specifically, in order to effectively address the potentially too dark or too bright regions in the image, the present invention introduces a series of deep - learning - based image - processing steps. First, in step S1051, using the above - mentioned YOLOv8 deep - learning detection network, the picture is comprehensively scanned to respectively identify and locate the too dark regions and the too bright regions therein. With its excellent detection speed and accuracy, YOLOv8 can quickly and accurately complete the above tasks. Subsequently, in step S1052, precise cropping operations are performed on the detected too dark and too bright regions. The above steps are to focus attention on the problem areas and remove irrelevant background information for more in - depth analysis later. By cropping, not only is the data processing volume reduced, but also the accuracy and efficiency of the analysis are improved. In step S1053, using the above - mentioned ResNet18 lightweight but efficient classification network, the cropped regions are classified. With its unique residual learning mechanism, ResNet18 can effectively extract image features and classify these features to obtain the probability that the region belongs to too dark or too bright. The above probability value reflects the network's judgment confidence in the illumination conditions of the region and provides an important basis for subsequent comprehensive evaluation. In step S1054, in order to obtain a more comprehensive and accurate evaluation result, the probability values obtained from the above classification, the too - dark values, and the too - bright values are weighted. The above process considers information from multiple dimensions and calculates a comprehensive value through reasonable weight allocation. The comprehensive value can more comprehensively reflect the actual situation of the too dark and too bright regions in the image. In step S1055, the comprehensive value is compared with a preset comprehensive - value threshold. The comprehensive - value threshold is set according to actual application requirements and image - quality requirements and is used to determine whether the too dark or too bright regions in the image have reached the degree that requires attention. In step S1056, if the comprehensive value is greater than the preset threshold, the final judgment results of the too dark regions and the too bright regions are output. The above results have important guiding significance for subsequent image - processing, optimization, or alarm operations. The entire process combines deep - learning detection and classification technologies to achieve automatic and intelligent identification and processing of the too dark and too bright regions in the image, with advantages such as high efficiency, accuracy, and flexibility, providing strong support for improving image quality and monitoring effects.
[0119] In this embodiment, the method also includes: determining whether a certain abnormal image category information appears in N consecutive frames, where N is a positive integer; if a certain abnormal image category information appears in N consecutive frames, determining whether an interval alarm time is reached; if the interval alarm time is reached, issuing an image quality abnormality alarm.
[0120] In order to effectively monitor and respond to abnormal changes in image quality, especially for the continuous appearance of a specific abnormal image category, the present invention adopts a dual judgment mechanism based on frame count and interval alarm time. The mechanism first focuses on whether the same abnormal image category information continues to appear in N consecutive frames of images, where N is a positive integer threshold set according to actual needs, which represents the system's sensitivity to the persistence of abnormalities. Through the above steps, the system can screen out those short-term and occasional abnormalities and focus on those image quality problems that may have a lasting impact on the monitoring effect. Once the system confirms that N consecutive frames of images all present the same abnormal image category information, it will further determine whether the preset interval alarm time has been reached since the last similar abnormal alarm. The interval alarm time is an important parameter, which is used to avoid repeated alarms for the same type of abnormality in a short period of time, thereby reducing unnecessary interference and false alarms. By setting a reasonable interval alarm time, the system can ensure timely response while maintaining the effectiveness and pertinence of the alarm information. If the system determines that the current abnormality not only appears in N consecutive frames, but also exceeds the interval alarm time since the last alarm, the system will automatically trigger an image quality abnormality alarm. The above alarm mechanism promptly notifies relevant personnel of image quality problems through sound, light signals or sending alarm information to the monitoring center so that they can quickly take measures to repair or adjust.
[0121] The advantages of this dual judgment mechanism are its efficiency and accuracy. By judging the number of consecutive frames, the system can screen out truly persistent image quality anomalies and avoid overreacting to short-term and occasional anomalies. At the same time, by setting the interval alarm time, the system can reduce unnecessary repeated alarms while ensuring timely response, thereby improving the effectiveness and pertinence of alarm information. In addition, the mechanism is also highly flexible and scalable, and can adjust parameters such as N value and interval alarm time according to different monitoring scenarios and needs to adapt to different monitoring requirements.
[0122] It can be seen from the above embodiments that the method for analyzing abnormal image quality provided by the present invention obtains a picture of an open scene; calculates the too dark value and the too bright value of the picture; inputs the picture into a deep learning detection network to identify the occluded area in the picture; inputs the occluded area into a feature extraction network for feature extraction; compares the extracted features with the occlusion database to obtain the occlusion area judgment result; inputs the picture into a deep learning detection network to identify the flower screen area and the blurred area in the picture; inputs the flower screen area and the blurred area into a classification network for judgment, and obtains the flower screen area and the blurred area judgment result; inputs the picture into the deep learning detection network , identify the overly dark areas and overly bright areas in the image; input the overly dark areas and overly bright areas into the classification network for judgment, and obtain the judgment results of the overly dark areas and overly bright areas; weight the judgment results of the overly dark areas and overly bright areas with the overly dark value and the overly bright value, respectively, to obtain the final judgment results of the overly dark areas and overly bright areas; output the image quality judgment result of the current image according to the judgment results of the occluded area, the judgment results of the flower screen area and the blurred area, and the final judgment results of the overly dark area and the overly bright area; the present invention adopts a strategy of combining deep learning with traditional algorithms, and can still maintain high-quality detection effects when facing an environment with a changing background. Different deep learning methods are used in combination with different anomaly categories to ensure generalization and accuracy in different scenarios. A deep learning method that is easier to deploy is adopted, which is easier to use in edge adaptation and device deployment, and has greater promotion.
[0123] See also Fig.10 , an embodiment of the present invention provides a device for analyzing abnormal image quality, comprising:
[0124] An acquisition unit 1001 is used to acquire a picture of an open scene;
[0125] A calculation unit 1002, configured to calculate an over-darkness value and an over-brightness value for the image;
[0126] The first judgment unit 1003 is used to input the image into a deep learning detection network to identify the occluded area in the image; input the occluded area into a feature extraction network to extract features; compare the extracted features with the occlusion database to obtain an occluded area judgment result;
[0127] The second judgment unit 1004 is used to input the image into a deep learning detection network to identify the distorted screen area and the blurred area in the image; input the distorted screen area and the blurred area into a classification network for judgment to obtain judgment results of the distorted screen area and the blurred area;
[0128] The third judgment unit 1005 is used to input the image into the deep learning detection network to identify the too dark area and the too bright area in the image; input the too dark area and the too bright area into the classification network for judgment to obtain the judgment results of the too dark area and the too bright area; and perform weighted processing on the judgment results of the too dark area and the too bright area with the too dark value and the too bright value respectively to obtain the final judgment results of the too dark area and the too bright area;
[0129] The output unit 1006 is used to output the image quality judgment result of the current picture according to the occlusion area judgment result, the distorted screen area and the blurred area judgment result, and the final judgment result of the too dark area and the too bright area.
[0130] See also Fig.11 The present invention provides an electronic device, comprising: a memory 100 and a processor 200, wherein the memory 100 stores a computer program, and when the computer program is executed by the processor 200, the processor 200 executes the steps of the above method.
[0131] The embodiment of the present invention further provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, some or all of the steps in each embodiment of the method for analyzing abnormal image quality provided by the present invention are implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0132] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0133] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the embodiment of the apparatus for analyzing abnormal image quality, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0134] The above-described embodiments of the present invention do not limit the protection scope of the present invention.
Claims
1. A method for analyzing image quality abnormality, characterized in that: include: Get an image of an open scene; Calculating an overly dark value and an overly bright value for the image; Inputting the image into a deep learning detection network to identify occluded areas in the image; Inputting the occluded area into a feature extraction network for feature extraction; Compare the extracted features with the occlusion database to obtain the occlusion area judgment result; The image is input into a deep learning detection network to identify the distorted screen area and the blurred area in the image; the distorted screen area and the blurred area are input into a classification network for judgment to obtain judgment results of the distorted screen area and the blurred area; Input the image into a deep learning detection network to identify overly dark areas and overly bright areas in the image; Inputting the too dark area and the too bright area into a classification network for judgment, and obtaining judgment results of the too dark area and the too bright area; The overly dark area and overly bright area judgment results are weighted with the overly dark value and the overly bright value respectively to obtain the final judgment results of the overly dark area and the overly bright area; The image quality judgment result of the current picture is output according to the judgment result of the blocked area, the judgment result of the flowery screen area and the blurred area, and the final judgment result of the too dark area and the too bright area.
2. The method for analyzing image quality abnormality according to claim 1, characterized in that: Inputting the image into a deep learning detection network to identify occluded areas in the image; Inputting the occluded area into a feature extraction network for feature extraction; Compare the extracted features with the occlusion database to obtain the occlusion area judgment results, including: Input the image into a deep learning detection network to detect and return the position of occluders in the image; According to the detection and position returned results, intercept the occlusion image; Calculating the area of the occlusion image; Determining whether the area of the obstruction image is greater than a preset area threshold; If the area of the occlusion image is greater than a preset area threshold, inputting the occlusion area into a feature extraction network for feature extraction; Compare the extracted features with the occlusion database and calculate the similarity between the extracted features and the features in the occlusion database; Determining whether the similarity is greater than a preset similarity threshold; If the similarity is greater than a preset similarity threshold, the occlusion area determination result is outputted as the camera is being occluded.
3. The method for analyzing image quality abnormality according to claim 2, characterized in that: Input the image into a deep learning detection network to identify the distorted area and the blurred area in the image; The distorted screen area and the fuzzy area are input into the classification network for judgment, and the judgment results of the distorted screen area and the fuzzy area are obtained, including: Decomposing the image into an HSV image; According to the HSV diagram, a DFT spectrum diagram is obtained for the chrominance component H; Obtaining the number of abnormal bright spots according to the DFT spectrum diagram; Determine whether the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold; If the number of abnormal bright spots is greater than a preset abnormal bright spot number threshold, the outputted result of the flowery screen area determination is that a flowery screen occurs.
4. The method for analyzing image quality abnormality according to claim 3, characterized in that: Input the image into a deep learning detection network to identify the distorted area and the blurred area in the image; The distorted screen area and the fuzzy area are input into a classification network for judgment, and the judgment results of the distorted screen area and the fuzzy area are obtained, and the method further includes: dividing the image into a plurality of regions; Calculate the contrast of each area using the formula: contrast = (max-min) / max, where max is the maximum pixel value and min is the minimum pixel value; Calculate the average value of contrast in all regions as blur ratio; Determining whether the blur rate is greater than a preset blur rate threshold; If the blur rate is greater than a preset blur rate threshold, a blur region determination result is output as blurring.
5. The method for analyzing image quality abnormality according to claim 4, characterized in that: Input the image into a deep learning detection network to identify overly dark areas and overly bright areas in the image; input the overly dark areas and overly bright areas into a classification network for judgment to obtain judgment results of overly dark areas and overly bright areas; The overly dark area and overly bright area judgment results are weighted with the overly dark value and the overly bright value respectively to obtain the overly dark area and overly bright area final judgment results, including: Use the YOLOv8 deep learning detection network to detect the dark and bright areas in the image respectively; Respectively cropping the overly dark area and the overly bright area in the image; Use the ResNet18 classification network to classify the cropped area and obtain the probability of the area; The probability, the too dark value and the too bright value are weighted to calculate a comprehensive value; Determine whether the comprehensive value is greater than a preset comprehensive value threshold; If the comprehensive value is greater than the preset comprehensive value threshold, the final judgment result of the too dark area and the too bright area is output.
6. The method for analyzing image quality abnormality according to claim 5, characterized in that: The method further comprises: Determine whether a certain abnormal image category information appears in N consecutive frames, where N is a positive integer; If a certain abnormal image category information appears in N consecutive frames, determine whether the interval alarm time has been reached; If the interval alarm time is reached, an abnormal image quality alarm will be issued.
7. A device for analyzing image quality abnormalities, characterized in that: include: An acquisition unit, used to acquire pictures of open scenes; A calculation unit, used for calculating an over-darkness value and an over-brightness value for the image; A first judgment unit is used to input the image into a deep learning detection network to identify the occluded area in the image; Inputting the occluded area into a feature extraction network for feature extraction; Compare the extracted features with the occlusion database to obtain the occlusion area judgment result; A second judgment unit is used to input the picture into a deep learning detection network to identify a distorted screen area and a blurred area in the picture; Input the distorted screen area and the fuzzy area into a classification network for judgment, and obtain judgment results of the distorted screen area and the fuzzy area; A third judgment unit is used to input the image into a deep learning detection network to identify overly dark areas and overly bright areas in the image; Inputting the too dark area and the too bright area into a classification network for judgment, and obtaining judgment results of the too dark area and the too bright area; The overly dark area and overly bright area judgment results are weighted with the overly dark value and the overly bright value respectively to obtain the final judgment results of the overly dark area and the overly bright area; The output unit is used to output the image quality judgment result of the current picture according to the judgment result of the occluded area, the judgment result of the flower screen area and the blurred area, and the final judgment result of the too dark area and the too bright area.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.
