Shooting end layout method, device and equipment based on safety helmet and storage medium

By generating contour terrain and building image acquisition areas, and automatically laying the shooting end with physical mechanics models and global optimization algorithms, the error and missed detection problems caused by poor sample quality of computer vision detection methods in the existing technology are solved, and efficient monitoring and safety improvement of the wear of safety helmets on the construction site are achieved.

CN119647229APending Publication Date: 2025-03-18YUNNAN POWER INVESTMENT LVNENG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411969337.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The computer vision detection method based on the safety helmet in the prior art has a high false detection and missed detection rate due to poor quality of visual samples, and it is impossible to promptly remind and correct the situation where construction personnel did not wear or were not wearing the safety helmet correctly.

Method used

By obtaining the elevation data of the construction site, a contour terrain is generated, an image acquisition area is constructed, and nodes are defined on its top and sides. Each node represents a preset shooting end. The shooting end is automatically laid out using a physical mechanics model and a global optimization algorithm to ensure the optimization of coverage and overlap.

Benefits of technology

The automated layout of the shooting end in the construction site is realized, ensuring efficient monitoring of the construction personnel wearing safety helmets, reducing the rate of false inspection and missed inspection, and improving the safety of the construction site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647229A_ABST
    Figure CN119647229A_ABST
Patent Text Reader

Abstract

The invention discloses a shooting end layout method and device based on a safety helmet, equipment and a storage medium, and relates to the technical field of electric digital data processing. According to the method, each preset shooting end is automatically arranged by simulating a physical and mechanical process, manual arrangement in a traditional method through artificial experience is avoided, redundant installation in artificial experience is avoided while it is guaranteed that all the preset shooting ends completely cover a construction site, and therefore the regional repeatability of each preset shooting end is reduced, and the construction efficiency is improved. Meanwhile, the regional repeatability is reduced to the minimum through a global optimization algorithm, so that no dead angle exists in image and image acquisition of the construction site, the repeatability is low, complex target functions and parameters do not need to be drawn up, the method is simple, rapid and accurate, a good and dead-angle-free image or image acquisition environment is obtained, and the method is suitable for large-scale popularization and application. Clear and high-quality data can be provided for subsequent computer vision detection, so that misjudgment is reduced or eliminated, and the personal safety of constructors can be accurately guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic digital data processing, and in particular to a method, device, equipment and storage medium for shooting end layout based on a helmet. Background Art

[0002] Construction workers must strictly follow safety regulations and wear appropriate safety gear, such as safety helmets and protective clothing.

[0003] Correctly wearing a helmet can effectively reduce head injuries. However, in the actual construction process, some construction workers are careless or take it lightly, and fail to wear helmets properly or do not wear helmets at all, which makes the construction workers always have safety hazards during the construction process. The mainstream construction site safety supervision is based on manual supervision, which is not only time-consuming and labor-intensive, but also unable to monitor whether the construction workers are not wearing helmets correctly or not wearing helmets at any time, resulting in frequent safety accidents on the construction site. In addition, most construction sites only have clear wearing requirements for helmets, thus ignoring the protection of other parts of the construction workers' bodies. At present, the computer vision detection method for helmets relies on the camera at the construction site to capture images and video data. However, since the arrangement of cameras is mainly determined by manual experience, cameras are installed around the construction site and at high places. Due to the diversity and complexity of the construction site, when the camera shoots the construction workers at the construction site, due to factors such as objects blocking and long distance, it is easy to cause the computer vision detection method to misdetect and miss detection, thereby affecting the subsequent detection results and increasing the misjudgment rate. Moreover, computer vision detection methods are currently the most popular algorithms used for helmet detection. If the quality of samples cannot be guaranteed, it will lead to more frequent false detections and missed detections in subsequent visual inspections, resulting in failure to wear helmets properly or not wearing helmets at all without timely reminders and corrections, which will in turn lead to the personal safety of construction workers not being accurately guaranteed. Summary of the invention

[0004] The main purpose of this application is to provide a shooting end layout method, device, equipment and storage medium based on a helmet, so as to solve the problem that the quality of visual samples used in the computer vision detection method based on a helmet in the prior art cannot be guaranteed, resulting in the problem that subsequent visual detection is prone to false detection and missed detection.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A method for arranging shooting terminals based on a safety helmet, the method for arranging shooting terminals being applied to construction workers who are in a construction site and wearing a safety helmet, the construction site having a plurality of preset shooting terminals to be arranged, the method for arranging shooting terminals comprising:

[0007] Step S1, obtaining elevation data of the construction site and generating contour terrain according to the elevation data;

[0008] Step S2, taking the contour terrain as a starting point surface and constructing an image acquisition area upward from the starting point surface with a vertical distance of a preset length as a height;

[0009] Step S3, defining a preset number of nodes on the top surface and the side surface of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface of the image acquisition area;

[0010] Step S4, generating a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, wherein the maximum viewing distance is greater than or equal to the preset length;

[0011] Step S5, respectively giving each node a charge of the same polarity with a preset amount of electricity to form a charged particle, and respectively calculating the first force between each two adjacent charged particles according to Coulomb's law;

[0012] Step S6, respectively assigning an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and respectively calculating the second force of each ideal spring according to Hooke's law;

[0013] Step S7, obtaining the resultant force of the first force and the second force based on the same node, and driving each node to move along the direction of the resultant force, so as to update the position information of each node on the top surface of the image acquisition area;

[0014] Step S8, iterating the minimum value of all node quantities through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area;

[0015] Step S9, iterating the minimum value of the preset power by a global optimization algorithm so as to minimize the sum of the overlapping volumes of all theoretical shooting balls or all theoretical shooting hemispheres;

[0016] Step S10, obtaining the final positions of all nodes after the iteration is completed and fixing them to the image acquisition area to form the final layout of all layout preset shooting ends.

[0017] As a further improvement of the present application, step S7, based on the same node, obtains the resultant force of the first force and the second force, and drives each node to move along the direction of the respective resultant force to update the position information of each node on the top surface of the image acquisition area, including:

[0018] Step S71, based on the same node, split each first force into a first x-direction force, a first y-direction force, and a first z-direction force, wherein x, y, and z are three axial directions of the world coordinate system, and the xy plane is a horizontal plane;

[0019] Step S72, converting the first x-direction force, the first y-direction force, and the first z-direction force into a first x-direction distance, a first y-direction distance, and a first z-direction distance respectively according to Coulomb's law;

[0020] Step S73, calculate the first displacement distance of each node according to equation (1), equation (2), and equation (3):

[0021]

[0022] Wherein, Fx1 is the first x-direction displacement distance, k is the electrostatic force constant, dx1 is the first x-direction distance, and d is the actual distance between the current node and other nodes;

[0023]

[0024] Wherein, Fy1 is the first y-direction displacement distance, and dy1 is the first y-direction distance;

[0025]

[0026] Wherein, Fz1 is the first z-direction displacement distance, dz1 is the first z-direction distance;

[0027] Step S74, integrating the Fx1, the Fy1, and the Fz1 to obtain the first displacement distance;

[0028] Step S75, splitting the second force into a second x-direction force, a second y-direction force, and a second z-direction force based on the same node;

[0029] Step S76, converting the second x-direction force, the second y-direction force, and the second z-direction force into a second x-direction distance, a second y-direction distance, and a second z-direction distance respectively according to Hooke's law;

[0030] Step S77, and respectively calculate the second displacement distance of each node according to equation (4), equation (5), and equation (6);

[0031] Lx2=-f·dx2 (4);

[0032] Wherein, Lx2 is the second x-direction displacement distance, f is the elastic coefficient, and dx2 is the second x-direction distance;

[0033] Ly2=-f·dy2 (5);

[0034] Wherein, Ly2 is the second y-direction displacement distance, and dy2 is the second y-direction distance;

[0035] Lz2=-f·dz2 (6);

[0036] Wherein, Lz2 is the second z-direction displacement distance, and dy2 is the second z-direction distance;

[0037] Step S78, integrating the Lx2, the Ly2, and the Lz2 to obtain the second displacement distance;

[0038] Step S79, summing the first displacement distance and the second displacement distance based on the same node to obtain the Euclidean distance of each node;

[0039] Step S710, moving according to the Euclidean distance of each node until the Euclidean distance of each node is zero, thereby obtaining the position information of each node.

[0040] As a further improvement of the present application, step S8, iterating the minimum value of all node numbers through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area, includes:

[0041] Step S81, defining a plurality of first random solutions for the minimum value of all node numbers according to formula (7), and defining the calculation results of all the first random solutions to be all theoretical shooting spheres or all theoretical shooting hemispheres completely filling the image acquisition area;

[0042]

[0043] in, is the set of all first random solutions, are each first random solution, j is the jth first random solution, and m is the number of all first random solutions; is the set of velocities of all first random solutions, are the speeds of each first random solution respectively;

[0044] Step S82, initialize the position of each first random solution, and update the position and speed of each first random solution according to equation (8) based on the same first random solution:

[0045]

[0046] in, is the speed of the jth first random solution at the dth step, is the velocity inertia of the jth first random solution at step d-1, ω (1)is the first inertia coefficient, is the self-perception representation of the jth first random solution, is the social cognitive representation of the jth first random solution; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the jth first random solution, is the global optimal solution obtained by the jth first random solution, is the jth first random solution at step d, is the jth first random solution at step d-1, is the speed of the jth first random solution at step d-1;

[0047] Step S83, iterate all first random solutions for a preset number of times according to formula (8) to update each and each

[0048] Step S84, determine each Compared with the first difference of the previous iteration, whether it is less than or equal to the first preset adaptation threshold, if so, executing step S85;

[0049] Step S85, determine each Compared with the second difference of the previous iteration, whether it is less than or equal to the second preset adaptation threshold, if so, executing step S86;

[0050] Step S86, determining the optimal solution that has obtained the minimum number of all nodes.

[0051] As a further improvement of the present application, in step S83, all first random solutions are iterated a preset number of times according to formula (8) to update each and each include:

[0052] Step S831, based on each iteration, linearly reduce the first inertia coefficient once according to formula (9):

[0053]

[0054] in, is the first inertia coefficient of the jth first random solution after optimization in the dth step, ω ini is the initial inertia coefficient, is the first inertia coefficient of the jth first random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

[0055] As a further improvement of the present application, step S9, iterating the minimum value of the preset power by a global optimization algorithm to minimize the sum of the overlapping volumes of all theoretical shooting balls or all theoretical shooting hemispheres, includes:

[0056] Step S91, defining a plurality of second random solutions for the minimum value of the preset power according to formula (10), and defining the calculation results of all the second random solutions to be the minimum sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres;

[0057]

[0058] Among them, P i (2) is the set of all second random solutions, are each second random solution, i is the i-th second random solution, and n is the number of all second random solutions; V i (2) is the set of velocities of all second random solutions, are the speeds of each second random solution respectively;

[0059] Step S92, initialize the position of each second random solution, and update the position and speed of each second random solution according to formula (11) based on the same second random solution:

[0060]

[0061] in, is the speed of the ith second random solution at the dth step, is the velocity inertia of the ith second random solution at step d-1, ω (2) is the second inertia coefficient, is the self-perception representation of the i-th second random solution, is the social cognitive representation of the second random solution of the ith one; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the i-th second random solution, is the global optimal solution obtained by the i-th second random solution, is the i-th second random solution at step d, is the i-th second random solution at step d-1, is the speed of the i-th second random solution at step d-1;

[0062] Step S93, iterate all second random solutions for a preset number of times according to formula (11) to update each and each

[0063] Step S94, determine each Compared with the third difference of the previous iteration, whether it is less than or equal to the third preset adaptation threshold, if so, executing step S95;

[0064] Step S95, determine each Compared with the fourth difference of the previous iteration, whether it is less than or equal to the fourth preset adaptation threshold, if so, executing step S96;

[0065] Step S96, determining that the optimal solution for the minimum value of the preset power has been obtained.

[0066] As a further improvement of the present application, in step S93, all second random solutions are iterated a preset number of times according to formula (11) to update each and each include:

[0067] Step S931, based on each iteration, the second inertia coefficient is linearly reduced once according to formula (12):

[0068]

[0069] in, is the second inertia coefficient of the i-th second random solution after optimization in the d-th step, ω ini is the initial inertia coefficient, is the second inertia coefficient of the i-th second random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

[0070] As a further improvement of the present application, step S10, obtaining the final positions of all nodes after the iteration is completed and fixing them to the image acquisition area to form the final layout of all layout preset shooting ends, then includes:

[0071] Step S11, sending the final layout to an external visualization receiving terminal;

[0072] Step S12, responding to an entry signal of the construction site, and acquiring a person detection frame matching the entry signal through at least one preset shooting end after layout;

[0073] Step S13, defining a standard model of the target detection algorithm, and training the standard model based on a helmet image training set, and obtaining a helmet detection model after the training is completed;

[0074] Step S14, detecting whether there is a safety helmet in the person detection frame by using the safety helmet detection model, if not, executing step S15;

[0075] Step S15, generating a helmet wearing reminder signal, and sending the helmet wearing reminder signal to the construction worker corresponding to the person detection frame.

[0076] In order to achieve the above objectives, this application also provides the following technical solutions:

[0077] A shooting end layout device based on a safety helmet, the shooting end layout device based on a safety helmet is applied to the shooting end layout method as described above, and the shooting end layout device comprises:

[0078] A contour terrain generation module, used to obtain elevation data of the construction site and generate contour terrain according to the elevation data;

[0079] An image acquisition area construction module is used to construct an image acquisition area upward from the starting point surface with the contour terrain as the starting point surface and a vertical distance of a preset length as the height;

[0080] A node definition and constraint module, used to define a preset number of nodes on the top surface and side surface of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface of the image acquisition area;

[0081] A theoretical shooting sphere or theoretical shooting hemisphere generating module, used to generate a theoretical shooting sphere or theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, wherein the maximum viewing distance is greater than or equal to the preset length;

[0082] A charged particle repulsion calculation module is used to respectively give each node a charge of the same polarity with a preset amount of electricity to form a charged particle, and respectively calculate the first force between each two adjacent charged particles according to Coulomb's law;

[0083] An ideal spring tension calculation module is used to assign an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and calculate the second force of each ideal spring according to Hooke's law;

[0084] a node position iteration module, configured to obtain the resultant force of the first force and the second force based on the same node, and drive each node to move along the direction of the resultant force, so as to update the position information of each node on the top surface of the image acquisition area;

[0085] A node quantity minimum value calculation module, used for iterating the minimum value of all node quantities through a global optimization algorithm, so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area;

[0086] A preset power minimum value calculation module, used for iterating the minimum value of the preset power through a global optimization algorithm, so as to minimize the sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres;

[0087] The final position acquisition and fixing module is used to acquire the final positions of all nodes after the iteration is completed and fix them to the image acquisition area to form the final layout of all layout preset shooting ends.

[0088] In order to achieve the above objectives, this application also provides the following technical solutions:

[0089] An electronic device includes a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the above-mentioned helmet-based shooting end layout method is implemented.

[0090] To achieve the above objectives, this application also provides the following technical solutions:

[0091] A storage medium stores program instructions, and when the program instructions are executed by a processor, the above-mentioned shooting end layout method based on a helmet can be implemented.

[0092] Beneficial effects: The present application obtains the elevation data of the construction site and generates contour terrain according to the elevation data; takes the contour terrain as the starting point surface, and constructs an image acquisition area upward from the starting point surface with a vertical distance of a preset length as the height; defines a preset number of nodes on the top surface and side surface of the image acquisition area, each node represents a preset shooting end to be arranged, and all nodes are constrained to the top surface and side surface of the image acquisition area; generates a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, and the maximum viewing distance is greater than or equal to the preset length; assigns a charge of the same polarity of a preset charge to each node to form a charged particle, and calculates the first force of each two adjacent charged particles according to Coulomb's law; respectively An ideal spring with a preset allowable tensile stress is assigned to every two adjacent nodes, and the second force of each ideal spring is calculated according to Hooke's law; the resultant force of the first force and the second force is obtained based on the same node, and each node is driven to move along the direction of its own resultant force to update the position information of each node on the top surface of the image acquisition area; the minimum value of the number of all nodes is iterated through a global optimization algorithm to make all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; the minimum value of the preset power is iterated through a global optimization algorithm to make the total overlapping volume of all theoretical shooting spheres or all theoretical shooting hemispheres minimized; the final positions of all nodes after the iteration are completed are obtained and fixed to the image acquisition area to form the final layout of all layout preset shooting ends. The present application simulates the physical and mechanical process to automatically layout each preset shooting end, avoiding the manual layout based on human experience in the traditional method, and ensuring that all preset shooting ends completely cover the construction site while avoiding redundant installation in human experience, thereby reducing the regional duplication of each preset shooting end. At the same time, the regional duplication is reduced to a minimum through a global optimization algorithm, so that the images and videos of the construction site are acquired without blind spots and with low duplication. The present application does not require the formulation of complex objective functions and parameters, and the method is simple, fast and accurate. A good image or video acquisition environment without blind spots can provide clear and high-quality data for subsequent computer vision detection, thereby reducing or eliminating misjudgments and accurately protecting the personal safety of construction workers. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] Figure 1 This is a schematic diagram of the process steps of an embodiment of the shooting end layout method based on a helmet of the present application;

[0094] Figure 2 This is a functional module diagram of an embodiment of a shooting end layout device based on a helmet of the present application;

[0095] Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application;

[0096] Figure 4 This is a schematic diagram of the structure of an embodiment of the storage medium of the present application. DETAILED DESCRIPTION

[0097] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0098] The terms "first", "second" and "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications in the embodiments of the present application (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or power device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or power devices.

[0099] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0100] like Figure 1 As shown, this embodiment provides an embodiment of a shooting end layout method based on a safety helmet. In this embodiment, the shooting end layout method is applied to construction workers who are in a construction site and wearing safety helmets. The construction site has several preset shooting ends to be laid out, and the preset shooting ends to be laid out are all used to detect the wearing of safety helmets by the construction workers.

[0101] Specifically, the shooting end layout method includes the following steps:

[0102] Step S1, obtaining elevation data of the construction site and generating contour terrain according to the elevation data.

[0103] Preferably, generating contour terrain according to elevation data can be completed in Civil-3D.

[0104] Preferably, the surface contours can be directly loaded into Global Mapper by DEM, wherein DEM (digital elevation model) can be directly obtained from public channels (national high-precision 5-12-30-meter DEM terrain data).

[0105] Preferably, after DEM is loaded into Global Mapper, before contour lines are generated, it is generally necessary to clip DEM first to extract the DEM of the target area. The target area data can be exported using LSV (LocaSpaceViewer, a three-dimensional digital earth software that integrates images such as Google Earth and three-dimensional terrain online services. The underlying development technology adopts C++ and OpenGL. The software can quickly browse, measure, analyze and mark three-dimensional geographic information data and oblique photography real-view data.), and then saved as KML (KML file is a kind of landmark file created by Google, used to record the time, longitude, latitude, altitude and other geographic information data of a certain place or continuous places) and imported into Global Mapper, or the target area can be directly exported in Global Mapper.

[0106] Preferably, after the target area is created, the DEM layer can be clipped by polygons through the layer control center of Global Mapper.

[0107] Preferably, after the polygon clipping is completed, the contour line generation function of Global Mapper can be directly used (the line distance needs to be set).

[0108] Preferably, Gaussian projection can be performed on the target area by loading the CGCS2000 standard in Global Mapper and configuring the reference points.

[0109] Step S2, taking the contour terrain as the starting point surface and constructing an image acquisition area upward from the starting point surface with a vertical distance of a preset length as the height.

[0110] Preferably, the top surface shape of the image acquisition area is the same as the contour terrain shape.

[0111] Step S3, defining a preset number of nodes on the top surface and the side surface of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface and the side surface of the image acquisition area.

[0112] Preferably, all nodes can move on the top surface and the side surfaces of the image acquisition area but do not leave the top surface and the side surfaces.

[0113] Step S4, generating a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, wherein the maximum viewing distance is greater than or equal to a preset length.

[0114] Preferably, the theoretical shooting sphere or theoretical shooting hemisphere can be independently selected according to the model of the shooting end (camera) and the movable range in actual application. The larger the focal length value of the camera, the longer the viewing distance and the narrower the viewing angle; the smaller the focal length value of the camera, the closer the viewing distance and the wider the viewing angle.

[0115] Preferably, the commonly used focal length values ​​are 2.5mm, 2.8mm, 3.6mm, 4mm, 6mm, 8mm, 12mm, 16mm, 30mm, 60mm, 100mm, and 200mm, and the corresponding viewing angles are 96.4°, 89.9°, 75.7°, 69.9°, 50°, 38.5°, 26.2°, 19.8°, 10.6°, 5.3°, and 3.2° respectively.

[0116] Step S5, respectively assigning a preset charge of the same polarity to each node to form a charged particle, and respectively calculating the first force between each two adjacent charged particles according to Coulomb's law.

[0117] Preferably, Coulomb's law is the interaction force between two stationary point charges in a vacuum, which is proportional to the product of the charges of the two stationary point charges and inversely proportional to the square of the distance between the two stationary point charges. The direction of the force is on their connecting line, and charges of the same name repel each other and charges of opposite names attract each other. Since the polarity of each charge in this embodiment is the same, there is a repulsive force between adjacent nodes, and the repulsive force can be set in proportion to the preset charge. And the nodes in this embodiment are virtual points fitted by the software, which can be equivalent to "vacuum".

[0118] Step S6, assigning an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and calculating the second force of each ideal spring according to Hooke's law.

[0119] Preferably, Hooke's law states that after a solid material is subjected to force, there is a linear relationship between stress and strain (unit deformation) in the material. The ideal spring in this embodiment does not consider its own gravity, and generates a pulling force on two adjacent nodes to prevent adjacent nodes at the edge from being too far away due to charge repulsion.

[0120] Step S7, obtaining the resultant force of the first force and the second force based on the same node, and driving each node to move along the direction of the respective resultant force to update the position information of each node on the top surface of the image acquisition area.

[0121] Step S8, iterating the minimum value of all node quantities through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area.

[0122] Step S9, iterating the preset minimum value of power through a global optimization algorithm to minimize the sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres.

[0123] Step S10, obtaining the final positions of all nodes after the iteration is completed and fixing them to the image acquisition area to form the final layout of all layout preset shooting ends.

[0124] Further, step S7, based on the same node, obtains the resultant force of the first force and the second force, and drives each node to move along the direction of the resultant force to update the position information of each node on the top surface of the image acquisition area, specifically including the following steps:

[0125] Step S71, based on the same node, each first force is split into a first x-direction force, a first y-direction force, and a first z-direction force, wherein x, y, and z are three axial directions of the world coordinate system, and the xy plane is a horizontal plane.

[0126] Step S72 , converting the first x-direction force, the first y-direction force, and the first z-direction force into a first x-direction distance, a first y-direction distance, and a first z-direction distance respectively according to Coulomb's law.

[0127] Step S73, calculate the first displacement distance of each node according to equation (1), equation (2), and equation (3):

[0128]

[0129] Among them, Fx1 is the first x-direction displacement distance, k is the electrostatic force constant, dx1 is the first x-direction distance, and d is the actual distance between the current node and other nodes.

[0130]

[0131] Among them, Fy1 is the first y-direction displacement distance, and dy1 is the first y-direction distance.

[0132]

[0133] Among them, Fz1 is the first z-direction displacement distance, and dz1 is the first z-direction distance.

[0134] Preferably, the value interval of the electrostatic force constant k is [1,10], and the preferred value in this embodiment is 1.

[0135] Preferably, the first x-direction force, the first y-direction force, and the first z-direction force are inversely proportional to the cube of the first x-direction distance, the first y-direction distance, and the first z-direction distance, respectively (that is, the force is inversely proportional to the cube of the distance), and the proportional coefficient can be set according to actual needs.

[0136] Step S74, integrating Fx1, Fy1, and Fz1 to obtain a first displacement distance.

[0137] Step S75, splitting the second force into a second x-direction force, a second y-direction force, and a second z-direction force based on the same node.

[0138] Step S76 , converting the second x-direction force, the second y-direction force, and the second z-direction force into the second x-direction distance, the second y-direction distance, and the second z-direction distance respectively according to Hooke's law.

[0139] Step S77, and calculate the second displacement distance of each node according to equation (4), equation (5), and equation (6).

[0140] Lx2=-f·dx2(4).

[0141] Wherein, Lx2 is the second x-direction displacement distance, f is the elastic coefficient, and dx2 is the second x-direction distance.

[0142] Ly2=-f·dy2(5).

[0143] Wherein, Ly2 is the second y-direction displacement distance, and dy2 is the second y-direction distance.

[0144] Lz2=-f·dz2(6).

[0145] Wherein, Lz2 is the second z-direction displacement distance, and dy2 is the second z-direction distance.

[0146] Preferably, the elastic coefficient f has a value interval of [0.1, 0.9], and the preferred value in this embodiment is 0.1.

[0147] Preferably, the second x-direction force, the second y-direction force, and the second z-direction force are respectively proportional to the second x-direction distance, the second y-direction distance, and the second z-direction distance, and the proportional coefficient can be set according to actual needs.

[0148] Step S78, integrating Lx2, Ly2, and Lz2 to obtain a second displacement distance.

[0149] Step S79, summing the first displacement distance and the second displacement distance based on the same node to obtain the Euclidean distance of each node.

[0150] Preferably, the accumulation of the first displacement distance and the second displacement distance is offset by the partial displacements in opposite directions, and the partial displacements in the same direction are added.

[0151] Step S710, moving according to the Euclidean distance of each node until the Euclidean distance of each node is zero, thereby obtaining the position information of each node.

[0152] Further, step S8, iterating the minimum value of the number of all nodes through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area, specifically includes the following steps:

[0153] Step S81, defining a plurality of first random solutions for the minimum value of all node numbers according to formula (7), and defining the calculation results of all first random solutions to completely fill the image acquisition area with all theoretical shooting spheres or all theoretical shooting hemispheres.

[0154]

[0155] in, is the set of all first random solutions, are each first random solution, j is the jth first random solution, and m is the number of all first random solutions; is the set of velocities of all first random solutions, are the speeds of each first random solution, respectively.

[0156] Step S82, initialize the position of each first random solution, and update the position and speed of each first random solution according to equation (8) based on the same first random solution:

[0157]

[0158] in, is the speed of the jth first random solution at the dth step, is the velocity inertia of the jth first random solution at step d-1, ω (1) is the first inertia coefficient, is the self-perception representation of the jth first random solution, is the social cognitive representation of the jth first random solution; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the jth first random solution, is the global optimal solution obtained by the jth first random solution, is the jth first random solution in the dth step, is the jth first random solution in the d-1th step, is the speed of the jth first random solution at the d-1th step.

[0159] Preferably, the preset value range of random() is [0,1], the value range of c1 is [0,0.5], preferably 0.4; the value range of c2 is [0.5,1], preferably 0.8.

[0160] Step S83, iterate all first random solutions for a preset number of times according to formula (8) to update each and each

[0161] Step S84, determine each Compared with the first difference of the previous iteration, whether it is less than or equal to the first preset adaptation threshold, if so, execute step S85.

[0162] Step S85, determine each Compared with the second difference of the previous iteration, whether it is less than or equal to the second preset adaptation threshold, if so, execute step S86.

[0163] Step S86, determining the optimal solution that has obtained the minimum number of all nodes.

[0164] Further, in step S83, all first random solutions are iterated a preset number of times according to formula (8) to update each and each The specific steps include:

[0165] Step S831, based on each iteration, the first inertia coefficient is linearly reduced once according to formula (9):

[0166]

[0167] in, is the first inertia coefficient of the jth first random solution after optimization in the dth step, ω ini is the initial inertia coefficient, is the first inertia coefficient of the jth first random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

[0168] Preferably, the first initial inertia coefficient is generally set to 0.9, and the maximum number of iteration steps is generally set according to actual needs, and in this embodiment can be set to 1000 times.

[0169] Preferably, the values ​​of the first preset adaptation threshold and the second preset adaptation threshold need to be adjusted according to the specific problem, and generally need to be adjusted according to the calculation results. If the adaptation threshold is set too small, the algorithm may stop prematurely and fail to obtain the optimal solution; if the adaptation threshold is set too large, the algorithm may be over-iterated, wasting computing resources.

[0170] Preferably, the adaptation threshold may also be evaluated by one of the Griewank function, the Rastrigin function, the Schaffer function, the Ackley function, and the Rosenbrock function.

[0171] Further, step S9, iterating the minimum value of the preset power by a global optimization algorithm so as to minimize the sum of the overlapping volumes of all theoretical shooting balls or all theoretical shooting hemispheres, specifically includes the following steps:

[0172] Step S91, defining a plurality of second random solutions for the minimum value of the preset power according to formula (10), and defining the calculation results of all the second random solutions to be the minimum sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres.

[0173]

[0174] Among them, P i (2) is the set of all second random solutions, are each second random solution, i is the i-th second random solution, and n is the number of all second random solutions; V i (2) is the set of velocities of all second random solutions, are the speeds of each second random solution, respectively.

[0175] Step S92, initialize the position of each second random solution, and update the position and speed of each second random solution according to formula (11) based on the same second random solution:

[0176]

[0177] in, is the speed of the ith second random solution at the dth step, is the velocity inertia of the ith second random solution at step d-1, ω (2) is the second inertia coefficient, is the self-perception representation of the i-th second random solution, is the social cognitive representation of the second random solution of the ith one; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the i-th second random solution, is the global optimal solution obtained by the i-th second random solution, is the ith second random solution of the dth step, is the ith second random solution of the d-1th step, is the speed of the i-th second random solution at the d-1 step.

[0178] Preferably, the preset value range of random() is [0,1], the value range of c1 is [0,0.5], preferably 0.4; the value range of c2 is [0.5,1], preferably 0.8.

[0179] Step S93, iterate all second random solutions for a preset number of times according to formula (11) to update each and each

[0180] Step S94, determine each Compared with the third difference of the previous iteration, whether it is less than or equal to the third preset adaptation threshold, if so, execute step S95.

[0181] Step S95, determine each Compared with the fourth difference of the previous iteration, whether it is less than or equal to the fourth preset adaptation threshold, if so, execute step S96.

[0182] Step S96, determining that the optimal solution for obtaining the minimum value of the preset power quantity has been obtained.

[0183] Further, in step S93, all second random solutions are iterated a preset number of times according to formula (11) to update each and each The specific steps include:

[0184] Step S931, based on each iteration, the second inertia coefficient is linearly reduced once according to formula (12):

[0185]

[0186] in, is the second inertia coefficient of the i-th second random solution after optimization in the d-th step, ω ini is the initial inertia coefficient, is the second inertia coefficient of the i-th second random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

[0187] Preferably, the second initial inertia coefficient can also be set to 0.9. The maximum number of iteration steps is generally set according to actual needs. In this embodiment, it can also be set to 1000 times.

[0188] Preferably, the values ​​of the third preset adaptation threshold and the fourth preset adaptation threshold need to be adjusted according to the specific problem, and generally need to be adjusted according to the calculation results. If the adaptation threshold is set too small, the algorithm may stop prematurely and fail to obtain the optimal solution; if the adaptation threshold is set too large, the algorithm may be over-iterated, wasting computing resources.

[0189] Preferably, the adaptation threshold may also be evaluated by one of the Griewank function, the Rastrigin function, the Schaffer function, the Ackley function, and the Rosenbrock function.

[0190] Further, in step S10, the final positions of all nodes after the iteration are obtained and fixed to the image acquisition area to form the final layout of all layout preset shooting ends, and then, the following steps are also included:

[0191] Step S11, sending the final layout to an external visualization receiving end.

[0192] Step S12, responding to an entry signal of the construction site, and acquiring a person detection frame matching the entry signal through at least one preset shooting end after layout.

[0193] Specifically, step S12 is implemented by the following steps:

[0194] Step S121, in response to the entry signal, acquiring image data matching the entry signal through the arranged preset shooting end.

[0195] Step S122, dividing the image data into a preset number of grids on average.

[0196] Preferably, the size of the original picture of the image data may be adjusted to 448×448, and then the resized picture may be evenly divided into S×S (eg, 7×7) grids, and the size of each grid is 64×64.

[0197] Preferably, each grid is used to predict the coordinates and width and height of N detection boxes, as well as the confidence of each detection box, that is, each grid needs to predict N×(4+1) values.

[0198] It should be noted that the "N" in these N detection boxes is not interoperable with the "N" in the global optimization algorithm.

[0199] Step S123 , predicting a plurality of first-order bounding boxes for the moving target in the image data based on all the grids according to the target detection algorithm, each first-order bounding box including at least one grid.

[0200] Preferably, if the center of an object lies on a certain grid, then that grid is responsible for predicting the bounding box of the object.

[0201] Step S124, defining the construction personnel with the highest confidence.

[0202] Step S125 , respectively obtain the confidence of each first-order bounding box, obtain the bounding box with the largest confidence and mark it as the second-order bounding box.

[0203] Step S126, calculating the intersection-over-union ratio between the second-order bounding box and each other first-order bounding box.

[0204] Preferably, the intersection-over-union ratio is a ratio obtained by dividing the intersection of the optimal detection box and each bounding box by the union of the optimal detection box and each bounding box.

[0205] Step S127 , selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a third-order bounding box.

[0206] Step S128: Obtain a third-order bounding box with the highest confidence and define it as a person detection box.

[0207] It can be understood that each grid needs to predict N (x, y, w, h, confidence); where (x, y) is the offset of the center of the detection box relative to the grid, (w, h) is the ratio of the detection box to the above resized image, and (confidence) is the confidence of the grid, which takes a value of 1 or 0.

[0208] Preferably, the confidence level can be understood as whether there is a target in the current grid and the accuracy of the detection box.

[0209] For example: suppose there is an object in a resized image, and the width and height of the resized image are (w a ,h a )but:

[0210] Divide the image into 7×7 (S×S) grids evenly. There is a grid located at the center of the target. The coordinates of the grid are (x i ,y i ), let the coordinates of the center of the target be (x a ,y a ), the above offset (x b ,y b ):

[0211] Preferably, in actual detection, if the predicted detection box and the actual bounding box overlap perfectly, the intersection-and-union ratio is 1. In actual application, the value of the first preset threshold can generally be set to 0.5 to determine whether the predicted bounding box is correct, and the accuracy of the bounding box is positively correlated with the intersection-and-union ratio.

[0212] Preferably, the YOLO algorithm also needs to train the detection frame to improve the accuracy of target detection.

[0213] It should be noted that the training model of the person detection frame is generally implemented directly through code, for example:

[0214]

[0215] Among them, “*” is the target category that needs to be identified, which can be set to words related to construction workers such as “person” and “human” to identify construction workers.

[0216] Next, the training model is trained using the training set, and the weights and biases of the training model are adjusted iteratively a certain number of times using the back propagation algorithm to reduce the value of the loss function of the training model.

[0217] Preferably, the loss function is as follows:

[0218]

[0219] in, is the indicator function of whether the j detection box of the i-th grid is responsible for the target, and its value is 1 or 0; x i ,y i 、w i 、h i , C i They correspond to the i-th (x, y, w, h, confidence) prediction value, that is, the N×(4+1) values ​​mentioned above.

[0220] It can be understood that the loss function includes the coordinate value deviation of the detection box, the confidence deviation, and the prediction probability deviation (or category deviation).

[0221] in, is the detection frame midpoint loss in the coordinate value deviation, is the loss of detection box width and height in coordinate value deviation, is the confidence deviation, is the deviation of the predicted probability (or class deviation).

[0222] Among them, λ coord is the positioning error penalty, generally λ coord =5;S 2 That is, the S×S grids mentioned above; B is the number of bounding boxes; and is the estimated value of the horizontal and vertical coordinates of the midpoint of the i-th bounding box; and is the estimated value of the width and height of the i-th bounding box; C i is the confidence of the i-th bounding box; is the estimated value of the confidence of the i-th bounding box; noobj is the confidence prediction loss, usually λ noobj =0.5; is the indicator function of whether the j detection boxes of the i-th grid are not responsible for the target, and if and If one of them is 1, the other must be 0. i (c) is the category probability of the i-th bounding box; is the estimated value of the category probability of the i-th bounding box; p i (c) with The c in it corresponds to classes, and classes are the categories of the detected targets.

[0223] It should be noted that since each grid does not necessarily contain a target, if there is no target in the grid, the value of (confidence) will be 0, making the gradient span in the subsequent back propagation algorithm too large, so λ is introduced coord To control the loss of the predicted position of the detection box, and introduce λ noobj Controls the loss of objects not existing in a single grid.

[0224] It should be noted that the meanings of all symbols in the above steps S121 to S128 and their extended contents are not interoperable with other symbol meanings.

[0225] Step S13, defining a standard model of the target detection algorithm, and training the standard model based on the helmet image training set, and obtaining a helmet detection model after the training is completed.

[0226] The target detection algorithm can be implemented through the target detection algorithms VJ, HOG, DPMDetector; deep learning two-stage target detection algorithms RCNN, SPPNet, FastRCNN, FasterRCNN; target detection trick algorithms FPN, CascadeRCNN; deep learning one-stage target detection algorithms Yolo, X, SSD, RetinaNet; deep learning anchor-free target detection algorithms CornerNet, CenterNet, FCOS; Transformer-based target detection algorithm DETR, etc.

[0227] Preferably, this embodiment preferably uses the above-mentioned Yolo algorithm.

[0228] Preferably, the character image training set can be directly obtained from public channels, or a number of images of the construction surface can be taken as training samples.

[0229] Preferably, the standard model is the Yolo standard model, which includes three parts: Backbone, PANet, and Yolo Head.

[0230] Step S14, using the helmet detection model to detect whether there is a helmet in the person detection frame, if not, execute step S15.

[0231] Step S15, generating a helmet wearing reminder signal, and sending the helmet wearing reminder signal to the construction worker corresponding to the person detection frame.

[0232] Preferably, the reminder signal can be sent to the construction personnel's portable devices, such as walkie-talkies, mobile phones and other portable devices with communication functions.

[0233] This embodiment obtains the elevation data of the construction site and generates contour terrain according to the elevation data; takes the contour terrain as the starting point surface, and constructs an image acquisition area upward from the starting point surface with a vertical distance of a preset length as the height; defines a preset number of nodes on the top surface and the side surface of the image acquisition area, each node represents a preset shooting end to be arranged, and all nodes are constrained to the top surface and the side surface of the image acquisition area; generates a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, and the maximum viewing distance is greater than or equal to the preset length; assigns a charge of the same polarity of a preset charge to each node to form a charged particle, and calculates the first force of each two adjacent charged particles according to Coulomb's law; and Two adjacent nodes are assigned ideal springs with preset allowable tensile stress, and the second force of each ideal spring is calculated according to Hooke's law; the resultant force of the first force and the second force is obtained based on the same node, and each node is driven to move along the direction of the respective resultant force to update the position information of each node on the top surface of the image acquisition area; the minimum value of the number of all nodes is iterated through a global optimization algorithm to make all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; the minimum value of the preset electric quantity is iterated through a global optimization algorithm to make the total overlapping volume of all theoretical shooting spheres or all theoretical shooting hemispheres minimized; the final positions of all nodes after the iteration are completed are obtained and fixed to the image acquisition area to form the final layout of all layout preset shooting ends. This embodiment simulates the physical and mechanical process to automatically layout each preset shooting end, avoiding the manual layout based on human experience in the traditional method. While ensuring that all preset shooting ends completely cover the construction site, it avoids redundant installation in human experience, thereby reducing the regional duplication of each preset shooting end. At the same time, the regional duplication is reduced to a minimum through a global optimization algorithm, so that the image and video of the construction site can be acquired without blind spots and with low duplication. This embodiment does not require the formulation of complex objective functions and parameters. The method is simple, fast and accurate. A good image or video acquisition environment without blind spots can provide clear and high-quality data for subsequent computer vision detection, thereby reducing or eliminating misjudgment and accurately protecting the personal safety of construction workers.

[0234] like Figure 2As shown, this embodiment provides an embodiment of a shooting end layout device based on a safety helmet. In this embodiment, the shooting end layout device is applied to the shooting end layout method as in the above embodiment, and the shooting end layout device includes a contour terrain generation module 1, an image acquisition area construction module 2, a node definition and constraint module 3, a theoretical shooting sphere or theoretical shooting hemisphere generation module 4, a charged particle repulsion calculation module 5, an ideal spring tension calculation module 6, a node position iteration module 7, a node quantity minimum calculation module 8, a preset power minimum calculation module 9, and a final position acquisition and fixation module 10 that are electrically connected in sequence.

[0235] Among them, the contour terrain generation module 1 is used to obtain the elevation data of the construction site and generate the contour terrain according to the elevation data; the image acquisition area construction module 2 is used to construct the image acquisition area from the starting point with the contour terrain as the starting point and the vertical distance of the preset length as the height; the node definition and constraint module 3 is used to define a preset number of nodes on the top and side surfaces of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface of the image acquisition area; the theoretical shooting sphere or theoretical shooting hemisphere generation module 4 is used to generate a theoretical shooting sphere or theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be laid out as the radius, and the maximum viewing distance is greater than or equal to the preset length; the charged particle repulsion calculation module 5 is used to give each node a charge of the same polarity with a preset amount of electricity to form a charged particle, and calculate the first force of each two adjacent charged particles according to Coulomb's law; the ideal spring tension meter The calculation module 6 is used to assign an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and calculate the second force of each ideal spring according to Hooke's law; the node position iteration module 7 is used to obtain the resultant force of the first force and the second force based on the same node, and drive each node to move along the direction of its own resultant force to update the position information of each node on the top surface of the image acquisition area; the node quantity minimum value calculation module 8 is used to iterate the minimum value of all node quantities through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; the preset power minimum value calculation module 9 is used to iterate the minimum value of the preset power through a global optimization algorithm so that the sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres is minimized; the final position acquisition and fixation module 10 is used to obtain the final positions of all nodes after the iteration is completed and fix them to the image acquisition area to form the final layout of all layout preset shooting ends.

[0236] Furthermore, the node position iteration module 7 specifically includes a first node position iteration submodule, a second node position iteration submodule, a third node position iteration submodule, a fourth node position iteration submodule, a fifth node position iteration submodule, a sixth node position iteration submodule, a seventh node position iteration submodule, an eighth node position iteration submodule, a ninth node position iteration submodule, and a tenth node position iteration submodule, which are electrically connected in sequence; the first node position iteration submodule is electrically connected to the ideal spring tension calculation module, and the tenth node position iteration submodule is electrically connected to the node quantity minimum calculation module.

[0237] Among them, the first node position iteration submodule is used to split each first force into a first x-direction force, a first y-direction force, and a first z-direction force based on the same node, where x, y, and z are the three axial directions of the world coordinate system, and the xy plane is a horizontal plane.

[0238] The second node position iteration submodule is used to convert the first x-direction force, the first y-direction force, and the first z-direction force into the first x-direction distance, the first y-direction distance, and the first z-direction distance respectively according to Coulomb's law.

[0239] The third node position iteration submodule is used to calculate the first displacement distance of each node according to equation (1), equation (2), and equation (3):

[0240]

[0241] Among them, Fx1 is the first x-direction displacement distance, k is the electrostatic force constant, dx1 is the first x-direction distance, and d is the actual distance between the current node and other nodes.

[0242]

[0243] Among them, Fy1 is the first y-direction displacement distance, and dy1 is the first y-direction distance.

[0244]

[0245] Among them, Fz1 is the first z-direction displacement distance, and dz1 is the first z-direction distance.

[0246] The fourth node position iteration submodule is used to integrate Fx1, Fy1, and Fz1 to obtain the first displacement distance.

[0247] The fifth node position iteration submodule is used to split the second force into a second x-direction force, a second y-direction force, and a second z-direction force based on the same node.

[0248] The sixth node position iteration submodule is used to convert the second x-direction force, the second y-direction force, and the second z-direction force into the second x-direction distance, the second y-direction distance, and the second z-direction distance respectively according to Hooke's law.

[0249] The seventh node position iteration submodule is used to calculate the second displacement distance of each node according to equation (4), equation (5) and equation (6).

[0250] Lx2=-f·dx2 (4).

[0251] Wherein, Lx2 is the second x-direction displacement distance, f is the elastic coefficient, and dx2 is the second x-direction distance.

[0252] Ly2=-f·dy2 (5).

[0253] Wherein, Ly2 is the second y-direction displacement distance, and dy2 is the second y-direction distance.

[0254] Lz2=-f·dz2 (6).

[0255] Wherein, Lz2 is the second z-direction displacement distance, and dy2 is the second z-direction distance.

[0256] The eighth node position iteration submodule is used to integrate Lx2, Ly2, and Lz2 to obtain the second displacement distance.

[0257] The ninth node position iteration submodule is used to sum the first displacement distance and the second displacement distance based on the same node to obtain the Euclidean distance of each node respectively.

[0258] The tenth node position iteration submodule is used to move according to the Euclidean distance of each node until the Euclidean distance of each node is zero, thereby obtaining the position information of each node.

[0259] Furthermore, the node quantity minimum calculation module 8 specifically includes a first node quantity minimum calculation submodule, a second node quantity minimum calculation submodule, a third node quantity minimum calculation submodule, a fourth node quantity minimum calculation submodule, a fifth node quantity minimum calculation submodule, and a sixth node quantity minimum calculation submodule, which are electrically connected in sequence; the first node quantity minimum calculation submodule is electrically connected to the tenth node position iteration submodule, and the sixth node quantity minimum calculation submodule is electrically connected to the preset power minimum calculation module.

[0260] The first node quantity minimum value calculation submodule is used to define a number of first random solutions for the minimum value of all node quantities according to formula (7), and define the calculation results of all first random solutions as all theoretical shooting spheres or all theoretical shooting hemispheres completely filling the image acquisition area.

[0261]

[0262] in, is the set of all first random solutions, are each first random solution, j is the jth first random solution, and m is the number of all first random solutions; is the set of velocities of all first random solutions, are the speeds of each first random solution, respectively.

[0263] The second node quantity minimum value calculation submodule is used to initialize the position of each first random solution, and based on the same first random solution, update the position and speed of each first random solution according to formula (8):

[0264]

[0265] in, is the speed of the jth first random solution at the dth step, is the velocity inertia of the jth first random solution at step d-1, ω (1) is the first inertia coefficient, is the self-perception representation of the jth first random solution, is the social cognitive representation of the jth first random solution; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the jth first random solution, is the global optimal solution obtained by the jth first random solution, is the jth first random solution in the dth step, is the jth first random solution in step d-1, is the speed of the jth first random solution at the d-1th step.

[0266] The third node quantity minimum calculation submodule is used to iterate all the first random solutions for a preset number of times according to formula (8) to update each and each

[0267] The fourth node quantity minimum calculation submodule is used to determine each Compared with the first difference of the previous iteration, whether it is less than or equal to the first preset adaptation threshold, if so, execute step S85.

[0268] The fifth node quantity minimum calculation submodule is used to determine each Compared with the second difference of the previous iteration, whether it is less than or equal to the second preset adaptation threshold, if so, execute step S86.

[0269] The sixth node quantity minimum value calculation submodule is used to determine the optimal solution that has obtained the minimum value of all node quantities.

[0270] Furthermore, the third node quantity minimum value calculation submodule is specifically used to linearly decrease the first inertia coefficient once according to formula (9) based on each iteration step:

[0271]

[0272] in, is the first inertia coefficient of the jth first random solution after optimization in the dth step, ω ini is the initial inertia coefficient, is the first inertia coefficient of the jth first random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

[0273] Furthermore, the preset minimum power calculation module 9 specifically includes a first preset minimum power calculation submodule, a second preset minimum power calculation submodule, a third preset minimum power calculation submodule, a fourth preset minimum power calculation submodule, a fifth preset minimum power calculation submodule, and a sixth preset minimum power calculation submodule, which are electrically connected in sequence; the first preset minimum power calculation submodule is electrically connected to the sixth node quantity minimum calculation submodule, and the sixth preset minimum power calculation submodule is electrically connected to the final position acquisition and fixing module.

[0274] The first preset minimum power calculation submodule is used to define a plurality of second random solutions for the preset minimum power according to formula (10), and the calculation results of all the second random solutions are defined as the minimum sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres.

[0275]

[0276] Among them, P i (2) is the set of all second random solutions, are each second random solution, i is the i-th second random solution, and n is the number of all second random solutions; V i (2) is the set of velocities of all second random solutions, are the speeds of each second random solution, respectively.

[0277] The second preset minimum power value calculation submodule is used to initialize the position of each second random solution, and based on the same second random solution, update the position and speed of each second random solution according to formula (11):

[0278]

[0279] in, is the speed of the ith second random solution at the dth step, is the velocity inertia of the ith second random solution at step d-1, ω (2) is the second inertia coefficient, is the self-perception representation of the i-th second random solution, is the social cognitive representation of the second random solution of the ith one; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the i-th second random solution, is the global optimal solution obtained by the i-th second random solution, is the ith second random solution of the dth step, is the ith second random solution of step d-1, is the speed of the i-th second random solution at the d-1 step.

[0280] The third preset minimum power value calculation submodule is used to iterate all the second random solutions for a preset number of times according to formula (11) to update each and each

[0281] The fourth preset minimum power calculation submodule is used to determine each Compared with the third difference of the previous iteration, whether it is less than or equal to the third preset adaptation threshold, if so, execute step S95.

[0282] The fifth preset minimum power value calculation submodule is used to determine each Compared with the fourth difference of the previous iteration, whether it is less than or equal to the fourth preset adaptation threshold, if so, execute step S96.

[0283] The sixth preset power minimum value calculation submodule is used to determine the optimal solution for obtaining the minimum value of the preset power.

[0284] Furthermore, the third preset minimum power value calculation submodule is specifically used to linearly decrease the second inertia coefficient once according to formula (12) based on each iteration step:

[0285]

[0286] in, is the second inertia coefficient of the i-th second random solution after optimization in the d-th step, ω ini is the initial inertia coefficient, is the second inertia coefficient of the i-th second random solution after optimization in the d-1 step, G c is the current iteration number, G maxis the maximum number of iteration steps.

[0287] Furthermore, the shooting end layout device also includes a final layout sending module, a person detection frame acquisition module, a helmet detection model acquisition module, a helmet detection module, and a helmet wearing reminder signal generation and sending module, which are electrically connected in sequence; the final layout sending module is electrically connected to the final position acquisition and fixing module.

[0288] Among them, the final layout sending module is used to send the final layout to an external visualization receiving end; the person detection frame acquisition module is used to respond to the entry signal of the construction site, and obtain the person detection frame matching the entry signal through at least one preset shooting end after the layout; the safety helmet detection model acquisition module is used to define the standard model of the target detection algorithm, and train the standard model based on the safety helmet image training set, and obtain a safety helmet detection model after the training is completed; the safety helmet detection module is used to detect whether there is a safety helmet in the person detection frame through the safety helmet detection model; the safety helmet wearing reminder signal generation and sending module is used to generate a safety helmet wearing reminder signal if there is no safety helmet in the person detection frame, and send the safety helmet wearing reminder signal to the construction personnel corresponding to the person detection frame.

[0289] It should be noted that this embodiment is a functional module item embodiment based on the above method embodiment. For additional contents such as the optimization, expansion, and example illustration of this embodiment, please refer to the above method embodiment, and this embodiment will not be repeated.

[0290] This embodiment obtains the elevation data of the construction site and generates contour terrain according to the elevation data; takes the contour terrain as the starting point surface, and constructs an image acquisition area upward from the starting point surface with a vertical distance of a preset length as the height; defines a preset number of nodes on the top surface and the side surface of the image acquisition area, each node represents a preset shooting end to be arranged, and all nodes are constrained to the top surface and the side surface of the image acquisition area; generates a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, and the maximum viewing distance is greater than or equal to the preset length; assigns a charge of the same polarity of a preset charge to each node to form a charged particle, and calculates the first force of each two adjacent charged particles according to Coulomb's law; and The ideal springs with preset allowable tensile stress are given to adjacent nodes, and the second force of each ideal spring is calculated according to Hooke's law; the resultant force of the first force and the second force is obtained based on the same node, and each node is driven to move along the direction of the respective resultant force to update the position information of each node on the top surface of the image acquisition area; the minimum value of the number of all nodes is iterated through a global optimization algorithm to make all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; the minimum value of the preset power is iterated through a global optimization algorithm to make the total volume of all theoretical shooting spheres or all theoretical shooting hemispheres overlapping each other minimized; the final positions of all nodes after the iteration are completed are obtained and fixed to the image acquisition area to form the final layout of all layout preset shooting ends. This embodiment simulates the physical and mechanical process to automatically layout each preset shooting end, avoiding the manual layout based on human experience in the traditional method. While ensuring that all preset shooting ends completely cover the construction site, it avoids redundant installation in human experience, thereby reducing the regional duplication of each preset shooting end. At the same time, the regional duplication is reduced to a minimum through a global optimization algorithm, so that the image and video of the construction site can be acquired without blind spots and with low duplication. This embodiment does not require the formulation of complex objective functions and parameters. The method is simple, fast and accurate. A good image or video acquisition environment without blind spots can provide clear and high-quality data for subsequent computer vision detection, thereby reducing or eliminating misjudgment and accurately protecting the personal safety of construction workers.

[0291] Figure 3 An embodiment of the electronic device of the present application is shown, see Figure 3 The electronic device 11 includes a processor 111 and a memory 112 coupled to the processor 111.

[0292] The memory 112 stores program instructions for implementing the helmet-based shooting end layout method of any of the above embodiments.

[0293] The processor 111 is used to execute the program instructions stored in the memory 112 to perform the shooting end layout based on the helmet.

[0294] The processor 111 may also be referred to as a CPU (Central Processing Unit). The processor 111 may be an integrated circuit chip having the ability to process signals. The processor 111 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0295] Further, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of the present application. Figure 4 The storage medium 12 of the embodiment of the present application stores program instructions 121 that can implement all the above methods, wherein the program instructions 121 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer power device (which can be a personal computer, server, or network power device, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal power devices such as a computer, a server, a mobile phone, and a tablet.

[0296] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of 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. Another point is that 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, which can be electrical, mechanical or other forms.

[0297] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.

[0298] The specific implementation methods of the invention are described in detail above, but they are only examples, and the present application is not limited to the specific implementation methods described above. For those skilled in the art, any equivalent modification or substitution of the invention is also within the scope of the present application, and therefore, the equalization, modification, and improvement made without departing from the spirit and principle of the present application should be included in the scope of the present application.

Claims

1. A method for placing shooting terminals based on a safety helmet, the method for placing shooting terminals being applied to construction workers wearing safety helmets in a construction site, the construction site having a plurality of preset shooting terminals to be placed, characterized in that: The shooting end layout method comprises: Step S1, obtaining elevation data of the construction site and generating contour terrain according to the elevation data; Step S2, taking the contour terrain as a starting point surface and constructing an image acquisition area upward from the starting point surface with a vertical distance of a preset length as a height; Step S3, defining a preset number of nodes on the top surface and the side surface of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface of the image acquisition area; Step S4, generating a theoretical shooting sphere or a theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, wherein the maximum viewing distance is greater than or equal to the preset length; Step S5, respectively giving each node a charge of the same polarity with a preset amount of electricity to form a charged particle, and respectively calculating the first force between each two adjacent charged particles according to Coulomb's law; Step S6, respectively assigning an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and respectively calculating the second force of each ideal spring according to Hooke's law; Step S7, obtaining the resultant force of the first force and the second force based on the same node, and driving each node to move along the direction of the resultant force, so as to update the position information of each node on the top surface of the image acquisition area; Step S8, iterating the minimum value of all node quantities through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; Step S9, iterating the minimum value of the preset power by a global optimization algorithm to minimize the sum of the overlapping volumes of all theoretical shooting balls or all theoretical shooting hemispheres; Step S10, obtaining the final positions of all nodes after the iteration is completed and fixing them to the image acquisition area to form the final layout of all layout preset shooting ends.

2. The shooting end layout method according to claim 1, characterized in that: Step S7, obtaining the resultant force of the first force and the second force based on the same node, and driving each node to move along the direction of the resultant force to update the position information of each node on the top surface of the image acquisition area, including: Step S71, based on the same node, split each first force into a first x-direction force, a first y-direction force, and a first z-direction force, wherein x, y, and z are three axial directions of the world coordinate system, and the xy plane is a horizontal plane; Step S72, converting the first x-direction force, the first y-direction force, and the first z-direction force into a first x-direction distance, a first y-direction distance, and a first z-direction distance respectively according to Coulomb's law; Step S73, calculate the first displacement distance of each node according to equation (1), equation (2), and equation (3): Wherein, Fx1 is the first x-direction displacement distance, k is the electrostatic force constant, dx1 is the first x-direction distance, and d is the actual distance between the current node and other nodes; Wherein, Fy1 is the first y-direction displacement distance, and dy1 is the first y-direction distance; Wherein, Fz1 is the first z-direction displacement distance, dz1 is the first z-direction distance; Step S74, integrating the Fx1, the Fy1, and the Fz1 to obtain the first displacement distance; Step S75, splitting the second force into a second x-direction force, a second y-direction force, and a second z-direction force based on the same node; Step S76, converting the second x-direction force, the second y-direction force, and the second z-direction force into a second x-direction distance, a second y-direction distance, and a second z-direction distance respectively according to Hooke's law; Step S77, and respectively calculate the second displacement distance of each node according to equation (4), equation (5), and equation (6); Lx2=-f·dx2(4); Wherein, Lx2 is the second x-direction displacement distance, f is the elastic coefficient, and dx2 is the second x-direction distance; Ly2=-f·dy2(5); Wherein, Ly2 is the second y-direction displacement distance, and dy2 is the second y-direction distance; Lz2=-f·dz2(6); Wherein, Lz2 is the second z-direction displacement distance, and dy2 is the second z-direction distance; Step S78, integrating the Lx2, the Ly2, and the Lz2 to obtain the second displacement distance; Step S79, summing the first displacement distance and the second displacement distance based on the same node to obtain the Euclidean distance of each node; Step S710, moving according to the Euclidean distance of each node until the Euclidean distance of each node is zero, thereby obtaining the position information of each node.

3. The shooting end layout method according to claim 1, characterized in that: Step S8, iterating the minimum value of all node numbers through a global optimization algorithm so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area, including: Step S81, defining a plurality of first random solutions for the minimum value of all node numbers according to formula (7), and defining the calculation results of all the first random solutions to be all theoretical shooting spheres or all theoretical shooting hemispheres completely filling the image acquisition area; in, is the set of all first random solutions, are each first random solution, j is the jth first random solution, and m is the number of all first random solutions; is the set of velocities of all first random solutions, are the speeds of each first random solution respectively; Step S82, initialize the position of each first random solution, and update the position and speed of each first random solution according to equation (8) based on the same first random solution: in, is the speed of the jth first random solution at the dth step, is the velocity inertia of the jth first random solution at step d-1, ω (1) is the first inertia coefficient, is the self-perception representation of the jth first random solution, is the social cognitive representation of the jth first random solution; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the jth first random solution, is the global optimal solution obtained by the jth first random solution, is the jth first random solution at step d, is the jth first random solution at step d-1, is the speed of the jth first random solution at step d-1; Step S83, iterate all first random solutions for a preset number of times according to formula (8) to update each and each Step S84, determine each Compared with the first difference of the previous iteration, whether it is less than or equal to the first preset adaptation threshold, if so, executing step S85; Step S85, determine each Compared with the second difference of the previous iteration, whether it is less than or equal to the second preset adaptation threshold, if so, executing step S86; Step S86, determining the optimal solution that has obtained the minimum number of all nodes.

4. The shooting end layout method according to claim 3, characterized in that: Step S83, iterate all first random solutions for a preset number of times according to formula (8) to update each and each include: Step S831, based on each iteration, linearly reduce the first inertia coefficient once according to formula (9): in, is the first inertia coefficient of the jth first random solution after optimization in the dth step, ω ini is the initial inertia coefficient, is the first inertia coefficient of the jth first random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

5. The shooting end layout method according to claim 1, characterized in that: Step S9, iterating the minimum value of the preset power by a global optimization algorithm to minimize the sum of the overlapping volumes of all theoretical shooting balls or all theoretical shooting hemispheres, including: Step S91, defining a plurality of second random solutions for the minimum value of the preset power according to formula (10), and defining the calculation results of all the second random solutions to be the minimum sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres; Among them, P i (2) is the set of all second random solutions, are each second random solution, i is the i-th second random solution, and n is the number of all second random solutions; V i (2) is the set of velocities of all second random solutions, are the speeds of each second random solution respectively; Step S92, initialize the position of each second random solution, and update the position and speed of each second random solution according to formula (11) based on the same second random solution: in, is the speed of the ith second random solution at the dth step, is the velocity inertia of the ith second random solution at step d-1, ω (2) is the second inertia coefficient, is the self-perception representation of the i-th second random solution, is the social cognitive representation of the second random solution of the ith one; c1 and c2 are both learning factors, random() is a random number in the preset value range, is the individual optimal solution obtained by the i-th second random solution, is the global optimal solution obtained by the i-th second random solution, is the i-th second random solution at step d, is the i-th second random solution at step d-1, is the speed of the i-th second random solution at step d-1; Step S93, iterate all second random solutions for a preset number of times according to formula (11) to update each and each Step S94, determine each Compared with the third difference of the previous iteration, whether it is less than or equal to the third preset adaptation threshold, if so, executing step S95; Step S95, determine each Compared with the fourth difference of the previous iteration, whether it is less than or equal to the fourth preset adaptation threshold, if so, executing step S96; Step S96, determining that the optimal solution for the minimum value of the preset power has been obtained.

6. The shooting end layout method according to claim 5, characterized in that: Step S93, iterate all second random solutions for a preset number of times according to formula (11) to update each and each include: Step S931, based on each iteration, the second inertia coefficient is linearly reduced once according to formula (12): in, is the second inertia coefficient of the i-th second random solution after optimization in the d-th step, ω ini is the initial inertia coefficient, is the second inertia coefficient of the i-th second random solution after optimization in the d-1 step, G c is the current iteration number, G max is the maximum number of iteration steps.

7. The shooting end layout method according to claim 1, characterized in that: Step S10, obtaining the final positions of all nodes after the iteration is completed and fixing them to the image acquisition area to form the final layout of all layout preset shooting ends, and then including: Step S11, sending the final layout to an external visualization receiving terminal; Step S12, responding to an entry signal of the construction site, and acquiring a person detection frame matching the entry signal through at least one preset shooting end after layout; Step S13, defining a standard model of the target detection algorithm, and training the standard model based on a helmet image training set, and obtaining a helmet detection model after the training is completed; Step S14, detecting whether there is a safety helmet in the person detection frame by using the safety helmet detection model, if not, executing step S15; Step S15, generating a helmet wearing reminder signal, and sending the helmet wearing reminder signal to the construction worker corresponding to the person detection frame.

8. A shooting end layout device based on a safety helmet, the shooting end layout device based on a safety helmet being applied to the shooting end layout method according to any one of claims 1 to 7, characterized in that: The shooting end layout device comprises: A contour terrain generation module, used to obtain elevation data of the construction site and generate contour terrain according to the elevation data; An image acquisition area construction module is used to construct an image acquisition area upward from the starting point surface with the contour terrain as the starting point surface and a vertical distance of a preset length as the height; A node definition and constraint module, used to define a preset number of nodes on the top surface and side surface of the image acquisition area, each node represents a preset shooting end to be laid out, and all nodes are constrained to the top surface of the image acquisition area; A theoretical shooting sphere or theoretical shooting hemisphere generating module, used to generate a theoretical shooting sphere or theoretical shooting hemisphere with each node as a sphere center and the maximum viewing distance of the preset shooting end to be arranged as a radius, wherein the maximum viewing distance is greater than or equal to the preset length; A charged particle repulsion calculation module is used to respectively give each node a charge of the same polarity with a preset amount of electricity to form a charged particle, and respectively calculate the first force between each two adjacent charged particles according to Coulomb's law; An ideal spring tension calculation module is used to assign an ideal spring with a preset allowable tensile stress to each two adjacent nodes, and calculate the second force of each ideal spring according to Hooke's law; a node position iteration module, configured to obtain the resultant force of the first force and the second force based on the same node, and drive each node to move along the direction of the resultant force, so as to update the position information of each node on the top surface of the image acquisition area; A node quantity minimum value calculation module, used for iterating the minimum value of all node quantities through a global optimization algorithm, so that all theoretical shooting spheres or all theoretical shooting hemispheres completely fill the image acquisition area; A preset power minimum value calculation module, used for iterating the minimum value of the preset power through a global optimization algorithm, so as to minimize the sum of the overlapping volumes of all theoretical shooting spheres or all theoretical shooting hemispheres; The final position acquisition and fixing module is used to acquire the final positions of all nodes after the iteration is completed and fix them to the image acquisition area to form the final layout of all layout preset shooting ends.

9. An electronic device, characterized in that: It includes a processor and a memory coupled to the processor, wherein the memory stores program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, the shooting end layout method based on a safety helmet as described in any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the shooting end layout method based on the helmet as described in any one of claims 1 to 7 can be implemented.

Citation Information

Patent Citations

  • Knowledge graph 3D visualization method based on unity 3d

    CN111125347A

  • Genetic algorithm-based method and device for monitoring by using fewest deploy and control balls, and medium

    CN116663867A

  • Wind power equipment layout method and device, equipment and storage medium

    CN117077232A