A video AI analysis system, method and storage medium
By calculating the motion changes and grayscale deviations of pixels in mineral transportation videos, image enhancement is performed for different areas, which solves the problem of poor video surveillance image processing in mine transportation environments and achieves more accurate anomaly analysis and detection.
Patent Information
- Application Number
- CN202311709746.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-12-13
AI Technical Summary
Existing video surveillance image processing technology cannot accurately detect anomalies in the mine transportation environment, resulting in poor image frame enhancement and inability to effectively perform anomaly analysis in video surveillance.
By acquiring the image frames of the mineral transportation monitoring video, the motion change value and grayscale deviation of each pixel point are calculated, and image enhancement is performed based on the regional category and grayscale difference to generate a more accurate enhanced video for anomaly analysis.
It improves the image quality and abnormality analysis accuracy of video surveillance, ensuring effective detection and early warning of abnormal situations in the mine transportation environment.
Smart Images

Figure CN117690085B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video surveillance processing technology, and in particular to a video AI analysis system, method and storage medium. Background Art
[0002] With the development of the Internet, the field of artificial intelligence has rapidly emerged and has been applied in many fields due to its low cost and intelligent characteristics. In the process of transporting minerals in mines, in order to ensure the safety of transportation, the videos collected by on-site monitoring will be analyzed and monitored online to facilitate the detection and early warning of abnormalities during mineral transportation.
[0003] Due to the dark environment of mine transportation, the existing video surveillance image processing technology generally does not consider the degree of enhancement required in different areas of the mine transportation environment when performing overall image enhancement, resulting in poor enhancement effects in some areas or even loss of details. When the video images are subsequently analyzed, the image frame enhancement effect is poor and the video quality is low, making it impossible to accurately perform abnormal analysis of video surveillance. Summary of the invention
[0004] In order to solve the technical problem that the image frame enhancement effect in the prior art is poor and the video surveillance anomaly analysis cannot be accurately performed, the purpose of the present invention is to provide a video AI analysis system, method and storage medium. The technical solutions adopted are as follows:
[0005] The present invention provides a video AI analysis method, the method comprising:
[0006] Acquire more than two monitoring image frames based on the mineral transportation monitoring video;
[0007] According to the motion change of each pixel point between each two adjacent monitoring image frames, the movement change value of each pixel point between each two adjacent monitoring image frames is obtained; according to the change degree and overall distribution of all the movement change values corresponding to each pixel point, the change degree of each pixel point is obtained; according to the distribution change trend of the change degree between all pixel points, the pixel points are classified to obtain the regional category of the pixel points;
[0008] In each monitoring image frame, the grayscale impact index of each pixel in the corresponding monitoring image frame is obtained according to the grayscale value deviation of each pixel and the grayscale difference between the region category where the corresponding pixel is located and other region categories; the enhancement degree of each pixel in each monitoring image frame is obtained according to the distribution of the degree of change of the region category where each pixel is located and the grayscale impact index of the corresponding pixel in each monitoring image frame;
[0009] For each monitoring image frame in the mineral transportation monitoring video, image enhancement is performed according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; and abnormality analysis is performed through the enhanced monitoring video.
[0010] Furthermore, the method for obtaining the degree of change includes:
[0011] Each pixel is taken as the target pixel in turn, and the average value of all movement change values corresponding to the target pixel is taken as the overall change index of the target pixel;
[0012] Among all the movement change values corresponding to the target pixel point, the difference between the maximum and minimum movement change values is taken as the change range of the target pixel point; the sum of the change range of the target pixel point and the preset adjustment parameter is taken as the change floating value of the target pixel point; the product of the change floating value of the target pixel point and the maximum movement change value corresponding to the target pixel point is calculated to obtain the change degree index of the target pixel point; the preset adjustment parameter is a positive number;
[0013] According to the change degree index and the overall change index of the target pixel, the change degree of the target pixel is obtained; the change degree index and the overall change index are both positively correlated with the change degree.
[0014] Furthermore, the method for obtaining the area category includes:
[0015] All pixel points are sorted in ascending order according to the degree of change to obtain a pixel change sequence; the pixel points in the pixel change sequence are sequentially used as points to be segmented, the difference in degree of change between the point to be segmented and the next adjacent pixel point is calculated, and the numerical difference index of the point to be segmented is obtained after normalization processing;
[0016] Calculate the average value of the change degree of all pixels before one pixel after the to-be-divided point as the first trend indicator; calculate the average value of the change degree of a preset trend number of pixels after the to-be-divided point as the second trend indicator; take the difference between the first trend indicator and the second trend indicator as the trend difference indicator of the to-be-divided point;
[0017] Normalize the product of the numerical difference index and the trend difference index of the point to be segmented to obtain the segmentation degree of the point to be segmented;
[0018] In the pixel change sequence, the pixels are traversed in the order of arrangement. When the segmentation degree of the current pixel is less than the segmentation degree of the adjacent previous pixel, the traversal is stopped and the current pixel is used as the segmentation point. All the pixels before the segmentation point are used as a region category and the pixels of the region category are removed from the pixel change sequence to obtain a new pixel change sequence for iterative segmentation to obtain the region category. The iteration is stopped until no segmentation point can be obtained, and all the remaining pixels are used as a region category.
[0019] Furthermore, the method for obtaining the grayscale impact index includes:
[0020] For any monitoring image frame, each pixel in the monitoring image frame is taken as a reference pixel in turn; the grayscale difference between the pixel value of the reference pixel and the average grayscale value of the monitoring image frame is calculated to obtain the grayscale deviation of the reference pixel in the monitoring image frame;
[0021] Calculate the average grayscale value of the pixel points corresponding to each regional category in the monitoring image frame to obtain the regional grayscale value of each regional category in the monitoring image frame; calculate the difference in regional grayscale values between the regional category where the reference pixel point is located and each other regional category to obtain the regional difference of the reference pixel point; take the average value of all regional differences of the reference pixel point as the regional deviation of the reference pixel point in the monitoring image frame;
[0022] The grayscale influence index of the reference pixel in the monitoring image frame is obtained by performing negative correlation mapping and normalization on the product of the grayscale deviation of the reference pixel in the monitoring image frame and the regional deviation.
[0023] Furthermore, the method for obtaining the enhancement degree includes:
[0024] The average value of all the change degrees in the category of the region where the reference pixel is located is used as the change impact indicator of the reference pixel;
[0025] According to the grayscale influence index and the change influence index of the reference pixel point in the monitoring image frame, the enhancement influence degree of the reference pixel point in the monitoring image frame is obtained; the grayscale influence index and the change influence index are both positively correlated with the enhancement influence degree;
[0026] The accumulated value of the enhanced influence of all pixels in the monitoring image frame is taken as the influence sum value of the monitoring image frame; the ratio of the enhanced influence of the reference pixel in the monitoring image frame to the influence sum value is calculated to obtain the enhancement degree of the reference pixel in the monitoring image frame.
[0027] Furthermore, the method for acquiring the enhanced surveillance video includes:
[0028] Each monitoring image frame is used as an image frame to be enhanced in turn. For any pixel in the image frame to be enhanced, the product of the enhancement degree and the grayscale value of the pixel is calculated to obtain the adjustment value of the pixel; the sum of the grayscale value of the pixel and the adjustment value is rounded down to obtain a new grayscale value of the pixel;
[0029] The final enhanced image frame is obtained according to the new grayscale values of all pixels in the image frame to be enhanced; all the final enhanced image frames are arranged in time sequence to obtain the enhanced monitoring video.
[0030] Furthermore, the abnormality analysis by enhancing the surveillance video includes:
[0031] The enhanced surveillance video is used as input to the trained neural network, and the anomaly detection results are output.
[0032] Furthermore, the method for obtaining the movement change value includes:
[0033] Two adjacent monitoring image frames are used as the input of the optical flow method, and the output is the moving distance of each pixel between the corresponding two adjacent monitoring image frames; the moving distance is used as the moving change value of each pixel between the corresponding two adjacent monitoring image frames.
[0034] The present invention also provides a video AI analysis system, comprising:
[0035] An image frame acquisition module, used to acquire two or more monitoring image frames according to the mineral transportation monitoring video;
[0036] The regional category acquisition module is used to obtain the movement change value of each pixel point between each two adjacent monitoring image frames according to the movement change of each pixel point between each two adjacent monitoring image frames; obtain the change degree of each pixel point according to the change degree and overall distribution of all movement change values corresponding to each pixel point; classify the pixels according to the distribution change trend of the change degree between all pixels points to obtain the regional category of the pixels;
[0037] The pixel enhancement acquisition module is used to obtain the grayscale impact index of each pixel in each monitoring image frame according to the grayscale value deviation of each pixel and the grayscale difference between the area category where the corresponding pixel is located and other area categories; obtain the enhancement degree of each pixel in each monitoring image frame according to the distribution of the degree of change of the area category where each pixel is located and the grayscale impact index of the corresponding pixel in each monitoring image frame;
[0038] The video enhancement analysis module is used to perform image enhancement on each monitoring image frame in the mineral transportation monitoring video according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; and perform abnormal analysis through the enhanced monitoring video.
[0039] The present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps in a video AI analysis method in any of the above-mentioned implementation methods can be implemented.
[0040] The present invention has the following beneficial effects:
[0041] The present invention analyzes each monitoring image frame, combines the motion change of each pixel between the monitoring image frames to obtain the change degree of each pixel, reflects the overall movement change of each pixel between all monitoring image frames, classifies the pixels based on the change trend of the movement change, obtains the regional category of each pixel, and classifies the pixels according to the motion of the pixel in the monitoring image frame, so that different enhancement degrees are performed for different regions. Further, the grayscale deviation of each pixel and the grayscale deviation between the regional categories are combined to obtain the grayscale influence index of each pixel in each monitoring image frame, considering the blur caused by the small grayscale difference, the smaller the contrast, the stronger the enhancement is required, and the enhancement degree of each pixel in each monitoring image frame is obtained by combining the distribution of the change degree and the grayscale influence index. According to the different grayscale difference degrees and motion change conditions of the pixels in each monitoring image, a more accurate enhancement degree of each pixel in each monitoring image is obtained. Finally, the enhanced monitoring video is obtained according to the enhancement degree of each pixel in each monitoring image for abnormal analysis. The present invention accurately enhances the video by combining the motion change and grayscale of the pixel points, thereby obtaining a higher quality monitoring video, thereby making the result of abnormal analysis on the monitoring video more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 A flow chart of a video AI analysis method provided by one embodiment of the present invention;
[0044] Figure 2 A structural diagram of a video AI analysis system provided for one embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a video AI analysis system, method and storage medium proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0046] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0047] The following is a detailed description of a video AI analysis system, method and storage medium provided by the present invention in conjunction with the accompanying drawings.
[0048] An embodiment of a video AI analysis method:
[0049] See also Figure 1 , which shows a flow chart of a video AI analysis method provided by an embodiment of the present invention, the method comprising the following steps:
[0050] S1: Acquire more than two monitoring image frames according to the mineral transportation monitoring video.
[0051] During the mineral mining process, since abnormal situations may occur during the transportation of mined minerals, such as ore falling or excessive dust in the environment, monitoring and analysis are required. The main means is to collect videos of the minerals during transportation through cameras arranged next to the transportation line, and then transmit the videos to the online monitoring system for analysis, detection and early warning of abnormal situations. However, when the clarity and brightness of the collected videos are poor, it will cause certain interference to the accuracy of the abnormal detection of the monitoring system, so the collected videos need to be enhanced. Obtain more than two monitoring image frames based on the mineral transportation monitoring video.
[0052] In one embodiment of the present invention, in order to ensure the integrity of the video analysis, the duration of the analyzed mineral transportation monitoring video is set to 30 seconds. In order to ensure the accuracy of the subsequent video analysis, each image frame in the mineral transportation monitoring video per second is enhanced, and each image frame in the collected mineral transportation monitoring video is grayed to obtain more than two monitoring image frames. The acquisition frame rate in the mineral transportation monitoring video is set to 30 frames per second. It should be noted that the acquisition of image frames in the video and the image graying method are technical means well known to those skilled in the art, and the specific numerical values can be adjusted by the implementer according to the specific implementation situation, and are not limited here.
[0053] At this point, the monitoring image frames in the mineral transportation monitoring video are obtained for enhanced analysis.
[0054] S2: According to the motion change of each pixel point between each two adjacent monitoring image frames, the movement change value of each pixel point between each two adjacent monitoring image frames is obtained; according to the change degree and overall distribution of all movement change values corresponding to each pixel point, the change degree of each pixel point is obtained; according to the distribution change trend of the change degree between all pixel points, the pixels are classified to obtain the regional category of the pixels.
[0055] Since there are moving objects in the continuous image frames monitored during mineral transportation, the pixels also move and change. The pixels can be preliminarily classified according to the degree of movement. The moving part may be more blurred than the static part, so different areas can be further enhanced to different degrees based on the grayscale value.
[0056] First, based on the motion change of each pixel between each two adjacent monitoring image frames, the movement change value of each pixel between each two adjacent monitoring image frames is obtained. Preferably, the two adjacent monitoring image frames are used as the input of the optical flow method, and the output is the movement distance of each pixel between the corresponding two adjacent monitoring image frames, and the movement distance is used as the movement change value of each pixel between the corresponding two adjacent monitoring image frames. The optical flow method is a motion estimation method based on grayscale changes. It estimates the movement distance of pixels by calculating the grayscale difference and position change of pixels between consecutive frames. It should be noted that the optical flow method is a technical means well known to those skilled in the art and will not be described in detail here. In other embodiments of the present invention, the block matching method can also be used to estimate the movement distance of pixels, which is not limited here.
[0057] The movement change value can reflect the change of pixel points. Each pixel point has a movement change value between all two adjacent monitoring image frames. According to the change of pixel points in consecutive monitoring image frames, its overall change degree is obtained, that is, according to the change degree and overall distribution of all movement change values corresponding to each pixel point, the change degree of each pixel point is obtained.
[0058] Preferably, each pixel point is taken as a target pixel point in turn, and the average value of all movement change values corresponding to the target pixel point is taken as the overall change index of the target pixel point, and the overall change index is used to reflect the overall position change size of the target pixel point. Among all the movement change values corresponding to the target pixel point, the difference between the maximum and minimum movement change values is taken as the change range of the target pixel point, and the fluctuation degree of the pixel point position change is reflected by the change range. Since the pixel point may have uniform changes, that is, the case of uniform motion of the transport vehicle, the sum of the change range of the target pixel point and the preset adjustment parameter is taken as the change floating value of the target pixel point, and the change floating value reflecting the discrete degree of the movement change value is obtained by adjusting the preset adjustment parameter. In the embodiment of the present invention, the preset adjustment parameter is a positive number, set to 0.001, and the specific numerical value can be adjusted by the implementer according to the specific implementation situation.
[0059] Furthermore, the product of the change floating value of the target pixel and the maximum value of the corresponding movement change value of the target pixel is calculated to obtain the change degree index of the target pixel, and the change degree of the pixel value movement distance is amplified by the maximum value to obtain a change degree index that reflects a more obvious change degree. According to the change degree index and the overall change index of the target pixel, the change degree of the target pixel is obtained, and both the change degree index and the overall change index are positively correlated with the change degree.
[0060] In the embodiment of the present invention, the expression of the degree of change of the pixel point is:
[0061]
[0062] In the formula, Q i Expressed as the degree of change of the i-th pixel, It is expressed as the maximum value of the movement change value corresponding to the i-th pixel point. It is expressed as the minimum value of the movement change corresponding to the i-th pixel point. It is expressed as the jth movement change value corresponding to the i-th pixel, V i It is represented as the total number of all movement change values corresponding to the i-th pixel point, α is represented as the preset adjustment parameter, and || is represented as the absolute value extraction function.
[0063] in, It is expressed as the extreme value of the change of the i-th pixel. Represented as the floating value of the change in the i-th pixel, It is expressed as the change degree index of the i-th pixel point, It is expressed as the overall change index of the i-th pixel. The product reflects that both the change degree index and the overall change index are positively correlated with the change degree. When the change degree index and the overall change index are larger, the change degree is larger, indicating that the position change of the pixel point is larger in degree and value. The pixel point corresponds to the complex motion part, and the change degree reflects the position change of the pixel point. In other embodiments of the present invention, other basic mathematical operations can be used to reflect that both the change degree index and the overall change index are positively correlated with the change degree, such as addition, etc., which are not limited here.
[0064] Therefore, the pixels can be further divided into corresponding regional categories according to the degree of change of each pixel. When the degree of change between pixels is relatively similar, it means that the possibility that the pixels correspond to the same part of the area is greater, and the difference in degree of change between different areas is also greater. That is, the pixels are classified according to the distribution trend of the degree of change between all pixels to obtain the regional category of the pixels.
[0065] Preferably, all pixel points are sorted in ascending order according to the degree of change to obtain a pixel change sequence, and segmentation is performed according to the change in the degree of change. The pixel points in the pixel change sequence are sequentially used as points to be segmented, and the difference in the degree of change between the point to be segmented and the next adjacent pixel point is calculated. After normalization, the numerical difference index of the point to be segmented is obtained. When the numerical difference in the degree of change between the pixel points is large, it means that the pixel points no longer belong to the same category of pixel points.
[0066] Furthermore, taking into account the changing trend of the degree of change between the local pixels before and after the pixel point, the overall change is comprehensively considered to determine the possibility that the pixel point is a segmentation point, and the average value of the degree of change of all pixels before a pixel after the point to be segmented is calculated as the first trend indicator. The average value of the degree of change of a preset trend number of pixels after the point to be segmented is calculated as the second trend indicator, and the difference between the first trend indicator and the second trend indicator is used as the trend difference indicator of the point to be segmented. The trend difference indicator reflects the difference in the degree of change of the pixels around the point to be segmented. In an embodiment of the present invention, the preset trend number is 20, and the specific value can be adjusted by the implementer according to the specific implementation situation. The preset trend number is to meet the analysis of the trend of the local change degree of each point to be segmented. If the number of pixels after the point to be segmented is less than the preset trend number, all pixels after the point to be segmented are analyzed.
[0067] The product of the numerical difference index and the trend difference index of the to-be-divided point is normalized to obtain the division degree of the to-be-divided point. In the embodiment of the present invention, the division degree is expressed as:
[0068]
[0069] Where P l It is expressed as the segmentation degree of the lth pixel in the pixel change sequence, Q l Expressed as the change degree of the lth pixel in the pixel change sequence, Q l+1 It is represented as the change degree of the l+1th pixel in the pixel change sequence, m is represented as the total number of all pixels before the l+1th pixel in the pixel change sequence, Q l+1,u It is represented as the segmentation degree of the uth pixel before the l+1th pixel in the pixel change sequence, r is represented as the total number of pixels with a preset trend number after the lth pixel in the pixel change sequence, Q l,vIt is expressed as the division degree of the vth pixel after the lth pixel in the pixel change sequence, || is expressed as the absolute value extraction function, exp() is expressed as the exponential function with the natural constant as the base, norm() is expressed as the normalization function. It should be noted that normalization is a technical means well known to those skilled in the art, and the normalization function can be linear normalization or standard normalization, etc. The specific normalization method is not limited here.
[0070] Among them, exp(|Q l -Q l+1 |) is expressed as the numerical difference index of the lth pixel in the pixel change sequence, It is expressed as the first trend indicator of the lth pixel point in the pixel change sequence. It is expressed as the second trend indicator of the lth pixel point in the pixel change sequence. It is expressed as the trend difference index of the lth pixel in the pixel change sequence. When the numerical difference index and the trend difference index are larger, it means that the change degree of the corresponding pixel in the sequence is different from that of the left and right distributed pixels. The larger the segmentation degree, the more likely the corresponding pixel is the segmentation point of the category, and the category division is further performed according to the segmentation degree.
[0071] In the pixel change sequence, the pixels are traversed in order of arrangement. Since the degree of change of the pixels is sorted from small to large, and the degree of change of the pixels belonging to the same region category is not much different, the segmentation degree is distributed in an increasing manner. When the segmentation degree of the current pixel is less than the segmentation degree of the adjacent previous pixel, it means that the segmentation possibility has reached the maximum, and the difference in the change degree before and after has reached the maximum, that is, the previous pixel is of the same category, and the following pixel is of another category. The traversal is stopped and the current pixel is used as the segmentation point. All the pixels before the segmentation point are regarded as a region category and the pixels of the region category are segmented and removed from the pixel change sequence to obtain a new pixel change sequence for iterative segmentation to obtain the region category. It is ensured that each time the segmentation point is analyzed, only the previous segmentation point belonging to one category is analyzed. The iteration is stopped when the segmentation point cannot be obtained, and all the remaining pixels are regarded as a region category.
[0072] Complete the regional category division of all pixels. Each regional category represents the pixels belonging to different areas in the video. For example, when a transport vehicle is transporting minerals, the transport vehicle and the minerals on the vehicle are constantly moving, while other locations in the mine, such as walls and lights, do not move, and the dust in the air moves slowly. Therefore, the pixels in the regional category can represent different areas such as background, dust, transport vehicles and minerals.
[0073] S3: In each monitoring image frame, according to the grayscale value deviation of each pixel and the grayscale difference between the area category where the corresponding pixel is located and other area categories, the grayscale influence index of each pixel in the corresponding monitoring image frame is obtained; according to the distribution of the degree of change of the area category where each pixel is located and the grayscale influence index of the corresponding pixel in each monitoring image frame, the enhancement degree of each pixel in each monitoring image frame is obtained.
[0074] After obtaining different area categories, different pixels can be analyzed according to the motion possibilities and grayscale differences of different area categories to obtain the different enhancement levels required for each pixel in each surveillance image frame, so that each frame of the image can be better enhanced, thereby obtaining a better enhanced video.
[0075] First, the grayscale difference is analyzed. Due to the dim characteristics of the mine transportation collection environment, the grayscale value difference may not be obvious. Therefore, the grayscale difference of the area where the pixel is located and the grayscale deviation of the pixel itself are used to comprehensively analyze the grayscale influence of each pixel in different monitoring image frames. That is, in each monitoring image frame, the grayscale impact index of each pixel in the corresponding monitoring image frame is obtained according to the grayscale value deviation of each pixel and the grayscale difference between the area category where the corresponding pixel is located and other area categories.
[0076] Preferably, for any monitoring image frame, each pixel in the monitoring image frame is taken as a reference pixel in turn, and the same analysis is performed on each pixel in each monitoring image frame, and the grayscale difference between the pixel value of the reference pixel and the average grayscale value of the monitoring image frame is calculated to obtain the grayscale deviation of the reference pixel in the monitoring image frame. The smaller the grayscale deviation of the reference pixel, the less obvious the grayscale contrast of the reference pixel.
[0077] Furthermore, the average grayscale value corresponding to each area category in the monitoring image frame is calculated as the regional grayscale value of each area category in the monitoring image frame, and the difference in regional grayscale values between the area category where the reference pixel is located and each other area category is calculated to obtain the regional difference of the reference pixel. The grayscale difference between the area categories is used to reflect the overall grayscale contrast of the area where the reference pixel is located. The average value of all regional differences of the reference pixel is taken as the regional deviation of the reference pixel. The smaller the regional deviation, the less obvious the grayscale contrast of the area where the reference pixel is located.
[0078] After negative correlation mapping and normalization of the product of the grayscale deviation of the reference pixel and the regional deviation, the grayscale influence index of the reference pixel in the monitoring image frame is obtained. In the embodiment of the present invention, the grayscale influence index is expressed as:
[0079]
[0080] In the formula, B ja It is expressed as the grayscale impact index of the a-th pixel in the j-th monitoring image frame, H ja It is represented by the gray value of the a-th pixel in the j-th monitoring image frame. Represented as the average gray value in the jth surveillance image frame, It is represented by the regional grayscale value of the regional category where the a-th pixel point is located in the j-th monitoring image frame, and s is represented by the number of other regional categories in the j-th monitoring image frame except the regional category where the a-th pixel point is located. It is represented as the grayscale value of the cth other area category in the jth monitoring image frame, || is represented as the absolute value extraction function, and exp() is represented as the exponential function with a natural constant as the base.
[0081] in, It is expressed as the grayscale deviation of the a-th pixel in the j-th monitoring image frame, It is represented as the regional difference between the region category where the a-th pixel point in the j-th monitoring image frame is located and the corresponding c-th other region category, It is expressed as the regional deviation of the ath pixel in the jth monitoring image frame. When the difference between the grayscale deviation and the regional deviation is smaller, it means that the grayscale difference between the pixel and other regions is smaller, its grayscale contrast is smaller, and the regional representation is more blurred. The larger the grayscale impact index is, the greater the degree of enhancement required for the pixel.
[0082] Then, combined with the distribution of the degree of change between regional categories, the degree of enhancement that needs to be enhanced for each pixel is obtained. Since the greater the degree of change, the more likely the part represented by the pixel is a motion area, and the motion area is an area that needs to be analyzed more, so a greater degree of enhancement is required. Therefore, the enhancement degree of each pixel in each monitoring image frame is obtained according to the distribution of the degree of change of the regional category where each pixel is located, and the grayscale influence index of the corresponding pixel in each monitoring image frame.
[0083] Preferably, the average value of all the change degrees in the regional category where the reference pixel is located is used as the change influence index of the reference pixel, and the distribution of the overall change degree of the regional category is reflected by the average value. The enhancement influence degree of the reference pixel in the monitoring image frame is obtained according to the grayscale influence index and the change influence index of the reference pixel in the monitoring image frame. The enhancement influence degree represents the degree of enhancement obtained by analyzing the grayscale and the change degree of the pixel. The grayscale influence index and the change influence index are both positively correlated with the enhancement influence degree. In the embodiment of the present invention, the expression of the enhancement influence degree is:
[0084]
[0085] Where W ja It is expressed as the enhancement influence of the a-th pixel in the j-th monitoring image frame, B ja It is expressed as the grayscale impact index of the a-th pixel in the j-th monitoring image frame, It is expressed as the change impact index of the a-th pixel in the j-th monitoring image frame.
[0086] The grayscale influence index and the change influence index are both positively correlated with the enhanced influence by the form of product. In other embodiments of the present invention, other basic mathematical operations can also be used to reflect that the grayscale influence index and the change influence index are both positively correlated with the enhanced influence, such as addition or power operation, etc., which is not limited here.
[0087] Further, the accumulated value of the enhanced influence of all pixels in the monitoring image frame is used as the influence sum value of the monitoring image frame, and the ratio of the enhanced influence of the reference pixel in the monitoring image frame to the influence sum value is calculated to obtain the enhancement degree of the reference pixel in the monitoring image frame. The optimal enhancement of the pixel in each monitoring image frame is obtained by the proportion of the pixel in the corresponding monitoring image frame. In the embodiment of the present invention, the expression of the enhancement degree is:
[0088]
[0089] In the formula, R ja It is expressed as the enhancement degree of the ath pixel in the jth monitoring image frame, W ja It is represented as the enhancement influence of the ath pixel in the jth monitoring image frame, and z is represented as the total number of pixels in the jth monitoring image frame.
[0090] in, It is expressed as the influence and value of the jth monitoring image frame. The larger the proportion of pixels, the less obvious the grayscale change of the pixels in the monitoring image frame, and the more likely they are to correspond to the motion area. Therefore, a stronger enhancement degree is required in the monitoring image frame.
[0091] At this point, the analysis of the grayscale and motion changes of each pixel in each monitoring image frame is completed, and the enhancement degree of each pixel in each monitoring image frame is obtained.
[0092] S4: For each monitoring image frame in the mineral transportation monitoring video, image enhancement is performed according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; and abnormality analysis is performed through the enhanced monitoring video.
[0093] Each monitoring image frame is enhanced by the enhancement degree. In one embodiment of the present invention, each monitoring image frame is sequentially used as an image frame to be enhanced. For any pixel in the image frame to be enhanced, the product of the enhancement degree and the gray value of the pixel is calculated to obtain an adjustment value of the pixel. The sum of the gray value of the pixel and the adjustment value is rounded down to obtain a new gray value of the pixel. In the embodiment of the present invention, the calculation expression of the new gray value of the pixel is:
[0094]
[0095] Where H' ja It is represented as the new gray value of the a-th pixel in the j-th monitoring image frame, H ja Represented as the gray value of the ath pixel in the jth monitoring image frame, R ja It is expressed as the enhancement degree of the a-th pixel in the j-th monitoring image frame, Represented as a floor function.
[0096] Among them, H ja ×R ja It is expressed as the adjustment value of the ath pixel in the jth monitoring image frame. In mine monitoring, environmental factors cause the overall image to be darker, so the pixel enhancement is achieved by increasing the pixel size, which improves the overall brightness of the image while increasing the grayscale contrast of different areas.
[0097] Furthermore, the final enhanced image frame is obtained according to the new grayscale values of all pixels in the image frame to be enhanced, and all the final enhanced image frames are arranged in a time sequence, that is, the order of each frame when acquired, to obtain an enhanced surveillance video. Further, the enhanced enhanced surveillance video can be analyzed to obtain a more accurate analysis result, that is, abnormal analysis is performed through the enhanced surveillance video.
[0098] Preferably, the enhanced surveillance video is used as input, input into the trained neural network, and the abnormal detection result is output. In an embodiment of the present invention, the neural network can select the convolutional neural network CNN in deep learning, and train it through the sample set of normal transportation video and abnormal transportation video prepared in advance. The training process mainly includes two steps of forward propagation and back propagation. The forward propagation is to pass the input frame through the CNN network to obtain the prediction result, and the back propagation is to update the network parameters according to the error between the prediction result and the true result. The trained CNN model is obtained through multiple iterations, and the abnormal detection result can be output according to the features in the transportation video. The abnormal detection result may include the abnormal type, such as personnel falling or transport vehicle failure, abnormal location, such as the location of the abnormal occurrence, abnormal classification, that is, the classification of normal or abnormal level, etc. It should be noted that the role of the neural network is mainly used to classify and analyze the video. The CNN neural network is a technical means well known to those skilled in the art. The convolutional neural network structure for realizing this task includes multiple, such as LSTM, etc. The specific neural network structure and training process are not repeated here.
[0099] In summary, the present invention analyzes each monitoring image frame, combines the motion change of each pixel between the monitoring image frames to obtain the change degree of each pixel, reflects the overall movement change of each pixel between all monitoring image frames, classifies the pixels based on the change trend of the movement change, obtains the regional category of each pixel, and classifies the pixels according to the motion of the pixels in the monitoring image frame, so that different enhancement degrees are performed for different regions. Further, the grayscale deviation of each pixel and the grayscale deviation between the regions are combined to obtain the grayscale influence index of each pixel in each monitoring image frame, considering the blur caused by the small grayscale difference, the smaller the contrast, the stronger the enhancement is required, and the distribution of the change degree and the grayscale influence index are combined to obtain the enhancement degree of each pixel in each monitoring image frame. For the different grayscale difference degrees and motion changes of the pixels in each monitoring image, a more accurate enhancement degree of each pixel in each monitoring image is obtained. Finally, the enhanced monitoring video is obtained according to the enhancement degree of each pixel in each monitoring image for abnormal analysis. The present invention accurately enhances the video by combining the motion change and grayscale of the pixel points, thereby obtaining a higher quality monitoring video, thereby making the result of abnormal analysis on the monitoring video more accurate.
[0100] See also Figure 2 , which shows a structural diagram of a video AI analysis system provided by an embodiment of the present invention, the system includes: an image frame acquisition module 101, a region category acquisition module 102, a pixel enhancement acquisition module 103, and a video enhancement analysis module 104.
[0101] An image frame acquisition module 101 is used to acquire two or more monitoring image frames according to the mineral transportation monitoring video;
[0102] The region category acquisition module 102 is used to obtain the movement change value of each pixel point between each two adjacent monitoring image frames according to the movement change of each pixel point between each two adjacent monitoring image frames; obtain the change degree of each pixel point according to the change degree and overall distribution of all the movement change values corresponding to each pixel point; classify the pixels according to the distribution change trend of the change degree between all the pixels points to obtain the region category of the pixel points;
[0103] The pixel enhancement degree acquisition module 103 is used to obtain the grayscale influence index of each pixel in each monitoring image frame according to the grayscale value deviation of each pixel and the grayscale difference between the region category where the corresponding pixel is located and other region categories; obtain the enhancement degree of each pixel in each monitoring image frame according to the distribution of the degree of change of the region category where each pixel is located and the grayscale influence index of the corresponding pixel in each monitoring image frame;
[0104] The video enhancement analysis module 104 is used to perform image enhancement on each monitoring image frame in the mineral transportation monitoring video according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; and perform abnormal analysis through the enhanced monitoring video.
[0105] It should be noted that the corresponding video AI analysis system provided in the above embodiment can implement the technical solution described in the above video AI analysis method embodiment. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above video AI analysis method embodiment, which will not be repeated here.
[0106] The present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps in a video AI analysis method in any of the above-mentioned implementation methods can be implemented.
[0107] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0108] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A video AI analysis method, characterized in that: The method comprises: Acquire more than two monitoring image frames based on the mineral transportation monitoring video; According to the motion change of each pixel point between each two adjacent monitoring image frames, the movement change value of each pixel point between each two adjacent monitoring image frames is obtained; according to the change degree and overall distribution of all the movement change values corresponding to each pixel point, the change degree of each pixel point is obtained; according to the distribution change trend of the change degree between all pixel points, the pixel points are classified to obtain the regional category of the pixel points; In each monitoring image frame, the grayscale impact index of each pixel in the corresponding monitoring image frame is obtained according to the grayscale value deviation of each pixel and the grayscale difference between the region category where the corresponding pixel is located and other region categories; the enhancement degree of each pixel in each monitoring image frame is obtained according to the distribution of the degree of change of the region category where each pixel is located and the grayscale impact index of the corresponding pixel in each monitoring image frame; For each monitoring image frame in the mineral transportation monitoring video, image enhancement is performed according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; abnormal analysis is performed through the enhanced monitoring video; The method for obtaining the degree of change includes: Each pixel is taken as the target pixel in turn, and the average value of all movement change values corresponding to the target pixel is taken as the overall change index of the target pixel; Among all the movement change values corresponding to the target pixel point, the difference between the maximum and minimum movement change values is taken as the change range of the target pixel point; the sum of the change range of the target pixel point and the preset adjustment parameter is taken as the change floating value of the target pixel point; the product of the change floating value of the target pixel point and the maximum movement change value corresponding to the target pixel point is calculated to obtain the change degree index of the target pixel point; the preset adjustment parameter is a positive number; According to the change degree index and the overall change index of the target pixel point, the change degree of the target pixel point is obtained; the change degree index and the overall change index are both positively correlated with the change degree; The method for obtaining the grayscale impact index includes: For any monitoring image frame, each pixel in the monitoring image frame is taken as a reference pixel in turn; the grayscale difference between the pixel value of the reference pixel and the average grayscale value of the monitoring image frame is calculated to obtain the grayscale deviation of the reference pixel in the monitoring image frame; Calculate the average grayscale value of the pixel points corresponding to each regional category in the monitoring image frame to obtain the regional grayscale value of each regional category in the monitoring image frame; calculate the difference in regional grayscale values between the regional category where the reference pixel point is located and each other regional category to obtain the regional difference of the reference pixel point; take the average value of all regional differences of the reference pixel point as the regional deviation of the reference pixel point in the monitoring image frame; The grayscale influence index of the reference pixel in the monitoring image frame is obtained by performing negative correlation mapping and normalization on the product of the grayscale deviation of the reference pixel in the monitoring image frame and the regional deviation.
2. According to claim 1, a video AI analysis method is characterized in that: The method for obtaining the area category includes: All pixel points are sorted in ascending order according to the degree of change to obtain a pixel change sequence; the pixel points in the pixel change sequence are sequentially used as points to be segmented, the difference in degree of change between the point to be segmented and the next adjacent pixel point is calculated, and the numerical difference index of the point to be segmented is obtained after normalization processing; Calculate the average value of the change degree of all pixels before one pixel after the to-be-divided point as the first trend indicator; calculate the average value of the change degree of a preset trend number of pixels after the to-be-divided point as the second trend indicator; take the difference between the first trend indicator and the second trend indicator as the trend difference indicator of the to-be-divided point; Normalize the product of the numerical difference index and the trend difference index of the point to be segmented to obtain the segmentation degree of the point to be segmented; In the pixel change sequence, the pixels are traversed in the order of arrangement. When the segmentation degree of the current pixel is less than the segmentation degree of the adjacent previous pixel, the traversal is stopped and the current pixel is used as the segmentation point. All the pixels before the segmentation point are used as a region category and the pixels of the region category are removed from the pixel change sequence to obtain a new pixel change sequence for iterative segmentation to obtain the region category. The iteration is stopped until no segmentation point can be obtained, and all the remaining pixels are used as a region category.
3. According to claim 1, a video AI analysis method is characterized in that: The method for obtaining the enhancement degree includes: The average value of all the change degrees in the category of the region where the reference pixel is located is used as the change impact indicator of the reference pixel; According to the grayscale influence index and the change influence index of the reference pixel point in the monitoring image frame, the enhancement influence degree of the reference pixel point in the monitoring image frame is obtained; the grayscale influence index and the change influence index are both positively correlated with the enhancement influence degree; The accumulated value of the enhanced influence of all pixels in the monitoring image frame is taken as the influence sum value of the monitoring image frame; the ratio of the enhanced influence of the reference pixel in the monitoring image frame to the influence sum value is calculated to obtain the enhancement degree of the reference pixel in the monitoring image frame.
4. According to claim 1, a video AI analysis method is characterized in that: The method for acquiring the enhanced surveillance video includes: Each monitoring image frame is used as an image frame to be enhanced in turn. For any pixel in the image frame to be enhanced, the product of the enhancement degree and the grayscale value of the pixel is calculated to obtain the adjustment value of the pixel; the sum of the grayscale value of the pixel and the adjustment value is rounded down to obtain a new grayscale value of the pixel; The final enhanced image frame is obtained according to the new grayscale values of all pixels in the image frame to be enhanced; all the final enhanced image frames are arranged in time sequence to obtain the enhanced monitoring video.
5. According to claim 1, a video AI analysis method is characterized in that: The abnormality analysis by enhancing the surveillance video includes: The enhanced surveillance video is used as input to the trained neural network, and the anomaly detection results are output.
6. According to claim 1, a video AI analysis method is characterized in that: The method for obtaining the movement change value includes: Two adjacent monitoring image frames are used as the input of the optical flow method, and the output is the moving distance of each pixel between the corresponding two adjacent monitoring image frames; the moving distance is used as the moving change value of each pixel between the corresponding two adjacent monitoring image frames.
7. A video AI analysis system, characterized in that: include: An image frame acquisition module, used to acquire two or more monitoring image frames according to the mineral transportation monitoring video; The region category acquisition module is used to obtain the movement change value of each pixel point between each two adjacent monitoring image frames according to the movement change of each pixel point between each two adjacent monitoring image frames; According to the change degree and overall distribution of all movement change values corresponding to each pixel, the change degree of each pixel is obtained; Classify the pixels according to the distribution trend of the degree of change among all pixels to obtain the regional category of the pixels; The method for obtaining the degree of change includes: Each pixel is taken as the target pixel in turn, and the average value of all movement change values corresponding to the target pixel is taken as the overall change index of the target pixel; Among all the movement change values corresponding to the target pixel point, the difference between the maximum and minimum movement change values is taken as the change range of the target pixel point; the sum of the change range of the target pixel point and the preset adjustment parameter is taken as the change floating value of the target pixel point; the product of the change floating value of the target pixel point and the maximum movement change value corresponding to the target pixel point is calculated to obtain the change degree index of the target pixel point; the preset adjustment parameter is a positive number; According to the change degree index and the overall change index of the target pixel point, the change degree of the target pixel point is obtained; the change degree index and the overall change index are both positively correlated with the change degree; The pixel enhancement acquisition module is used to obtain the grayscale impact index of each pixel in each monitoring image frame according to the grayscale value deviation of each pixel and the grayscale difference between the area category where the corresponding pixel is located and other area categories; obtain the enhancement degree of each pixel in each monitoring image frame according to the distribution of the degree of change of the area category where each pixel is located and the grayscale impact index of the corresponding pixel in each monitoring image frame; The method for obtaining the grayscale impact index includes: For any monitoring image frame, each pixel in the monitoring image frame is taken as a reference pixel in turn; the grayscale difference between the pixel value of the reference pixel and the average grayscale value of the monitoring image frame is calculated to obtain the grayscale deviation of the reference pixel in the monitoring image frame; Calculate the average grayscale value of the pixel points corresponding to each regional category in the monitoring image frame to obtain the regional grayscale value of each regional category in the monitoring image frame; calculate the difference in regional grayscale values between the regional category where the reference pixel point is located and each other regional category to obtain the regional difference of the reference pixel point; take the average value of all regional differences of the reference pixel point as the regional deviation of the reference pixel point in the monitoring image frame; The grayscale influence index of the reference pixel in the monitoring image frame is obtained by performing negative correlation mapping and normalization on the product of the grayscale deviation of the reference pixel in the monitoring image frame and the regional deviation; The video enhancement analysis module is used to perform image enhancement on each monitoring image frame in the mineral transportation monitoring video according to the enhancement degree of the pixel points to obtain an enhanced monitoring video; and perform abnormal analysis through the enhanced monitoring video.
8. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of a video AI analysis method described in any one of claims 1 to 6 above.
