Fuzzy evaluation method based on image gradient analysis in gun dome safety supervision scene
By adopting a fuzzy evaluation method based on image gradient analysis in the gun ball safety monitoring scenario, the problem of high false alarm rate caused by image blur is solved, and the effect of improving the accuracy and reliability of the intelligent identification system of the safety monitoring is achieved.
Patent Information
- Application Number
- CN202411717501.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-21
AI Technical Summary
In the gun ball safety monitoring scenario, the high false alarm rate caused by image blurring is high, which brings challenges to the accuracy and reliability of the intelligent identification system.
The fuzzy evaluation method based on image gradient analysis is used to calculate the noise ratio and the edge ratio of the scenery in the image, and comprehensively evaluate the image quality, thereby screening out high-quality images.
It effectively reduces the misjudgment rate, improves the accuracy and reliability of the intelligent identification system of security monitoring, and optimizes image acquisition and processing strategies, saving computing resources.
Smart Images

Figure CN119671956A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of safety and surveillance identification, and specifically is a fuzzy evaluation method based on image gradient analysis in a gun and ball safety and surveillance scene. Background Art
[0002] With the rapid development of computer vision and artificial intelligence, intelligent image recognition plays an important role in many applications, such as face recognition, object detection, image classification, etc. Intelligent recognition can be performed by using the gun-ball linkage surveillance camera, which can not only take the overall situation into consideration, but also capture details with the ball camera. However, the quality of the image is crucial to the accuracy and robustness of these detection tasks. The ball camera captures the details of the target by rotating and focusing, but in this process, the picture is prone to blurry image quality, or other situations, such as light intensity, target movement, etc., will cause the image to lose clarity and details, which is not conducive to intelligent recognition.
[0003] In the safety supervision intelligent identification system, it is very important to intelligently identify safety issues such as whether the workers are wearing safety helmets, work clothes, and protective masks. However, blurred images caused by various factors are most likely to cause false alarms. Through long-term statistical analysis of video detection data, the proportion of blurred images in false alarms of not wearing safety helmets, not wearing work clothes, and not wearing protective masks is 85.49%, 72.74%, and 53.74%, respectively, which poses a severe challenge to the accuracy and reliability of the system. Therefore, there is an urgent need for a fuzziness evaluation algorithm to define image quality, so as to more effectively protect the personal safety of workers. Summary of the invention
[0004] The purpose of the present invention is to address the above-mentioned problems and propose a fuzzy evaluation method based on image gradient analysis in a gun and ball safety monitoring scenario. In order to avoid the incorrect recognition of the intelligent safety monitoring system caused by image blur, the present invention proposes a very reliable image fuzzy evaluation method, which takes into account the total pixel ratio of the image noise point on the one hand, and the total noise ratio of the edge scenery in the image on the other hand, so as to fully judge the quality of the image.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a fuzzy evaluation method based on image gradient analysis in a gun and ball safety monitoring scenario, specifically comprising the following steps:
[0006] Step 1: Preprocess the images taken by the gun and ball safety inspection, and convert the RGB images into grayscale images to highlight the brightness and contrast of the images;
[0007] Step 2: Use a 3×3 window to traverse all pixels in the grayscale image and calculate the grayscale difference between the maximum and minimum values in each window area;
[0008] Step 3: Count the grayscale differences of the 3×3 regions in the image and define them separately. When the difference in the statistical region is greater than 18, it is recorded as an abrupt point; when the difference in the statistical region is greater than 18 and less than 86, it is recorded as a noise point; when the difference in the statistical region is greater than 86, it is recorded as an edge point of the scene;
[0009] Step 4: Calculate the grayscale image noise ratio and scene edge ratio, and comprehensively evaluate the image quality based on these two indicators.
[0010] Specifically, in step 1, the gray value formula is used to map the RGB pixel values in the image to gray values. The mathematical conversion formula is:
[0011] Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j)
[0012] Among them, Gray(i,j) is the gray value of the converted image pixel in the i-th row and j-th column, and R, G, and B are the values of the red, green, and blue components of the input image pixel respectively;
[0013] Specifically, in step 2, the position of each pixel area in the grayscale image is traversed to calculate the maximum and minimum grayscale values. The specific contents include:
[0014] Use a 3×3 sliding window to traverse every position of the grayscale image, the total number is recorded as num, and calculate the difference between the maximum and minimum values of each pixel in the area dif(i,j), which symbolizes the regional gradient:
[0015] num=(h-2)*(w-2)
[0016]
[0017] Among them, h represents the height of the grayscale image, w represents the width of the grayscale image, i and j represent the pixels in the i-th row and j-th column of the grayscale image, respectively, and x i,j Represents the pixel value of the i-th row and j-th column in the grayscale image;
[0018] Specifically, in step 3, the pixel difference values of the grayscale image area traversed by the sliding window are counted, and different categories are defined and divided according to different statistical values:
[0019] S31: The area where the difference dif(i,j) is greater than 18 is recorded as an abrupt area, and the number of abrupt areas dif_n in the grayscale image is counted. The mathematical relationship is as follows:
[0020]
[0021] Among them, dif_judge(i,j) determines whether there is an abrupt point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0022] S32: The area where the difference is greater than 18 and less than 86 is recorded as the noise area, and the number of noise areas in the grayscale image is counted as noise_n. The mathematical relationship is as follows:
[0023]
[0024] Among them, noise_judge(i,j) judges whether there is a noise area in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0025] S33: The area where the difference is greater than 86 is recorded as the scene edge point, and the number of scene edge points edge_n in the grayscale image is counted. The mathematical relationship is as follows:
[0026]
[0027] Among them, edge_n(i,j) determines whether there is a scene edge point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0028] Specifically, in step 4, the blur and clarity of the image are determined according to the noise ratio and the scene edge ratio, and the image quality is comprehensively judged based on these two values:
[0029] S41: Calculate the noise ratio noise_rate of the grayscale image. The ratio value represents the degree of image blur caused by noise factors. The mathematical relationship is as follows:
[0030]
[0031] S42: Calculate the edge ratio edge_rate of the grayscale image. The ratio value represents the clarity of the scene in the image. The mathematical relationship is as follows:
[0032]
[0033] S43: The image quality is comprehensively judged based on the noise_rate and edge_rate numerical indicators. The mathematical relationship of the judgment method is as follows:
[0034]
[0035] Among them, evaluation represents the image quality. When the image quality is judged as bad, it means that the image quality is poor and is not suitable for intelligent recognition, and it is easy to make mistakes. When the image quality is judged as good, it means that the image quality is good and is suitable for intelligent recognition for task detection.
[0036] Beneficial effects of the present invention
[0037] 1. Judging the image quality of the safety supervision intelligent recognition system input by image fuzziness and judging the image fuzziness will help to screen out high-quality images with low fuzziness and improve the accuracy and reliability of safety supervision intelligent recognition;
[0038] 2. By monitoring and evaluating image ambiguity, optimizing image acquisition and processing strategies, and excluding images with high ambiguity from the recognition and detection process, the false positive rate is reduced and the accuracy and reliability of the system are improved;
[0039] 3. The evaluation method takes into account the noise ratio and scene edge ratio of the grayscale image, comprehensively analyzes the blur and clarity of the image, and makes a more accurate evaluation of the image quality;
[0040] 4. In large-scale safety inspection and recognition applications, evaluating and screening a large number of images is a heavy task that requires a lot of computing resources. Based on the image fuzziness evaluation method, images with higher clarity are processed first, thereby saving computing resources and improving the processing efficiency of image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a logic flow chart of the present invention.
[0042] Figure 2 This is a fuzzy human body image collected by the system in Example 1.
[0043] Figure 3 Schematic diagram of the human body image and its fuzzy evaluation result in Example 1.
[0044] Figure 4 This is a fuzzy head image collected by the system in Example 2.
[0045] Figure 5 Schematic diagram of the head image and its fuzzy evaluation result in Example 2.
[0046] Figure 6 This is the Python implementation code of the image blur evaluation method of the present invention. DETAILED DESCRIPTION
[0047] The present invention will be further described below in conjunction with embodiments, but the protection scope of the present invention is not limited thereto:
[0048] Combination Figure 1 A fuzzy evaluation method based on image gradient analysis in a gun and ball safety monitoring scenario specifically includes the following steps:
[0049] Step 1: Preprocess the images taken by the gun and ball safety inspection, and convert the RGB images into grayscale images to highlight the brightness and contrast of the images;
[0050] Step 2: Use a 3×3 window to traverse all pixels in the grayscale image and calculate the grayscale difference between the maximum and minimum values in each window area;
[0051] Step 3: Count the grayscale differences of the 3×3 regions in the image and define them separately. When the difference in the statistical region is greater than 18, it is recorded as an abrupt point; when the difference in the statistical region is greater than 18 and less than 86, it is recorded as a noise point; when the difference in the statistical region is greater than 86, it is recorded as an edge point of the scene;
[0052] Step 4: Calculate the grayscale image noise ratio and scene edge ratio, and comprehensively evaluate the image quality based on these two indicators.
[0053] Specifically, in step 1, the gray value formula is used to map the RGB pixel values in the image to gray values. The mathematical conversion formula is:
[0054] Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j)
[0055] Among them, Gray(i,j) is the gray value of the converted image pixel in the i-th row and j-th column, and R, G, and B are the values of the red, green, and blue components of the input image pixel respectively;
[0056] Specifically, in step 2, the position of each pixel area in the grayscale image is traversed to calculate the maximum and minimum grayscale values. The specific contents include:
[0057] Use a 3×3 sliding window to traverse every position of the grayscale image, the total number is recorded as num, and calculate the difference between the maximum and minimum values of each pixel in the area dif(i,j), which symbolizes the regional gradient:
[0058] num=(h-2)*(w-2)
[0059]
[0060] Among them, h represents the height of the grayscale image, w represents the width of the grayscale image, i and j represent the pixels in the i-th row and j-th column of the grayscale image, respectively, and x i,j Represents the pixel value of the i-th row and j-th column in the grayscale image;
[0061] Specifically, in step 3, the pixel difference values of the grayscale image area traversed by the sliding window are counted, and different categories are defined and divided according to different statistical values:
[0062] S31: The area where the difference dif(i,j) is greater than 18 is recorded as an abrupt area, and the number of abrupt areas dif_n in the grayscale image is counted. The mathematical relationship is as follows:
[0063]
[0064] Among them, dif_judge(i,j) determines whether there is an abrupt point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0065] S32: The area where the difference is greater than 18 and less than 86 is recorded as the noise area, and the number of noise areas in the grayscale image is counted as noise_n. The mathematical relationship is as follows:
[0066]
[0067]
[0068] Among them, noise_judge(i,j) judges whether there is a noise area in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0069] S33: The area where the difference is greater than 86 is recorded as the scene edge point, and the number of scene edge points edge_n in the grayscale image is counted. The mathematical relationship is as follows:
[0070]
[0071] Among them, edge_n(i,j) determines whether there is a scene edge point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
[0072] Specifically, in step 4, the blur and clarity of the image are determined according to the noise ratio and the scene edge ratio, and the image quality is comprehensively judged based on these two values:
[0073] S41: Calculate the noise ratio noise_rate of the grayscale image. The ratio value represents the degree of image blur caused by noise factors. The mathematical relationship is as follows:
[0074]
[0075] S42: Calculate the edge ratio edge_rate of the grayscale image. The ratio value represents the clarity of the scene in the image. The mathematical relationship is as follows:
[0076]
[0077] S43: The image quality is comprehensively judged based on the noise_rate and edge_rate numerical indicators. The mathematical relationship of the judgment method is as follows:
[0078]
[0079] Among them, evaluation represents the image quality. When the image quality is judged as bad, it means that the image quality is poor and is not suitable for intelligent recognition, and it is easy to make mistakes. When the image quality is judged as good, it means that the image quality is good and is suitable for intelligent recognition for task detection.
[0080] When the safety supervision intelligent recognition system identifies whether workers in the work area are wearing work clothes, helmets and other safety compliance behaviors, it inputs poor quality images, such as Figure 2 , Figure 4 The human body image and head image shown cannot accurately determine whether the workers are wearing work clothes and helmets. Considering that the input image with poor image quality greatly affects the intelligent recognition effect and recognition speed, the present invention evaluates the image quality based on the fuzziness evaluation algorithm, thereby realizing the intelligent filtering and recognition of the input image. Therefore, when the safety supervision intelligent recognition system includes the fuzzy evaluation method based on image gradient analysis of the present invention (the Python part of the implementation code of the image fuzziness evaluation method of the present invention is as follows Figure 6 As shown), it can automatically identify the blurriness of the input image and make judgments such as Figure 3 , Figure 5 The results shown (and screened out) make it easier for the safety supervision intelligent recognition system to prioritize processing of images with higher definition, thereby saving computing resources and improving the processing efficiency of image recognition.
[0081] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
Claims
1. A fuzzy evaluation method based on image gradient analysis in the gun and ball safety monitoring scene, characterized in that It includes the following steps: Step 1: Preprocess the images taken by the gun and ball safety inspection and convert the RGB images into grayscale images; Step 2: The window traverses all the pixels in the grayscale image and calculates the grayscale difference between the maximum and minimum values in each window area; Step 3: Count the grayscale differences in the window area of the image and define them separately: abrupt points, noise points, and edge points; Step 4: Calculate the grayscale image noise ratio and scene edge ratio, and comprehensively evaluate the image quality based on these two indicators.
2. The method according to claim 1, characterized in that In step 1, the RGB pixel values in the image are mapped to grayscale values using the following formula: Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j) Among them, Gray(i,j) is the grayscale value of the converted image pixel in the i-th row and j-th column, R, G, and B are the values of the red, green, and blue components of the input image pixel respectively, and (i,j) is the image pixel in the i-th row and j-th column.
3. The method according to claim 1, characterized in that In step 2, a 3×3 sliding window is selected, and the grayscale difference dif(i,j) between the maximum and minimum values in each window area is calculated by the following formula: Among them, h represents the height of the grayscale image, w represents the width of the grayscale image, i and j represent the pixels in the i-th row and j-th column of the grayscale image, respectively, and x i,j Represents the pixel value of the i-th row and j-th column in the grayscale image.
4. The method according to claim 1, characterized in that In step 3, for the 3×3 sliding window, when the statistical area difference is greater than 18, the position is recorded as an abrupt point; when the statistical area difference is greater than 18 and less than 86, the position is recorded as a noise point; when the statistical area difference is greater than 86, the position is recorded as an edge point of the scene.
5. The method according to claim 4, characterized in that The abrupt points, noise points, and edge points are determined by the following formula: S31: Among them, dif_judge(i,j) determines whether there is an abrupt point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0; S32: Among them, noise_judge(i,j) determines whether there is a noise area in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0; S33: Among them, edge_n(i,j) determines whether there is a scene edge point in the 3×3 window starting from the i-th row and j-th column in the grayscale image. If yes, it is 1; otherwise, it is 0.
6. The method according to claim 5, characterized in that The number of abruptness, noise, and edge points in the grayscale image is counted by the following formula: Among them, h represents the height of the grayscale image, w represents the width of the grayscale image, dif_n represents the number of abrupt areas in the grayscale image; noise_n represents the number of noise areas in the grayscale image; edge_n represents the number of edge points of the scene in the grayscale image.
7. The method according to claim 1, characterized in that Step 4 specifically includes: S41: Calculate the noise ratio noise_rate of the grayscale image by the following formula: Wherein, num=(h-2)*(w-2), num represents the number of 3×3 sliding windows; S42: Calculate the scene edge ratio edge_rate of the grayscale image by the following formula: S43: Based on the noise_rate and edge_rate numerical indicators, the image quality is comprehensively evaluated by the following formula: Among them, evaluation represents the image quality. When the image quality is judged as bad, it means that the image quality is poor and is not suitable for intelligent recognition, and it is easy to make mistakes. When the image quality is judged as good, it means that the image quality is good and is suitable for intelligent recognition for task detection.