A method, system and terminal for detecting illegal behavior of people standing under a crane arm
Through binocular vision and artificial intelligence technology, the position of the crane and workers is monitored in real time, which solves the problem of safety hazards for people standing under the boom at the construction site, realizes real-time supervision and automatic alarm, and improves construction safety.
Patent Information
- Application Number
- CN202111550551.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-17
AI Technical Summary
At the construction site, when people are standing under the crane arm, the existing supervision method cannot track the position of the arm in real time, resulting in blind spots in the field of vision, making it impossible to identify and remind in time, and posing safety risks.
Using binocular vision and artificial intelligence technology, two cameras are set up to form a binocular vision model, and videos of the construction site are captured. The trained crane and human body key point detection models are used to calculate the positions of the crane and workers, and determine whether there is a boom under the arm. Stop this violation.
It realizes real-time supervision of the construction site, reduces the loss of life and property caused by illegal operations, improves the safety of the construction process, automatically judges and alarms, and improves supervision efficiency.
Smart Images

Figure CN114494427B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing and deep learning technology, and in particular to a method, system and terminal for detecting illegal behavior of people standing under a crane arm based on binocular vision and artificial intelligence technology. Background Art
[0002] In power construction scenarios, cranes are widely used. Safety accidents caused by illegal operation of cranes occur frequently every year, and people standing under the crane arm is one of the main causes of crane accidents.
[0003] In the existing supervision of construction scenarios, supervisors are mainly arranged to supervise on-site and correct any violations found. However, for crane equipment, since the crane boom is constantly moving during use, on-site supervisors are unable to track the position of the boom in real time, resulting in blind spots. The blind spots may cause danger to people under the boom, and they cannot be identified or reminded, posing a safety hazard to construction operations. Summary of the invention
[0004] In order to supervise the standardization of crane operations at construction sites and reduce the loss of life and property caused by illegal operations, the present invention adopts binocular vision and artificial intelligence technology to constantly monitor the position of the crane boom at the construction site and calculate the position of the workers at the construction site. By comparing the position of the crane boom and the position of the workers, it is determined whether there is any illegal behavior of standing under the boom.
[0005] Methods include:
[0006] Step 1: Set up two cameras according to the position of the crane so that the crane is in the common field of view of the two cameras, and form a binocular vision model through the intersection of the fields of view of the two cameras;
[0007] Step 2: Use a binocular camera to shoot a video of the construction site, decode the video stream, and obtain the images to be inspected after being decoded by the two cameras respectively;
[0008] Step 3: Input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively;
[0009] Step 4: Input the left and right images taken by the binocular camera into a trained human key point detection model, wherein the human key point detection model uses the human body as a detection target and detects multiple key points of the human body in the image;
[0010] Step 5: Input the coordinates of the key points of the crane obtained in step 3 into the binocular vision positioning module in step 1 to obtain the coordinate values of the 8 key points of the crane in the world coordinate system; fit the minimum approximation plane P1 of these 8 coordinate points through the principle of least squares method, and then establish the crane coordinate system according to the minimum approximation plane P1;
[0011] Step 6: Input the coordinate values of the key points of the human body in the pixel coordinate system of the pictures taken by the left and right cameras obtained in step 4 into the binocular vision positioning module described in step 1, obtain the coordinate values of the key points of the human body in the world coordinate system, and calculate the mean coordinates P(x1, y1, z1) of the key points;
[0012] Step 7: Calculate the distance d1 between the point P(x1, y1, z1) obtained in step 6 and the approximation plane P1 obtained in step 5; the distance d1 is calculated as follows:
[0013]
[0014] Step 8: Calculate the coordinate position of the point obtained in step 6 in the crane coordinate system according to the following formula;
[0015]
[0016] Where R is a 3×3 orthogonal unit matrix, the translation vector t is a 3×1 dimensional vector, P(x1, y1, z1) is the mean coordinate of the key points of the human body obtained in step 6, (x cra ,y cra ,z cra ) is the value of the point mapped from the mean coordinates of the key points of the human body to the crane coordinate system;
[0017] Step 9: According to the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, compliance judgment is performed and the compliance judgment result is output.
[0018] It should be further explained that step one also includes:
[0019] Establish a coordinate system;
[0020] Configure the three-dimensional coordinate system conversion method from the world coordinate system to the camera coordinate system; the conversion method expression is:
[0021]
[0022] The corresponding homogeneous expression is:
[0023]
[0024] Where R is a 3×3 orthogonal unit matrix, the translation vector t is a 3×1 dimensional vector, R and t are independent of the camera, and the two parameters are the external parameters of the camera, X w , Y w , Z w is a point in the world coordinate system, X c , Y c , Z c Map a point in the world coordinate system to a point in the camera coordinate system;
[0025] Project the camera coordinate system to the image coordinate system to obtain the conversion method from three-dimensional coordinates to two-dimensional coordinates;
[0026] The conversion relationship between the camera coordinate system and the image coordinate system satisfies the pinhole imaging model of the camera. The pinhole imaging model performs a certain ratio of scaling operation on the spatial point. c , projected onto the two-dimensional imaging plane; plane π is called the image plane of the camera, point O c is called the center of the camera, and f is the focal length of the camera;
[0027] The homogeneous coordinates of the spatial point P in the camera coordinate system are:
[0028] X c =[X c Y c Z c 1] T ,
[0029] The homogeneous coordinates of the image point m in the image coordinate system are:
[0030] m=[xy 1] T
[0031] The matrix representation is:
[0032]
[0033] It is further necessary to explain that the image coordinate system is transformed into the final pixel coordinate system to obtain the conversion method between two-dimensional coordinates;
[0034] Among them, a rectangular coordinate system uv is established with the upper left corner of the image as the origin and the pixel is in units of pixels. The horizontal coordinate u and the Z coordinate v of the pixel are the column number and the row number of the pixel in the image array respectively.
[0035] Establish an image coordinate system based on physical units;
[0036]
[0037]
[0038]
[0039] Combining the above formulas into a matrix, we can get the relationship between the world coordinate system and the pixel coordinate system:
[0040]
[0041] set up where f x and f y is called the effective focal length, in pixels; then the expression can be expressed as:
[0042]
[0043] Among them, matrix M1 represents the internal parameters of the camera; matrix M2 represents the internal parameters of the camera, which is related to the position of the camera and the setting of the world coordinates, including the rotation matrix R and the translation matrix t, which describes the way the camera posture changes.
[0044] In step 3 of the present invention, the specific training process of the crane key point detection model is:
[0045] Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras. Then use the Labelme annotation tool to annotate the four key points of the crane boom and the four key points of the pulley block in the training set image to obtain image labels. The captured images and the produced labels are mapped one by one as the data set for crane key point detection.
[0046] The data set is set as a training set and a validation set in a ratio of 8:2;
[0047] Input the training set into the OpenPose keypoint detection algorithm and train it with the default parameters of the algorithm in the NVIDIA GPU server;
[0048] The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and the crane key point detection model is obtained.
[0049] In step 4 of the present invention, the number of key points of the human body in the detection image is 17; wherein the specific training process of the human body key point detection model is:
[0050] Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras. Then use the Labelme annotation tool to annotate the 17 key points of the human body in the training set images to obtain image labels. The captured images and the labels are mapped one by one as the data set for human key point detection.
[0051] The dataset is set as a training set and a validation set in a ratio of 8:2.
[0052] The training set is input into the OpenPose key point detection algorithm and trained with the default parameters of the algorithm in the NVIDIA GPU server.
[0053] The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and a human key point detection model is obtained.
[0054] In step nine of the present invention, when the crane key point detection model fails to detect the crane key point, the compliance judgment output result is "normal";
[0055] When the crane key point detection model detects the crane key points and the human body key point detection model does not detect the human body key points, the compliance judgment output result is "normal".
[0056] The set threshold a is used to judge compliance;
[0057] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, and the distance d1 between the mean value P of the human key point in the world coordinate system and the approximation plane P1 of the crane key point is greater than the set threshold a, the compliance judgment output result is "normal";
[0058] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, the distance d1 between the mean value P of the human key point and the approximation plane P1 of the crane key point is less than the set threshold a, and z in step eight cra When it is less than 0, the compliance judgment output result is "normal".
[0059] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, the distance d1 between the mean value P of the human key point and the approximation plane P1 of the crane key point is less than the set threshold a, and z in step eight cra When it is greater than 0, the compliance judgment output result is "violation".
[0060] The present invention also provides a system for detecting illegal behaviors of people standing under the crane arm, the system comprising: two cameras, an image acquisition and decoding module, a coordinate value parsing module, a human key point detection module, a crane coordinate system establishment module, a key point mean value coordinate calculation module, a distance calculation module, a key point position calculation module and a compliance judgment module;
[0061] Two cameras are set according to the position of the crane so that the crane is in the common field of view of the two cameras, and a binocular vision model is formed by the intersection of the fields of view of the two cameras;
[0062] The image acquisition and decoding module is used to shoot the construction site video with a binocular camera and decode the video stream to obtain the images to be inspected after being decoded by two cameras respectively;
[0063] The coordinate value parsing module is used to input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively;
[0064] The human key point detection module is used to input the left and right images taken by the binocular camera into the trained human key point detection model. The human key point detection model uses the human body as the detection target and detects multiple key points of the human body in the image.
[0065] The crane coordinate system establishment module is used to input the coordinates of the crane's key points into the binocular vision positioning module to obtain the coordinate values of the crane's 8 key points in the world coordinate system; the minimum approximation plane P1 of the 8 coordinate points is fitted by the principle of least squares method, and then the crane coordinate system is established based on the minimum approximation plane P1;
[0066] The key point mean coordinate calculation module is used to input the coordinate values of the key points of the human body in the pixel coordinate system of the pictures taken by the left and right cameras obtained in step 4 into the binocular vision positioning module, obtain the coordinate values of the key points of the human body in the world coordinate system, and calculate the mean coordinates P(x1, y1, z1) of the key points;
[0067] The distance calculation module is used to calculate the distance d1 from point P (x1, y1, z1) to the approximate plane P1. The distance d1 is calculated as follows:
[0068]
[0069] The key point position calculation module is used to calculate the coordinate position of the key point in the crane coordinate system according to the following formula;
[0070]
[0071] Where R is a 3×3 orthogonal unit matrix, the translation vector t is a 3×1 dimensional vector, P(x1,y1,z1) is the mean coordinate of the key points of the human body, (x cra ,y cra ,z cra ) is the value of the point mapped from the mean coordinates of the key points of the human body to the crane coordinate system;
[0072] The compliance judgment module is used to perform compliance judgment according to the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, and output the compliance judgment result.
[0073] The present invention also provides a terminal for realizing a method for detecting illegal behavior of a person standing under a crane arm, comprising:
[0074] A memory, used for storing a computer program and a method for detecting illegal behavior of a person standing under the crane arm;
[0075] The processor is used to execute the computer program and the method for detecting illegal behaviors of people standing under the crane arm, so as to implement the steps of the method for detecting illegal behaviors of people standing under the crane arm.
[0076] It can be seen from the above technical solutions that the present invention has the following advantages:
[0077] The present invention inputs the coordinate values of the key points of the human body in the pixel coordinate system into the binocular vision positioning module to obtain the mean coordinates; and performs compliance judgment based on the coordinate relationship. The present invention can achieve the effect of real-time detection, and can save the on-site images of violations for manual review, which greatly improves efficiency. There is no need for manual supervision and management on site. The system automatically obtains images, performs compliance judgments, and outputs compliance judgment results. If a violation occurs, an alarm can be issued.
[0078] The binocular camera of the present invention is composed of two horizontally placed left and right cameras with basically the same internal parameters. The imaging processes of the two cameras satisfy the pinhole imaging model of the classic camera. The two cameras can avoid blind spots in taking pictures, realize panoramic image shooting, and perform compliance judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0080] Figure 1 A flow chart of a method for detecting illegal behavior of people standing under the crane arm;
[0081] Figure 2 Schematic diagram of the conversion between the world coordinate system and the camera coordinate system;
[0082] Figure 3 Schematic diagram of the conversion between the camera coordinate system and the image coordinate system;
[0083] Figure 4 Schematic diagram of the conversion between the image coordinate system and the pixel coordinate system;
[0084] Figure 5 Schematic diagram of binocular vision model;
[0085] Figure 6 This is a schematic diagram of the binocular vision principle;
[0086] Figure 7 This is a schematic diagram of the key points of the crane;
[0087] Figure 8 This is a schematic diagram of the crane coordinate system;
[0088] Fig. 9 It is a schematic diagram of the conversion between the crane coordinate system and the world coordinate system;
[0089] Fig.10 This is a diagram to determine the position relationship between the crane and the human body. DETAILED DESCRIPTION
[0090] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0091] The present invention provides the units and algorithm steps of each example described in the disclosed embodiments of the method and system for detecting the illegal behavior of people standing under the boom, which can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to function in the above description. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0092] The block diagrams shown in the accompanying drawings of the method and system for detecting illegal behaviors of people standing under the crane provided by the present invention are only functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0093] In the present invention, a method and system for detecting illegal behaviors of people standing under the boom are provided. It should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0094] The present invention provides a method and system for detecting the illegal behavior of people standing under the boom in order to supervise the standardization of crane operations at the construction site, reduce the loss of life and property caused by illegal operations, and improve the safety of the construction process. The present invention uses binocular vision and artificial intelligence technology to monitor the position of the crane boom at the construction site at all times, calculate the position of the workers at the construction site, and judge whether there is an illegal behavior of people standing under the boom by comparing the position of the crane boom and the position of the workers.
[0095] like Figure 1 As shown, step 1: two cameras are set according to the position of the crane so that the crane is in the common field of view of the two cameras, and a binocular vision model is formed by the intersection of the fields of view of the two cameras;
[0096] In the present invention, the binocular camera is generally composed of two horizontally placed left and right cameras with basically the same internal parameters, and the imaging process of the two cameras satisfies the pinhole imaging model of the classic camera. In the process of pinhole imaging, the establishment of the coordinate system is a crucial part. Generally speaking, the objects in the real world form the images we see on the digital terminal through the following processes: first, the world coordinate system is mapped to the camera coordinate system, which belongs to the three-dimensional coordinate system conversion; secondly, the camera coordinate system is projected to the image coordinate system, which belongs to the mapping of three-dimensional coordinates to two-dimensional coordinates; finally, the image coordinate system is transformed to the final pixel coordinate system, which belongs to the conversion between two-dimensional coordinates. The steps in the camera optical imaging process based on the pinhole imaging model will be described in detail below.
[0097] Specifically, the conversion from the world coordinate system to the camera coordinate system is:
[0098] The world coordinate system and the camera coordinate system are both transformations of the three-dimensional space coordinate system, which is essentially a rigid body transformation process. In three-dimensional space, when the object does not deform, the rotation and translation of a geometric object is called a rigid body transformation. The transformation relationship is as follows: Figure 2 As shown:
[0099] The expression of rigid body transformation between the two
[0100]
[0101] The corresponding homogeneous expression is:
[0102]
[0103] Where R is a 3×3 orthogonal unit matrix (i.e., rotation matrix), and the translation vector t is a 3×1 dimensional vector. R and t are independent of the camera, so these two parameters are called the external parameters of the camera, X w , Y w , Z w is a point in the world coordinate system, X c , Y c , Z c Maps a point in the world coordinate system to a point in the camera coordinate system.
[0104] Project the camera coordinate system to the image coordinate system to obtain the conversion method from three-dimensional coordinates to two-dimensional coordinates;
[0105] Specifically, the transformation relationship between the camera coordinate system and the image coordinate system satisfies the pinhole imaging model of the camera. This model performs a certain ratio of scaling operation on the spatial point. c , projected onto the two-dimensional imaging plane. Since this process is a transformation from a three-dimensional coordinate system to a two-dimensional coordinate system, the depth information represented by the Z axis is lost during the transformation. Figure 3 The following is the basic model of a pinhole camera. The plane π is called the image plane of the camera. c It is called the center (or optical center) of the camera, and f is the focal length of the camera.
[0106] like Figure 3 As shown, the homogeneous coordinates of the spatial point P in the camera coordinate system are:
[0107] X c =[X c Y c Z c 1] T ,
[0108] The homogeneous coordinates of its image point m in the image coordinate system are:
[0109] m=[xy 1] T
[0110] The matrix representation is:
[0111]
[0112] In the present invention, the image coordinate system is transformed into the final pixel coordinate system to obtain the conversion method between two-dimensional coordinates;
[0113] like Figure 4 As shown, a rectangular coordinate system uv is established with the upper left corner of the image as the origin and the pixel is in units of pixels. The horizontal coordinate u and the Z coordinate v of the pixel are the column number and the row number of the pixel in the image array respectively.
[0114] Since (u, v) only represents the number of columns and rows of pixels, and the coordinate position of the pixel in the image is not expressed in physical units, an image coordinate system based on physical units is established.
[0115]
[0116]
[0117]
[0118] Combining the above formulas into a matrix, we can achieve the relationship between the world coordinate system and the pixel coordinate system:
[0119]
[0120] set up where f x and f y is called the effective focal length, in pixels. Then the expression can be expressed as:
[0121]
[0122] Among them, matrix M1 represents the internal parameters of the camera, which is related to the camera's center coordinates, the camera's focal length, the size of the CCD camera sensor, and other internal parameters of the camera; usually it will not change due to changes in the external environment; matrix M2 represents the internal parameters of the camera, which is related to the camera's position and world coordinate settings, including the rotation matrix R and the translation matrix t, which describe the way the camera's posture changes. The process of camera calibration is the process of solving the matrix M1 and the matrix M2, and then the pixel coordinates (u, v) corresponding to any point P (x, y, z) in space can be obtained.
[0123] When the parameters of the monocular camera are known, only two linear equations about point P (x, y, z) can be obtained, and the projection point is mapped to a ray. The specific position of this spatial point cannot be determined based on only one pixel. This is because all points on the line from the camera optical center to the normalized plane can be projected onto the pixel, and the corresponding three-dimensional coordinates in the real world cannot be uniquely determined. Therefore, a camera needs to be added to obtain the depth information of point P. Only after the depth information of point P is determined can its spatial position be known accurately to uniquely determine its three-dimensional coordinates in the real world.
[0124] The present invention adopts Figure 5 As shown, the positions of the two cameras are placed according to the position of the crane so that the crane is in the common field of view of the two cameras to form a binocular camera system. A binocular vision model is formed by the intersection of the fields of view of the two cameras, and the object to be measured is measured in the common field of view of the two cameras.
[0125] The principle of binocular vision model is as follows Figure 6 As shown in the figure: In the convergent stereo vision model, it is assumed that P1 and P2 are the imaging points of the same point P in space on the left and right images respectively. From the above, we can see that the two cameras (C1 and C2) have their own projection matrices, M1 and M2 respectively. So in the left and right images, the relationship between the spatial point and the image point is:
[0126]
[0127]
[0128] From the above, we can see that if the pixel position of point P in the two cameras and the relevant internal and external parameters of the cameras are known, the coordinates (X, Y, Z) of the feature point P in the world coordinate system can be calculated.
[0129] Step 2: Use a binocular camera to shoot a video of the construction site, decode the video stream, and obtain the images to be inspected after being decoded by the two cameras respectively;
[0130] Among them, the present invention uses a binocular camera to shoot a video of the construction site, and decodes the video stream through tools such as OpenCv to obtain the images to be inspected after being decoded by the left and right cameras respectively.
[0131] The images to be inspected consist of multiple groups of images, and each group of images includes two images taken by the left and right cameras at the same time.
[0132] Step 3: Input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively;
[0133] In the present invention, the left and right images taken by the binocular camera are input into a trained crane key point detection model, and the crane key point detection model detects the two pictures taken by the left and right cameras respectively to obtain the coordinates of the crane key points.
[0134] The key points of the crane that need to be detected in the present invention are as follows: Figure 7 As shown, there are 8 key points in total.
[0135] In step 3, the trained crane key point detection model is trained based on the OpenPose key point detection network.
[0136] The purpose of the present invention using the crane key point detection model is to perform key point detection on the boom and pulley block of the crane at the construction site, so as to obtain the key point positions of the crane boom and pulley block in the image.
[0137] The specific training process of the crane key point detection model is as follows:
[0138] Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras, and then use the Labelme annotation tool to annotate the four key points of the crane boom and the four key points of the pulley group in the training set image to obtain image labels. The captured images and the produced labels are matched one by one as the data set for crane key point detection.
[0139] The dataset is set as a training set and a validation set in a ratio of 8:2.
[0140] The training set is input into the OpenPose key point detection algorithm and trained with the default parameters of the algorithm in the NVIDIA GPU server.
[0141] The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and the crane key point detection model is obtained.
[0142] Step 4: Input the left and right images taken by the binocular camera into a trained human key point detection model, wherein the human key point detection model uses the human body as a detection target and detects multiple key points of the human body in the image;
[0143] The number of key points of the human body in the detected image is 17; the specific training process of the human key point detection model is as follows:
[0144] The crane key point detection model trained in the present invention is trained based on the OpenPose key point detection network.
[0145] The purpose of adopting the human body key point detection model in the present invention is to perform key point detection on workers at a construction site, thereby obtaining the positions of the human body key points.
[0146] The specific training process of the human key point detection model is:
[0147] Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras, and then use the Labelme annotation tool to annotate the 17 key points of the human body in the training set images to obtain image labels. The captured images and the produced labels are matched one by one as the data set for human key point detection.
[0148] The data set is set as a training set and a validation set in a ratio of 8:2.
[0149] The training set is input into the OpenPose keypoint detection algorithm and trained with the default parameters of the algorithm on the NVIDIA GPU server.
[0150] The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and a human key point detection model is obtained.
[0151] Step 5: Input the coordinates of the key points of the crane obtained in step 3 into the binocular vision positioning module in step 1 to obtain the coordinate values of the 8 key points of the crane in the world coordinate system; fit the minimum approximation plane P1 of these 8 coordinate points through the principle of least squares method, and then establish the crane coordinate system according to the minimum approximation plane P1;
[0152] The expression formula of the minimum approximation plane of the present invention is:
[0153] A1x+B1y+C1z+D1=0
[0154] There are 8 key points of the crane, which are distributed as follows: Figure 8 and Fig. 9 The crane coordinate system takes point C among the key points of the crane as the origin of the coordinates. The horizontal left of point C is the Z coordinate of the crane coordinate system. cra Axis, point C is horizontally upward and is the Y axis of the crane coordinate system cra Axis, X cra The direction of the axis is perpendicular to the paper and outward.
[0155] Step 6: Input the coordinate values of the key points of the human body in the pixel coordinate system of the pictures taken by the left and right cameras obtained in step 4 into the binocular vision positioning module described in step 1, obtain the coordinate values of the key points of the human body in the world coordinate system, and calculate the mean coordinates P(x1, y1, z1) of the key points;
[0156] Step 7: Calculate the distance d1 between the point P(x1, y1, z1) obtained in step 6 and the approximation plane P1 obtained in step 5; the distance d1 is calculated as follows:
[0157]
[0158] Step 8: Calculate the coordinate position of the point obtained in step 6 in the crane coordinate system according to the following formula;
[0159]
[0160] Where R is a 3×3 orthogonal unit matrix, the translation vector t is a 3×1 dimensional vector, P(x1, y1, z1) is the mean coordinate of the key points of the human body obtained in step 6, (x cra ,y cra ,z cra ) is the value of the point mapped from the mean coordinates of the key points of the human body to the crane coordinate system;
[0161] Step 9: According to the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, compliance judgment is performed and the compliance judgment result is output.
[0162] Among them, in step nine, Fig.10 The compliance judgment is performed as shown and the compliance judgment result is output.
[0163] When the crane key point detection model does not detect the crane key point, the compliance judgment output result is "normal";
[0164] When the crane key point detection model detects the crane key points and the human body key point detection model does not detect the human body key points, the compliance judgment output result is "normal".
[0165] In step nine, a threshold a is also set to judge compliance;
[0166] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, and the distance d1 between the mean value P of the human key point in the world coordinate system and the approximation plane P1 of the crane key point is greater than the set threshold a, the compliance judgment output result is "normal";
[0167] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, the distance d1 between the mean value P of the human key point and the approximation plane P1 of the crane key point is less than the set threshold a, and z in step eight cra When it is less than 0, the compliance judgment output result is "normal".
[0168] When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, the distance d1 between the mean value P of the human key point and the approximation plane P1 of the crane key point is less than the set threshold a, and z in step eight cra When it is greater than 0, the compliance judgment output result is "violation".
[0169] The present invention establishes a model based on the deep learning method, decomposes the complex scene of "people standing under the crane arm" into two targets, namely "crane key points" and "human body key points", and uses binocular vision technology to extract the positions of the human body and the crane in the world coordinate system.
[0170] The present invention can achieve the effect of real-time detection, and can save the on-site images of violations for manual review, thereby greatly improving efficiency and reducing the workload of supervisors.
[0171] The method for detecting illegal behaviors of people standing under a crane arm provided by the present invention mainly involves computer vision technology of artificial intelligence and artificial intelligence cloud services in cloud technology. Specifically, artificial intelligence processing is realized by utilizing computer vision technology and artificial intelligence cloud services, which can improve the accuracy of artificial intelligence processing.
[0172] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0173] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. Among them, computer vision technology (Computer Vision, CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify, track, and measure targets, and further perform graphics processing to make computer processing into images that are more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, trying to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0174] Based on the above method, the present invention also provides a system for detecting illegal behavior of people standing under the crane arm, the system comprising: two cameras, an image acquisition and decoding module, a coordinate value parsing module, a human key point detection module, a crane coordinate system establishment module, a key point mean value coordinate calculation module, a distance calculation module, a key point position calculation module and a compliance judgment module;
[0175] Two cameras are set according to the position of the crane so that the crane is in the common field of view of the two cameras, and a binocular vision model is formed by the intersection of the fields of view of the two cameras;
[0176] The image acquisition and decoding module is used to shoot the construction site video with a binocular camera and decode the video stream to obtain the images to be inspected after being decoded by two cameras respectively;
[0177] The coordinate value parsing module is used to input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively;
[0178] The human key point detection module is used to input the left and right images taken by the binocular camera into the trained human key point detection model. The human key point detection model uses the human body as the detection target and detects multiple key points of the human body in the image.
[0179] The crane coordinate system establishment module is used to input the coordinates of the crane's key points into the binocular vision positioning module to obtain the coordinate values of the crane's 8 key points in the world coordinate system; the minimum approximation plane P1 of the 8 coordinate points is fitted by the principle of least squares method, and then the crane coordinate system is established based on the minimum approximation plane P1;
[0180] The key point mean coordinate calculation module is used to input the coordinate values of the key points of the human body in the pixel coordinate system of the pictures taken by the left and right cameras obtained in step 4 into the binocular vision positioning module, obtain the coordinate values of the key points of the human body in the world coordinate system, and calculate the mean coordinates P(x1, y1, z1) of the key points;
[0181] The distance calculation module is used to calculate the distance d1 from point P (x1, y1, z1) to the approximate plane P1. The distance d1 is calculated as follows:
[0182]
[0183] The key point position calculation module is used to calculate the coordinate position of the key point in the crane coordinate system according to the following formula;
[0184]
[0185] Where R is a 3×3 orthogonal unit matrix, the translation vector t is a 3×1 dimensional vector, P(x1,y1,z1) is the mean coordinate of the key points of the human body, (x cra ,y cra ,z cra ) is the value of the point mapped from the mean coordinates of the key points of the human body to the crane coordinate system;
[0186] The compliance judgment module is used to perform compliance judgment according to the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, and output the compliance judgment result.
[0187] The present invention also provides a terminal for implementing a method for detecting illegal behavior of a person standing under a crane arm, comprising: a memory for storing a computer program and a method for detecting illegal behavior of a person standing under a crane arm; a processor for executing the computer program and the method for detecting illegal behavior of a person standing under a crane arm, so as to implement the steps of the method for detecting illegal behavior of a person standing under a crane arm.
[0188] The terminal can be implemented in various forms. For example, the terminal described in the embodiment of the present invention may include a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a personal digital assistant (PDA, Personal Digital Assistant), a tablet computer (PAD), etc. and a fixed terminal such as a digital TV, a desktop computer, etc. Below, it is assumed that the terminal is a mobile terminal. However, it will be understood by those skilled in the art that, in addition to the elements specifically used for mobile purposes, the construction according to the embodiment of the present invention can also be applied to a fixed type of terminal.
[0189] The method for detecting the illegal behavior of people standing under the boom is a combination of the units and algorithm steps of each example described in the embodiments disclosed in this article, which can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0190] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting illegal behavior of people standing under a crane arm, characterized in that: Methods include: Step 1: Set up two cameras according to the position of the crane so that the crane is in the common field of view of the two cameras, and form a binocular vision model through the intersection of the fields of view of the two cameras; Step 2: Use a binocular camera to shoot a video of the construction site, decode the video stream, and obtain the images to be inspected after being decoded by the two cameras respectively; Step 3: Input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively; Step 4: Input the left and right images taken by the binocular camera into a trained human key point detection model, wherein the human key point detection model uses the human body as a detection target and detects multiple key points of the human body in the image; Step 5: Input the coordinates of the key points of the crane obtained in step 3 into the binocular vision positioning module in step 1 to obtain the coordinate values of the 8 key points of the crane in the world coordinate system; fit the minimum approximation plane of these 8 coordinate points through the principle of least squares method. , and then according to the minimum approximation plane Establish crane coordinate system; Step 6: Input the coordinate values of the key points of the human body in the pixel coordinate system of the left and right camera images obtained in step 4 into the binocular vision positioning module described in step 1 to obtain the coordinate values of the key points of the human body in the world coordinate system, and calculate the mean coordinates of the key points ; Step 7: Calculate the point obtained in step 6 Distance from the approximation plane obtained in step 5 Distance ;distance The calculation method is as follows: Step 8: Calculate the coordinate position of the point obtained in step 6 in the crane coordinate system according to the following formula; in R is a 3×3 orthogonal identity matrix, the translation vector t is a 3×1 dimensional vector, is the mean coordinate of the key points of the human body obtained in step 6, The mean coordinates of the key points of the human body are mapped to the values of the points in the crane coordinate system; Step 9: Perform compliance judgment based on the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, and output the compliance judgment result; When the crane key point detection model does not detect the crane key point, the compliance judgment output result is "normal"; When the crane key point detection model detects the crane key points, and the human key point detection model does not detect the human key points, the compliance judgment output result is "normal"; The set threshold a is used to judge compliance; When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, and the mean of the human key point in the world coordinate system P Approach plane from the crane key point Distance When it is greater than the set threshold a, the compliance judgment output result is "normal"; When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, and the mean of the human key point Approach plane from the crane key point Distance is less than the set threshold a, and the When it is less than 0, the compliance judgment output result is "normal"; When the crane key point detection model detects the crane key point, the human key point detection model detects the human key point, and the mean of the human key point Approach plane from the crane key point Distance is less than the set threshold a, and the When it is greater than 0, the compliance judgment output result is "violation".
2. The method for detecting illegal behavior of people standing under the boom according to claim 1 is characterized in that: Step 1 also includes: Establish a coordinate system; Configure the three-dimensional coordinate system conversion method from the world coordinate system to the camera coordinate system; the conversion method expression is: The corresponding homogeneous expression is: in R is a 3×3 orthogonal identity matrix, the translation vector t is a 3×1 dimensional vector, It has nothing to do with the camera. The two parameters are the external parameters of the camera. is a point in the world coordinate system, Map a point in the world coordinate system to a point in the camera coordinate system; Project the camera coordinate system to the image coordinate system to obtain the conversion method from three-dimensional coordinates to two-dimensional coordinates; The conversion relationship between the camera coordinate system and the image coordinate system satisfies the camera's pinhole imaging model. The pinhole imaging model performs a certain ratio of scaling operations on the spatial points. , projected onto the two-dimensional imaging plane; plane π is called the image plane of the camera, point is called the center of the camera, is the focal length of the camera; Space Point The homogeneous coordinates in the camera coordinate system are: , The homogeneous coordinates of the image point m in the image coordinate system are: The matrix representation is: 。 3. The method for detecting illegal behavior of people standing under the boom according to claim 1 or 2, characterized in that: Transform the image coordinate system to the final pixel coordinate system to obtain the conversion method between two-dimensional coordinates; Among them, a rectangular coordinate system with pixels as the unit is established with the upper left corner of the image as the origin , the horizontal coordinate of the pixel With Z coordinate are the column and row numbers of the image array respectively; Establish an image coordinate system based on physical units; Combining the above formulas into a matrix, we can get the relationship between the world coordinate system and the pixel coordinate system: set up ,in and is called the effective focal length, in pixels; then the expression can be expressed as: Among them, the matrix Represents the camera internal parameters; matrix Represents the internal parameters of the camera, which are related to the camera's position and world coordinate settings, including the rotation matrix R and translation matrix t , describes the way the camera pose changes.
4. The method for detecting illegal behavior of people standing under the boom according to claim 1 is characterized in that: In step 3, the specific training process of the crane key point detection model is as follows: Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras. Then use the Labelme annotation tool to annotate the four key points of the crane boom and the four key points of the pulley block in the training set image to obtain image labels. The captured images and the produced labels are mapped one by one as the data set for crane key point detection. The data set is set as a training set and a validation set in a ratio of 8:2; Input the training set into the OpenPose keypoint detection algorithm and train it with the default parameters of the algorithm in the NVIDIA GPU server; The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and the crane key point detection model is obtained.
5. The method for detecting illegal behavior of people standing under the boom according to claim 1 is characterized in that: In step 4, the number of key points of the human body in the detection image is 17; the specific training process of the human key point detection model is as follows: Prepare the training set: Use a binocular camera to shoot the working scene of the crane to obtain images taken by the left and right cameras. Then use the Labelme annotation tool to annotate the 17 key points of the human body in the training set images to obtain image labels. The captured images and the labels are mapped one by one as the data set for human key point detection. The data set is set as a training set and a validation set in a ratio of 8:2; Input the training set into the OpenPose keypoint detection algorithm and train it with the default parameters of the algorithm in the NVIDIA GPU server; The model performance is evaluated using OKS as the evaluation standard until the model meets the usage requirements and a human key point detection model is obtained.
6. A system for detecting illegal behavior of people standing under a crane arm, characterized in that: The system adopts the method for detecting illegal behavior of people standing under the crane arm as described in any one of claims 1 to 5; The system includes: two cameras, image acquisition and decoding module, coordinate value parsing module, human key point detection module, crane coordinate system establishment module, key point mean coordinate calculation module, distance calculation module, key point position calculation module and compliance judgment module; Two cameras are set according to the position of the crane so that the crane is in the common field of view of the two cameras, and a binocular vision model is formed by the intersection of the fields of view of the two cameras; The image acquisition and decoding module is used to shoot the construction site video with a binocular camera and decode the video stream to obtain the images to be inspected after being decoded by the two cameras respectively; The coordinate value parsing module is used to input the left and right images taken by the binocular camera into the trained crane key point detection model, detect the two images, and obtain the coordinate values of the crane key points in the pixel coordinate system of the two images respectively; The human key point detection module is used to input the left and right images taken by the binocular camera into the trained human key point detection model. The human key point detection model uses the human body as the detection target and detects multiple key points of the human body in the image. The crane coordinate system establishment module is used to input the coordinates of the crane's key points into the binocular vision positioning module to obtain the coordinate values of the crane's 8 key points in the world coordinate system; the minimum approximation plane of these 8 coordinate points is fitted by the least squares method principle. , and then according to the minimum approximation plane Establish crane coordinate system; The key point mean coordinate calculation module is used to input the coordinate values of the key points of the human body in the pixel coordinate system of the left and right camera images obtained in step 4 into the binocular vision positioning module to obtain the coordinate values of the key points of the human body in the world coordinate system and calculate the mean coordinates of the key points. ; The distance calculation module is used to calculate the point Distance Approach Plane Distance ,distance The calculation method is as follows: The key point position calculation module is used to calculate the coordinate position of the key point in the crane coordinate system according to the following formula; in R is a 3×3 orthogonal identity matrix, the translation vector t is a 3×1 dimensional vector, is the mean coordinate of the key points of the human body, The mean coordinates of the key points of the human body are mapped to the values of the points in the crane coordinate system; The compliance judgment module is used to perform compliance judgment according to the relationship between the coordinate position in the crane coordinate system and the mean coordinates of the key points of the human body, and output the compliance judgment result.
7. A terminal for realizing a method for detecting illegal behavior of people standing under a crane arm, characterized in that: include: A memory, used for storing a computer program and a method for detecting illegal behavior of a person standing under the crane arm; A processor is used to execute the computer program and the method for detecting illegal behavior of a person standing under a crane arm, so as to implement the steps of the method for detecting illegal behavior of a person standing under a crane arm as claimed in any one of claims 1 to 5.
