A computer vision-based video slicing method and system
By segmenting, adjusting lighting, and analyzing behavior in construction site video frames, abnormal lighting areas are identified and risk levels are assessed. This solves the problem of high false alarm rates in existing monitoring systems under complex lighting conditions, and achieves high efficiency and accuracy in construction site safety management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG CONSTR INVESTMENT DIGITAL TECH CO LTD
- Filing Date
- 2025-07-02
- Publication Date
- 2026-06-26
AI Technical Summary
Existing computer vision-based monitoring systems struggle to accurately identify the behavior of people and vehicles on construction sites under complex lighting conditions, resulting in a high false alarm rate and an inability to detect safety hazards in a timely manner.
By acquiring continuous video frames from the construction site, segmenting and adjusting the lighting, identifying abnormal lighting areas, detecting behaviors in unexpected areas, evaluating the frequency and duration of behaviors, determining whether they are part of the workflow, and triggering warning signals when thresholds are exceeded.
Accurately identify the behavior of people or vehicles on the construction site under complex lighting conditions, reduce false alarm rate, improve safety, effectively prevent potential safety hazards, and ensure construction site safety.
Smart Images

Figure CN120808568B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of video processing technology, specifically relating to a video slicing method and system based on computer vision. Background Technology
[0002] In modern construction site management, ensuring the safety of personnel and equipment is paramount. Traditional safety monitoring methods primarily rely on manual supervision or simple video playback review. These methods are not only inefficient but also prone to missing critical information, especially in complex construction environments. With the development of computer vision technology, automated safety monitoring through video analytics has become possible. Existing computer vision-based monitoring systems can identify and track personnel and vehicles on construction sites; however, under complex lighting conditions (such as shadows and strong light reflections), the performance of these systems deteriorates significantly, leading to increased false alarm rates or the failure to detect safety hazards in a timely manner.
[0003] Current solutions attempt to use machine learning algorithms to analyze video content to identify specific behavioral patterns or anomalies. However, these methods typically require large amounts of labeled data for training, perform poorly when dealing with dynamically changing lighting conditions, and struggle to accurately distinguish between behaviors within normal workflows and potential safety hazards. Summary of the Invention
[0004] The purpose of this invention is to provide a video slicing method and system based on computer vision, which can not only adapt to different lighting conditions, but also effectively identify activities in unexpected areas and assess their risk levels, so as to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, this invention proposes a video slicing method based on computer vision, comprising the following steps:
[0006] The system acquires continuous video frames from the construction site, segments the video frames to distinguish the activity areas of personnel and vehicles, calculates the illumination change parameters within the activity areas, marks abnormal illumination areas, and adjusts the contrast of the video frames based on the abnormal illumination areas. It then detects behaviors in unexpected areas within the contrast-adjusted video frames, analyzes the frequency and duration of these behaviors, and determines whether they are part of the workflow. If the behavior is not part of the workflow, it assesses the potential risk level based on location information, compares the risk level with a preset threshold, and triggers a warning signal if the threshold is exceeded.
[0007] Preferably, acquiring continuous video frames at the construction site includes:
[0008] Multiple cameras are installed at selected locations on the construction site. The data streams collected by the cameras are processed synchronously to ensure that the timestamps of video frames from different cameras are consistent. The timestamp of each frame is calculated using the formula Ts=T0+s*Dt, where Ts is the timestamp of the s-th frame, T0 is the start timestamp, and Dt is a fixed time interval.
[0009] The video frames with the same timestamp are numbered to form a continuous frame sequence, which is represented by the formula Fs=F(Ts), where Fs is the s-th frame arranged in chronological order;
[0010] The continuous frame sequence is initially screened to remove duplicate or corrupted frames. This is determined by comparing the timestamp difference between adjacent frames with Dt. If they are not equal, they are considered abnormal frames and are removed.
[0011] Preferably, the video frames are segmented to distinguish the activity areas of people and vehicles, including:
[0012] Each frame in the continuous frame sequence is processed using a color space conversion method, converting each frame from the RGB color space to the HSV color space;
[0013] The saturation and brightness values of each pixel in the HSV color space are calculated using the formulas Sa=(max(R,G,B)-min(R,G,B)) / max(R,G,B) and Va=max(R,G,B), where R, G, and B are the red, green, and blue component values of the pixel in the RGB space, respectively.
[0014] Based on the saturation and brightness values, a threshold range is set to segment out the set of pixels that meet the conditions, forming a candidate region, which is represented by the formula Th(Sa,Va), where Th is the set threshold range;
[0015] Connectivity analysis is applied to candidate regions to identify and label activity areas belonging to people or vehicles by comparing the consistency between adjacent pixels. The area of each activity region is calculated using the formula A=Sum(P), where P is the number of pixels that meet the consistency.
[0016] Preferably, calculating the illumination change parameters within the active area and marking abnormal illumination areas includes:
[0017] For each pixel within the active area, the brightness change rate in a continuous frame sequence is calculated using the formula Lr=(Vb-V0) / b, where Lr is the brightness change rate, Vb is the brightness value of the current frame, V0 is the brightness value of the initial frame, and b is the frame number.
[0018] Based on the brightness change rate, a dynamic threshold range Thresh_L is set using the formula Thresh_L=Avg(Lr)±k*Std(Lr) to distinguish between normal and abnormal lighting conditions, where Avg(Lr) is the average brightness change rate, Std(Lr) is the standard deviation, and k is the adjustment coefficient.
[0019] Traverse all pixels within the active area, identify the set of pixels exceeding the threshold based on the dynamic threshold range, and form a potential abnormal lighting area, which is represented by the formula O={Px|Lr(Px)>Thresh_L or Lr(Px)<-Thresh_L}, where O is the set of pixels in the abnormal lighting area;
[0020] Connectivity analysis is performed on the potential abnormal lighting areas, adjacent pixel blocks with similar lighting conditions are merged, and the boundary of the abnormal lighting area is finally determined. The area of the abnormal lighting area is calculated using the formula A_Anomaly=Sum(O).
[0021] Preferably, adjusting the video frame contrast based on the abnormal lighting area includes:
[0022] The formula Dif = Avg_V(A_Anomaly) - Avg_V(Global) is used to calculate the difference between the average brightness value of each pixel in the abnormal lighting area and the average brightness value of the global area. Here, Dif is the brightness difference value, Avg_V(A_Anomaly) is the average brightness value of the abnormal lighting area, and Avg_V(Global) is the average brightness value of the entire frame.
[0023] Based on the brightness difference value, the contrast adjustment coefficient is determined using the formula AdjFac=1+k*(Dif / Avg_V(Global)), where AdjFac is the contrast adjustment coefficient and k is a proportional constant used to control the adjustment intensity.
[0024] The brightness value of each pixel in the abnormal lighting area is adjusted by applying a contrast adjustment coefficient, which is achieved by the formula V_new=V_old*AdjFac, where V_new is the adjusted brightness value and V_old is the original brightness value.
[0025] Update all brightness-adjusted pixels in the frame using the formula Frame_upd={Px|PxinFrameandPxadjustedbyV_new}, where Frame_upd represents the adjusted frame.
[0026] Preferably, detecting behavior in unexpected regions within contrast-adjusted video frames includes:
[0027] Define the coordinate range of different types of unexpected areas within the construction site, and map the areas onto the frame after adjusting the contrast. Use the formula Z=(X_min,Y_min,X_max,Y_max) to represent the coordinate range of each unexpected area.
[0028] For each active object in the frame after contrast adjustment, its centroid position Ct is calculated using the formula Ct=(Sum(X) / N,Sum(Y) / N), where X and Y are the horizontal and vertical coordinates of all pixels constituting the active object, respectively, and N is the total number of pixels.
[0029] Check whether the centroid of the active object falls within any unexpected region. This is determined by the condition IfCt is within Z. If the condition is met, the active object is marked as a potentially abnormal behavior object.
[0030] Record the behavioral trajectory of objects with potential abnormal behavior, and update the path information using the formula Path=Path+Ct, where Path is the cumulative path, and a new centroid position is added with each update.
[0031] Preferably, the frequency and duration of the analyzed behavior are used to determine whether it is part of the workflow, including:
[0032] The behavioral trajectory of objects with potential abnormal behavior is time-stamped, and the timestamp of each centroid position is recorded. The calculation is performed using the formula Ts=T0+i*Dt, where Ts is the timestamp of the i-th centroid position, T0 is the start timestamp, and Dt is a fixed time interval.
[0033] Based on the timestamp sequence, the frequency of behavior occurring in the unexpected region is calculated using the formula Frq=Count(Ts within Z) / Total_Time, where Frq is the behavior frequency, Count is the number of timestamps that meet the conditions, and Total_Time is the total observation duration.
[0034] The cumulative time spent in the unexpected area by the behavior is calculated using the formula Dur=Sum(Dur_i), where Dur_i=Tj-Tk, Tk is recorded when Ct first enters Z and Tj is recorded when it leaves, and Sum is the sum of all Dur_i.
[0035] The frequency Frq and cumulative dwell time Dur of the behavior are compared with the preset workflow baseline values. If both are lower than or equal to the baseline values, the behavior is determined to be part of the normal working process. Otherwise, it is considered a potential safety hazard. The formula Res = If (Frq <= F_base) and (Dur <= D_base) is used to determine if Res is normal, otherwise Res is abnormal. Here, F_base and D_base are the baseline values for frequency and duration, respectively.
[0036] Preferably, if the behavior does not fall within the workflow, the potential risk level is assessed based on location information, including:
[0037] For objects with abnormal behavior (Res), extract their location coordinates (Ct) within the unexpected area and determine the hazard type (Zone_Type) of the location using the formula Zone_Type=Match(Ct,Z_List), where Z_List is a predefined list of coordinates for each hazard area.
[0038] Based on the aforementioned hazard type Zone_Type and cumulative stay time Dur, the preliminary risk score Sc1 is calculated using the formula Sc1=Dur*W1(Zone_Type), where W1 is the weight value for different hazard types, representing the inherent risk level of each type of hazard area;
[0039] The risk score Sc2 is adjusted by combining the movement speed Spd of the behavioral object with the formula Sc2=Sc1+Spd*W2, where Spd is the distance of the centroid displacement per unit time, and W2 is the speed influence factor, which is used to quantify the impact of speed on risk.
[0040] The risk score Sc2 is compared with the set risk threshold Risk_Thresh to determine the final risk level Lvl. Using the formula Lvl=If(Sc2>Risk_Thresh), then Lvl=high risk, otherwise Lvl=low risk.
[0041] Preferably, the risk level is compared with a preset threshold, and a warning signal is triggered when the risk level exceeds the threshold, including:
[0042] Obtain the value Sc2 corresponding to the final risk level Lvl, and use the formula Threshold_Lvl=Base(Lvl) to determine the corresponding risk level benchmark Threshold_Lvl, where Base is a list of preset benchmark values for different risk levels;
[0043] The degree to which Sc2 exceeds Threshold_Lvl is calculated using the formula Ex=Sc2-Threshold_Lvl. If Ex>0, it means that the risk of the current behavior exceeds the set safety limit.
[0044] The urgency level Grd of the warning signal is determined based on the Ex value using the formula Grd=Round(Ex / Step_Size), where Step_Size is a predefined fractional difference between each level of warning signal, and Round represents the rounding operation to ensure that the warning signal is clearly graded.
[0045] When Grd is greater than zero, the corresponding level of warning signal Act is triggered using the formula Act=Trigger(Grd), where Trigger is the process of triggering corresponding warning measures based on different Grd values.
[0046] On the other hand, the present invention proposes a video slicing system based on computer vision, comprising:
[0047] The activity area segmentation module is used to acquire continuous video frames at the construction site, segment the video frames, and distinguish the activity areas of personnel and vehicles.
[0048] The video frame contrast adjustment module is used to calculate the illumination change parameters within the active area, mark abnormal illumination areas, and adjust the video frame contrast based on the abnormal illumination areas.
[0049] The behavior detection and analysis module is used to detect behaviors in unexpected areas in video frames after contrast adjustment, analyze the frequency and duration of the behaviors, and determine whether they are part of the workflow.
[0050] The warning signal triggering module is used to assess the potential risk level based on location information if the behavior does not belong to the workflow, compare the risk level with a preset threshold, and trigger a warning signal when the threshold is exceeded.
[0051] Technical effects and advantages of the present invention: The video slicing method and system based on computer vision proposed in this invention have the following advantages compared with the prior art:
[0052] This invention can accurately identify the behavior of personnel or vehicles on construction sites under complex lighting conditions and effectively distinguish whether these behaviors are part of normal work processes, thereby significantly reducing false alarm rates and improving safety. By calculating the lighting change parameters in the activity area, adjusting the contrast of video frames, detecting behaviors in unexpected areas and their frequency and duration, and then assessing the potential risk level based on location information and triggering an early warning signal when the risk exceeds a preset threshold, this method greatly improves the efficiency and accuracy of construction site safety management, effectively prevents potential safety hazards, and ensures the safety of construction site personnel and equipment. Attached Figure Description
[0053] Figure 1 This is a flowchart of a video slicing method based on computer vision according to the present invention;
[0054] Figure 2 This is a block diagram of a video slicing system based on computer vision according to the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] This invention provides, for example Figure 1 The video slicing method based on computer vision shown here significantly improves the efficiency and accuracy of construction site safety management, effectively prevents potential safety hazards, and ensures the safety of construction site personnel and equipment; details are as follows:
[0057] Specifically, the computer vision-based video slicing method includes the following steps:
[0058] Step 1: Acquire continuous video frames from the construction site; specifically including:
[0059] Multiple cameras are installed at selected locations on the construction site, and the data streams collected by the cameras are processed synchronously to ensure that the timestamps of video frames from different cameras are consistent. The timestamp of each frame is calculated using the formula Ts=T0+s*Dt, where Ts is the timestamp of the s-th frame, T0 is the start timestamp, and Dt is a fixed time interval. This formula can assign a unique and consistent timestamp to each frame, which is convenient for subsequent processing.
[0060] The video frames with the same timestamp are numbered to form a continuous frame sequence, which is represented by the formula Fs=F(Ts), where Fs is the s-th frame arranged in chronological order; this ensures that the order between frames is correct.
[0061] The continuous frame sequence is initially screened to remove duplicate or damaged frames. This is determined by comparing the timestamp difference between adjacent frames with Dt. If they are not equal, they are considered abnormal frames and are removed. This improves the quality of the data and reduces misjudgments caused by duplicate or damaged frames.
[0062] Example 1
[0063] Suppose four cameras are installed on a construction site, covering a key area of the site. The start timestamp T0 is set to 0 seconds, and the fixed time interval Dt is 0.04 seconds (i.e., 25 frames per second).
[0064] First, according to the formula Ts=T0+s*Dt, the timestamp of the 100th frame is calculated as Ts=0+100*0.04=4 seconds, which means that the 100th frame was captured 4 seconds after the start of recording.
[0065] Then, using the formula Fs=F(Ts), all frames with the same timestamp are numbered in chronological order, for example, frame 100 is marked as Fs(4).
[0066] Next, check if the timestamp difference between adjacent frames is equal to Dt. For example, check the timestamp difference between frame 99 and frame 100. If the difference is not equal to 0.04 seconds, then one of the frames is considered to have a problem and is removed.
[0067] By following the steps above, a set of high-quality, time-synchronized continuous video frame sequences can be obtained, providing a solid foundation for subsequent construction site safety monitoring.
[0068] Step 2: Segment the video frames to distinguish the activity areas of people and vehicles; specifically including:
[0069] Each frame in the continuous frame sequence is processed using a color space conversion method, converting each frame from the RGB color space to the HSV color space;
[0070] The saturation and brightness values of each pixel in the HSV color space are calculated using the formulas Sa=(max(R,G,B)-min(R,G,B)) / max(R,G,B) and Va=max(R,G,B), where R, G, and B are the red, green, and blue component values of the pixel in the RGB space, respectively. By calculating the saturation and brightness values of each pixel, different objects in the image can be better identified, especially high-contrast objects such as people and vehicles.
[0071] Based on the saturation and brightness values, a threshold range is set to segment the data into a set of pixels that meet the criteria, forming a candidate region. This candidate region is represented by the formula Th(Sa,Va), where Th is the set threshold range. Only pixels whose Sa and Va values fall within this range are included in the candidate region. By setting a reasonable threshold range, areas that may contain people or vehicles can be effectively filtered out, reducing the impact of background noise.
[0072] Connectivity analysis is applied to candidate regions to identify and label activity areas belonging to people or vehicles by comparing the consistency between adjacent pixels. The area of each activity region is calculated using the formula A=Sum(P), where P is the number of pixels that meet the consistency criteria. This step accurately identifies and quantifies activity regions, providing reliable data support for subsequent behavior analysis.
[0073] Example 2
[0074] Suppose we have a sequence of continuous video frames from a construction site, and the goal is to distinguish the activity areas of people and vehicles from these frames.
[0075] Color space conversion: Convert each frame from the RGB color space to the HSV color space to better handle different lighting conditions.
[0076] Calculate saturation and brightness values: For a specific pixel, assuming its RGB values are R=200, G=150, B=100, then: Sa=(200-100) / 200=0.5; Va=200. These calculations help determine the color attributes of the pixel, providing a basis for further segmentation.
[0077] Set the threshold range and segment: Set the threshold range Th(Sa,Va), for example, Sa is between [0.4, 0.6] and Va is between [150, 250]. Any pixel that meets these conditions will be included in the candidate region.
[0078] Suppose that after threshold filtering, several potential activity regions are obtained.
[0079] Connectivity analysis and area calculation: Perform connectivity analysis on the candidate region to find adjacent and highly consistent pixel blocks. For example, if P=500 pixels meet the criteria in a candidate region, then the area of the region is A=Sum(P)=500.
[0080] This step ensures that the specific location and size of people or vehicles can be accurately identified and marked, providing crucial information for subsequent security monitoring.
[0081] Step 3: Calculate the illumination variation parameters within the activity area and mark abnormal illumination areas; specifically including:
[0082] For each pixel within the active area, the rate of change of brightness in a continuous frame sequence is calculated using the formula Lr=(Vb-V0) / b, where Lr is the rate of change of brightness, Vb is the brightness value of the current frame, V0 is the brightness value of the initial frame, and b is the frame number. By calculating the rate of change of brightness, the changes in lighting conditions over time can be identified, thereby helping to detect abnormal lighting areas.
[0083] Based on the brightness change rate, a dynamic threshold range Thresh_L is set using the formula Thresh_L=Avg(Lr)±k*Std(Lr) to distinguish between normal and abnormal lighting conditions, where Avg(Lr) is the average brightness change rate, Std(Lr) is the standard deviation, and k is the adjustment coefficient. This formula helps define a reasonable threshold range, so that pixels outside this range are considered to be part of the abnormal lighting area.
[0084] By traversing all pixels within the active area, a set of pixels exceeding the threshold is identified based on the dynamic threshold range, forming a potential abnormal lighting area. This is represented by the formula O={Px|Lr(Px)>Thresh_L or Lr(Px)<-Thresh_L}, where O is the set of pixels in the abnormal lighting area. This method can accurately screen out potential abnormal lighting areas, providing a data foundation for further analysis.
[0085] Connectivity analysis was performed on the potential abnormal lighting areas, and adjacent pixel blocks with similar lighting conditions were merged to finally determine the boundaries of the abnormal lighting areas. The area of the abnormal lighting areas was calculated using the formula A_Anomaly=Sum(O), which ensured that the boundaries of the abnormal lighting areas were clear and their size was quantified.
[0086] Example 3
[0087] Suppose we have a video feed from a construction site that includes an activity area. The goal is to identify and mark areas of unusual lighting within that area.
[0088] Calculate the brightness change rate: For each pixel in the active area, assuming the initial frame brightness value V0=180, the current frame brightness value Vb=220, and the frame number b=50, the brightness change rate is: Lr=(220-180) / 50=0.8; This step helps to understand the brightness change trend of each pixel.
[0089] Set the dynamic threshold range: Assuming that the average value of the rate of change of brightness Avg(Lr) = 0.5 and the standard deviation Std(Lr) = 0.2 in the entire active area, and the adjustment coefficient k = 2, then the dynamic threshold range is: Thresh_L = 0.5 ± 2 * 0.2 = [0.1, 0.9]; This step helps to define the normal range of illumination variation.
[0090] Identify and mark anomalous lighting areas: Traverse all pixels and find those whose brightness change rate exceeds a threshold range. For example, for a given pixel, if Lr = 1.2 (greater than the upper limit of Thresh_L), mark it as part of an anomalous lighting area.
[0091] The set of these pixels is represented by the formula O={Px|Lr(Px)>Thresh_L or Lr(Px)<-Thresh_L}.
[0092] Connectivity analysis and area calculation: For the pixel set O marked as an abnormal lighting area, perform connectivity analysis and merge adjacent pixel blocks with similar lighting conditions.
[0093] Assuming there are 300 such pixels, the area of the abnormal lighting region is: A_Anomaly=Sum(O)=300; This step ensures the clarity of the boundary of the abnormal lighting region and provides specific area information, which is convenient for subsequent processing and early warning.
[0094] Step 4: Adjust the video frame contrast according to the abnormal lighting area; specifically including:
[0095] The formula Dif = Avg_V(A_Anomaly) - Avg_V(Global) is used to calculate the difference between the average brightness value of each pixel within the abnormal lighting area and the average brightness value of the entire frame. Here, Dif represents the brightness difference, Avg_V(A_Anomaly) represents the average brightness value of the abnormal lighting area, and Avg_V(Global) represents the average brightness value of the entire frame. By calculating the brightness difference, the brightness change of the abnormal lighting area relative to the overall image can be quantified, providing a basis for subsequent contrast adjustments.
[0096] The contrast adjustment coefficient is determined based on the brightness difference value using the formula AdjFac=1+k*(Dif / Avg_V(Global)), where AdjFac is the contrast adjustment coefficient and k is a proportional constant used to control the adjustment intensity. This formula helps to dynamically adjust the contrast, making abnormal lighting areas clearer visually while maintaining the consistency of the overall image.
[0097] The brightness value of each pixel in the abnormal lighting area is adjusted by applying a contrast adjustment coefficient, which is achieved by the formula V_new=V_old*AdjFac, where V_new is the adjusted brightness value and V_old is the original brightness value. By adjusting the brightness value, the visibility of the abnormal lighting area is improved, and the recognition difficulty caused by uneven lighting is reduced.
[0098] The update function updates all pixels in the frame that have undergone brightness adjustment, using the formula Frame_upd={Px|PxinFrameandPxadjustedbyV_new}, where Frame_upd represents the adjusted frame. This ensures that all pixels that have undergone brightness adjustment are updated correctly, improving the overall image quality and consistency.
[0099] Example 4
[0100] Suppose we have a video frame of a construction site containing areas of abnormal lighting. The goal is to adjust the contrast of these areas of abnormal lighting to improve their visibility.
[0101] Calculate the brightness difference value: Assuming the average brightness of the abnormal lighting area Avg_V(A_Anomaly) = 150 and the average brightness of the entire frame Avg_V(Global) = 200, then the brightness difference value is: Dif = 150 - 200 = -50; This step helps to quantify the brightness difference of the abnormal lighting area relative to the overall image.
[0102] Determine the contrast adjustment coefficient: Set the proportional constant k=0.5, then the contrast adjustment coefficient is: AdjFac=1+0.5*(-50 / 200)=1-0.125=0.875; This step dynamically adjusts the contrast based on the brightness difference value, making abnormal lighting areas clearer visually.
[0103] Adjusting the brightness value: For a specific pixel in an abnormal lighting area, assuming its original brightness value V_old=160, the adjusted brightness value is: V_new=160*0.875=140; This step improves the visibility of the abnormal lighting area and reduces the recognition difficulties caused by uneven lighting.
[0104] Update all pixels in the frame that have undergone brightness adjustment: Update all pixels that meet the adjustment conditions. For example, for a certain pixel Px, if its brightness value has been adjusted to V_new according to the above formula, then add it to the new frame.
[0105] Assuming there are 200 such pixels, the updated frame is represented as: Frame_upd={Px|PxinFrameandPxadjustedbyV_new}; This step ensures that all pixels that have undergone brightness adjustment are updated correctly, improving the overall image quality and consistency.
[0106] Step 5: Detect behavior in unexpected areas within the video frames after contrast adjustment; specifically including:
[0107] Define the coordinate range of different types of unexpected areas within the construction site, and map the areas onto frames with adjusted contrast. Use the formula Z=(X_min,Y_min,X_max,Y_max) to represent the coordinate range of each unexpected area. By clearly defining the location of unexpected areas, activities occurring within these areas can be monitored in a targeted manner.
[0108] For each active object in the frame after contrast adjustment, its centroid position Ct is calculated using the formula Ct=(Sum(X) / N,Sum(Y) / N), where X and Y are the horizontal and vertical coordinates of all pixels constituting the active object, respectively, and N is the total number of pixels. By calculating the centroid position, the position of the active object in the frame can be accurately located, providing a basis for subsequent behavior analysis.
[0109] Check whether the centroid of the active object falls within any unexpected area. This is determined by the condition IfCt is within Z. If the condition is met, the active object is marked as a potential abnormal behavior object. This step can identify which active objects have entered unexpected areas, thus marking them as potential security risks.
[0110] Record the behavioral trajectory of objects with potential abnormal behavior, and update the path information using the formula Path=Path+Ct, where Path is the cumulative path. Each update adds a new centroid position. By continuously tracking and recording the movement path of active objects, we can better understand their behavioral patterns and provide data support for the early warning system.
[0111] Example 5
[0112] Suppose we have a video frame of a construction site with adjusted contrast, and the goal is to detect behavior in unexpected areas within that frame.
[0113] Define the coordinate range of the unexpected area: Suppose an excavation work area is defined as an unexpected area in a construction site, with a coordinate range of Z=(100,150,200,250), that is, the lower left corner is (100,150) and the upper right corner is (200,250). This step helps to clarify the areas that need to be monitored.
[0114] Calculate the centroid position of the active object: For a specific active object, assuming the sum of the x-coordinates of all its pixels is Sum(X)=1800, the sum of the y-coordinates is Sum(Y)=2200, and the total number of pixels is N=20, then the centroid position is: Ct=(1800 / 20,2200 / 20)=(90,110); By calculating the centroid position, the specific position of the active object in the frame can be accurately determined.
[0115] Check if the centroid position falls within the unexpected region: Based on the centroid position Ct=(90,110) above, check if the condition IfCt is within Z is met. Since (90,110) is not within the range of Z=(100,150,200,250), the active object is not marked as a potential anomalous behavior object. If the centroid position is between (100,150) and (200,250), it will be marked as a potential anomalous behavior object.
[0116] Record and update the behavior trajectory: Suppose that the centroid position Ct=(150,200) of another active object does indeed fall into the unexpected region Z=(100,150,200,250). Add this centroid position to its behavior trajectory: Path=Path+Ct=[(initial path)]+(150,200); each time the path is updated, the new centroid position is added to the cumulative path for subsequent analysis and early warning.
[0117] Step Six: Analyze the frequency and duration of the behavior to determine if it is part of the workflow; specifically including:
[0118] The behavioral trajectory of potentially abnormal objects is time-stamped, and the timestamp of each centroid position is recorded. The timestamp is calculated using the formula Ts=T0+i*Dt, where Ts is the timestamp of the i-th centroid position, T0 is the starting timestamp, and Dt is a fixed time interval. By assigning a unique timestamp to each centroid position, the positional changes of active objects at different points in time can be accurately tracked.
[0119] The frequency of a behavior occurring in the unexpected region is calculated based on the timestamp sequence using the formula Frq=Count(Ts within Z) / Total_Time, where Frq is the behavior frequency, Count is the number of timestamps that meet the conditions, and Total_Time is the total observation time. This formula helps to quantify the frequency of the behavior in the unexpected region, facilitating subsequent comparison with the baseline value.
[0120] The cumulative dwell time of the behavior in the unexpected area is calculated using the formula Dur=Sum(Dur_i), where Dur_i=Tj-Tk, Tk is recorded when Ct first enters Z, and Tj is recorded when it leaves, and Sum is the sum of all Dur_i. By calculating the cumulative dwell time, the dwell time of the active object in the unexpected area can be assessed, and its behavior can be further judged as normal.
[0121] The frequency (Frq) and cumulative dwell time (Dur) of the behavior are compared with preset workflow baseline values. If both are lower than or equal to the baseline values, the behavior is determined to be part of the normal work process; otherwise, it is considered a potential safety hazard. The formula Res = If (Frq <= F_base) and (Dur <= D_base) is used, then Res = normal; otherwise, Res = abnormal. Here, F_base and D_base are the baseline values for frequency and duration, respectively. By comparing actual data with baseline values, normal behavior and potential safety hazards can be effectively distinguished, providing a basis for the early warning system.
[0122] Example 6
[0123] Suppose we have a video frame from a construction site that has identified several objects exhibiting potentially abnormal behavior, and their behavioral trajectories have been recorded. The goal is to analyze whether these behaviors are part of the normal work process.
[0124] Timestamp centroid position: Assuming the starting timestamp T0 = 0 seconds and the fixed time interval Dt = 0.04 seconds (i.e., 25 frames per second), the timestamp for the 50th centroid position is: Ts = 0 + 50 * 0.04 = 2 seconds; this step ensures that each centroid position has an accurate timestamp, which is convenient for subsequent analysis.
[0125] Calculate the frequency of the behavior: Assuming that within one observation period (Total_Time=60 seconds), a certain active object has its centroid position fall into the unexpected region Z 15 times, then the frequency of the behavior is: Frq=15 / 60=0.25 times / second; This step helps to quantify the frequency of the behavior, providing a basis for further analysis.
[0126] Calculate the cumulative dwell time: Assuming the participant stayed in the unexpected area twice, the first time from 5 to 10 seconds, and the second time from 20 to 25 seconds, the cumulative dwell time is:
[0127] Dur_1 = 10 - 5 = 5 seconds;
[0128] Dur_2 = 25 - 20 = 5 seconds;
[0129] Dur=Sum(Dur_1,Dur_2)=5+5=10 seconds;
[0130] This step quantifies the time an individual spends in an unexpected area, which helps in assessing their behavioral patterns.
[0131] Determining if the behavior is normal: Assuming the preset workflow baseline values are F_base = 0.3 times / second and D_base = 15 seconds, then based on the above calculation results:
[0132] Frq=0.25 <F_base;
[0133] Dur=10 <D_base;
[0134] Based on the formula Res = If(Frq<=F_base) and (Dur<=D_base), then Res = "Normal" otherwise Res = "Abnormal". Therefore, we conclude that Res = "Normal". This indicates that the behavior of the active object conforms to the normal working process and does not pose a security risk.
[0135] Step 7: If the behavior does not fall within the workflow, assess the potential risk level based on location information; specifically including:
[0136] For objects exhibiting abnormal behavior (Res), their location coordinates (Ct) within the unexpected area are extracted, and the hazard type (Zone_Type) to which the location belongs is determined using the formula Zone_Type=Match(Ct,Z_List), where Z_List is a predefined list of coordinates for each hazard zone. By matching the centroid location with the predefined list of hazard zones, the specific hazard type of the active object can be identified, providing a basis for subsequent risk assessment.
[0137] Based on the aforementioned hazard type Zone_Type and cumulative stay time Dur, the preliminary risk score Sc1 is calculated using the formula Sc1=Dur*W1(Zone_Type), where W1 is the weight value for different hazard types, representing the inherent risk level of each type of hazard area. This formula helps quantify the impact of the activity object's stay time in a specific hazard area on its risk score.
[0138] The risk score Sc2 is adjusted by combining the moving speed Spd of the action object with the formula Sc2=Sc1+Spd*W2, where Spd is the distance of the centroid displacement per unit time and W2 is the speed influence factor, which is used to quantify the impact of speed on risk. By taking the moving speed into account, the impact of the action object's behavior on the overall risk can be assessed more accurately, especially when rapid movement may increase the risk of accidents.
[0139] The risk score Sc2 is compared with the set risk threshold Risk_Thresh to determine the final risk level Lvl. Using the formula Lvl=If(Sc2>Risk_Thresh), Lvl=high risk, otherwise Lvl=low risk. By comparing the actual risk score with the preset threshold, different levels of risk can be effectively distinguished.
[0140] Example 7
[0141] Suppose that a certain behavior has been identified as "abnormal" (Res) and detailed behavioral data of it within the unexpected area has been recorded. The goal is to assess the potential risk level based on this information.
[0142] Determine the hazard type: Assume the centroid of the active object is located at Ct = (150, 200), and Z_List contains the coordinate range of an excavation work area (100, 150, 200, 250). Using the formula Zone_Type = Match(Ct, Z_List), we determine that the active object is located within the excavation work area; therefore, Zone_Type = Excavation Work Area. This step helps to clarify the specific hazard type of the active object.
[0143] Calculate the preliminary risk score: Assuming the cumulative dwell time is Dur=10 seconds and the weight value of the excavation work area is W1(Zone_Type)=1.5, the preliminary risk score is: Sc1=10*1.5=15; This step quantifies the impact of the dwell time of the activity object in a specific dangerous area on the risk score.
[0144] Adjusting the risk score: Assuming the moving speed of the activity object Spd = 0.5 m / s and the speed influence factor W2 = 2, the adjusted risk score is: Sc2 = 15 + 0.5 * 2 = 16; This step further refines the risk score by taking into account the moving speed, making the assessment more comprehensive.
[0145] Determine the risk level: Assuming the set risk threshold Risk_Thresh=15, according to the formula Lvl=If(Sc2>Risk_Thresh), then Lvl=high risk, otherwise Lvl=low risk. The conclusion is: Lvl=high risk (because Sc2=16>Risk_Thresh=15); this indicates that the behavior of the activity subject has a high safety risk and immediate intervention measures are required.
[0146] Step 8: Compare the risk level with a preset threshold; trigger a warning signal if the risk level exceeds the threshold; specifically including:
[0147] Obtain the value Sc2 corresponding to the final risk level Lvl, and use the formula Threshold_Lvl=Base(Lvl) to determine the corresponding risk level benchmark Threshold_Lvl, where Base is a list of preset benchmark values for different risk levels; by matching the risk level with the predefined list of benchmark values, the safety limit corresponding to the current behavior can be determined.
[0148] The degree to which Sc2 exceeds Threshold_Lvl is calculated using the formula Ex=Sc2-Threshold_Lvl. If Ex>0, it means that the risk of the current behavior exceeds the set safety limit. This formula helps to quantify the gap between the actual risk score and the safety limit, which is convenient for subsequent graded early warning.
[0149] The urgency level Grd of the warning signal is determined based on the Ex value using the formula Grd=Round(Ex / Step_Size), where Step_Size is a predefined fractional difference between each level of warning signal, and Round represents the rounding operation to ensure that the warning signal is clearly graded. By calculating and rounding the ratio of the excess to the step size, the urgency level of the warning signal can be clearly determined, ensuring clear grading.
[0150] When Grd is greater than zero, the corresponding level of warning signal Act is triggered using the formula Act=Trigger(Grd), where Trigger is the process of triggering corresponding warning measures based on different Grd values. By comparing the urgency level with preset conditions, appropriate warning signals can be issued in a timely manner to remind managers to take corresponding countermeasures.
[0151] Example 8
[0152] Suppose the risk level of a certain activity has been assessed, and its adjusted risk score is Sc2=16. The goal is to compare this risk level with a preset threshold and trigger an early warning signal if necessary.
[0153] Determine the risk level baseline: Assuming the final risk level is Lvl = high risk, and the corresponding preset baseline value list Base is {low risk: 10, high risk: 15}, then the risk level baseline is: Threshold_Lvl = Base(high risk) = 15; This step clarifies the safety limit corresponding to the current behavior.
[0154] Calculate the degree of exceedance: According to the formula Ex=Sc2-Threshold_Lvl, calculate the degree of exceedance: Ex=16-15=1; this step indicates that the risk of the current behavior exceeds the set safety limit.
[0155] Determine the urgency level of the warning signal: Assuming the fractional difference Step_Size between each warning level is 2, calculate the urgency level using the formula Grd=Round(Ex / Step_Size): Grd=Round(1 / 2)=0 (rounded to the nearest integer); if Ex=2.5, then Grd=Round(2.5 / 2)=1, indicating that a Level 1 warning signal needs to be triggered. This step ensures that the warning signal classification is clear, facilitating subsequent processing.
[0156] Triggering an early warning signal: When Grd is greater than zero, an early warning signal of the corresponding level is triggered. For example, if Grd = 1, then according to the formula Act = Trigger(Grd), a level one early warning signal is triggered: Act = Trigger(1); this may include specific measures such as sending SMS notifications and activating sound alarms. If Grd = 0, no early warning signal is triggered, but continuous monitoring is still required.
[0157] By following the steps described above, risk levels can be effectively compared with preset thresholds, and warning signals can be triggered when necessary. This not only improves the efficiency of construction site safety management but also enhances the ability to respond to emergencies, ensuring the safety of personnel and equipment on site.
[0158] On the other hand, this invention proposes a video slicing system based on computer vision, such as... Figure 2 As shown, it includes:
[0159] The activity area segmentation module is used to acquire continuous video frames at the construction site, segment the video frames, and distinguish the activity areas of personnel and vehicles.
[0160] The video frame contrast adjustment module is used to calculate the illumination change parameters within the active area, mark abnormal illumination areas, and adjust the video frame contrast based on the abnormal illumination areas.
[0161] The behavior detection and analysis module is used to detect behaviors in unexpected areas in video frames after contrast adjustment, analyze the frequency and duration of the behaviors, and determine whether they are part of the workflow.
[0162] The warning signal triggering module is used to assess the potential risk level based on location information if the behavior does not belong to the workflow, compare the risk level with a preset threshold, and trigger a warning signal when the threshold is exceeded.
[0163] In addition, the modules mentioned above are also used to implement other steps of the computer vision-based video slicing method, which will not be elaborated here.
[0164] In summary, this method can accurately identify the behavior of personnel or vehicles on construction sites under complex lighting conditions and effectively distinguish whether these behaviors are part of normal work processes, thereby significantly reducing false alarm rates and improving safety. By calculating lighting change parameters within the activity area, adjusting video frame contrast, detecting behaviors in unexpected areas and their frequency and duration, and then assessing the potential risk level based on location information and triggering an early warning signal when the risk exceeds a preset threshold, this method greatly improves the efficiency and accuracy of construction site safety management, effectively prevents potential safety hazards, and ensures the safety of construction site personnel and equipment.
[0165] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A video slicing method based on computer vision, characterized in that, Includes the following steps: Acquire continuous video frames from the construction site, segment the video frames, and distinguish the activity areas of personnel and vehicles; Calculate the illumination change parameters within the active area, mark abnormal illumination areas, and adjust the video frame contrast based on the abnormal illumination areas; Detect behaviors in unexpected areas within video frames after contrast adjustment, analyze the frequency and duration of these behaviors, and determine whether they are part of the workflow. If the behavior does not fall within the workflow, the potential risk level is assessed based on the location information, and the risk level is compared with a preset threshold. If the threshold is exceeded, a warning signal is triggered. The calculation of illumination variation parameters within the active area and the marking of abnormal illumination areas include: For each pixel within the active area, the brightness change rate in a continuous frame sequence is calculated using the formula Lr=(Vb-V0) / b, where Lr is the brightness change rate, Vb is the brightness value of the current frame, V0 is the brightness value of the initial frame, and b is the frame number. Based on the brightness change rate, a dynamic threshold range Thresh_L is set using the formula Thresh_L=Avg(Lr)±k*Std(Lr) to distinguish between normal and abnormal lighting conditions, where Avg(Lr) is the average brightness change rate, Std(Lr) is the standard deviation, and k is the adjustment coefficient. Traverse all pixels within the active area, identify the set of pixels exceeding the threshold based on the dynamic threshold range, and form a potential abnormal lighting area, which is represented by the formula O={Px|Lr(Px)>Thresh_L or Lr(Px)<-Thresh_L}, where O is the set of pixels in the abnormal lighting area; Connectivity analysis is performed on the potential abnormal lighting areas, adjacent pixel blocks with similar lighting conditions are merged, the boundary of the abnormal lighting areas is finally determined, and the area of the abnormal lighting areas is calculated using the formula A_Anomaly=Sum(O). Adjusting the video frame contrast based on the abnormal lighting area includes: The formula Dif = Avg_V(A_Anomaly) - Avg_V(Global) is used to calculate the difference between the average brightness value of each pixel in the abnormal lighting area and the average brightness value of the global area. Here, Dif is the brightness difference value, Avg_V(A_Anomaly) is the average brightness value of the abnormal lighting area, and Avg_V(Global) is the average brightness value of the entire frame. Based on the brightness difference value, the contrast adjustment coefficient is determined using the formula AdjFac=1+k*(Dif / Avg_V(Global)), where AdjFac is the contrast adjustment coefficient and k is a proportional constant used to control the adjustment intensity. The brightness value of each pixel in the abnormal lighting area is adjusted by applying a contrast adjustment coefficient, which is achieved by the formula V_new=V_old*AdjFac, where V_new is the adjusted brightness value and V_old is the original brightness value. Update all brightness-adjusted pixels in the frame using the formula Frame_upd={Px|PxinFrameandPxadjustedbyV_new}, where Frame_upd represents the adjusted frame.
2. The video slicing method based on computer vision according to claim 1, characterized in that, The acquisition of continuous video frames at the construction site includes: Multiple cameras are installed at selected locations on the construction site. The data streams collected by the cameras are processed synchronously to ensure that the timestamps of video frames from different cameras are consistent. The timestamp of each frame is calculated using the formula Ts=T0+s*Dt, where Ts is the timestamp of the s-th frame, T0 is the start timestamp, and Dt is a fixed time interval. The video frames with the same timestamp are numbered to form a continuous frame sequence, which is represented by the formula Fs=F(Ts), where Fs is the s-th frame arranged in chronological order; The continuous frame sequence is initially screened to remove duplicate or corrupted frames. This is determined by comparing the timestamp difference between adjacent frames with Dt. If they are not equal, they are considered abnormal frames and are removed.
3. The video slicing method based on computer vision according to claim 2, characterized in that, The video frames are segmented to distinguish the activity areas of people and vehicles, including: Each frame in the continuous frame sequence is processed using a color space conversion method, converting each frame from the RGB color space to the HSV color space; The saturation and brightness values of each pixel in the HSV color space are calculated using the formulas Sa=(max(R,G,B)-min(R,G,B)) / max(R,G,B) and Va=max(R,G,B), where R, G, and B are the red, green, and blue component values of the pixel in the RGB space, respectively. Based on the saturation and brightness values, a threshold range is set to segment out the set of pixels that meet the conditions, forming a candidate region, which is represented by the formula Th(Sa,Va), where Th is the set threshold range; Connectivity analysis is applied to candidate regions to identify and label activity areas belonging to people or vehicles by comparing the consistency between adjacent pixels. The area of each activity region is calculated using the formula A=Sum(P), where P is the number of pixels that meet the consistency.
4. The video slicing method based on computer vision according to claim 3, characterized in that, Detecting behavior in unexpected regions within contrast-adjusted video frames, including: Define the coordinate range of different types of unexpected areas within the construction site, and map the areas onto the frame after adjusting the contrast. Use the formula Z=(X_min,Y_min,X_max,Y_max) to represent the coordinate range of each unexpected area. For each active object in the frame after contrast adjustment, its centroid position Ct is calculated using the formula Ct=(Sum(X) / N,Sum(Y) / N), where X and Y are the horizontal and vertical coordinates of all pixels constituting the active object, respectively, and N is the total number of pixels. Check whether the centroid of the active object falls within any unexpected region. This is determined by the condition IfCt is within Z. If the condition is met, the active object is marked as a potentially abnormal behavior object. Record the behavioral trajectory of objects with potential abnormal behavior, and update the path information using the formula Path=Path+Ct, where Path is the cumulative path, and a new centroid position is added with each update.
5. The video slicing method based on computer vision according to claim 4, characterized in that, Analyze the frequency and duration of the behavior to determine whether it is part of the workflow, including: The behavioral trajectory of objects with potential abnormal behavior is time-stamped, and the timestamp of each centroid position is recorded. The calculation is performed using the formula Ts=T0+i*Dt, where Ts is the timestamp of the i-th centroid position, T0 is the start timestamp, and Dt is a fixed time interval. Based on the timestamp sequence, the frequency of behavior occurring in the unexpected region is calculated using the formula Frq=Count(Ts within Z) / Total_Time, where Frq is the behavior frequency, Count is the number of timestamps that meet the conditions, and Total_Time is the total observation duration. The cumulative time spent in the unexpected area by the behavior is calculated using the formula Dur=Sum(Dur_i), where Dur_i=Tj-Tk, Tk is recorded when Ct first enters Z and Tj is recorded when it leaves, and Sum is the sum of all Dur_i. The frequency Frq and cumulative dwell time Dur of the behavior are compared with the preset workflow baseline values. If both are lower than or equal to the baseline values, the behavior is determined to be part of the normal working process. Otherwise, it is considered a potential safety hazard. The formula Res = If (Frq <= F_base) and (Dur <= D_base) is used to determine if Res is normal, otherwise Res is abnormal. Here, F_base and D_base are the baseline values for frequency and duration, respectively.
6. The video slicing method based on computer vision according to claim 5, characterized in that, If the behavior does not fall within the workflow, the potential risk level is assessed based on location information, including: For objects with abnormal behavior (Res), extract their location coordinates (Ct) within the unexpected area and determine the hazard type (Zone_Type) of the location using the formula Zone_Type=Match(Ct,Z_List), where Z_List is a predefined list of coordinates for each hazard area. Based on the aforementioned hazard type Zone_Type and cumulative stay time Dur, the preliminary risk score Sc1 is calculated using the formula Sc1=Dur*W1(Zone_Type), where W1 is the weight value for different hazard types, representing the inherent risk level of each type of hazard area; The risk score Sc2 is adjusted by combining the movement speed Spd of the behavioral object with the formula Sc2=Sc1+Spd*W2, where Spd is the distance of the centroid displacement per unit time, and W2 is the speed influence factor, which is used to quantify the impact of speed on risk. The risk score Sc2 is compared with the set risk threshold Risk_Thresh to determine the final risk level Lvl. Using the formula Lvl=If(Sc2>Risk_Thresh), then Lvl=high risk, otherwise Lvl=low risk.
7. A video slicing method based on computer vision according to claim 6, characterized in that, The risk level is compared with a preset threshold, and a warning signal is triggered when the risk level exceeds the threshold, including: Obtain the value Sc2 corresponding to the final risk level Lvl, and use the formula Threshold_Lvl=Base(Lvl) to determine the corresponding risk level benchmark Threshold_Lvl, where Base is a list of preset benchmark values for different risk levels; The degree to which Sc2 exceeds Threshold_Lvl is calculated using the formula Ex=Sc2-Threshold_Lvl. If Ex>0, it means that the risk of the current behavior exceeds the set safety limit. The urgency level Grd of the warning signal is determined based on the Ex value using the formula Grd=Round(Ex / Step_Size), where Step_Size is a predefined fractional difference between each level of warning signal, and Round represents the rounding operation to ensure that the warning signal is clearly graded. When Grd is greater than zero, the corresponding level of warning signal Act is triggered using the formula Act=Trigger(Grd), where Trigger is the process of triggering corresponding warning measures based on different Grd values.
8. A computer vision-based video slicing system for implementing the method as described in any one of claims 1-7, characterized in that, include: The activity area segmentation module is used to acquire continuous video frames at the construction site, segment the video frames, and distinguish the activity areas of personnel and vehicles. The video frame contrast adjustment module is used to calculate illumination change parameters within the active area, mark abnormal illumination areas, and adjust the video frame contrast based on the abnormal illumination areas. Specifically, it includes: The formula Dif = Avg_V(A_Anomaly) - Avg_V(Global) is used to calculate the difference between the average brightness value of each pixel in the abnormal lighting area and the average brightness value of the global area. Here, Dif is the brightness difference value, Avg_V(A_Anomaly) is the average brightness value of the abnormal lighting area, and Avg_V(Global) is the average brightness value of the entire frame. Based on the brightness difference value, the contrast adjustment coefficient is determined using the formula AdjFac=1+k*(Dif / Avg_V(Global)), where AdjFac is the contrast adjustment coefficient and k is a proportional constant used to control the adjustment intensity. The brightness value of each pixel in the abnormal lighting area is adjusted by applying a contrast adjustment coefficient, which is achieved by the formula V_new=V_old*AdjFac, where V_new is the adjusted brightness value and V_old is the original brightness value. Update all pixels in the frame that have undergone brightness adjustment, represented by the formula Frame_upd={Px|PxinFrameandPxadjustedbyV_new}, where Frame_upd represents the adjusted frame; The behavior detection and analysis module is used to detect behaviors in unexpected areas in video frames after contrast adjustment, analyze the frequency and duration of the behaviors, and determine whether they are part of the workflow. The warning signal triggering module is used to assess the potential risk level based on location information if the behavior does not belong to the workflow, compare the risk level with a preset threshold, and trigger a warning signal when the threshold is exceeded.