Safety monitoring method and system based on AI image recognition
By adaptively setting the similarity threshold and utilizing grayscale histogram features, the block matching process of the BM3D algorithm is improved, the artifact problem in image denoising is solved, and the image denoising effect and calculation efficiency are improved.
Patent Information
- Application Number
- CN202411086170.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In existing image denoising methods, improper threshold settings for similar blocks during the block matching process lead to artifacts and affect the image denoising effect.
By adaptively setting the similarity threshold, using grayscale histogram features and flatness to calculate similarity weights, the block matching process in the BM3D algorithm is improved, similar blocks are determined, and artifacts are reduced.
It improves the image denoising effect, reduces the computational complexity, and provides more accurate image data to support subsequent recognition.
Smart Images

Figure CN118822893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology. More specifically, the present invention relates to a security monitoring method and system based on AI image recognition. Background Art
[0002] In recent years, the advancement of computer vision and artificial intelligence (AI) technology has driven the rapid development of the security industry. With the increasing number of cameras, AI intelligent applications based on cameras have expanded rapidly and are widely used in various industries, such as production workshops, internal enterprises, financial fields (business hall monitoring, ATM and self-service bank monitoring, etc.), telecommunications / power fields (remote monitoring of switch rooms, wireless rooms, power rooms, etc., remote unattended monitoring of substations, power plants, etc.), transportation fields, community property management (security of residential areas, offices, unmanned monitoring of smart buildings and parking lots, etc.), and military security fields, etc.
[0003] Among them, cameras usually use computer vision and deep learning algorithms to achieve image processing and visual recognition; image processing is an important step. Specifically, since the images collected in the monitoring scene are easily affected by the external environment and the image quality is compressed during the transmission process, the image details are lost and the quality is reduced, which affects the accuracy of the subsequent recognition results; therefore, it is necessary to perform denoising preprocessing on the image before image recognition to improve the image quality and clarity, so as to facilitate the subsequent accurate recognition of the image.
[0004] Existing image denoising methods usually use filtering methods based on the spatial domain, wavelet decomposition based on the transform domain, dictionary learning algorithms or block-matching and 3D filtering (BM3D). Among them, the BM3D algorithm is a non-local denoising algorithm that uses the similarity and redundancy characteristics of the image itself to denoise. Figure 1As shown in the figure, the algorithm is mainly divided into two stages: basic estimation and final estimation. Each stage includes three parts: block matching, collaborative filtering and aggregation. The basic estimation provides weight parameters for the final estimation, and the final estimation uses the weight of the basic estimation to filter the noise. That is, the image I is first processed by the basic estimation to obtain a preliminary estimated image, and then the image I and the preliminary estimated image are processed by the final estimation stage to obtain the denoised image I1; the block matching is to obtain several reference blocks by setting a sliding window, and each reference block is searched in the appropriate surrounding area to find several blocks with the smallest difference (the difference between two blocks is usually quantified by the error square sum algorithm), and the similar blocks of the reference block are obtained, and these similar blocks are integrated into a three-dimensional matrix in any order. When determining similar blocks, a threshold is usually set, and blocks with differences less than this threshold are regarded as similar blocks. At the same time, the maximum number of similar blocks is also set to determine the similar blocks of the reference block. Then, collaborative filtering is performed in three-dimensional space, and the result is inversely transformed and aggregated to form a denoised image. Therefore, this algorithm is an image denoising method that combines spatial domain and transform domain, and is known as one of the general image denoising algorithms with the best denoising performance.
[0005] In the above block matching process, the determination of similar blocks depends on the setting of the threshold. Therefore, if the threshold is set too large or too small, it will cause under-matching or over-matching of certain areas, thereby generating artifacts, and ultimately leading to poor image denoising effect. Summary of the invention
[0006] The purpose of the present invention is to propose a security monitoring method and system based on AI image recognition to solve the problem of poor image denoising effect in the existing security monitoring process; to this end, the present invention provides solutions in the following two aspects.
[0007] In a first aspect, the present invention provides a safety monitoring method based on AI image recognition, comprising: Obtain a grayscale image of the target area; Using an improved BM3D algorithm to process the grayscale image to obtain a denoised image; Performing security monitoring on the denoised image to obtain an early warning result; The method for adjusting the block matching in the base estimation and / or the final estimation in the improved BM3D algorithm is as follows: Obtain reference blocks of the grayscale image and all candidate blocks of each reference block; Taking any reference block as the target reference block, calculating the similarity between the target reference block and any candidate block; Calculate the distance between the center point of the target reference block and the center pixel point of any candidate block; take the product of the reciprocal of the distance and the first flatness of any candidate block as the similarity weight; the first flatness represents the difference between the gray value of each pixel in any candidate block and the gray mean of all pixels; take the product of the similarity weight and the similarity as the weighted value; take the average of the weighted values corresponding to all candidate blocks as the similarity threshold of the target reference block; Any candidate block whose similarity is greater than a similarity threshold is used as a similar block of the target reference block.
[0008] The beneficial effect is that: the scheme of the present invention can determine appropriate similarity thresholds for different reference blocks by adaptively setting the similarity threshold in the process of obtaining similar blocks in the basic estimation stage, so as to determine the similarity of the reference blocks. Compared with the block matching grouping in the traditional BM3D algorithm, it avoids the problem that setting the same fixed threshold may cause over-matching or under-matching in certain areas, thereby generating artifacts and leading to poor image denoising effect.
[0009] In one embodiment, the first flatness is: ; In the formula, Candidate block The first flatness, Candidate block The gray value of the i-th pixel in , Candidate block The grayscale mean, n is the candidate block The total number of pixels in Candidate block The maximum value of the middle gray level, Candidate block The minimum gray value in Candidate block The set of grayscale values of all pixels in .
[0010] The beneficial effect is that the first flatness of the candidate block is obtained by the grayscale difference between the grayscale values of all pixels of the candidate block and the grayscale mean thereof, so that the change of all pixels of the candidate block can be evaluated.
[0011] In one embodiment, the similarity is: ; In the formula, is the reference block C and the candidate block The similarity of is the reference eigenvalue of the reference block C, Candidate block Candidate feature values for is the reference block C and the candidate block The grayscale difference, is an exponential function with the natural constant e as the base, the reference feature value is the product of the grayscale distribution interval difference and the peak coefficient corresponding to the grayscale histogram of the reference block C; the candidate feature value is the candidate block The product of the grayscale distribution interval difference and the peak coefficient corresponding to the grayscale histogram.
[0012] The beneficial effect is that the similarity between the reference block and the candidate block can be accurately evaluated by using the grayscale distribution interval difference and the peak coefficient in the grayscale histogram of the reference block and the candidate block as their own characteristic values.
[0013] In one embodiment, the specific process of performing security monitoring on the denoised image is as follows: Constructing a target detection model, and training the target detection model to obtain a trained target detection model; The denoised image is input into a trained target detection model to obtain a warning result, and a warning reminder is given according to the warning result, wherein the warning result includes dangerous targets and non-dangerous targets.
[0014] The beneficial effect is that the target detection model is used to perform target detection on the denoised image, and the early warning result can be accurately obtained.
[0015] In one embodiment, the target detection model is a Faster R-CNN model.
[0016] In one embodiment, the step of obtaining a reference block of a grayscale image is: Use the preset window to traverse the entire grayscale image, obtain the pixel block corresponding to the window, and then obtain all the pixel blocks; The second flatness of each pixel block is obtained, and the pixel block corresponding to the second flatness less than the set threshold is used as a reference block; the second flatness represents the difference between the grayscale value of each pixel point in the pixel block and the grayscale mean value of all pixel points.
[0017] The beneficial effect is that by obtaining the second flatness of each pixel block to screen the corresponding pixel block to determine the reference block, not only can the pixel blocks with large differences in the pixel blocks be screened out and taken as the objects of attention, but also the subsequent calculation complexity is reduced.
[0018] In one embodiment, the process of obtaining all candidate blocks of each reference block is as follows: With any reference block as the center, set the search range and a target window of the same size as the reference block, use the target window to slide through the image area within the search range, obtain the candidate blocks corresponding to the target window, and obtain all candidate blocks of each reference block.
[0019] In the second aspect, the security monitoring system based on AI image recognition includes: processor; A memory storing computer instructions for security monitoring based on AI image recognition. When the computer instructions are executed by the processor, the system executes the above-mentioned security monitoring method based on AI image recognition.
[0020] The beneficial effects of the present invention are: The solution of the present invention sets the similarity threshold corresponding to each reference block during the acquisition of similar blocks in the basic estimation stage, so as to more accurately determine the similar blocks of each reference block, reduce the error in the matching process, and further improve the denoising effect of the image, providing accurate data basis for subsequent image monitoring.
[0021] Furthermore, the solution of the present invention also screens reference blocks to obtain reference blocks that need attention, and only performs subsequent block matching, collaborative filtering and aggregation on the screened reference blocks, thereby reducing the amount of calculation and improving calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 The basic flow chart of the existing BM3D algorithm is schematically shown; Figure 2 The following is a schematic diagram showing the steps of the safety monitoring method based on AI image recognition in this embodiment; Figure 3 The structural block diagram of the security monitoring system based on AI image recognition in this embodiment is schematically shown. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0024] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0025] The scenes targeted by the present invention are mainly business halls, industrial parks, industrial production workshops, and the interior of enterprises, etc., and AI intelligence with cameras as the infrastructure is used to collect and identify images, and finally identify whether there are hidden dangers such as intrusion, theft, and fire. Before image recognition, the collected images need to be filtered, and the matching process of similar blocks in the block matching process in the basic estimation and final estimation in the existing BM3D algorithm requires artificially setting a similarity threshold to screen similar blocks. The content in different images is different, and a fixed threshold may cause over-matching or under-matching in certain areas, thereby generating artifacts. Therefore, the present invention provides a security monitoring method and system based on AI image recognition to improve the block matching process in the existing BM3D algorithm, reduce the artifacts generated in the matching process, and improve the image quality, which is beneficial to subsequent image recognition.
[0026] Specifically, taking a certain industrial park as an example, the security monitoring method based on AI image recognition of the present invention is introduced.
[0027] like Figure 2 As shown, the safety monitoring method based on AI image recognition in this embodiment includes the following steps: In step S1, a grayscale image of the target area is obtained. Specifically, a suitable location is selected in the industrial park to install the camera, and the physical position and angle of the camera are adjusted to ensure that the field of view can cover the specified target area, and lens distortion correction is performed to ensure the geometric accuracy of the acquired image.
[0028] In this embodiment, the collected image of the target area is grayed to obtain a gray image of the target area. It should be noted that the sampling interval of the collected image is 5s, and the gray image of the collected image is denoised for subsequent image recognition.
[0029] In step S2, the grayscale image is processed using an improved BM3D algorithm to obtain a denoised image.
[0030] The method for adjusting the block matching in the base estimation and / or the final estimation in the improved BM3D algorithm is as follows: First, obtain the reference blocks of the grayscale image and all candidate blocks of each reference block.
[0031] In this embodiment, a sliding window is set, and the sliding window is used to traverse the entire grayscale image to obtain a pixel block corresponding to the sliding window, and then all pixel blocks are obtained; any pixel block can be used as a reference block.
[0032] The size of the sliding window in this embodiment can be set to 5×5. Of course, the window size can be adjusted according to actual conditions, but it must be an odd-length window to ensure that there is a central pixel point in the window; the sliding window is used to slide on the entire image, and the step size of the sliding window when sliding is 5. Each sliding of the sliding window corresponds to a pixel block, and the entire grayscale image can be traversed to obtain multiple pixel blocks.
[0033] Furthermore, in order to reduce the amount of calculation, all pixel blocks can be screened to obtain at least two reference blocks. Specifically, the second flatness of each pixel block is obtained, and the corresponding pixel block when the second flatness is less than the set threshold is used as the reference block; the second flatness represents the difference between the grayscale value of each pixel point in the pixel block and the grayscale mean value of all pixel points.
[0034] Among them, the second flatness is: ; In the formula, is the second flatness of pixel block k, is the gray value of the i-th pixel in pixel block k, is the grayscale mean of pixel block k, n is the total number of pixels in pixel block k, is the maximum grayscale value in pixel block k, is the minimum grayscale value in pixel block k, is the set of grayscale values of all pixels in pixel block k. When the size of the sliding window can be set to 5×5, the total number of pixels in pixel block k is n=25.
[0035] In this embodiment, the second flatness of the corresponding pixel block is reflected according to the cumulative sum of the differences between the grayscale of each pixel point in the pixel block and the grayscale mean of the pixel block. If the cumulative sum of the differences is larger, the flatness of the pixel block is lower, the possibility that the corresponding pixel block contains important information (such as edge information) is greater, the necessity of filtering it to improve the image quality is greater, and the possibility of being screened as a reference block for filtering is greater.
[0036] The threshold in the above example can be set to 0.68, that is, when the flatness of pixel block k is (empirical value), it can be considered that the pixel block k has a lower second flatness, and the image content is more likely to contain important information, and then it is selected as a reference block for filtering. Of course, the threshold can be set smaller to obtain a more suitable reference value.
[0037] In this embodiment, the pixel blocks are screened according to the second flatness to determine whether each pixel block is a reference block. It should be noted that the screened reference blocks may be at least two, which is determined according to the actual screening situation.
[0038] In this embodiment, any reference block is taken as the center, a search range and a target window of the same size as the reference block are set, and the target window is used to slide through the image area within the search range to obtain the candidate blocks corresponding to the target window, and all candidate blocks of each reference block are obtained.
[0039] The search range in this embodiment is 25×25. A target window of the same size as any reference block is set within the search range, the step length is the side length of the target window, and the target block corresponding to the target window within the search range is named a candidate block.
[0040] Exemplarily, if the size of the reference block is 5×5, the size of the window is also 5×5. Since the reference block is randomly selected, the size of other reference blocks is also 5×5.
[0041] It should be noted that when determining all candidate blocks in this embodiment, all candidate blocks may include reference blocks or may not include reference blocks. In this embodiment, taking the case where all candidate blocks do not include reference blocks as an example, subsequent similar blocks must not include reference blocks.
[0042] Secondly, taking any reference block as the target reference block, the similarity between the reference block and any candidate block is calculated.
[0043] The similarity in this embodiment can be calculated by cosine similarity, Euclidean distance or hashing method. Since cosine similarity, Euclidean distance or hashing method are all prior arts, the specific calculation process will not be described in detail here.
[0044] Of course, as another implementation, the similarity in this embodiment may also be calculated in the following manner, including the following steps: Obtain the grayscale difference between the reference block and any candidate block within its search range; obtain the grayscale histogram of the reference block; based on the grayscale histogram, determine the corresponding grayscale distribution interval difference and peak coefficient; use the product of the grayscale distribution interval difference and the peak coefficient as the reference eigenvalue of the reference block; obtain the grayscale histogram of the candidate block and its candidate eigenvalues; obtain the similarity between the reference block and any candidate block based on the difference between the reference eigenvalue and the candidate eigenvalue and the grayscale difference.
[0045] The grayscale difference in the above steps is obtained by obtaining the cumulative sum of grayscale differences between the pixels at the corresponding positions in the reference block and the candidate block, and averaging the cumulative sum of the differences, which is used as the grayscale difference between the reference block and the candidate block; specifically, the grayscale difference between the reference block C and the candidate block Grayscale difference It is expressed as: ; In the formula, is the gray value of the pixel at the jth position in the reference block C, Candidate block The gray value of the pixel at the jth position in , and t is the sequence number of the candidate block.
[0046] In this embodiment, the size of the reference block and the candidate block are both 5×5, and the number of pixels in the reference block and the candidate block is 25.
[0047] The grayscale distribution interval difference in the above steps is the difference between the grayscale maximum value and the grayscale minimum value in the grayscale histogram, and the peak coefficient is the ratio of the grayscale maximum frequency to the grayscale average frequency in the grayscale histogram. Since the grayscale distribution interval difference and the peak coefficient are prior art, they will not be described in detail here.
[0048] Exemplarily, the reference feature value of the grayscale histogram of the reference block C is for: .
[0049] In the formula, is the maximum grayscale value in the reference block C, is the minimum gray value in the reference block C, is the grayscale frequency in reference block C The maximum value of is the grayscale frequency in reference block C The mean of . represents the grayscale distribution interval difference of the reference block C, Represents the peak coefficient of the grayscale histogram of the reference block C.
[0050] According to the above method of calculating the reference eigenvalue, the candidate block can be obtained: The eigenvalue of the grayscale histogram , specifically: .
[0051] In the formula, Candidate block The maximum value of the middle gray level, Candidate block The minimum value of medium gray, Candidate block Medium gray frequency The maximum value of Candidate block Medium gray frequency The mean of . Represents candidate blocks The grayscale distribution interval difference, Represents candidate blocks The peak coefficient of the grayscale histogram.
[0052] Furthermore, the reference block C and the candidate block The similarity is: .
[0053] In the formula, is the reference block C and the candidate block The similarity of is the reference eigenvalue of the reference block C, Candidate block Candidate feature values for is the reference block C and the candidate block The grayscale difference, It is an exponential function with the natural constant e as its base.
[0054] The smaller the difference in histogram features and grayscale between the reference block and the candidate block, the higher the similarity.
[0055] Then, the distance between the center point of the target reference block and the center pixel point of any candidate block is calculated; the product of the inverse of the distance and the first flatness of any candidate block is used as the similarity weight; the first flatness represents the difference between the grayscale value of each pixel in any candidate block and the grayscale mean of all pixels; the product of the similarity weight and the similarity is used as the weighted value; the average of the weighted values corresponding to all candidate blocks is used as the similarity threshold of the target reference block.
[0056] Taking reference block C as the target reference block as an example, the similarity weight of this embodiment is: ;in, For reference block With candidate blocks The similarity weight of For reference block The position coordinates of the center pixel point, Candidate block The position coordinates of the center pixel point, Candidate block The first level of flatness.
[0057] Among them, the candidate block The first flatness is: ; In the formula, Candidate block The gray value of the i-th pixel in , Candidate block The grayscale mean, n is the candidate block The total number of pixels in Candidate block The maximum value of the middle gray level, Candidate block The minimum gray value in Candidate block The set of grayscale values of all pixels in .
[0058] It should be noted that the reference block, pixel block and candidate block in this embodiment have the same size. Therefore, the total number of pixels in the reference block, pixel block and candidate block is also the same, that is, n.
[0059] in, is the center point of the reference block C and the candidate block The distance from the center pixel position coordinates.
[0060] The similarity weight in the above is the product of the inverse of the Euclidean distance between the center point of the target reference block and the center pixel point of the candidate block and the flatness. The closer the distance and the higher the flatness of the candidate block, the greater the corresponding weight.
[0061] Of course, as other implementation methods, in this embodiment, the center point of the reference block can be used as the origin, and a rectangular coordinate system can be established with the direction of the horizontal coordinate of the center point as the x-axis and the direction of the vertical coordinate as the y-axis; the similarity weight is calculated; at this time, it is only necessary to obtain the corresponding similarity weight based on the distance from the position coordinates of the central pixel points of each candidate block within the search range of the reference block to the origin and the first flatness.
[0062] The similarity threshold in the above steps for: ; In the formula, For reference block With candidate blocks The similarity weight of For reference block With candidate blocks The similarity of is the total number of candidate blocks.
[0063] It should be noted that each reference block in this embodiment corresponds to a similarity threshold, and the similarity thresholds of different reference blocks are different.
[0064] Finally, any candidate block whose similarity is greater than the similarity threshold is taken as a similar block of the target reference block.
[0065] In this embodiment, according to the similarity between the reference block and each candidate block and a set similarity threshold, some candidate blocks can be screened out as similar blocks to the reference block for subsequent collaborative filtering processing.
[0066] Specifically, if , then the candidate block As a reference block similar blocks of the reference block C, and then perform subsequent collaborative filtering. is the similarity threshold. Therefore, in the process of screening similar blocks, this embodiment sets an adaptive similarity threshold, that is, by setting the similarity thresholds corresponding to different reference blocks, the screened similar blocks are different; it avoids the situation where the different similarity distribution conditions between different reference blocks and their candidate blocks, and the use of fixed screening criteria will also affect the subsequent filtering effect. That is, by adjusting the similarity metric standard (similarity threshold) between the reference block and its candidate blocks, the robustness of the algorithm is improved, and the filtering effect is also improved, which is convenient for subsequent AI recognition of the image.
[0067] In the basic estimation stage, all similar blocks corresponding to each reference block are subjected to collaborative filtering and aggregation processing; in the final estimation stage, all similar blocks corresponding to each reference block are also subjected to collaborative filtering and aggregation processing, and finally the denoised grayscale image is obtained. Specifically, in the basic estimation process, when the similar block does not include the reference block, collaborative filtering is to combine the reference block and its similar blocks to obtain a three-dimensional combination, and then perform collaborative transformation and filtering (3D-Transform) on it, and remove the noise by setting the hard threshold (Hard-thresholding) method; aggregation processing is to integrate the filtering results of the combination corresponding to each reference block (Aggregation). In the final estimation process, collaborative filtering adopts the empirical Wiener shrinkage method. According to the power spectrum of the collaborative transformation coefficients of the initial estimated image in the basic estimation process and the intensity of the noise, the collaborative transformation coefficients of the 3D blocks at the same position of the grayscale image are shrunk, and then the shrunk coefficients are inversely transformed, and then aggregated to obtain the final denoised denoised image.
[0068] It should be noted that, since only the block matching part is improved in this embodiment, while the collaborative filtering and aggregation are not improved; therefore, since collaborative filtering and aggregation are existing technologies, the process of how to perform collaborative filtering and aggregation after obtaining all similar blocks of the reference block will not be described in detail here, and specific reference may be made to the existing technology.
[0069] In step S3, the denoised image is subjected to safety monitoring to obtain an early warning result. Specifically, in this embodiment, a target detection model is constructed and trained to obtain a trained target detection model. The denoised image is input into the trained target detection model to obtain an early warning result, and an early warning reminder is given based on the early warning result.
[0070] The warning result in the above steps can be to classify the target area, such as dangerous targets and non-dangerous targets. When the warning result is a dangerous target, a warning reminder is required.
[0071] The target detection model in the above steps can be a YOLO (You nolly look once) series model or a Faster R-CNN (Region with CNN feature) model.
[0072] The early warning reminders in the above steps can warn relevant personnel through sound, text messages, emails, etc., and can also be linked to other security systems, such as closing gates, activating emergency equipment, etc.
[0073] The solution of the present invention performs image processing on the monitored image data during the security monitoring process to achieve image denoising filtering, obtain high-quality and high-definition images, and provide data support for subsequent image recognition.
[0074] The present invention also provides a safety monitoring system based on AI image recognition. Figure 3 As shown, the safety monitoring system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the safety monitoring method based on AI image recognition according to the present invention is implemented.
[0075] The safety monitoring system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.
[0076] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0077] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0078] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A safety monitoring method based on AI image recognition, characterized in that: include: Obtain a grayscale image of the target area; Using an improved BM3D algorithm to process the grayscale image to obtain a denoised image; Performing security monitoring on the denoised image to obtain an early warning result; The method for adjusting the block matching in the base estimation and / or the final estimation in the improved BM3D algorithm is as follows: Obtain reference blocks of the grayscale image and all candidate blocks of each reference block; Taking any reference block as the target reference block, calculating the similarity between the target reference block and any candidate block; Calculate the distance between the center point of the target reference block and the center pixel point of any candidate block; take the product of the reciprocal of the distance and the first flatness of any candidate block as the similarity weight; the first flatness represents the difference between the gray value of each pixel in any candidate block and the gray mean of all pixels; take the product of the similarity weight and the similarity as the weighted value; take the average of the weighted values corresponding to all candidate blocks as the similarity threshold of the target reference block; Any candidate block whose similarity is greater than a similarity threshold is used as a similar block of the target reference block.
2. The safety monitoring method based on AI image recognition according to claim 1 is characterized in that: The first flatness is: ; In the formula, Candidate block The first flatness, Candidate block The gray value of the i-th pixel in , Candidate block The grayscale mean, n is the candidate block The total number of pixels in Candidate block The maximum value of the middle gray level, Candidate block The minimum gray value in Candidate block The set of grayscale values of all pixels in .
3. The safety monitoring method based on AI image recognition according to claim 1 is characterized in that: The similarities are: ; In the formula, is the reference block C and the candidate block The similarity of is the reference eigenvalue of the reference block C, Candidate block Candidate feature values for is the reference block C and the candidate block The grayscale difference, is an exponential function with the natural constant e as the base, the reference feature value is the product of the grayscale distribution interval difference and the peak coefficient corresponding to the grayscale histogram of the reference block C; the candidate feature value is the candidate block The product of the grayscale distribution interval difference and the peak coefficient corresponding to the grayscale histogram.
4. The safety monitoring method based on AI image recognition according to claim 1 is characterized in that: The specific process of performing security monitoring on the denoised image is as follows: Constructing a target detection model, and training the target detection model to obtain a trained target detection model; The denoised image is input into a trained target detection model to obtain a warning result, and a warning reminder is given according to the warning result, wherein the warning result includes dangerous targets and non-dangerous targets.
5. The safety monitoring method based on AI image recognition according to claim 4 is characterized in that: The target detection model is the Faster R-CNN model.
6. The safety monitoring method based on AI image recognition according to claim 1 is characterized in that: The step of obtaining a reference block of a grayscale image is: Use the preset window to traverse the entire grayscale image, obtain the pixel block corresponding to the window, and then obtain all the pixel blocks; Obtaining the second flatness of each pixel block, and taking the corresponding pixel block when the second flatness is less than a set threshold as a reference block; The second flatness represents the difference between the grayscale value of each pixel in the pixel block and the grayscale mean value of all pixels.
7. The safety monitoring method based on AI image recognition according to claim 6 is characterized in that: The process of obtaining all candidate blocks of each reference block is as follows: With any reference block as the center, set the search range and a target window of the same size as the reference block, use the target window to slide through the image area within the search range, obtain the candidate blocks corresponding to the target window, and obtain all candidate blocks of each reference block.
8. Safety monitoring system based on AI image recognition, characterized by: include: processor; A memory storing computer instructions for security monitoring based on AI image recognition. When the computer instructions are executed by the processor, the system executes the security monitoring method based on AI image recognition according to any one of claims 1 to 7.
Citation Information
Patent Citations
Identification method and device for foreign matter suspended on power transmission line, terminal and storage medium
CN113392803A
Improved adaptive threshold Canny edge detection method based on three-dimensional block matching
CN113837198A
Real image blind noise reduction method based on pixel-level noise variance estimation
CN114913097A
Improved BM3D denoising OFDR distributed strain measurement method
CN115031651A
Systems and methods for image noise reduction
US20180114297A1
