Method, device and program product for locating object trajectory based on image recognition
By performing image feature processing and geometric parameter determination based on the fusion model in the tunnel, dynamically divide the grid areas, solving the problem of object mispositioning caused by insufficient mesh division in the prior art, and realizing accurate positioning and trajectory tracking of object marks in the tunnel.
Patent Information
- Application Number
- CN202411463366.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Since the grid processing is usually carried out according to preset values, the grid division is not meticulous enough, resulting in the object being mislocated and the tracking cannot be accurately tracked.
By performing feature processing on the original image data based on the fusion model, the geometric parameters and pixel coordinate sets of the tunnel are determined, vertical and horizontal segmentation lines are dynamically determined, and image segmentation is performed to obtain a detailed grid area for accurate positioning and trajectory tracking.
Accurate positioning and trajectory tracking of object marks in the tunnel are achieved, and error positioning problems caused by insufficient mesh division is avoided, and the accuracy of trajectory tracking is improved.
Smart Images

Figure CN119180845B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image recognition technology, and in particular, relates to a method, device and program product for locating object trajectory based on image recognition. Background Art
[0002] The existing method for locating the trajectory of an object in a tunnel mainly involves performing video virtual gridding processing on the captured video surveillance images to form multiple virtual grids, and establishing a mapping between the position of the virtual grid in the video surveillance image and the actual position of the physical space of the tunnel. When locating, the video surveillance images captured by each video surveillance device are obtained, and the target recognition algorithm is used to identify each video surveillance image, determine the virtual grid where the target object is located, and map the position of the virtual grid to the actual position of the physical space of the tunnel, thereby obtaining the position and trajectory of the target object. However, the gridding processing is usually performed according to the preset value. The gridding is not detailed enough, which will cause the object to be incorrectly located, and thus the trajectory cannot be accurately tracked. Summary of the invention
[0003] The embodiments of the present application provide a method, device and program product for locating an object trajectory based on image recognition, which can solve the problem that gridding processing usually performs grid division according to preset values, and the grid division is not detailed enough, which will cause the object to be incorrectly located, making it impossible to accurately track the trajectory.
[0004] In a first aspect, an embodiment of the present application provides a method for locating an object trajectory based on image recognition, comprising:
[0005] Based on the fusion model, feature processing is performed on the acquired raw image data to obtain the tunnel ground image;
[0006] Based on the tunnel ground image, determine the tunnel width D, a first pixel parameter of a first tunnel cross section on the near-sighted side of the tunnel, a second pixel parameter of a second tunnel cross section on the far-sighted side of the tunnel, an angle between a longitudinal side of the tunnel and a cross-sectional side of the tunnel, and a set of pixel coordinates of the longitudinal side of the tunnel;
[0007] Determining a longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter;
[0008] Determining a horizontal dividing line according to the tunnel width D, the angle and the pixel coordinate set;
[0009] The tunnel ground image is segmented based on the longitudinal segmentation line and the transverse segmentation line to obtain a plurality of grid areas; wherein the grid areas are used for positioning and tracking the trajectory of the object.
[0010] In a second aspect, an embodiment of the present application provides an object trajectory positioning device based on image recognition, comprising:
[0011] An image processing module is used to perform feature processing on the acquired original image data based on a fusion model to obtain a tunnel ground image;
[0012] A parameter determination module, for determining, based on the tunnel ground image, a tunnel width D, a first pixel parameter of a first tunnel cross section on the tunnel nearsighted side, a second pixel parameter of a second tunnel cross section on the tunnel farsighted side, an angle between a tunnel longitudinal side and a tunnel cross section, and a set of pixel coordinates of the tunnel longitudinal side;
[0013] A longitudinal dividing line determining module, configured to determine a longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter;
[0014] A transverse dividing line determination module, used to determine a transverse dividing line according to the tunnel width D, the angle and the pixel coordinate set;
[0015] The segmentation and positioning module is used to segment the tunnel ground image based on the longitudinal segmentation line and the transverse segmentation line to obtain a plurality of grid areas; wherein the grid areas are used to locate and track the object.
[0016] In a third aspect, an embodiment of the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for locating object trajectory based on image recognition described in any one of the first aspects above is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for locating an object trajectory based on image recognition as described in any one of the first aspects above is implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes the object trajectory positioning method based on image recognition as described in any one of the above-mentioned first aspects.
[0019] In an embodiment of the present application, feature processing is performed on the acquired raw image data based on a fusion model to obtain a tunnel ground image; based on the tunnel ground image, the tunnel width D, the first pixel parameter of the first tunnel cross-section on the myopic side of the tunnel, the second pixel parameter of the second tunnel cross-section on the hyperopic side of the tunnel, the angle between the longitudinal side of the tunnel and the cross-sectional side of the tunnel, and the pixel coordinate set of the longitudinal side of the tunnel are determined; according to the tunnel width D, the first pixel parameter and the second pixel parameter, a longitudinal dividing line is determined; according to the tunnel width D, the angle and the pixel coordinate set, a transverse dividing line is determined; based on the longitudinal dividing line and the transverse dividing line, the tunnel ground image is segmented to obtain a plurality of grid areas; wherein the grid area is used to locate and track the trajectory of the object, so that accurate positioning and trajectory tracking can be achieved.
[0020] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown;
[0023] Figure 2 It is a schematic diagram of a tunnel structure provided by an embodiment of the present application;
[0024] Figure 3 is a schematic diagram of a tunnel structure provided by another embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a tunnel structure provided by yet another embodiment of the present application;
[0026] Figure 5 is a schematic diagram of a tunnel structure provided by yet another embodiment of the present application;
[0027] Figure 6 is a schematic flow chart of obtaining a longitudinal dividing line provided in an embodiment of the present application;
[0028] Figure 7 is a schematic flow chart of obtaining a horizontal dividing line provided in an embodiment of the present application;
[0029] Figure 8is a schematic diagram of a tunnel structure provided by yet another embodiment of the present application;
[0030] Fig. 9 is a schematic diagram of a tunnel structure provided by yet another embodiment of the present application;
[0031] Fig.10 A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown;
[0032] Fig.11 It is a deformation diagram of the near-sighted side and the far-sighted side of the tunnel monitoring provided by an embodiment of the present application;
[0033] Fig.12 This is a diagram of monitoring point installation in a curved tunnel provided by an embodiment of the present application;
[0034] Fig.13 A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown;
[0035] Fig.14 It is a structural schematic diagram of an object trajectory positioning device based on image recognition provided in an embodiment of the present application;
[0036] Fig.15 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0038] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0039] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0040] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0041] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0042] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0043] Figure 1 A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown.
[0044] S101, performing feature processing on the acquired original image data based on the fusion model to obtain a tunnel ground image.
[0045] The fusion model includes a target detection model and a semantic segmentation model. The target detection model is the YOLOv5 model, and the semantic segmentation model is the BiSeNet model.
[0046] Among them, BiSeNet and YOLOv5 are both neural network models based on deep learning, and they have achieved remarkable performance in the fields of semantic segmentation and target detection respectively. BiSeNet is a network for real-time semantic segmentation, which captures the spatial details and contextual information of the image through two parallel paths, the spatial path and the context path. YOLOv5 is a target detection model with the characteristics of fast speed and high accuracy.
[0047] The model that combines BiSeNet with YOLOv5 can perform both target detection and semantic segmentation tasks. In the embodiment of the present application, a segmentation head is added to YOLOv5, so that the model can classify images at the pixel level while performing target detection to achieve semantic segmentation. This architecture allows the model to more accurately locate and classify each pixel in the image while understanding the image content.
[0048] In the embodiment of the present application, S101 specifically includes:
[0049] Step a1, obtaining the original image data.
[0050] Among them, monitoring points are arranged in advance in the tunnel, cameras are set at the monitoring points, and original image data are collected in real time based on the cameras, or the original image data are collected by inductive triggering.
[0051] Step a2: extracting features from the original image data based on the target detection model to obtain a multi-scale feature map.
[0052] Step a3: fuse the multi-scale feature maps to the same spatial scale to obtain a first fused feature.
[0053] Among them, the YOLOv5 multi-scale feature map can be fused based on BiSeNet.
[0054] Step a4: Process the first fusion feature based on the semantic segmentation model to obtain local detail features and global semantic features.
[0055] Step a5: Fusing the local detail feature and the global semantic feature to obtain a second fused feature.
[0056] Step a6: input the second fusion feature into a classifier, and output the probability that each pixel belongs to each semantic category.
[0057] Step a7, determining a semantic segmentation result based on the probability of the semantic category, and determining the semantic segmentation result as the tunnel ground image.
[0058] Among them, the semantic segmentation result refers to the pixel-level semantic classification label map data finally output by the semantic segmentation task.
[0059] S102, based on the tunnel ground image, determine the tunnel width D, the first pixel parameter of the first tunnel cross-section on the near-sighted side of the tunnel, the second pixel parameter of the second tunnel cross-section on the far-sighted side of the tunnel, the angle between the longitudinal side of the tunnel and the cross-sectional side of the tunnel, and the pixel coordinate set of the longitudinal side of the tunnel.
[0060] In an embodiment of the present application, the tunnel ground image is identified to obtain the tunnel width D, the first pixel parameter of the first tunnel cross-section on the near-sighted side of the tunnel, the second pixel parameter of the second tunnel cross-section on the far-sighted side of the tunnel, the angle between the longitudinal side of the tunnel and the cross-sectional side of the tunnel, and the pixel coordinate set of the longitudinal side of the tunnel.
[0061] The first pixel parameters include a first pixel width d1 and a first starting pixel coordinate (X pn0 , Y pn0 ), the second pixel parameter includes a second pixel width d2 and a second starting pixel coordinate (X pf0 , Y pf0 ). The first pixel width d1 is the cross-sectional pixel of the tunnel near-view side, and the first starting pixel coordinate (X pn0 , Y pn0 ) is the leftmost pixel coordinate on the near-sighted side of the tunnel. The second pixel width d2 is the cross-sectional pixel on the far-sighted side of the tunnel. The second starting pixel coordinate (X pf0 , Y pf0 ) is the leftmost pixel coordinate on the far-sighted side of the tunnel.
[0062] The schematic diagram of the tunnel width D (also called the actual tunnel width D) is shown in Figure 2 , the schematic diagram of the first pixel parameter and the second pixel parameter can be seen in Figure 3 .
[0063] Among them, Figure 4 As shown, the angle between the longitudinal side of the tunnel and the cross-sectional side of the tunnel (also referred to as the angle between the two side sides of the tunnel and the near-viewing cross-section of the tunnel) includes a first angle θ1 and a second angle θ2, and the first angle θ1 is smaller than the second angle θ2.
[0064] Among them, the pixel coordinate set of the longitudinal side of the tunnel (also called the pixel coordinate set of the two side sides of the tunnel) is as follows: Figure 5 The red line segment shown (two edge coordinate point sets).
[0065] S103: Determine a longitudinal dividing line according to the tunnel width D, the first pixel parameter, and the second pixel parameter.
[0066] In the embodiment of the present application, Figure 6 , S103 specifically includes:
[0067] Step b1, according to the tunnel width D, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in .
[0068] The middle coordinate refers to the coordinate point in the middle of the tunnel cross section, excluding the first and last coordinates.
[0069] Step b2, according to the tunnel width D, the second pixel width d2, the second starting pixel coordinate (X pf0 , Y pf0 ), determine the second intermediate coordinate X of the hyperopia side if .
[0070] Step b3: according to the first intermediate coordinate X in and the second intermediate coordinate X if , determine the longitudinal dividing line.
[0071] If the tunnel width D is an integer, then according to the tunnel width D, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in , and, according to the first intermediate coordinate X in and the second intermediate coordinate X if , determining the longitudinal dividing line, including: determining the first pixel length of the myopic side according to the tunnel width D and the first pixel width d1; determining the first pixel length according to the first pixel length, the horizontal coordinate X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x in The horizontal coordinate of the first starting pixel is pn0 Determine the first intermediate coordinate X in wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1; and, according to the tunnel width D and the second pixel width d2, determining the second pixel length of the hyperopia side; according to the second pixel length, the abscissa X in the second starting pixel coordinate pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if 's vertical coordinate; wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1.
[0072] Wherein, if the tunnel width D is not an integer, according to the tunnel width D, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in , and, according to the first intermediate coordinate Xin and the second intermediate coordinate X if , determining the longitudinal dividing line, including: determining the first pixel length of the myopic side according to the tunnel width D and the first pixel width d1; determining the first pixel length according to the first pixel length, the horizontal coordinate X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x in The horizontal coordinate of the first starting pixel is pn0 Determine the first intermediate coordinate X in The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D; and, according to the tunnel width D and the second pixel width d2, determining the second pixel length of the hyperopia side; according to the second pixel length, the abscissa X in the second starting pixel coordinates pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D.
[0073] In the embodiment of the present application, a rounding function is defined , only keep the integer part of the input data in brackets.
[0074] First, obtain the key points for longitudinal segmentation on the near-sighted side of the tunnel, including: , indicating that the tunnel width D is an integer, and that the tunnel section length is exactly a multiple of 0.5m, and the tunnel can be divided into The first intermediate coordinate (also called the coordinate of the middle point) of the tunnel near-sighted side without the first digit is X in , , where the number of intermediate points is exactly 0.5m, and the number of longitudinal dividing lines is 1:2×D-1 less than the number of segments. Since the key points are taken for the transverse sections on the near side of the tunnel, the ordinate values of the same transverse sections are equal, both Each time it moves horizontally, the pixel width increases by 0.5m to the right. The calculation formula for the pixel width of the image corresponding to 0.5m in the real world is: .
[0075] like , indicating that the tunnel width D is not an integer, and that the tunnel section length is not a multiple of 0.5m, and the tunnel cannot be exactly divided into In this case, call The constant result obtained indicates that the tunnel segment (in this case, the segment is longitudinally divided, so the segment is the cross-section of the tunnel) has been longitudinally divided into 0.5m segments for most of the tunnel space, and divided into The part that is not included in the calculation is: , the length is less than 0.5m pixel length, this part does not need to be segmented and is a segment in itself. Then the coordinate point of the middle point of the cross section of the tunnel on this side excluding the head and tail can be expressed as: , the number of midpoints is The number of tunnel segments is .
[0076] The above article introduced the key points for obtaining the longitudinal segmentation on the myopic side of the tunnel. Here, the relevant method for obtaining the key points for longitudinal segmentation on the hyperopia side of the tunnel is introduced. Among them, perspective deformation is a similarity relationship. The geometric shapes of objects near and far are similar, but the sizes are different. Especially when the two objects are in a parallel state, the camera viewing angle is kept unchanged, and the data of the near and far objects are scaled in the same proportion. Therefore, since the cross-section of the tunnel on the hyperopia side is parallel to the cross-section of the tunnel on the myopia side, the processing method for the cross-section of the tunnel on the myopia side can be directly used to process the hyperopia side. And since the cross-section of the tunnel on the hyperopia side is only a certain scale of the cross-section of the tunnel on the myopia side, the key points obtained should be one-to-one corresponding. The following conclusions can be drawn:
[0077] like , the second intermediate coordinate (also called the coordinate of the middle point) of the tunnel far-sighted side without the first digit is X if , .like , the second intermediate coordinate X without the first digit on the far-sighted side of the tunnel if , .
[0078] In the above steps, key points on the myopic side and the hyperopic side have been formed. The key points correspond one to one, the number is equal, and the position and significance are equal. The key points are connected, and the corresponding horizontal coordinates are found. , a longitudinal dividing line parallel to both sides of the tunnel with an interval of about 0.5m can be formed.
[0079] S104: Determine a horizontal dividing line according to the tunnel width D, the angle and the pixel coordinate set.
[0080] In the embodiment of the present application, Figure 7 , S104 specifically includes:
[0081] Step c1, determining a height h1 perpendicular to the cross-section of the tunnel according to the tunnel width D, the first angle θ1 and the first pixel width d1.
[0082] Step c2: according to the ordinate Y in the first starting pixel coordinates pn0 , the height h1 and the pixel coordinate set, determine a first line segment L1 parallel to the cross-section of the tunnel.
[0083] Step c3, obtaining the pixel length d3 of the first line segment L1.
[0084] Step c4, determining the gradual vertical coordinate increase value h2 according to the pixel length d3 of the first line segment L1, the first angle θ1 and the tunnel width D.
[0085] Step c5, according to the height h1, the gradual vertical coordinate increase value h2, the vertical coordinate Y in the first starting pixel coordinate pn0 and the pixel coordinate set, to determine a second line segment L2 parallel to the cross-section of the tunnel.
[0086] Step c6, obtaining the pixel length d4 of the second line segment L2.
[0087] Step c7, looping the operation for a preset number of times to obtain a set of line segments parallel to the cross-section of the tunnel as the transverse dividing line.
[0088] Wherein, based on the data, angle, and pixel coordinate set of the vertical segmentation, determining the horizontal segmentation line specifically includes: 1) marking the first horizontal segmentation line. , intercepted on the side close to θ1 Pixel length. Figure 8 As shown in the figure. Since θ1 is small, the perspective deformation of the side close to the angle is relatively small. The closer to the camera and the smaller the interception length, the smaller the perspective deformation effect. Therefore, the pixel length intercepted on the side can be considered to have a small error and can be selected. Then through , Calculate the ordinate of the first key coordinate point on the side with small angle θ1. Since the pixel coordinates of the two sides of the tunnel have been obtained, we can directly use the pixel coordinates just calculated. By searching in the pixel coordinate set, you can get two vertical coordinates. The complete coordinates of . Since the horizontal dividing line is parallel to the cross section of the tunnel on the near-sighted side, the coordinates with the same ordinate value are on the same horizontal dividing line. Connecting the two coordinate points, the first horizontal dividing line parallel to the cross section of the tunnel is obtained, and the distance between the two is about 0.5m in the real world. Among them, the ordinate on the side with a small angle θ1 is , let the ordinate on the side with large angle θ2 be . Get the pixel length of the first horizontal dividing line ,like Fig. 9 2) Draw the second horizontal dividing line. The principle is similar to that of drawing the first horizontal dividing line. Select the side with the smaller angle for operation. , Calculate the ordinate of the second key coordinate point on the side with a small angle. Since the pixel coordinates of the two sides of the tunnel have been obtained, we can directly use the pixel coordinates just calculated. By searching in the pixel coordinate set, you can get two vertical coordinates. The complete coordinates of . Since the horizontal dividing line is parallel to the cross-section of the tunnel on the near-sighted side, the coordinates with the same ordinate value are on the same horizontal dividing line. Connecting the two coordinate points, we get the second horizontal dividing line parallel to the cross-section of the tunnel, and the distance between the two is about 0.5m in the real world. Get the pixel width of the second horizontal dividing line: (i.e., the pixel length d4 of the second line segment L2). 3) Repeat the operation for a preset number of times to obtain a set of line segments parallel to the cross-section of the tunnel as the transverse dividing line. Optionally, assuming that the distance of each straight tunnel segment is about 30m, it is sufficient to repeat the operation about 60 times. Repeat the above operation about 55 to 65 times, depending on the specific situation.
[0089] It should be noted that for , the length obtained when doing longitudinal segmentation (drawing longitudinal lines / taking points on the cross-sectional edges) is unified as pixel width; the length obtained when doing transverse segmentation (drawing transverse lines / taking points on the two longitudinal edges of the tunnel) is unified as pixel length.
[0090] In the embodiment of the present application, a horizontal and vertical line segmentation system is adopted, the vertical segmentation line is parallel to both sides of the tunnel ground, the horizontal segmentation line is parallel to the cross-section of the tunnel, and the horizontal and vertical lines are perpendicular to each other in reality. Specifically: first determine the key points on the cross-section of the near-sighted side and the far-sighted side of the tunnel section, connect the key points one by one, and draw the vertical segmentation line; then determine the key points on both sides of the tunnel section, connect the key points one by one, and draw the horizontal segmentation line.
[0091] The space inside the tunnel is precisely divided into multiple areas or grids by dividing the horizontal and vertical dividing lines perpendicular to each other. This division helps to quickly and accurately locate the specific location in the tunnel during the subsequent analysis, design or construction process, which can improve efficiency and accuracy whether it is equipment layout, safety monitoring or emergency response. In addition, the horizontal and vertical line division facilitates the maintenance and management of the tunnel. Maintenance personnel can check and maintain each area one by one in a planned manner according to the grid division to ensure the normal operation of the tunnel facilities.
[0092] Fig.10A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown.
[0093] S1001, obtaining the geometric structure of the tunnel.
[0094] S1002: If the geometric structure is a straight line structure, a monitoring point is set at every preset distance.
[0095] S1003: If the geometric structure is a curved structure, a monitoring point is set according to the curvature radius of the tunnel section.
[0096] The geometric structure of the tunnel obtained includes a straight structure and a curved structure.
[0097] If the geometric structure of the tunnel is a straight structure, a monitoring point can be set up every 30m. However, the tunnel is a typical long and narrow space. Since it is not always straight and vertical (straight structure), it is limited by the monitoring distance of the camera and the clarity of the video image. Therefore, it is impossible to use a single camera to complete the overall monitoring of the tunnel. This requires the cooperation of multiple cameras. The selection of appropriate monitoring points can not only improve the utilization rate of the camera, but also provide high-quality monitoring images, so that the field of view is appropriate and the key points of the image are clear. In a sense, the selection of monitoring points is to divide the monitoring task of the entire tunnel into different small sections, and the monitoring points can be regarded as segmentation points. The monitoring point is the installation point of the camera (data acquisition device). However, the selection of appropriate monitoring points is affected by many parameters of the camera (such as resolution, focus, and viewing distance) and the tunnel environment (such as straightness, curvature, and light and darkness). If you want to select appropriate monitoring points, be sure to consider the above factors.
[0098] The straightness and curvature of the tunnel have a significant impact on the selection of monitoring points. A camera with a viewing distance of 100m and an image size of 2560×1440 can effectively monitor a distance of about 30m in a straight corridor section with sufficient lighting. Within a straight distance of 30m, relevant units can also be well monitored on the far-sighted side. When the distance exceeds 30m, the monitoring effect is significantly weakened due to image deformation and scaling. Fig.11 Shows the deformation diagrams of the myopic and hyperopic sides of the tunnel monitoring.
[0099] like Fig.12 As shown, assuming that the arc is a curved tunnel, the selection of monitoring points should meet the principle of not blocking the field of vision. The interval between monitoring points is adjusted according to the curvature radius of the tunnel. The monitoring points are set according to the following formula , r is the radius of curvature of the tunnel, Through this installation method, the camera can completely and clearly monitor a range of vision at the corresponding position.
[0100] Optionally, the camera installed at each monitoring point can monitor just one section of the tunnel, so the monitoring points are named monitoring point 1, monitoring point 2, monitoring point 3, etc. from west to east or south to north. The names of different tunnel sections are the names of the current monitoring points.
[0101] In an optional embodiment, after a camera is set up at each monitoring point, the camera obtains original image data of different tunnel sections at different monitoring points, and uploads the original image data collected by the camera to the central processor in real time for analysis and processing, such as performing feature processing on the obtained original image data based on a fusion model to obtain the tunnel ground image.
[0102] Among them, the original image data collected by the camera is uploaded to the central processor in real time. The specific implementation needs to consider the following conditions:
[0103] Mode and method selection: Data transmission is carried out through wired mode (USB, network interface, etc.) or wireless mode (Wi-Fi, Bluetooth, etc.). The data transmission mode and specific method are determined according to the tunnel environment.
[0104] Transmission protocol determination: Data is transmitted between the camera and the central processor through certain communication protocols. These protocols define the data transmission rate, format, synchronization method, etc. Different protocols have different transmission effects.
[0105] Data encapsulation: It is necessary to determine the appropriate data encapsulation format, which can ensure the integrity and accuracy of the data.
[0106] The above data must be transmitted in real time, continuously and accurately, and the data transmission between the camera and the central processor must also be synchronized; in addition, in order to improve the overall performance of the system, the data transmission and processing between the camera and the central processor can be optimized, such as using a high-speed interface, optimizing the image processing algorithm, etc. These measures are taken according to the tunnel environment and the specific construction conditions.
[0107] After obtaining the original image data, it is necessary to preprocess the original image data. Specifically:
[0108] Data preparation: First, prepare a labeled dataset that contains images or video frames in which objects such as people, equipment, vehicles, and tunnel floors have been accurately labeled. The dataset needs to be divided into training sets, validation sets, and test sets to facilitate model training and evaluation.
[0109] Data enhancement: In order to increase the generalization ability of the model, data enhancement operations are performed on the training set, such as rotation, scaling, cropping, brightness adjustment, etc. Through the above operations, a more robust model can be obtained.
[0110] After preprocessing, the model is trained. The labeled dataset is input into the YOLOv5 model for training. During the training process, the model will continuously learn how to identify objects in the image and adjust its internal parameters to optimize performance.
[0111] In the embodiment of the present application, a new segmentation head is added to the model structure of YOLOv5, and the segmentation head is responsible for predicting the category of each pixel in the image. The segmentation head is designed according to the structure of BiSeNet to ensure that it can output a segmentation map corresponding to the size of the input image. YOLOv5 is the main body, and a segmentation head (new functional module) is added inside YOLOv5, and BiSeNet is added thereto. The two are merged into a new toolbox.
[0112] The specific practical process is referred to in the above embodiment. Based on the combination of BiSeNet and YOLOv5, target detection and semantic segmentation are performed on the tunnel floor, tunnel wall and other tunnel facilities, so that the pixel point set of the tunnel floor, that is, the tunnel floor image, can be accurately obtained.
[0113] In an embodiment of the present application, by drawing longitudinal dividing lines and transverse dividing lines in the above manner, the monitored tunnel section can be divided into regions in a small grid manner, and with the help of target detection and semantic segmentation algorithms, the extraction of tunnel pixels is more thorough and the regional segmentation is more thorough.
[0114] Fig.13 A schematic flow chart of an object trajectory positioning method based on image recognition provided by the present application is shown.
[0115] S1301, obtaining the coordinates, number and time of the grid area triggered by the target object.
[0116] After the grid is divided by the above method, the center coordinate point of the grid needs to be calculated.
[0117] Generally, in an image, the upper left corner is the default coordinate origin. Get the pixel coordinates of the four corners of a grid in the current video image, and calculate the ratio of the horizontal and vertical coordinates of the four pixels to the top and left of the video image. Assume that in an actual project, the video image pixel is 1920×1080, and a certain pixel point is marked as (192, 108), then the ratio of this point is and . Based on this ratio, obtain the height and width ratio data of the four coordinate points. Fill in and modify the data in detect.py of YOLOv5. At this point, you can complete the area setting of a single grid and determine the four corner coordinate points. On this basis, calculate the position of the center coordinate point through the four corner coordinate points, and use this point as the coordinate point representing the position of the grid. Repeat the above steps until the area setting and center coordinate calculation of all grids are completed.
[0118] Among them, combined with the previous tunnel section name, each grid has a unique number in the tunnel environment. Starting from the lower left corner of the tunnel ground area, first row and then column, from left to right, from bottom to top, the numbering is Combined with the tunnel segment name, the grid name number is: tunnel segment Grid number .
[0119] In an embodiment of the present application, the central pixel coordinates of each grid are obtained and an intrusion detection algorithm is set for the grid. When a person, object, or other object breaks into a grid, the monitoring screen will display the target information, the current grid pixel coordinates, etc. on one side.
[0120] S1302: Based on the time, sort the grid areas triggered by the target object using the coordinates and the numbers to obtain a sequence.
[0121] S1303: Use the sequence as the trajectory of the target object.
[0122] In the embodiment of the present application, when the target moves, the intrusion detection algorithm of different grids is triggered. The algorithm will track the same target and record the coordinate information of the grid it triggers, and then sort them in time to form a movement track. If multiple targets appear at the same time, the algorithm will track different targets separately to form multiple movement tracks.
[0123] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0124] Corresponding to the object trajectory positioning method based on image recognition described in the above embodiment, Fig.14 A structural block diagram of an object trajectory positioning device based on image recognition provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0125] Reference Fig.14 , the object trajectory positioning device based on image recognition includes:
[0126] An image processing module is used to perform feature processing on the acquired original image data based on a fusion model to obtain a tunnel ground image;
[0127] A parameter determination module, for determining, based on the tunnel ground image, a tunnel width D, a first pixel parameter of a first tunnel cross section on the tunnel nearsighted side, a second pixel parameter of a second tunnel cross section on the tunnel farsighted side, an angle between a tunnel longitudinal side and a tunnel cross section, and a set of pixel coordinates of the tunnel longitudinal side;
[0128] A longitudinal dividing line determining module, configured to determine a longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter;
[0129] A transverse dividing line determination module, used to determine a transverse dividing line according to the tunnel width D, the angle and the pixel coordinate set;
[0130] The segmentation and positioning module is used to segment the tunnel ground image based on the longitudinal segmentation line and the transverse segmentation line to obtain a plurality of grid areas; wherein the grid areas are used to locate and track the object.
[0131] In a possible implementation, the fusion model includes a target detection model and a semantic segmentation model; an image processing module, which is used to:
[0132] Acquiring the original image data;
[0133] Performing feature extraction on the original image data based on the target detection model to obtain a multi-scale feature map;
[0134] Fusion the multi-scale feature maps to the same spatial scale to obtain a first fused feature;
[0135] Processing the first fusion feature based on the semantic segmentation model to obtain local detail features and global semantic features;
[0136] Performing feature fusion on the local detail feature and the global semantic feature to obtain a second fused feature;
[0137] Inputting the second fused feature into a classifier, and outputting the probability that each pixel belongs to each semantic category;
[0138] A semantic segmentation result is determined based on the probability of the semantic category, and the semantic segmentation result is determined as the tunnel ground image.
[0139] In a possible implementation, the first pixel parameter includes a first pixel width d1 and a first starting pixel coordinate (X pn0 , Y pn0 ), the second pixel parameter includes a second pixel width d2 and a second starting pixel coordinate (X pf0 , Y pf0 ); A vertical dividing line determination module is used to:
[0140] According to the tunnel width D, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in ;
[0141] According to the tunnel width D, the second pixel width d2, the second starting pixel coordinate (X pf0 , Y pf0 ), determine the second intermediate coordinate X of the hyperopia side if ;
[0142] According to the first intermediate coordinate X in and the second intermediate coordinate X if , determine the longitudinal dividing line.
[0143] In a possible implementation, if the tunnel width D is an integer, the longitudinal dividing line determination module is used to:
[0144] Determining a first pixel length of the myopic side according to the tunnel width D and the first pixel width d1;
[0145] According to the first pixel length, the abscissa X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x in The horizontal coordinate of the first starting pixel is Y pn0 Determine the first intermediate coordinate X in The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1;
[0146] Determining a second pixel length of the hyperopia side according to the tunnel width D and the second pixel width d2;
[0147] According to the second pixel length, the abscissa X in the second starting pixel coordinates pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1;
[0148] If the tunnel width D is not an integer, the longitudinal dividing line determination module is used to:
[0149] Determining a first pixel length of the myopic side according to the tunnel width D and the first pixel width d1;
[0150] According to the first pixel length, the abscissa X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x inThe horizontal coordinate of the first starting pixel is Y pn0 Determine the first intermediate coordinate X in The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D;
[0151] Determining a second pixel length of the hyperopia side according to the tunnel width D and the second pixel width d2;
[0152] According to the second pixel length, the abscissa X in the second starting pixel coordinates pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D.
[0153] In a possible implementation, the angle includes a first angle θ1 and a second angle θ2, and the first angle θ1 is smaller than the second angle θ2; the horizontal dividing line determination module is used to:
[0154] According to the tunnel width D, the first angle θ1 and the first pixel width d1, determine the height h1 perpendicular to the cross-sectional edge of the tunnel;
[0155] According to the ordinate Y in the first starting pixel coordinate pn0 , the height h1 and the pixel coordinate set, determining a first line segment L1 parallel to the cross-section of the tunnel;
[0156] Obtaining the pixel length d3 of the first line segment L1;
[0157] Determine a gradual vertical coordinate increase value h2 according to the pixel length d3 of the first line segment L1, the first angle θ1 and the tunnel width D;
[0158] According to the height h1, the gradient vertical coordinate increase value h2, the vertical coordinate Y in the first starting pixel coordinate pn0 and the pixel coordinate set, determining a second line segment L2 parallel to the cross-section of the tunnel;
[0159] Obtaining the pixel length d4 of the second line segment L2;
[0160] The operation is repeated for a preset number of times to obtain a set of line segments parallel to the cross-section of the tunnel as the transverse dividing line.
[0161] In a possible implementation, the object track positioning device based on image recognition further includes a monitoring point setting module, which is used to:
[0162] The geometric structure of the tunnel is obtained; if the geometric structure is a straight structure, a monitoring point is set at a preset distance; if the geometric structure is a curved structure, the monitoring point is set according to the curvature radius of the tunnel section.
[0163] In a possible implementation, each grid area includes a number and coordinates; the object trajectory positioning device based on image recognition also includes a trajectory determination module, which is used to:
[0164] The coordinates, numbers and time of the grid area triggered by the target object are obtained; based on the time, the grid area triggered by the target object is sorted by the coordinates and the numbers to obtain a sequence; and the sequence is used as the trajectory of the target object.
[0165] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0166] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0167] An embodiment of the present application also provides a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.
[0168] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0169] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0171] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0172] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0173] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0176] Fig.15 This is a schematic diagram of the structure of a computer device provided in one embodiment of the present application. Fig.15 As shown, the computer device 15 of this embodiment includes: at least one processor 20 ( Fig.15 Only one is shown in the figure), a memory 21 and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, wherein the processor 20 implements the steps in any of the above-mentioned embodiments of the method for locating the object trajectory based on image recognition when executing the computer program 22.
[0177] The computer device may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Fig.15 It is only an example of a computer device and does not constitute a limitation of the computer device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0178] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0179] In some embodiments, the memory 21 may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 21 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory 21 may also include both an internal storage unit of the computer device and an external storage device. The memory 21 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0180] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for locating object trajectory based on image recognition, characterized in that: The object trajectory positioning method based on image recognition includes: Based on the fusion model, feature processing is performed on the acquired raw image data to obtain the tunnel ground image; Based on the tunnel ground image, determine the tunnel width D, a first pixel parameter of a first tunnel cross section on the near-sighted side of the tunnel, a second pixel parameter of a second tunnel cross section on the far-sighted side of the tunnel, an angle between a longitudinal side of the tunnel and a cross-sectional side of the tunnel, and a set of pixel coordinates of the longitudinal side of the tunnel; Determining a longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter; Determining a horizontal dividing line according to the tunnel width D, the angle and the pixel coordinate set; Based on the longitudinal dividing line and the transverse dividing line, the tunnel ground image is segmented to obtain a plurality of grid areas; wherein the grid areas are used to locate and track the object; The included angle includes a first included angle θ1 and a second included angle θ2, and the first included angle θ1 is smaller than the second included angle θ2; The first pixel parameters include a first pixel width d1 and a first starting pixel coordinate (X pn0 , Y pn0 ), the second pixel parameter includes a second pixel width d2 and a second starting pixel coordinate (X pf0 , Y pf0 ); The determining of the horizontal dividing line according to the tunnel width D, the angle and the pixel coordinate set includes: According to the tunnel width D, the first angle θ1 and the first pixel width d1, determine the height h1 perpendicular to the cross-sectional edge of the tunnel; According to the ordinate Y in the first starting pixel coordinate pn0 , the height h1 and the pixel coordinate set, determining a first line segment L1 parallel to the cross-section of the tunnel; Obtaining the pixel length d3 of the first line segment L1; Determine a gradual vertical coordinate increase value h2 according to the pixel length d3 of the first line segment L1, the first angle θ1 and the tunnel width D; According to the height h1, the gradient vertical coordinate increase value h2, the vertical coordinate Y in the first starting pixel coordinate pn0 and the pixel coordinate set, determining a second line segment L2 parallel to the cross-section of the tunnel; Obtaining the pixel length d4 of the second line segment L2; The operation is repeated for a preset number of times to obtain a set of line segments parallel to the cross-section of the tunnel as the transverse dividing line.
2. The object trajectory positioning method based on image recognition as claimed in claim 1, characterized in that: The fusion model includes a target detection model and a semantic segmentation model; The method of performing feature processing on the acquired original image data based on the fusion model to obtain the tunnel ground image includes: Acquiring the original image data; Performing feature extraction on the original image data based on the target detection model to obtain a multi-scale feature map; Fusion the multi-scale feature maps to the same spatial scale to obtain a first fused feature; Processing the first fusion feature based on the semantic segmentation model to obtain local detail features and global semantic features; Performing feature fusion on the local detail feature and the global semantic feature to obtain a second fused feature; Inputting the second fused feature into a classifier, and outputting the probability that each pixel belongs to each semantic category; A semantic segmentation result is determined based on the probability of the semantic category, and the semantic segmentation result is determined as the tunnel ground image.
3. The object trajectory positioning method based on image recognition as claimed in claim 1, characterized in that: The determining of the longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter comprises: According to the tunnel width D, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in ; According to the tunnel width D, the second pixel width d2, the second starting pixel coordinate (X pf0 , Y pf0 ), determine the second intermediate coordinate X of the hyperopia side if ; According to the first intermediate coordinate X in and the second intermediate coordinate X if , determine the longitudinal dividing line.
4. The object trajectory positioning method based on image recognition as claimed in claim 3, characterized in that: If the tunnel width D is an integer, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in ,include: Determining a first pixel length of the myopic side according to the tunnel width D and the first pixel width d1; According to the first pixel length, the abscissa X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x in The horizontal coordinate of the first starting pixel is pn0 Determine the first intermediate coordinate X in The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1; And / or, the first intermediate coordinate X in and the second intermediate coordinate X if , determining the longitudinal dividing line, including: Determining a second pixel length of the hyperopia side according to the tunnel width D and the second pixel width d2; According to the second pixel length, the abscissa X in the second starting pixel coordinates pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to 2×D-1; If the tunnel width D is not an integer, the first pixel width d1, the first starting pixel coordinate (X pn0 , Y pn0 ), determine the first intermediate coordinate X of the myopic side in ,include: Determining a first pixel length of the myopic side according to the tunnel width D and the first pixel width d1; According to the first pixel length, the abscissa X in the first starting pixel coordinate pn0 and the integer index i determines the first intermediate coordinate x in The horizontal coordinate of the first starting pixel is pn0 Determine the first intermediate coordinate X in The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D; And / or, the first intermediate coordinate X in and the second intermediate coordinate X if , determining the longitudinal dividing line, including: Determining a second pixel length of the hyperopia side according to the tunnel width D and the second pixel width d2; According to the second pixel length, the abscissa X in the second starting pixel coordinates pf0 and the integer index i determines the second intermediate coordinate x if The horizontal coordinate of the second starting pixel is Y pf0 Determine the second intermediate coordinate X if The vertical coordinate of ; wherein the integer index i is greater than or equal to 1 and less than or equal to f q (2×D), the f q (2×D) represents the integer part reserved for 2×D.
5. The object trajectory positioning method based on image recognition as claimed in claim 1, characterized in that: The method further comprises: Get the geometry of the tunnel; If the geometric structure is a linear structure, a monitoring point is set at every preset distance; If the geometric structure is a curved structure, the monitoring points are set according to the curvature radius of the tunnel section.
6. The object trajectory positioning method based on image recognition according to claim 1, characterized in that: Each grid area includes a number and coordinates; the method further includes: Get the coordinates, number and time of the grid area triggered by the target object; Based on the time, the grid areas triggered by the target object are sorted by the coordinates and the numbers to obtain a sequence; The sequence is used as the trajectory of the target object.
7. An object trajectory positioning device based on image recognition, characterized in that: include: An image processing module is used to perform feature processing on the acquired original image data based on a fusion model to obtain a tunnel ground image; A parameter determination module, for determining, based on the tunnel ground image, a tunnel width D, a first pixel parameter of a first tunnel cross section on the tunnel nearsighted side, a second pixel parameter of a second tunnel cross section on the tunnel farsighted side, an angle between a tunnel longitudinal side and a tunnel cross section, and a set of pixel coordinates of the tunnel longitudinal side; A longitudinal dividing line determining module, configured to determine a longitudinal dividing line according to the tunnel width D, the first pixel parameter and the second pixel parameter; A transverse dividing line determination module, used to determine a transverse dividing line according to the tunnel width D, the angle and the pixel coordinate set; A segmentation and positioning module, used to segment the tunnel ground image based on the longitudinal segmentation line and the transverse segmentation line to obtain a plurality of grid areas; wherein the grid areas are used to locate and track the object; The included angle includes a first included angle θ1 and a second included angle θ2, and the first included angle θ1 is smaller than the second included angle θ2; The first pixel parameters include a first pixel width d1 and a first starting pixel coordinate (X pn0 , Y pn0 ), the second pixel parameter includes a second pixel width d2 and a second starting pixel coordinate (X pf0 , Y pf0 ); The horizontal dividing line determination module is used for: According to the tunnel width D, the first angle θ1 and the first pixel width d1, determine the height h1 perpendicular to the cross-sectional edge of the tunnel; According to the ordinate Y in the first starting pixel coordinate pn0 , the height h1 and the pixel coordinate set, determining a first line segment L1 parallel to the cross-section of the tunnel; Obtaining the pixel length d3 of the first line segment L1; Determine a gradual vertical coordinate increase value h2 according to the pixel length d3 of the first line segment L1, the first angle θ1 and the tunnel width D; According to the height h1, the gradient vertical coordinate increase value h2, the vertical coordinate Y in the first starting pixel coordinate pn0 and the pixel coordinate set, determining a second line segment L2 parallel to the cross-section of the tunnel; Obtaining the pixel length d4 of the second line segment L2; The operation is repeated for a preset number of times to obtain a set of line segments parallel to the cross-section of the tunnel as the transverse dividing line.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer program product, characterized in that When the computer program product is executed on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Tunnel personnel positioning method based on video identification
CN115628114A
Vehicle track generation method and device, vehicle and storage medium
CN118243130A